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

namespace Google\Cloud\PubSub\V1;

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

/**
 * Request for the `ListTopicSubscriptions` method.
 *
 * Generated from protobuf message <code>google.pubsub.v1.ListTopicSubscriptionsRequest</code>
 */
class ListTopicSubscriptionsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the topic that subscriptions are attached to.
     * Format is `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $topic = '';
    /**
     * Optional. Maximum number of subscription names to return.
     *
     * Generated from protobuf field <code>int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $page_size = 0;
    /**
     * Optional. The value returned by the last `ListTopicSubscriptionsResponse`;
     * indicates that this is a continuation of a prior `ListTopicSubscriptions`
     * call, and that the system should return the next page of data.
     *
     * Generated from protobuf field <code>string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $page_token = '';

    /**
     * @param string $topic Required. The name of the topic that subscriptions are attached to.
     *                      Format is `projects/{project}/topics/{topic}`. Please see
     *                      {@see PublisherClient::topicName()} for help formatting this field.
     *
     * @return \Google\Cloud\PubSub\V1\ListTopicSubscriptionsRequest
     *
     * @experimental
     */
    public static function build(string $topic): self
    {
        return (new self())
            ->setTopic($topic);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $topic
     *           Required. The name of the topic that subscriptions are attached to.
     *           Format is `projects/{project}/topics/{topic}`.
     *     @type int $page_size
     *           Optional. Maximum number of subscription names to return.
     *     @type string $page_token
     *           Optional. The value returned by the last `ListTopicSubscriptionsResponse`;
     *           indicates that this is a continuation of a prior `ListTopicSubscriptions`
     *           call, and that the system should return the next page of data.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the topic that subscriptions are attached to.
     * Format is `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getTopic()
    {
        return $this->topic;
    }

    /**
     * Required. The name of the topic that subscriptions are attached to.
     * Format is `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setTopic($var)
    {
        GPBUtil::checkString($var, True);
        $this->topic = $var;

        return $this;
    }

    /**
     * Optional. Maximum number of subscription names to return.
     *
     * 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. Maximum number of subscription names to return.
     *
     * 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. The value returned by the last `ListTopicSubscriptionsResponse`;
     * indicates that this is a continuation of a prior `ListTopicSubscriptions`
     * call, and that the system should return the next page of data.
     *
     * 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. The value returned by the last `ListTopicSubscriptionsResponse`;
     * indicates that this is a continuation of a prior `ListTopicSubscriptions`
     * call, and that the system should return the next page of data.
     *
     * 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;
    }

}

