<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Request message for
 * [AgentService.CreateAppVersion][google.cloud.ces.v1.AgentService.CreateAppVersion]
 *
 * Generated from protobuf message <code>google.cloud.ces.v1.CreateAppVersionRequest</code>
 */
class CreateAppVersionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the app to create an app version in.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Optional. The ID to use for the app version, which will become the final
     * component of the app version's resource name. If not provided, a unique ID
     * will be automatically assigned for the app version.
     *
     * Generated from protobuf field <code>string app_version_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $app_version_id = '';
    /**
     * Required. The app version to create.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.AppVersion app_version = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $app_version = null;

    /**
     * @param string                          $parent       Required. The resource name of the app to create an app version in. Please see
     *                                                      {@see AgentServiceClient::appName()} for help formatting this field.
     * @param \Google\Cloud\Ces\V1\AppVersion $appVersion   Required. The app version to create.
     * @param string                          $appVersionId Optional. The ID to use for the app version, which will become the final
     *                                                      component of the app version's resource name. If not provided, a unique ID
     *                                                      will be automatically assigned for the app version.
     *
     * @return \Google\Cloud\Ces\V1\CreateAppVersionRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Ces\V1\AppVersion $appVersion, string $appVersionId): self
    {
        return (new self())
            ->setParent($parent)
            ->setAppVersion($appVersion)
            ->setAppVersionId($appVersionId);
    }

    /**
     * @param string                          $parent     Required. The resource name of the app to create an app version in. Please see
     *                                                    {@see AgentServiceClient::appName()} for help formatting this field.
     * @param \Google\Cloud\Ces\V1\AppVersion $appVersion Required. The app version to create.
     *
     * @return \Google\Cloud\Ces\V1\CreateAppVersionRequest
     *
     * @experimental
     */
    public static function buildFromParentAppVersion(string $parent, \Google\Cloud\Ces\V1\AppVersion $appVersion): self
    {
        return (new self())
            ->setParent($parent)
            ->setAppVersion($appVersion);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The resource name of the app to create an app version in.
     *     @type string $app_version_id
     *           Optional. The ID to use for the app version, which will become the final
     *           component of the app version's resource name. If not provided, a unique ID
     *           will be automatically assigned for the app version.
     *     @type \Google\Cloud\Ces\V1\AppVersion $app_version
     *           Required. The app version to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Ces\V1\AgentService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource name of the app to create an app version in.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The resource name of the app to create an app version in.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Optional. The ID to use for the app version, which will become the final
     * component of the app version's resource name. If not provided, a unique ID
     * will be automatically assigned for the app version.
     *
     * Generated from protobuf field <code>string app_version_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAppVersionId()
    {
        return $this->app_version_id;
    }

    /**
     * Optional. The ID to use for the app version, which will become the final
     * component of the app version's resource name. If not provided, a unique ID
     * will be automatically assigned for the app version.
     *
     * Generated from protobuf field <code>string app_version_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setAppVersionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->app_version_id = $var;

        return $this;
    }

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

    public function hasAppVersion()
    {
        return isset($this->app_version);
    }

    public function clearAppVersion()
    {
        unset($this->app_version);
    }

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

        return $this;
    }

}

