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

namespace Google\Cloud\ServiceDirectory\V1;

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

/**
 * The request message for
 * [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1.RegistrationService.CreateNamespace].
 *
 * Generated from protobuf message <code>google.cloud.servicedirectory.v1.CreateNamespaceRequest</code>
 */
class CreateNamespaceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the project and location the namespace
     * will be created in.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The Resource ID must be 1-63 characters long, and comply with
     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
     * Specifically, the name must be 1-63 characters long and match the regular
     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
     * character must be a lowercase letter, and all following characters must
     * be a dash, lowercase letter, or digit, except the last character, which
     * cannot be a dash.
     *
     * Generated from protobuf field <code>string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $namespace_id = '';
    /**
     * Required. A namespace with initial fields set.
     *
     * Generated from protobuf field <code>.google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $namespace = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The resource name of the project and location the namespace
     *           will be created in.
     *     @type string $namespace_id
     *           Required. The Resource ID must be 1-63 characters long, and comply with
     *           <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
     *           Specifically, the name must be 1-63 characters long and match the regular
     *           expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
     *           character must be a lowercase letter, and all following characters must
     *           be a dash, lowercase letter, or digit, except the last character, which
     *           cannot be a dash.
     *     @type \Google\Cloud\ServiceDirectory\V1\PBNamespace $namespace
     *           Required. A namespace with initial fields set.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Servicedirectory\V1\RegistrationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource name of the project and location the namespace
     * will be created 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 project and location the namespace
     * will be created 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;
    }

    /**
     * Required. The Resource ID must be 1-63 characters long, and comply with
     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
     * Specifically, the name must be 1-63 characters long and match the regular
     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
     * character must be a lowercase letter, and all following characters must
     * be a dash, lowercase letter, or digit, except the last character, which
     * cannot be a dash.
     *
     * Generated from protobuf field <code>string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getNamespaceId()
    {
        return $this->namespace_id;
    }

    /**
     * Required. The Resource ID must be 1-63 characters long, and comply with
     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
     * Specifically, the name must be 1-63 characters long and match the regular
     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
     * character must be a lowercase letter, and all following characters must
     * be a dash, lowercase letter, or digit, except the last character, which
     * cannot be a dash.
     *
     * Generated from protobuf field <code>string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setNamespaceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->namespace_id = $var;

        return $this;
    }

    /**
     * Required. A namespace with initial fields set.
     *
     * Generated from protobuf field <code>.google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\ServiceDirectory\V1\PBNamespace|null
     */
    public function getNamespace()
    {
        return isset($this->namespace) ? $this->namespace : null;
    }

    public function hasNamespace()
    {
        return isset($this->namespace);
    }

    public function clearNamespace()
    {
        unset($this->namespace);
    }

    /**
     * Required. A namespace with initial fields set.
     *
     * Generated from protobuf field <code>.google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\ServiceDirectory\V1\PBNamespace $var
     * @return $this
     */
    public function setNamespace($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ServiceDirectory\V1\PBNamespace::class);
        $this->namespace = $var;

        return $this;
    }

}

