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\CloudIdentity\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudIdentity\Group;
|
---|
21 | use Google\Service\CloudIdentity\ListGroupsResponse;
|
---|
22 | use Google\Service\CloudIdentity\LookupGroupNameResponse;
|
---|
23 | use Google\Service\CloudIdentity\Operation;
|
---|
24 | use Google\Service\CloudIdentity\SearchGroupsResponse;
|
---|
25 | use Google\Service\CloudIdentity\SecuritySettings;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "groups" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $cloudidentityService = new Google\Service\CloudIdentity(...);
|
---|
32 | * $groups = $cloudidentityService->groups;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class Groups extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Creates a Group. (groups.create)
|
---|
39 | *
|
---|
40 | * @param Group $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string initialGroupConfig Optional. The initial configuration
|
---|
44 | * option for the `Group`.
|
---|
45 | * @return Operation
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function create(Group $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('create', [$params], Operation::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Deletes a `Group`. (groups.delete)
|
---|
56 | *
|
---|
57 | * @param string $name Required. The [resource
|
---|
58 | * name](https://cloud.google.com/apis/design/resource_names) of the `Group` to
|
---|
59 | * retrieve. Must be of the form `groups/{group}`.
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return Operation
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function delete($name, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['name' => $name];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('delete', [$params], Operation::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Retrieves a `Group`. (groups.get)
|
---|
72 | *
|
---|
73 | * @param string $name Required. The [resource
|
---|
74 | * name](https://cloud.google.com/apis/design/resource_names) of the `Group` to
|
---|
75 | * retrieve. Must be of the form `groups/{group}`.
|
---|
76 | * @param array $optParams Optional parameters.
|
---|
77 | * @return Group
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function get($name, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['name' => $name];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('get', [$params], Group::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Get Security Settings (groups.getSecuritySettings)
|
---|
88 | *
|
---|
89 | * @param string $name Required. The security settings to retrieve. Format:
|
---|
90 | * `groups/{group_id}/securitySettings`
|
---|
91 | * @param array $optParams Optional parameters.
|
---|
92 | *
|
---|
93 | * @opt_param string readMask Field-level read mask of which fields to return.
|
---|
94 | * "*" returns all fields. If not specified, all fields will be returned. May
|
---|
95 | * only contain the following field: `member_restriction`.
|
---|
96 | * @return SecuritySettings
|
---|
97 | * @throws \Google\Service\Exception
|
---|
98 | */
|
---|
99 | public function getSecuritySettings($name, $optParams = [])
|
---|
100 | {
|
---|
101 | $params = ['name' => $name];
|
---|
102 | $params = array_merge($params, $optParams);
|
---|
103 | return $this->call('getSecuritySettings', [$params], SecuritySettings::class);
|
---|
104 | }
|
---|
105 | /**
|
---|
106 | * Lists the `Group` resources under a customer or namespace.
|
---|
107 | * (groups.listGroups)
|
---|
108 | *
|
---|
109 | * @param array $optParams Optional parameters.
|
---|
110 | *
|
---|
111 | * @opt_param int pageSize The maximum number of results to return. Note that
|
---|
112 | * the number of results returned may be less than this value even if there are
|
---|
113 | * more available results. To fetch all results, clients must continue calling
|
---|
114 | * this method repeatedly until the response no longer contains a
|
---|
115 | * `next_page_token`. If unspecified, defaults to 200 for `View.BASIC` and to 50
|
---|
116 | * for `View.FULL`. Must not be greater than 1000 for `View.BASIC` or 500 for
|
---|
117 | * `View.FULL`.
|
---|
118 | * @opt_param string pageToken The `next_page_token` value returned from a
|
---|
119 | * previous list request, if any.
|
---|
120 | * @opt_param string parent Required. The parent resource under which to list
|
---|
121 | * all `Group` resources. Must be of the form
|
---|
122 | * `identitysources/{identity_source}` for external- identity-mapped groups or
|
---|
123 | * `customers/{customer_id}` for Google Groups. The `customer_id` must begin
|
---|
124 | * with "C" (for example, 'C046psxkn'). [Find your customer ID.]
|
---|
125 | * (https://support.google.com/cloudidentity/answer/10070793)
|
---|
126 | * @opt_param string view The level of detail to be returned. If unspecified,
|
---|
127 | * defaults to `View.BASIC`.
|
---|
128 | * @return ListGroupsResponse
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function listGroups($optParams = [])
|
---|
132 | {
|
---|
133 | $params = [];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('list', [$params], ListGroupsResponse::class);
|
---|
136 | }
|
---|
137 | /**
|
---|
138 | * Looks up the [resource
|
---|
139 | * name](https://cloud.google.com/apis/design/resource_names) of a `Group` by
|
---|
140 | * its `EntityKey`. (groups.lookup)
|
---|
141 | *
|
---|
142 | * @param array $optParams Optional parameters.
|
---|
143 | *
|
---|
144 | * @opt_param string groupKey.id The ID of the entity. For Google-managed
|
---|
145 | * entities, the `id` should be the email address of an existing group or user.
|
---|
146 | * Email addresses need to adhere to [name guidelines for users and
|
---|
147 | * groups](https://support.google.com/a/answer/9193374). For external-identity-
|
---|
148 | * mapped entities, the `id` must be a string conforming to the Identity
|
---|
149 | * Source's requirements. Must be unique within a `namespace`.
|
---|
150 | * @opt_param string groupKey.namespace The namespace in which the entity
|
---|
151 | * exists. If not specified, the `EntityKey` represents a Google-managed entity
|
---|
152 | * such as a Google user or a Google Group. If specified, the `EntityKey`
|
---|
153 | * represents an external-identity-mapped group. The namespace must correspond
|
---|
154 | * to an identity source created in Admin Console and must be in the form of
|
---|
155 | * `identitysources/{identity_source}`.
|
---|
156 | * @return LookupGroupNameResponse
|
---|
157 | * @throws \Google\Service\Exception
|
---|
158 | */
|
---|
159 | public function lookup($optParams = [])
|
---|
160 | {
|
---|
161 | $params = [];
|
---|
162 | $params = array_merge($params, $optParams);
|
---|
163 | return $this->call('lookup', [$params], LookupGroupNameResponse::class);
|
---|
164 | }
|
---|
165 | /**
|
---|
166 | * Updates a `Group`. (groups.patch)
|
---|
167 | *
|
---|
168 | * @param string $name Output only. The [resource
|
---|
169 | * name](https://cloud.google.com/apis/design/resource_names) of the `Group`.
|
---|
170 | * Shall be of the form `groups/{group}`.
|
---|
171 | * @param Group $postBody
|
---|
172 | * @param array $optParams Optional parameters.
|
---|
173 | *
|
---|
174 | * @opt_param string updateMask Required. The names of fields to update. May
|
---|
175 | * only contain the following field names: `display_name`, `description`,
|
---|
176 | * `labels`.
|
---|
177 | * @return Operation
|
---|
178 | * @throws \Google\Service\Exception
|
---|
179 | */
|
---|
180 | public function patch($name, Group $postBody, $optParams = [])
|
---|
181 | {
|
---|
182 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
183 | $params = array_merge($params, $optParams);
|
---|
184 | return $this->call('patch', [$params], Operation::class);
|
---|
185 | }
|
---|
186 | /**
|
---|
187 | * Searches for `Group` resources matching a specified query. (groups.search)
|
---|
188 | *
|
---|
189 | * @param array $optParams Optional parameters.
|
---|
190 | *
|
---|
191 | * @opt_param int pageSize The maximum number of results to return. Note that
|
---|
192 | * the number of results returned may be less than this value even if there are
|
---|
193 | * more available results. To fetch all results, clients must continue calling
|
---|
194 | * this method repeatedly until the response no longer contains a
|
---|
195 | * `next_page_token`. If unspecified, defaults to 200 for `GroupView.BASIC` and
|
---|
196 | * 50 for `GroupView.FULL`. Must not be greater than 1000 for `GroupView.BASIC`
|
---|
197 | * or 500 for `GroupView.FULL`.
|
---|
198 | * @opt_param string pageToken The `next_page_token` value returned from a
|
---|
199 | * previous search request, if any.
|
---|
200 | * @opt_param string query Required. The search query. * Must be specified in
|
---|
201 | * [Common Expression Language](https://opensource.google/projects/cel). * Must
|
---|
202 | * contain equality operators on the parent, e.g. `parent ==
|
---|
203 | * 'customers/{customer_id}'`. The `customer_id` must begin with "C" (for
|
---|
204 | * example, 'C046psxkn'). [Find your customer ID.]
|
---|
205 | * (https://support.google.com/cloudidentity/answer/10070793) * Can contain
|
---|
206 | * optional inclusion operators on `labels` such as
|
---|
207 | * `'cloudidentity.googleapis.com/groups.discussion_forum' in labels`). * Can
|
---|
208 | * contain an optional equality operator on `domain_name`. e.g. `domain_name ==
|
---|
209 | * 'examplepetstore.com'` * Can contain optional `startsWith/contains/equality`
|
---|
210 | * operators on `group_key`, e.g. `group_key.startsWith('dev')`,
|
---|
211 | * `group_key.contains('dev'), group_key == 'dev@examplepetstore.com'` * Can
|
---|
212 | * contain optional `startsWith/contains/equality` operators on `display_name`,
|
---|
213 | * such as `display_name.startsWith('dev')` , `display_name.contains('dev')`,
|
---|
214 | * `display_name == 'dev'`
|
---|
215 | * @opt_param string view The level of detail to be returned. If unspecified,
|
---|
216 | * defaults to `View.BASIC`.
|
---|
217 | * @return SearchGroupsResponse
|
---|
218 | * @throws \Google\Service\Exception
|
---|
219 | */
|
---|
220 | public function search($optParams = [])
|
---|
221 | {
|
---|
222 | $params = [];
|
---|
223 | $params = array_merge($params, $optParams);
|
---|
224 | return $this->call('search', [$params], SearchGroupsResponse::class);
|
---|
225 | }
|
---|
226 | /**
|
---|
227 | * Update Security Settings (groups.updateSecuritySettings)
|
---|
228 | *
|
---|
229 | * @param string $name Output only. The resource name of the security settings.
|
---|
230 | * Shall be of the form `groups/{group_id}/securitySettings`.
|
---|
231 | * @param SecuritySettings $postBody
|
---|
232 | * @param array $optParams Optional parameters.
|
---|
233 | *
|
---|
234 | * @opt_param string updateMask Required. The fully-qualified names of fields to
|
---|
235 | * update. May only contain the following field: `member_restriction.query`.
|
---|
236 | * @return Operation
|
---|
237 | * @throws \Google\Service\Exception
|
---|
238 | */
|
---|
239 | public function updateSecuritySettings($name, SecuritySettings $postBody, $optParams = [])
|
---|
240 | {
|
---|
241 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
242 | $params = array_merge($params, $optParams);
|
---|
243 | return $this->call('updateSecuritySettings', [$params], Operation::class);
|
---|
244 | }
|
---|
245 | }
|
---|
246 |
|
---|
247 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
248 | class_alias(Groups::class, 'Google_Service_CloudIdentity_Resource_Groups');
|
---|