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

namespace Google\Apps\Chat\V1;

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

/**
 * Request message for creating a section.
 *
 * Generated from protobuf message <code>google.chat.v1.CreateSectionRequest</code>
 */
class CreateSectionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource name where the section is created.
     * Format: `users/{user}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The section to create.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section section = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $section = null;

    /**
     * @param string                       $parent  Required. The parent resource name where the section is created.
     *
     *                                              Format: `users/{user}`
     *                                              Please see {@see ChatServiceClient::userName()} for help formatting this field.
     * @param \Google\Apps\Chat\V1\Section $section Required. The section to create.
     *
     * @return \Google\Apps\Chat\V1\CreateSectionRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Apps\Chat\V1\Section $section): self
    {
        return (new self())
            ->setParent($parent)
            ->setSection($section);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource name where the section is created.
     *           Format: `users/{user}`
     *     @type \Google\Apps\Chat\V1\Section $section
     *           Required. The section to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Section::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource name where the section is created.
     * Format: `users/{user}`
     *
     * 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 parent resource name where the section is created.
     * Format: `users/{user}`
     *
     * 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 section to create.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section section = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Apps\Chat\V1\Section|null
     */
    public function getSection()
    {
        return $this->section;
    }

    public function hasSection()
    {
        return isset($this->section);
    }

    public function clearSection()
    {
        unset($this->section);
    }

    /**
     * Required. The section to create.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section section = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Apps\Chat\V1\Section $var
     * @return $this
     */
    public function setSection($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Section::class);
        $this->section = $var;

        return $this;
    }

}

