<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/run/v2/service.proto

namespace Google\Cloud\Run\V2;

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

/**
 * Request message for creating a Service.
 *
 * Generated from protobuf message <code>google.cloud.run.v2.CreateServiceRequest</code>
 */
class CreateServiceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The location and project in which this service should be created.
     * Format: projects/{project}/locations/{location}, where {project} can be
     * project id or number. Only lowercase characters, digits, and hyphens.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The Service instance to create.
     *
     * Generated from protobuf field <code>.google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $service = null;
    /**
     * Required. The unique identifier for the Service. It must begin with letter,
     * and cannot end with hyphen; must contain fewer than 50 characters.
     * The name of the service becomes {parent}/services/{service_id}.
     *
     * Generated from protobuf field <code>string service_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $service_id = '';
    /**
     * Indicates that the request should be validated and default values
     * populated, without persisting the request or creating any resources.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     */
    private $validate_only = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The location and project in which this service should be created.
     *           Format: projects/{project}/locations/{location}, where {project} can be
     *           project id or number. Only lowercase characters, digits, and hyphens.
     *     @type \Google\Cloud\Run\V2\Service $service
     *           Required. The Service instance to create.
     *     @type string $service_id
     *           Required. The unique identifier for the Service. It must begin with letter,
     *           and cannot end with hyphen; must contain fewer than 50 characters.
     *           The name of the service becomes {parent}/services/{service_id}.
     *     @type bool $validate_only
     *           Indicates that the request should be validated and default values
     *           populated, without persisting the request or creating any resources.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The location and project in which this service should be created.
     * Format: projects/{project}/locations/{location}, where {project} can be
     * project id or number. Only lowercase characters, digits, and hyphens.
     *
     * 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 location and project in which this service should be created.
     * Format: projects/{project}/locations/{location}, where {project} can be
     * project id or number. Only lowercase characters, digits, and hyphens.
     *
     * 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;
    }

    /**
     * Required. The Service instance to create.
     *
     * Generated from protobuf field <code>.google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Run\V2\Service|null
     */
    public function getService()
    {
        return $this->service;
    }

    public function hasService()
    {
        return isset($this->service);
    }

    public function clearService()
    {
        unset($this->service);
    }

    /**
     * Required. The Service instance to create.
     *
     * Generated from protobuf field <code>.google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Run\V2\Service $var
     * @return $this
     */
    public function setService($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Service::class);
        $this->service = $var;

        return $this;
    }

    /**
     * Required. The unique identifier for the Service. It must begin with letter,
     * and cannot end with hyphen; must contain fewer than 50 characters.
     * The name of the service becomes {parent}/services/{service_id}.
     *
     * Generated from protobuf field <code>string service_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getServiceId()
    {
        return $this->service_id;
    }

    /**
     * Required. The unique identifier for the Service. It must begin with letter,
     * and cannot end with hyphen; must contain fewer than 50 characters.
     * The name of the service becomes {parent}/services/{service_id}.
     *
     * Generated from protobuf field <code>string service_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setServiceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->service_id = $var;

        return $this;
    }

    /**
     * Indicates that the request should be validated and default values
     * populated, without persisting the request or creating any resources.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * Indicates that the request should be validated and default values
     * populated, without persisting the request or creating any resources.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

}

