<?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 listing sections.
 *
 * Generated from protobuf message <code>google.chat.v1.ListSectionsRequest</code>
 */
class ListSectionsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent, which is the user resource name that owns this
     * collection of sections. Only supports listing sections for the calling
     * user. To refer to the calling user, set one of the following:
     * - The `me` alias. For example, `users/me`.
     * - Their Workspace email address. For example, `users/user\@example.com`.
     * - Their user id. For example, `users/123456789`.
     * Format: `users/{user}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Optional. The maximum number of sections to return. The service may return
     * fewer than this value.
     * If unspecified, at most 10 sections will be returned.
     * The maximum value is 100. If you use a value more than 100, it's
     * automatically changed to 100.
     * Negative values return an `INVALID_ARGUMENT` error.
     *
     * Generated from protobuf field <code>int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $page_size = 0;
    /**
     * Optional. A page token, received from a previous list sections call.
     * Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided should match the call that
     * provided the page token. Passing different values to the other parameters
     * might lead to unexpected results.
     *
     * Generated from protobuf field <code>string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $page_token = '';

    /**
     * @param string $parent Required. The parent, which is the user resource name that owns this
     *                       collection of sections. Only supports listing sections for the calling
     *                       user. To refer to the calling user, set one of the following:
     *
     *                       - The `me` alias. For example, `users/me`.
     *
     *                       - Their Workspace email address. For example, `users/user&#64;example.com`.
     *
     *                       - Their user id. For example, `users/123456789`.
     *
     *                       Format: `users/{user}`
     *                       Please see {@see ChatServiceClient::userName()} for help formatting this field.
     *
     * @return \Google\Apps\Chat\V1\ListSectionsRequest
     *
     * @experimental
     */
    public static function build(string $parent): self
    {
        return (new self())
            ->setParent($parent);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent, which is the user resource name that owns this
     *           collection of sections. Only supports listing sections for the calling
     *           user. To refer to the calling user, set one of the following:
     *           - The `me` alias. For example, `users/me`.
     *           - Their Workspace email address. For example, `users/user\@example.com`.
     *           - Their user id. For example, `users/123456789`.
     *           Format: `users/{user}`
     *     @type int $page_size
     *           Optional. The maximum number of sections to return. The service may return
     *           fewer than this value.
     *           If unspecified, at most 10 sections will be returned.
     *           The maximum value is 100. If you use a value more than 100, it's
     *           automatically changed to 100.
     *           Negative values return an `INVALID_ARGUMENT` error.
     *     @type string $page_token
     *           Optional. A page token, received from a previous list sections call.
     *           Provide this to retrieve the subsequent page.
     *           When paginating, all other parameters provided should match the call that
     *           provided the page token. Passing different values to the other parameters
     *           might lead to unexpected results.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Section::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent, which is the user resource name that owns this
     * collection of sections. Only supports listing sections for the calling
     * user. To refer to the calling user, set one of the following:
     * - The `me` alias. For example, `users/me`.
     * - Their Workspace email address. For example, `users/user\@example.com`.
     * - Their user id. For example, `users/123456789`.
     * 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, which is the user resource name that owns this
     * collection of sections. Only supports listing sections for the calling
     * user. To refer to the calling user, set one of the following:
     * - The `me` alias. For example, `users/me`.
     * - Their Workspace email address. For example, `users/user\@example.com`.
     * - Their user id. For example, `users/123456789`.
     * 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;
    }

    /**
     * Optional. The maximum number of sections to return. The service may return
     * fewer than this value.
     * If unspecified, at most 10 sections will be returned.
     * The maximum value is 100. If you use a value more than 100, it's
     * automatically changed to 100.
     * Negative values return an `INVALID_ARGUMENT` error.
     *
     * Generated from protobuf field <code>int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getPageSize()
    {
        return $this->page_size;
    }

    /**
     * Optional. The maximum number of sections to return. The service may return
     * fewer than this value.
     * If unspecified, at most 10 sections will be returned.
     * The maximum value is 100. If you use a value more than 100, it's
     * automatically changed to 100.
     * Negative values return an `INVALID_ARGUMENT` error.
     *
     * Generated from protobuf field <code>int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setPageSize($var)
    {
        GPBUtil::checkInt32($var);
        $this->page_size = $var;

        return $this;
    }

    /**
     * Optional. A page token, received from a previous list sections call.
     * Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided should match the call that
     * provided the page token. Passing different values to the other parameters
     * might lead to unexpected results.
     *
     * Generated from protobuf field <code>string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getPageToken()
    {
        return $this->page_token;
    }

    /**
     * Optional. A page token, received from a previous list sections call.
     * Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided should match the call that
     * provided the page token. Passing different values to the other parameters
     * might lead to unexpected results.
     *
     * Generated from protobuf field <code>string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setPageToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->page_token = $var;

        return $this;
    }

}

