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

namespace Google\Apps\Chat\V1;

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

/**
 * A request to create a named space.
 *
 * Generated from protobuf message <code>google.chat.v1.CreateSpaceRequest</code>
 */
class CreateSpaceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The `displayName` and `spaceType` fields must be populated.  Only
     * `SpaceType.SPACE` is supported.
     * If you receive the error message `ALREADY_EXISTS` when creating a space,
     * try a different `displayName`. An existing space within the Google
     * Workspace organization might already use this display name.
     * The space `name` is assigned on the server so anything specified in this
     * field will be ignored.
     *
     * Generated from protobuf field <code>.google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $space = null;
    /**
     * Optional. A unique identifier for this request.
     * A random UUID is recommended.
     * Specifying an existing request ID returns the space created with that ID
     * instead of creating a new space.
     * Specifying an existing request ID from the same Chat app with a different
     * authenticated user returns an error.
     *
     * Generated from protobuf field <code>string request_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $request_id = '';

    /**
     * @param \Google\Apps\Chat\V1\Space $space Required. The `displayName` and `spaceType` fields must be populated.  Only
     *                                          `SpaceType.SPACE` is supported.
     *
     *                                          If you receive the error message `ALREADY_EXISTS` when creating a space,
     *                                          try a different `displayName`. An existing space within the Google
     *                                          Workspace organization might already use this display name.
     *
     *                                          The space `name` is assigned on the server so anything specified in this
     *                                          field will be ignored.
     *
     * @return \Google\Apps\Chat\V1\CreateSpaceRequest
     *
     * @experimental
     */
    public static function build(\Google\Apps\Chat\V1\Space $space): self
    {
        return (new self())
            ->setSpace($space);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Apps\Chat\V1\Space $space
     *           Required. The `displayName` and `spaceType` fields must be populated.  Only
     *           `SpaceType.SPACE` is supported.
     *           If you receive the error message `ALREADY_EXISTS` when creating a space,
     *           try a different `displayName`. An existing space within the Google
     *           Workspace organization might already use this display name.
     *           The space `name` is assigned on the server so anything specified in this
     *           field will be ignored.
     *     @type string $request_id
     *           Optional. A unique identifier for this request.
     *           A random UUID is recommended.
     *           Specifying an existing request ID returns the space created with that ID
     *           instead of creating a new space.
     *           Specifying an existing request ID from the same Chat app with a different
     *           authenticated user returns an error.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Space::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The `displayName` and `spaceType` fields must be populated.  Only
     * `SpaceType.SPACE` is supported.
     * If you receive the error message `ALREADY_EXISTS` when creating a space,
     * try a different `displayName`. An existing space within the Google
     * Workspace organization might already use this display name.
     * The space `name` is assigned on the server so anything specified in this
     * field will be ignored.
     *
     * Generated from protobuf field <code>.google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Apps\Chat\V1\Space|null
     */
    public function getSpace()
    {
        return $this->space;
    }

    public function hasSpace()
    {
        return isset($this->space);
    }

    public function clearSpace()
    {
        unset($this->space);
    }

    /**
     * Required. The `displayName` and `spaceType` fields must be populated.  Only
     * `SpaceType.SPACE` is supported.
     * If you receive the error message `ALREADY_EXISTS` when creating a space,
     * try a different `displayName`. An existing space within the Google
     * Workspace organization might already use this display name.
     * The space `name` is assigned on the server so anything specified in this
     * field will be ignored.
     *
     * Generated from protobuf field <code>.google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Apps\Chat\V1\Space $var
     * @return $this
     */
    public function setSpace($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space::class);
        $this->space = $var;

        return $this;
    }

    /**
     * Optional. A unique identifier for this request.
     * A random UUID is recommended.
     * Specifying an existing request ID returns the space created with that ID
     * instead of creating a new space.
     * Specifying an existing request ID from the same Chat app with a different
     * authenticated user returns an error.
     *
     * Generated from protobuf field <code>string request_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Optional. A unique identifier for this request.
     * A random UUID is recommended.
     * Specifying an existing request ID returns the space created with that ID
     * instead of creating a new space.
     * Specifying an existing request ID from the same Chat app with a different
     * authenticated user returns an error.
     *
     * Generated from protobuf field <code>string request_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

}

