<?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 updating a section.
 *
 * Generated from protobuf message <code>google.chat.v1.UpdateSectionRequest</code>
 */
class UpdateSectionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The section to update.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section section = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $section = null;
    /**
     * Required. The mask to specify which fields to update.
     * Currently supported field paths:
     * - `display_name`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Apps\Chat\V1\Section $section    Required. The section to update.
     * @param \Google\Protobuf\FieldMask   $updateMask Required. The mask to specify which fields to update.
     *
     *                                                 Currently supported field paths:
     *
     *                                                 - `display_name`
     *
     * @return \Google\Apps\Chat\V1\UpdateSectionRequest
     *
     * @experimental
     */
    public static function build(\Google\Apps\Chat\V1\Section $section, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setSection($section)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Apps\Chat\V1\Section $section
     *           Required. The section to update.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. The mask to specify which fields to update.
     *           Currently supported field paths:
     *           - `display_name`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Section::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The section to update.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section section = 1 [(.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 update.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section section = 1 [(.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;
    }

    /**
     * Required. The mask to specify which fields to update.
     * Currently supported field paths:
     * - `display_name`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Required. The mask to specify which fields to update.
     * Currently supported field paths:
     * - `display_name`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

