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