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\AndroidPublisher\Resource;
19
20use Google\Service\AndroidPublisher\ListUsersResponse;
21use Google\Service\AndroidPublisher\User;
22
23/**
24 * The "users" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $androidpublisherService = new Google\Service\AndroidPublisher(...);
28 *   $users = $androidpublisherService->users;
29 *  </code>
30 */
31class Users extends \Google\Service\Resource
32{
33  /**
34   * Grant access for a user to the given developer account. (users.create)
35   *
36   * @param string $parent Required. The developer account to add the user to.
37   * Format: developers/{developer}
38   * @param User $postBody
39   * @param array $optParams Optional parameters.
40   * @return User
41   */
42  public function create($parent, User $postBody, $optParams = [])
43  {
44    $params = ['parent' => $parent, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('create', [$params], User::class);
47  }
48  /**
49   * Removes all access for the user to the given developer account.
50   * (users.delete)
51   *
52   * @param string $name Required. The name of the user to delete. Format:
53   * developers/{developer}/users/{email}
54   * @param array $optParams Optional parameters.
55   */
56  public function delete($name, $optParams = [])
57  {
58    $params = ['name' => $name];
59    $params = array_merge($params, $optParams);
60    return $this->call('delete', [$params]);
61  }
62  /**
63   * Lists all users with access to a developer account. (users.listUsers)
64   *
65   * @param string $parent Required. The developer account to fetch users from.
66   * Format: developers/{developer}
67   * @param array $optParams Optional parameters.
68   *
69   * @opt_param int pageSize The maximum number of results to return. This must be
70   * set to -1 to disable pagination.
71   * @opt_param string pageToken A token received from a previous call to this
72   * method, in order to retrieve further results.
73   * @return ListUsersResponse
74   */
75  public function listUsers($parent, $optParams = [])
76  {
77    $params = ['parent' => $parent];
78    $params = array_merge($params, $optParams);
79    return $this->call('list', [$params], ListUsersResponse::class);
80  }
81  /**
82   * Updates access for the user to the developer account. (users.patch)
83   *
84   * @param string $name Required. Resource name for this user, following the
85   * pattern "developers/{developer}/users/{email}".
86   * @param User $postBody
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param string updateMask Optional. The list of fields to be updated.
90   * @return User
91   */
92  public function patch($name, User $postBody, $optParams = [])
93  {
94    $params = ['name' => $name, 'postBody' => $postBody];
95    $params = array_merge($params, $optParams);
96    return $this->call('patch', [$params], User::class);
97  }
98}
99
100// Adding a class alias for backwards compatibility with the previous class name.
101class_alias(Users::class, 'Google_Service_AndroidPublisher_Resource_Users');
102