<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/ces/v1/agent_service.proto

namespace Google\Cloud\Ces\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Request message for
 * [AgentService.UpdateApp][google.cloud.ces.v1.AgentService.UpdateApp].
 *
 * Generated from protobuf message <code>google.cloud.ces.v1.UpdateAppRequest</code>
 */
class UpdateAppRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The app to update.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.App app = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $app = null;
    /**
     * Optional. Field mask is used to control which fields get updated. If the
     * mask is not present, all fields will be updated.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Cloud\Ces\V1\App   $app        Required. The app to update.
     * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to control which fields get updated. If the
     *                                               mask is not present, all fields will be updated.
     *
     * @return \Google\Cloud\Ces\V1\UpdateAppRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\Ces\V1\App $app, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setApp($app)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Ces\V1\App $app
     *           Required. The app to update.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Optional. Field mask is used to control which fields get updated. If the
     *           mask is not present, all fields will be updated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Ces\V1\AgentService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The app to update.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.App app = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Ces\V1\App|null
     */
    public function getApp()
    {
        return $this->app;
    }

    public function hasApp()
    {
        return isset($this->app);
    }

    public function clearApp()
    {
        unset($this->app);
    }

    /**
     * Required. The app to update.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.App app = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Ces\V1\App $var
     * @return $this
     */
    public function setApp($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\App::class);
        $this->app = $var;

        return $this;
    }

    /**
     * Optional. Field mask is used to control which fields get updated. If the
     * mask is not present, all fields will be updated.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Optional. Field mask is used to control which fields get updated. If the
     * mask is not present, all fields will be updated.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

