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\CloudAlloyDBAdmin\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudAlloyDBAdmin\AlloydbEmpty;
|
---|
21 | use Google\Service\CloudAlloyDBAdmin\ListUsersResponse;
|
---|
22 | use Google\Service\CloudAlloyDBAdmin\User;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "users" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $alloydbService = new Google\Service\CloudAlloyDBAdmin(...);
|
---|
29 | * $users = $alloydbService->projects_locations_clusters_users;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsClustersUsers extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new User in a given project, location, and cluster. (users.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. Value for parent.
|
---|
38 | * @param User $postBody
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | *
|
---|
41 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
42 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
43 | * the server ignores the request if it has already been completed. The server
|
---|
44 | * guarantees that for at least 60 minutes since the first request. For example,
|
---|
45 | * consider a situation where you make an initial request and the request times
|
---|
46 | * out. If you make the request again with the same request ID, the server can
|
---|
47 | * check if the original operation with the same request ID was received, and if
|
---|
48 | * so, ignores the second request. This prevents clients from accidentally
|
---|
49 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
50 | * exception that zero UUID is not supported
|
---|
51 | * (00000000-0000-0000-0000-000000000000).
|
---|
52 | * @opt_param string userId Required. ID of the requesting object.
|
---|
53 | * @opt_param bool validateOnly Optional. If set, the backend validates the
|
---|
54 | * request, but doesn't actually execute it.
|
---|
55 | * @return User
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function create($parent, User $postBody, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('create', [$params], User::class);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Deletes a single User. (users.delete)
|
---|
66 | *
|
---|
67 | * @param string $name Required. The name of the resource. For the required
|
---|
68 | * format, see the comment on the User.name field.
|
---|
69 | * @param array $optParams Optional parameters.
|
---|
70 | *
|
---|
71 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
72 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
73 | * the server ignores the request if it has already been completed. The server
|
---|
74 | * guarantees that for at least 60 minutes since the first request. For example,
|
---|
75 | * consider a situation where you make an initial request and the request times
|
---|
76 | * out. If you make the request again with the same request ID, the server can
|
---|
77 | * check if the original operation with the same request ID was received, and if
|
---|
78 | * so, ignores the second request. This prevents clients from accidentally
|
---|
79 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
80 | * exception that zero UUID is not supported
|
---|
81 | * (00000000-0000-0000-0000-000000000000).
|
---|
82 | * @opt_param bool validateOnly Optional. If set, the backend validates the
|
---|
83 | * request, but doesn't actually execute it.
|
---|
84 | * @return AlloydbEmpty
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function delete($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('delete', [$params], AlloydbEmpty::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets details of a single User. (users.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. The name of the resource. For the required
|
---|
97 | * format, see the comment on the User.name field.
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | * @return User
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function get($name, $optParams = [])
|
---|
103 | {
|
---|
104 | $params = ['name' => $name];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('get', [$params], User::class);
|
---|
107 | }
|
---|
108 | /**
|
---|
109 | * Lists Users in a given project and location.
|
---|
110 | * (users.listProjectsLocationsClustersUsers)
|
---|
111 | *
|
---|
112 | * @param string $parent Required. Parent value for ListUsersRequest
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | *
|
---|
115 | * @opt_param string filter Optional. Filtering results
|
---|
116 | * @opt_param string orderBy Optional. Hint for how to order the results
|
---|
117 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
118 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
119 | * default.
|
---|
120 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
121 | * the server should return.
|
---|
122 | * @return ListUsersResponse
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function listProjectsLocationsClustersUsers($parent, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['parent' => $parent];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('list', [$params], ListUsersResponse::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Updates the parameters of a single User. (users.patch)
|
---|
133 | *
|
---|
134 | * @param string $name Output only. Name of the resource in the form of
|
---|
135 | * projects/{project}/locations/{location}/cluster/{cluster}/users/{user}.
|
---|
136 | * @param User $postBody
|
---|
137 | * @param array $optParams Optional parameters.
|
---|
138 | *
|
---|
139 | * @opt_param bool allowMissing Optional. Allow missing fields in the update
|
---|
140 | * mask.
|
---|
141 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
142 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
143 | * the server ignores the request if it has already been completed. The server
|
---|
144 | * guarantees that for at least 60 minutes since the first request. For example,
|
---|
145 | * consider a situation where you make an initial request and the request times
|
---|
146 | * out. If you make the request again with the same request ID, the server can
|
---|
147 | * check if the original operation with the same request ID was received, and if
|
---|
148 | * so, ignores the second request. This prevents clients from accidentally
|
---|
149 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
150 | * exception that zero UUID is not supported
|
---|
151 | * (00000000-0000-0000-0000-000000000000).
|
---|
152 | * @opt_param string updateMask Optional. Field mask is used to specify the
|
---|
153 | * fields to be overwritten in the User resource by the update. The fields
|
---|
154 | * specified in the update_mask are relative to the resource, not the full
|
---|
155 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
156 | * not provide a mask then all fields will be overwritten.
|
---|
157 | * @opt_param bool validateOnly Optional. If set, the backend validates the
|
---|
158 | * request, but doesn't actually execute it.
|
---|
159 | * @return User
|
---|
160 | * @throws \Google\Service\Exception
|
---|
161 | */
|
---|
162 | public function patch($name, User $postBody, $optParams = [])
|
---|
163 | {
|
---|
164 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
165 | $params = array_merge($params, $optParams);
|
---|
166 | return $this->call('patch', [$params], User::class);
|
---|
167 | }
|
---|
168 | }
|
---|
169 |
|
---|
170 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
171 | class_alias(ProjectsLocationsClustersUsers::class, 'Google_Service_CloudAlloyDBAdmin_Resource_ProjectsLocationsClustersUsers');
|
---|