<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/spanner/admin/instance/v1/spanner_instance_admin.proto

namespace Google\Cloud\Spanner\Admin\Instance\V1;

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

/**
 * The request for
 * [CreateInstanceConfigRequest][InstanceAdmin.CreateInstanceConfigRequest].
 *
 * Generated from protobuf message <code>google.spanner.admin.instance.v1.CreateInstanceConfigRequest</code>
 */
class CreateInstanceConfigRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the project in which to create the instance config.
     * Values are of the form `projects/<project>`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The ID of the instance config to create.  Valid identifiers are
     * of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
     * characters in length. The `custom-` prefix is required to avoid name
     * conflicts with Google managed configurations.
     *
     * Generated from protobuf field <code>string instance_config_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $instance_config_id = '';
    /**
     * Required. The InstanceConfig proto of the configuration to create.
     * instance_config.name must be
     * `<parent>/instanceConfigs/<instance_config_id>`.
     * instance_config.base_config must be a Google managed configuration name,
     * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
     *
     * Generated from protobuf field <code>.google.spanner.admin.instance.v1.InstanceConfig instance_config = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $instance_config = null;
    /**
     * An option to validate, but not actually execute, a request,
     * and provide the same response.
     *
     * 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 name of the project in which to create the instance config.
     *           Values are of the form `projects/<project>`.
     *     @type string $instance_config_id
     *           Required. The ID of the instance config to create.  Valid identifiers are
     *           of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
     *           characters in length. The `custom-` prefix is required to avoid name
     *           conflicts with Google managed configurations.
     *     @type \Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig $instance_config
     *           Required. The InstanceConfig proto of the configuration to create.
     *           instance_config.name must be
     *           `<parent>/instanceConfigs/<instance_config_id>`.
     *           instance_config.base_config must be a Google managed configuration name,
     *           e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
     *     @type bool $validate_only
     *           An option to validate, but not actually execute, a request,
     *           and provide the same response.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\Admin\Instance\V1\SpannerInstanceAdmin::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the project in which to create the instance config.
     * Values are of the form `projects/<project>`.
     *
     * 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 name of the project in which to create the instance config.
     * Values are of the form `projects/<project>`.
     *
     * 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 ID of the instance config to create.  Valid identifiers are
     * of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
     * characters in length. The `custom-` prefix is required to avoid name
     * conflicts with Google managed configurations.
     *
     * Generated from protobuf field <code>string instance_config_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getInstanceConfigId()
    {
        return $this->instance_config_id;
    }

    /**
     * Required. The ID of the instance config to create.  Valid identifiers are
     * of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
     * characters in length. The `custom-` prefix is required to avoid name
     * conflicts with Google managed configurations.
     *
     * Generated from protobuf field <code>string instance_config_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setInstanceConfigId($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance_config_id = $var;

        return $this;
    }

    /**
     * Required. The InstanceConfig proto of the configuration to create.
     * instance_config.name must be
     * `<parent>/instanceConfigs/<instance_config_id>`.
     * instance_config.base_config must be a Google managed configuration name,
     * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
     *
     * Generated from protobuf field <code>.google.spanner.admin.instance.v1.InstanceConfig instance_config = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig|null
     */
    public function getInstanceConfig()
    {
        return $this->instance_config;
    }

    public function hasInstanceConfig()
    {
        return isset($this->instance_config);
    }

    public function clearInstanceConfig()
    {
        unset($this->instance_config);
    }

    /**
     * Required. The InstanceConfig proto of the configuration to create.
     * instance_config.name must be
     * `<parent>/instanceConfigs/<instance_config_id>`.
     * instance_config.base_config must be a Google managed configuration name,
     * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
     *
     * Generated from protobuf field <code>.google.spanner.admin.instance.v1.InstanceConfig instance_config = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig $var
     * @return $this
     */
    public function setInstanceConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig::class);
        $this->instance_config = $var;

        return $this;
    }

    /**
     * An option to validate, but not actually execute, a request,
     * and provide the same response.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * An option to validate, but not actually execute, a request,
     * and provide the same response.
     *
     * 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;
    }

}

