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

namespace Google\Apps\Chat\V1;

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

/**
 * Response to list memberships of the space.
 *
 * Generated from protobuf message <code>google.chat.v1.ListMembershipsResponse</code>
 */
class ListMembershipsResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Unordered list. List of memberships in the requested (or first) page.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.Membership memberships = 1 [(.google.api.field_behavior) = UNORDERED_LIST];</code>
     */
    private $memberships;
    /**
     * A token that you can send as `pageToken` to retrieve the next page of
     * results. If empty, there are no subsequent pages.
     *
     * Generated from protobuf field <code>string next_page_token = 2;</code>
     */
    protected $next_page_token = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Apps\Chat\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $memberships
     *           Unordered list. List of memberships in the requested (or first) page.
     *     @type string $next_page_token
     *           A token that you can send as `pageToken` to retrieve the next page of
     *           results. If empty, there are no subsequent pages.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Membership::initOnce();
        parent::__construct($data);
    }

    /**
     * Unordered list. List of memberships in the requested (or first) page.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.Membership memberships = 1 [(.google.api.field_behavior) = UNORDERED_LIST];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMemberships()
    {
        return $this->memberships;
    }

    /**
     * Unordered list. List of memberships in the requested (or first) page.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.Membership memberships = 1 [(.google.api.field_behavior) = UNORDERED_LIST];</code>
     * @param array<\Google\Apps\Chat\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMemberships($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Membership::class);
        $this->memberships = $arr;

        return $this;
    }

    /**
     * A token that you can send as `pageToken` to retrieve the next page of
     * results. If empty, there are no subsequent pages.
     *
     * Generated from protobuf field <code>string next_page_token = 2;</code>
     * @return string
     */
    public function getNextPageToken()
    {
        return $this->next_page_token;
    }

    /**
     * A token that you can send as `pageToken` to retrieve the next page of
     * results. If empty, there are no subsequent pages.
     *
     * Generated from protobuf field <code>string next_page_token = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setNextPageToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->next_page_token = $var;

        return $this;
    }

}

