<?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;

/**
 * Represents a [section](https://support.google.com/chat/answer/16059854) in
 * Google Chat. Sections help users organize their spaces. There are two types
 * of sections:
 * 1.  **System Sections:** These are predefined sections managed by Google
 * Chat.
 *     Their resource names are fixed, and they cannot be created, deleted, or
 *     have their `display_name` modified. Examples include:
 *     *   `users/{user}/sections/default-direct-messages`
 *     *   `users/{user}/sections/default-spaces`
 *     *   `users/{user}/sections/default-apps`
 * 2.  **Custom Sections:** These are sections created and managed by the user.
 *     Creating a custom section using `CreateSection` **requires** a
 *     `display_name`. Custom sections can be updated using `UpdateSection` and
 *     deleted using `DeleteSection`.
 *
 * Generated from protobuf message <code>google.chat.v1.Section</code>
 */
class Section extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. Resource name of the section.
     * For system sections, the section ID is a constant string:
     * - DEFAULT_DIRECT_MESSAGES: `users/{user}/sections/default-direct-messages`
     * - DEFAULT_SPACES: `users/{user}/sections/default-spaces`
     * - DEFAULT_APPS: `users/{user}/sections/default-apps`
     * Format: `users/{user}/sections/{section}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Optional. The section's display name. Only populated for sections of type
     * `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a
     * `CUSTOM_SECTION`.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $display_name = '';
    /**
     * Output only. The order of the section in relation to other sections.
     * Sections with a lower `sort_order` value appear before sections with a
     * higher value.
     *
     * Generated from protobuf field <code>int32 sort_order = 3;</code>
     */
    protected $sort_order = 0;
    /**
     * Required. The type of the section.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. Resource name of the section.
     *           For system sections, the section ID is a constant string:
     *           - DEFAULT_DIRECT_MESSAGES: `users/{user}/sections/default-direct-messages`
     *           - DEFAULT_SPACES: `users/{user}/sections/default-spaces`
     *           - DEFAULT_APPS: `users/{user}/sections/default-apps`
     *           Format: `users/{user}/sections/{section}`
     *     @type string $display_name
     *           Optional. The section's display name. Only populated for sections of type
     *           `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a
     *           `CUSTOM_SECTION`.
     *     @type int $sort_order
     *           Output only. The order of the section in relation to other sections.
     *           Sections with a lower `sort_order` value appear before sections with a
     *           higher value.
     *     @type int $type
     *           Required. The type of the section.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Section::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. Resource name of the section.
     * For system sections, the section ID is a constant string:
     * - DEFAULT_DIRECT_MESSAGES: `users/{user}/sections/default-direct-messages`
     * - DEFAULT_SPACES: `users/{user}/sections/default-spaces`
     * - DEFAULT_APPS: `users/{user}/sections/default-apps`
     * Format: `users/{user}/sections/{section}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. Resource name of the section.
     * For system sections, the section ID is a constant string:
     * - DEFAULT_DIRECT_MESSAGES: `users/{user}/sections/default-direct-messages`
     * - DEFAULT_SPACES: `users/{user}/sections/default-spaces`
     * - DEFAULT_APPS: `users/{user}/sections/default-apps`
     * Format: `users/{user}/sections/{section}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. The section's display name. Only populated for sections of type
     * `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a
     * `CUSTOM_SECTION`.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Optional. The section's display name. Only populated for sections of type
     * `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a
     * `CUSTOM_SECTION`.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Output only. The order of the section in relation to other sections.
     * Sections with a lower `sort_order` value appear before sections with a
     * higher value.
     *
     * Generated from protobuf field <code>int32 sort_order = 3;</code>
     * @return int
     */
    public function getSortOrder()
    {
        return $this->sort_order;
    }

    /**
     * Output only. The order of the section in relation to other sections.
     * Sections with a lower `sort_order` value appear before sections with a
     * higher value.
     *
     * Generated from protobuf field <code>int32 sort_order = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setSortOrder($var)
    {
        GPBUtil::checkInt32($var);
        $this->sort_order = $var;

        return $this;
    }

    /**
     * Required. The type of the section.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Required. The type of the section.
     *
     * Generated from protobuf field <code>.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Section\SectionType::class);
        $this->type = $var;

        return $this;
    }

}

