1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\HangoutsChat\Resource;
19
20use Google\Service\HangoutsChat\ListMembershipsResponse;
21use Google\Service\HangoutsChat\Membership;
22
23/**
24 * The "members" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $chatService = new Google\Service\HangoutsChat(...);
28 *   $members = $chatService->members;
29 *  </code>
30 */
31class SpacesMembers extends \Google\Service\Resource
32{
33  /**
34   * Returns a membership. Requires [service account
35   * authentication](https://developers.google.com/chat/api/guides/auth/service-
36   * accounts). (members.get)
37   *
38   * @param string $name Required. Resource name of the membership to be
39   * retrieved, in the form "spaces/members". Example:
40   * spaces/AAAAAAAAAAAA/members/111111111111111111111
41   * @param array $optParams Optional parameters.
42   * @return Membership
43   */
44  public function get($name, $optParams = [])
45  {
46    $params = ['name' => $name];
47    $params = array_merge($params, $optParams);
48    return $this->call('get', [$params], Membership::class);
49  }
50  /**
51   * Lists human memberships in a space. Requires [service account
52   * authentication](https://developers.google.com/chat/api/guides/auth/service-
53   * accounts). (members.listSpacesMembers)
54   *
55   * @param string $parent Required. The resource name of the space for which
56   * membership list is to be fetched, in the form "spaces". Example:
57   * spaces/AAAAAAAAAAAA
58   * @param array $optParams Optional parameters.
59   *
60   * @opt_param int pageSize Requested page size. The value is capped at 1000.
61   * Server may return fewer results than requested. If unspecified, server will
62   * default to 100.
63   * @opt_param string pageToken A token identifying a page of results the server
64   * should return.
65   * @return ListMembershipsResponse
66   */
67  public function listSpacesMembers($parent, $optParams = [])
68  {
69    $params = ['parent' => $parent];
70    $params = array_merge($params, $optParams);
71    return $this->call('list', [$params], ListMembershipsResponse::class);
72  }
73}
74
75// Adding a class alias for backwards compatibility with the previous class name.
76class_alias(SpacesMembers::class, 'Google_Service_HangoutsChat_Resource_SpacesMembers');
77