OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.cloudresourcemanager.v1; | 3 library googleapis.cloudresourcemanager.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 10 matching lines...) Expand all Loading... |
21 class CloudresourcemanagerApi { | 21 class CloudresourcemanagerApi { |
22 /** View and manage your data across Google Cloud Platform services */ | 22 /** View and manage your data across Google Cloud Platform services */ |
23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
24 | 24 |
25 /** View your data across Google Cloud Platform services */ | 25 /** View your data across Google Cloud Platform services */ |
26 static const CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/clo
ud-platform.read-only"; | 26 static const CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/clo
ud-platform.read-only"; |
27 | 27 |
28 | 28 |
29 final commons.ApiRequester _requester; | 29 final commons.ApiRequester _requester; |
30 | 30 |
| 31 FoldersResourceApi get folders => new FoldersResourceApi(_requester); |
31 LiensResourceApi get liens => new LiensResourceApi(_requester); | 32 LiensResourceApi get liens => new LiensResourceApi(_requester); |
32 OperationsResourceApi get operations => new OperationsResourceApi(_requester); | 33 OperationsResourceApi get operations => new OperationsResourceApi(_requester); |
33 OrganizationsResourceApi get organizations => new OrganizationsResourceApi(_re
quester); | 34 OrganizationsResourceApi get organizations => new OrganizationsResourceApi(_re
quester); |
34 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | 35 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
35 | 36 |
36 CloudresourcemanagerApi(http.Client client, {core.String rootUrl: "https://clo
udresourcemanager.googleapis.com/", core.String servicePath: ""}) : | 37 CloudresourcemanagerApi(http.Client client, {core.String rootUrl: "https://clo
udresourcemanager.googleapis.com/", core.String servicePath: ""}) : |
37 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 38 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
38 } | 39 } |
39 | 40 |
40 | 41 |
41 class LiensResourceApi { | 42 class FoldersResourceApi { |
42 final commons.ApiRequester _requester; | 43 final commons.ApiRequester _requester; |
43 | 44 |
44 LiensResourceApi(commons.ApiRequester client) : | 45 FoldersResourceApi(commons.ApiRequester client) : |
45 _requester = client; | 46 _requester = client; |
46 | 47 |
47 /** | 48 /** |
48 * Create a Lien which applies to the resource denoted by the `parent` field. | 49 * Clears a `Policy` from a resource. |
49 * | |
50 * Callers of this method will require permission on the `parent` resource. | |
51 * For example, applying to `projects/1234` requires permission | |
52 * `resourcemanager.projects.updateLiens`. | |
53 * | |
54 * NOTE: Some resources may limit the number of Liens which may be applied. | |
55 * | 50 * |
56 * [request] - The metadata request object. | 51 * [request] - The metadata request object. |
57 * | 52 * |
58 * Request parameters: | 53 * Request parameters: |
59 * | 54 * |
60 * Completes with a [Lien]. | 55 * [resource] - Name of the resource for the `Policy` to clear. |
| 56 * Value must have pattern "^folders/[^/]+$". |
| 57 * |
| 58 * Completes with a [Empty]. |
61 * | 59 * |
62 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 60 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
63 * error. | 61 * error. |
64 * | 62 * |
65 * If the used [http.Client] completes with an error when making a REST call, | 63 * If the used [http.Client] completes with an error when making a REST call, |
66 * this method will complete with the same error. | 64 * this method will complete with the same error. |
67 */ | 65 */ |
68 async.Future<Lien> create(Lien request) { | 66 async.Future<Empty> clearOrgPolicy(ClearOrgPolicyRequest request, core.String
resource) { |
69 var _url = null; | 67 var _url = null; |
70 var _queryParams = new core.Map(); | 68 var _queryParams = new core.Map(); |
71 var _uploadMedia = null; | 69 var _uploadMedia = null; |
72 var _uploadOptions = null; | 70 var _uploadOptions = null; |
73 var _downloadOptions = commons.DownloadOptions.Metadata; | 71 var _downloadOptions = commons.DownloadOptions.Metadata; |
74 var _body = null; | 72 var _body = null; |
75 | 73 |
76 if (request != null) { | 74 if (request != null) { |
77 _body = convert.JSON.encode((request).toJson()); | 75 _body = convert.JSON.encode((request).toJson()); |
78 } | 76 } |
| 77 if (resource == null) { |
| 78 throw new core.ArgumentError("Parameter resource is required."); |
| 79 } |
79 | 80 |
80 _url = 'v1/liens'; | 81 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':clearO
rgPolicy'; |
81 | 82 |
82 var _response = _requester.request(_url, | 83 var _response = _requester.request(_url, |
83 "POST", | 84 "POST", |
84 body: _body, | 85 body: _body, |
85 queryParams: _queryParams, | 86 queryParams: _queryParams, |
86 uploadOptions: _uploadOptions, | 87 uploadOptions: _uploadOptions, |
87 uploadMedia: _uploadMedia, | 88 uploadMedia: _uploadMedia, |
88 downloadOptions: _downloadOptions); | 89 downloadOptions: _downloadOptions); |
89 return _response.then((data) => new Lien.fromJson(data)); | 90 return _response.then((data) => new Empty.fromJson(data)); |
90 } | 91 } |
91 | 92 |
92 /** | 93 /** |
93 * Delete a Lien by `name`. | 94 * Clears a `Policy` from a resource. |
94 * | 95 * |
95 * Callers of this method will require permission on the `parent` resource. | 96 * [request] - The metadata request object. |
96 * For example, a Lien with a `parent` of `projects/1234` requires permission | |
97 * `resourcemanager.projects.updateLiens`. | |
98 * | 97 * |
99 * Request parameters: | 98 * Request parameters: |
100 * | 99 * |
101 * [name] - The name/identifier of the Lien to delete. | 100 * [resource] - Name of the resource for the `Policy` to clear. |
102 * Value must have pattern "^liens/.+$". | 101 * Value must have pattern "^folders/[^/]+$". |
103 * | 102 * |
104 * Completes with a [Empty]. | 103 * Completes with a [Empty]. |
105 * | 104 * |
106 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 105 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
107 * error. | 106 * error. |
108 * | 107 * |
109 * If the used [http.Client] completes with an error when making a REST call, | 108 * If the used [http.Client] completes with an error when making a REST call, |
110 * this method will complete with the same error. | 109 * this method will complete with the same error. |
111 */ | 110 */ |
112 async.Future<Empty> delete(core.String name) { | 111 async.Future<Empty> clearOrgPolicyV1(ClearOrgPolicyRequest request, core.Strin
g resource) { |
113 var _url = null; | 112 var _url = null; |
114 var _queryParams = new core.Map(); | 113 var _queryParams = new core.Map(); |
115 var _uploadMedia = null; | 114 var _uploadMedia = null; |
116 var _uploadOptions = null; | 115 var _uploadOptions = null; |
117 var _downloadOptions = commons.DownloadOptions.Metadata; | 116 var _downloadOptions = commons.DownloadOptions.Metadata; |
118 var _body = null; | 117 var _body = null; |
119 | 118 |
120 if (name == null) { | 119 if (request != null) { |
121 throw new core.ArgumentError("Parameter name is required."); | 120 _body = convert.JSON.encode((request).toJson()); |
| 121 } |
| 122 if (resource == null) { |
| 123 throw new core.ArgumentError("Parameter resource is required."); |
122 } | 124 } |
123 | 125 |
124 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 126 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':clearO
rgPolicyV1'; |
125 | 127 |
126 var _response = _requester.request(_url, | 128 var _response = _requester.request(_url, |
127 "DELETE", | 129 "POST", |
128 body: _body, | 130 body: _body, |
129 queryParams: _queryParams, | 131 queryParams: _queryParams, |
130 uploadOptions: _uploadOptions, | 132 uploadOptions: _uploadOptions, |
131 uploadMedia: _uploadMedia, | 133 uploadMedia: _uploadMedia, |
132 downloadOptions: _downloadOptions); | 134 downloadOptions: _downloadOptions); |
133 return _response.then((data) => new Empty.fromJson(data)); | 135 return _response.then((data) => new Empty.fromJson(data)); |
134 } | 136 } |
135 | 137 |
136 /** | 138 /** |
137 * List all Liens applied to the `parent` resource. | 139 * Gets the effective `Policy` on a resource. This is the result of merging |
| 140 * `Policies` in the resource hierarchy. The returned `Policy` will not have |
| 141 * an `etag`set because it is a computed `Policy` across multiple resources. |
138 * | 142 * |
139 * Callers of this method will require permission on the `parent` resource. | 143 * [request] - The metadata request object. |
140 * For example, a Lien with a `parent` of `projects/1234` requires permission | |
141 * `resourcemanager.projects.get`. | |
142 * | 144 * |
143 * Request parameters: | 145 * Request parameters: |
144 * | 146 * |
145 * [parent] - The name of the resource to list all attached Liens. | 147 * [resource] - The name of the resource to start computing the effective |
146 * For example, `projects/1234`. | 148 * `Policy`. |
| 149 * Value must have pattern "^folders/[^/]+$". |
147 * | 150 * |
148 * [pageToken] - The `next_page_token` value returned from a previous List | 151 * Completes with a [OrgPolicy]. |
149 * request, if any. | |
150 * | |
151 * [pageSize] - The maximum number of items to return. This is a suggestion | |
152 * for the server. | |
153 * | |
154 * Completes with a [ListLiensResponse]. | |
155 * | 152 * |
156 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 153 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
157 * error. | 154 * error. |
158 * | 155 * |
159 * If the used [http.Client] completes with an error when making a REST call, | 156 * If the used [http.Client] completes with an error when making a REST call, |
160 * this method will complete with the same error. | 157 * this method will complete with the same error. |
161 */ | 158 */ |
162 async.Future<ListLiensResponse> list({core.String parent, core.String pageToke
n, core.int pageSize}) { | 159 async.Future<OrgPolicy> getEffectiveOrgPolicy(GetEffectiveOrgPolicyRequest req
uest, core.String resource) { |
163 var _url = null; | 160 var _url = null; |
164 var _queryParams = new core.Map(); | 161 var _queryParams = new core.Map(); |
165 var _uploadMedia = null; | 162 var _uploadMedia = null; |
166 var _uploadOptions = null; | 163 var _uploadOptions = null; |
167 var _downloadOptions = commons.DownloadOptions.Metadata; | 164 var _downloadOptions = commons.DownloadOptions.Metadata; |
168 var _body = null; | 165 var _body = null; |
169 | 166 |
170 if (parent != null) { | 167 if (request != null) { |
171 _queryParams["parent"] = [parent]; | 168 _body = convert.JSON.encode((request).toJson()); |
172 } | 169 } |
173 if (pageToken != null) { | 170 if (resource == null) { |
174 _queryParams["pageToken"] = [pageToken]; | 171 throw new core.ArgumentError("Parameter resource is required."); |
175 } | |
176 if (pageSize != null) { | |
177 _queryParams["pageSize"] = ["${pageSize}"]; | |
178 } | 172 } |
179 | 173 |
180 _url = 'v1/liens'; | 174 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getEff
ectiveOrgPolicy'; |
181 | 175 |
182 var _response = _requester.request(_url, | 176 var _response = _requester.request(_url, |
183 "GET", | 177 "POST", |
184 body: _body, | 178 body: _body, |
185 queryParams: _queryParams, | 179 queryParams: _queryParams, |
186 uploadOptions: _uploadOptions, | 180 uploadOptions: _uploadOptions, |
187 uploadMedia: _uploadMedia, | 181 uploadMedia: _uploadMedia, |
188 downloadOptions: _downloadOptions); | 182 downloadOptions: _downloadOptions); |
189 return _response.then((data) => new ListLiensResponse.fromJson(data)); | 183 return _response.then((data) => new OrgPolicy.fromJson(data)); |
190 } | 184 } |
191 | 185 |
192 } | |
193 | |
194 | |
195 class OperationsResourceApi { | |
196 final commons.ApiRequester _requester; | |
197 | |
198 OperationsResourceApi(commons.ApiRequester client) : | |
199 _requester = client; | |
200 | |
201 /** | 186 /** |
202 * Gets the latest state of a long-running operation. Clients can use this | 187 * Gets the effective `Policy` on a resource. This is the result of merging |
203 * method to poll the operation result at intervals as recommended by the API | 188 * `Policies` in the resource hierarchy. The returned `Policy` will not have |
204 * service. | 189 * an `etag`set because it is a computed `Policy` across multiple resources. |
| 190 * |
| 191 * [request] - The metadata request object. |
205 * | 192 * |
206 * Request parameters: | 193 * Request parameters: |
207 * | 194 * |
208 * [name] - The name of the operation resource. | 195 * [resource] - The name of the resource to start computing the effective |
209 * Value must have pattern "^operations/.+$". | 196 * `Policy`. |
| 197 * Value must have pattern "^folders/[^/]+$". |
210 * | 198 * |
211 * Completes with a [Operation]. | 199 * Completes with a [OrgPolicy]. |
212 * | 200 * |
213 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 201 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
214 * error. | 202 * error. |
215 * | 203 * |
216 * If the used [http.Client] completes with an error when making a REST call, | 204 * If the used [http.Client] completes with an error when making a REST call, |
217 * this method will complete with the same error. | 205 * this method will complete with the same error. |
218 */ | 206 */ |
219 async.Future<Operation> get(core.String name) { | 207 async.Future<OrgPolicy> getEffectiveOrgPolicyV1(GetEffectiveOrgPolicyRequest r
equest, core.String resource) { |
220 var _url = null; | 208 var _url = null; |
221 var _queryParams = new core.Map(); | 209 var _queryParams = new core.Map(); |
222 var _uploadMedia = null; | 210 var _uploadMedia = null; |
223 var _uploadOptions = null; | 211 var _uploadOptions = null; |
224 var _downloadOptions = commons.DownloadOptions.Metadata; | 212 var _downloadOptions = commons.DownloadOptions.Metadata; |
225 var _body = null; | 213 var _body = null; |
226 | 214 |
227 if (name == null) { | 215 if (request != null) { |
228 throw new core.ArgumentError("Parameter name is required."); | 216 _body = convert.JSON.encode((request).toJson()); |
| 217 } |
| 218 if (resource == null) { |
| 219 throw new core.ArgumentError("Parameter resource is required."); |
229 } | 220 } |
230 | 221 |
231 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 222 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getEff
ectiveOrgPolicyV1'; |
232 | 223 |
233 var _response = _requester.request(_url, | 224 var _response = _requester.request(_url, |
234 "GET", | 225 "POST", |
235 body: _body, | 226 body: _body, |
236 queryParams: _queryParams, | 227 queryParams: _queryParams, |
237 uploadOptions: _uploadOptions, | 228 uploadOptions: _uploadOptions, |
238 uploadMedia: _uploadMedia, | 229 uploadMedia: _uploadMedia, |
239 downloadOptions: _downloadOptions); | 230 downloadOptions: _downloadOptions); |
240 return _response.then((data) => new Operation.fromJson(data)); | 231 return _response.then((data) => new OrgPolicy.fromJson(data)); |
241 } | 232 } |
242 | 233 |
243 } | |
244 | |
245 | |
246 class OrganizationsResourceApi { | |
247 final commons.ApiRequester _requester; | |
248 | |
249 OrganizationsResourceApi(commons.ApiRequester client) : | |
250 _requester = client; | |
251 | |
252 /** | 234 /** |
253 * Fetches an Organization resource identified by the specified resource name. | 235 * Gets a `Policy` on a resource. |
| 236 * |
| 237 * If no `Policy` is set on the resource, a `Policy` is returned with default |
| 238 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The |
| 239 * `etag` value can be used with `SetOrgPolicy()` to create or update a |
| 240 * `Policy` during read-modify-write. |
| 241 * |
| 242 * [request] - The metadata request object. |
254 * | 243 * |
255 * Request parameters: | 244 * Request parameters: |
256 * | 245 * |
257 * [name] - The resource name of the Organization to fetch, e.g. | 246 * [resource] - Name of the resource the `Policy` is set on. |
258 * "organizations/1234". | 247 * Value must have pattern "^folders/[^/]+$". |
259 * Value must have pattern "^organizations/[^/]+$". | |
260 * | 248 * |
261 * Completes with a [Organization]. | 249 * Completes with a [OrgPolicy]. |
262 * | 250 * |
263 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 251 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
264 * error. | 252 * error. |
265 * | 253 * |
266 * If the used [http.Client] completes with an error when making a REST call, | 254 * If the used [http.Client] completes with an error when making a REST call, |
267 * this method will complete with the same error. | 255 * this method will complete with the same error. |
268 */ | 256 */ |
269 async.Future<Organization> get(core.String name) { | 257 async.Future<OrgPolicy> getOrgPolicy(GetOrgPolicyRequest request, core.String
resource) { |
270 var _url = null; | 258 var _url = null; |
271 var _queryParams = new core.Map(); | 259 var _queryParams = new core.Map(); |
272 var _uploadMedia = null; | 260 var _uploadMedia = null; |
273 var _uploadOptions = null; | 261 var _uploadOptions = null; |
274 var _downloadOptions = commons.DownloadOptions.Metadata; | 262 var _downloadOptions = commons.DownloadOptions.Metadata; |
275 var _body = null; | 263 var _body = null; |
276 | 264 |
277 if (name == null) { | 265 if (request != null) { |
278 throw new core.ArgumentError("Parameter name is required."); | 266 _body = convert.JSON.encode((request).toJson()); |
| 267 } |
| 268 if (resource == null) { |
| 269 throw new core.ArgumentError("Parameter resource is required."); |
279 } | 270 } |
280 | 271 |
281 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 272 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getOrg
Policy'; |
282 | 273 |
283 var _response = _requester.request(_url, | 274 var _response = _requester.request(_url, |
284 "GET", | 275 "POST", |
285 body: _body, | 276 body: _body, |
286 queryParams: _queryParams, | 277 queryParams: _queryParams, |
287 uploadOptions: _uploadOptions, | 278 uploadOptions: _uploadOptions, |
288 uploadMedia: _uploadMedia, | 279 uploadMedia: _uploadMedia, |
289 downloadOptions: _downloadOptions); | 280 downloadOptions: _downloadOptions); |
290 return _response.then((data) => new Organization.fromJson(data)); | 281 return _response.then((data) => new OrgPolicy.fromJson(data)); |
291 } | 282 } |
292 | 283 |
293 /** | 284 /** |
294 * Gets the access control policy for an Organization resource. May be empty | 285 * Gets a `Policy` on a resource. |
295 * if no such policy or resource exists. The `resource` field should be the | 286 * |
296 * organization's resource name, e.g. "organizations/123". | 287 * If no `Policy` is set on the resource, a `Policy` is returned with default |
| 288 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The |
| 289 * `etag` value can be used with `SetOrgPolicy()` to create or update a |
| 290 * `Policy` during read-modify-write. |
297 * | 291 * |
298 * [request] - The metadata request object. | 292 * [request] - The metadata request object. |
299 * | 293 * |
300 * Request parameters: | 294 * Request parameters: |
301 * | 295 * |
302 * [resource] - REQUIRED: The resource for which the policy is being | 296 * [resource] - Name of the resource the `Policy` is set on. |
303 * requested. | 297 * Value must have pattern "^folders/[^/]+$". |
304 * See the operation documentation for the appropriate value for this field. | |
305 * Value must have pattern "^organizations/[^/]+$". | |
306 * | 298 * |
307 * Completes with a [Policy]. | 299 * Completes with a [OrgPolicy]. |
308 * | 300 * |
309 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 301 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
310 * error. | 302 * error. |
311 * | 303 * |
312 * If the used [http.Client] completes with an error when making a REST call, | 304 * If the used [http.Client] completes with an error when making a REST call, |
313 * this method will complete with the same error. | 305 * this method will complete with the same error. |
314 */ | 306 */ |
315 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { | 307 async.Future<OrgPolicy> getOrgPolicyV1(GetOrgPolicyRequest request, core.Strin
g resource) { |
316 var _url = null; | 308 var _url = null; |
317 var _queryParams = new core.Map(); | 309 var _queryParams = new core.Map(); |
318 var _uploadMedia = null; | 310 var _uploadMedia = null; |
319 var _uploadOptions = null; | 311 var _uploadOptions = null; |
320 var _downloadOptions = commons.DownloadOptions.Metadata; | 312 var _downloadOptions = commons.DownloadOptions.Metadata; |
321 var _body = null; | 313 var _body = null; |
322 | 314 |
323 if (request != null) { | 315 if (request != null) { |
324 _body = convert.JSON.encode((request).toJson()); | 316 _body = convert.JSON.encode((request).toJson()); |
325 } | 317 } |
326 if (resource == null) { | 318 if (resource == null) { |
327 throw new core.ArgumentError("Parameter resource is required."); | 319 throw new core.ArgumentError("Parameter resource is required."); |
328 } | 320 } |
329 | 321 |
330 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam
Policy'; | 322 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getOrg
PolicyV1'; |
331 | 323 |
332 var _response = _requester.request(_url, | 324 var _response = _requester.request(_url, |
333 "POST", | 325 "POST", |
334 body: _body, | 326 body: _body, |
335 queryParams: _queryParams, | 327 queryParams: _queryParams, |
336 uploadOptions: _uploadOptions, | 328 uploadOptions: _uploadOptions, |
337 uploadMedia: _uploadMedia, | 329 uploadMedia: _uploadMedia, |
338 downloadOptions: _downloadOptions); | 330 downloadOptions: _downloadOptions); |
339 return _response.then((data) => new Policy.fromJson(data)); | 331 return _response.then((data) => new OrgPolicy.fromJson(data)); |
340 } | 332 } |
341 | 333 |
342 /** | 334 /** |
343 * Searches Organization resources that are visible to the user and satisfy | 335 * Lists `Constraints` that could be applied on the specified resource. |
344 * the specified filter. This method returns Organizations in an unspecified | |
345 * order. New Organizations do not necessarily appear at the end of the | |
346 * results. | |
347 * | 336 * |
348 * [request] - The metadata request object. | 337 * [request] - The metadata request object. |
349 * | 338 * |
350 * Request parameters: | 339 * Request parameters: |
351 * | 340 * |
352 * Completes with a [SearchOrganizationsResponse]. | 341 * [resource] - Name of the resource to list `Constraints` for. |
| 342 * Value must have pattern "^folders/[^/]+$". |
| 343 * |
| 344 * Completes with a [ListAvailableOrgPolicyConstraintsResponse]. |
353 * | 345 * |
354 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 346 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
355 * error. | 347 * error. |
356 * | 348 * |
357 * If the used [http.Client] completes with an error when making a REST call, | 349 * If the used [http.Client] completes with an error when making a REST call, |
358 * this method will complete with the same error. | 350 * this method will complete with the same error. |
359 */ | 351 */ |
360 async.Future<SearchOrganizationsResponse> search(SearchOrganizationsRequest re
quest) { | 352 async.Future<ListAvailableOrgPolicyConstraintsResponse> listAvailableOrgPolicy
Constraints(ListAvailableOrgPolicyConstraintsRequest request, core.String resour
ce) { |
361 var _url = null; | 353 var _url = null; |
362 var _queryParams = new core.Map(); | 354 var _queryParams = new core.Map(); |
363 var _uploadMedia = null; | 355 var _uploadMedia = null; |
364 var _uploadOptions = null; | 356 var _uploadOptions = null; |
365 var _downloadOptions = commons.DownloadOptions.Metadata; | 357 var _downloadOptions = commons.DownloadOptions.Metadata; |
366 var _body = null; | 358 var _body = null; |
367 | 359 |
368 if (request != null) { | 360 if (request != null) { |
369 _body = convert.JSON.encode((request).toJson()); | 361 _body = convert.JSON.encode((request).toJson()); |
370 } | 362 } |
| 363 if (resource == null) { |
| 364 throw new core.ArgumentError("Parameter resource is required."); |
| 365 } |
371 | 366 |
372 _url = 'v1/organizations:search'; | 367 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':listAv
ailableOrgPolicyConstraints'; |
373 | 368 |
374 var _response = _requester.request(_url, | 369 var _response = _requester.request(_url, |
375 "POST", | 370 "POST", |
376 body: _body, | 371 body: _body, |
377 queryParams: _queryParams, | 372 queryParams: _queryParams, |
378 uploadOptions: _uploadOptions, | 373 uploadOptions: _uploadOptions, |
379 uploadMedia: _uploadMedia, | 374 uploadMedia: _uploadMedia, |
380 downloadOptions: _downloadOptions); | 375 downloadOptions: _downloadOptions); |
381 return _response.then((data) => new SearchOrganizationsResponse.fromJson(dat
a)); | 376 return _response.then((data) => new ListAvailableOrgPolicyConstraintsRespons
e.fromJson(data)); |
382 } | 377 } |
383 | 378 |
384 /** | 379 /** |
385 * Sets the access control policy on an Organization resource. Replaces any | 380 * Lists all the `Policies` set for a particular resource. |
386 * existing policy. The `resource` field should be the organization's resource | |
387 * name, e.g. "organizations/123". | |
388 * | 381 * |
389 * [request] - The metadata request object. | 382 * [request] - The metadata request object. |
390 * | 383 * |
391 * Request parameters: | 384 * Request parameters: |
392 * | 385 * |
393 * [resource] - REQUIRED: The resource for which the policy is being | 386 * [resource] - Name of the resource to list Policies for. |
394 * specified. | 387 * Value must have pattern "^folders/[^/]+$". |
395 * See the operation documentation for the appropriate value for this field. | |
396 * Value must have pattern "^organizations/[^/]+$". | |
397 * | 388 * |
398 * Completes with a [Policy]. | 389 * Completes with a [ListOrgPoliciesResponse]. |
399 * | 390 * |
400 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 391 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
401 * error. | 392 * error. |
402 * | 393 * |
403 * If the used [http.Client] completes with an error when making a REST call, | 394 * If the used [http.Client] completes with an error when making a REST call, |
404 * this method will complete with the same error. | 395 * this method will complete with the same error. |
405 */ | 396 */ |
406 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { | 397 async.Future<ListOrgPoliciesResponse> listOrgPolicies(ListOrgPoliciesRequest r
equest, core.String resource) { |
407 var _url = null; | 398 var _url = null; |
408 var _queryParams = new core.Map(); | 399 var _queryParams = new core.Map(); |
409 var _uploadMedia = null; | 400 var _uploadMedia = null; |
410 var _uploadOptions = null; | 401 var _uploadOptions = null; |
411 var _downloadOptions = commons.DownloadOptions.Metadata; | 402 var _downloadOptions = commons.DownloadOptions.Metadata; |
412 var _body = null; | 403 var _body = null; |
413 | 404 |
414 if (request != null) { | 405 if (request != null) { |
415 _body = convert.JSON.encode((request).toJson()); | 406 _body = convert.JSON.encode((request).toJson()); |
416 } | 407 } |
417 if (resource == null) { | 408 if (resource == null) { |
418 throw new core.ArgumentError("Parameter resource is required."); | 409 throw new core.ArgumentError("Parameter resource is required."); |
419 } | 410 } |
420 | 411 |
421 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam
Policy'; | 412 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':listOr
gPolicies'; |
422 | 413 |
423 var _response = _requester.request(_url, | 414 var _response = _requester.request(_url, |
424 "POST", | 415 "POST", |
425 body: _body, | 416 body: _body, |
426 queryParams: _queryParams, | 417 queryParams: _queryParams, |
427 uploadOptions: _uploadOptions, | 418 uploadOptions: _uploadOptions, |
428 uploadMedia: _uploadMedia, | 419 uploadMedia: _uploadMedia, |
429 downloadOptions: _downloadOptions); | 420 downloadOptions: _downloadOptions); |
430 return _response.then((data) => new Policy.fromJson(data)); | 421 return _response.then((data) => new ListOrgPoliciesResponse.fromJson(data)); |
431 } | 422 } |
432 | 423 |
433 /** | 424 /** |
434 * Returns permissions that a caller has on the specified Organization. | 425 * Updates the specified `Policy` on the resource. Creates a new `Policy` for |
435 * The `resource` field should be the organization's resource name, | 426 * that `Constraint` on the resource if one does not exist. |
436 * e.g. "organizations/123". | 427 * |
| 428 * Not supplying an `etag` on the request `Policy` results in an unconditional |
| 429 * write of the `Policy`. |
437 * | 430 * |
438 * [request] - The metadata request object. | 431 * [request] - The metadata request object. |
439 * | 432 * |
440 * Request parameters: | 433 * Request parameters: |
441 * | 434 * |
442 * [resource] - REQUIRED: The resource for which the policy detail is being | 435 * [resource] - Resource name of the resource to attach the `Policy`. |
443 * requested. | 436 * Value must have pattern "^folders/[^/]+$". |
444 * See the operation documentation for the appropriate value for this field. | |
445 * Value must have pattern "^organizations/[^/]+$". | |
446 * | 437 * |
447 * Completes with a [TestIamPermissionsResponse]. | 438 * Completes with a [OrgPolicy]. |
448 * | 439 * |
449 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 440 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
450 * error. | 441 * error. |
451 * | 442 * |
452 * If the used [http.Client] completes with an error when making a REST call, | 443 * If the used [http.Client] completes with an error when making a REST call, |
453 * this method will complete with the same error. | 444 * this method will complete with the same error. |
454 */ | 445 */ |
455 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions
Request request, core.String resource) { | 446 async.Future<OrgPolicy> setOrgPolicy(SetOrgPolicyRequest request, core.String
resource) { |
456 var _url = null; | 447 var _url = null; |
457 var _queryParams = new core.Map(); | 448 var _queryParams = new core.Map(); |
458 var _uploadMedia = null; | 449 var _uploadMedia = null; |
459 var _uploadOptions = null; | 450 var _uploadOptions = null; |
460 var _downloadOptions = commons.DownloadOptions.Metadata; | 451 var _downloadOptions = commons.DownloadOptions.Metadata; |
461 var _body = null; | 452 var _body = null; |
462 | 453 |
463 if (request != null) { | 454 if (request != null) { |
464 _body = convert.JSON.encode((request).toJson()); | 455 _body = convert.JSON.encode((request).toJson()); |
465 } | 456 } |
466 if (resource == null) { | 457 if (resource == null) { |
467 throw new core.ArgumentError("Parameter resource is required."); | 458 throw new core.ArgumentError("Parameter resource is required."); |
468 } | 459 } |
469 | 460 |
470 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa
mPermissions'; | 461 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setOrg
Policy'; |
471 | 462 |
472 var _response = _requester.request(_url, | 463 var _response = _requester.request(_url, |
473 "POST", | 464 "POST", |
474 body: _body, | 465 body: _body, |
475 queryParams: _queryParams, | 466 queryParams: _queryParams, |
476 uploadOptions: _uploadOptions, | 467 uploadOptions: _uploadOptions, |
477 uploadMedia: _uploadMedia, | 468 uploadMedia: _uploadMedia, |
478 downloadOptions: _downloadOptions); | 469 downloadOptions: _downloadOptions); |
479 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data
)); | 470 return _response.then((data) => new OrgPolicy.fromJson(data)); |
480 } | 471 } |
481 | 472 |
482 } | |
483 | |
484 | |
485 class ProjectsResourceApi { | |
486 final commons.ApiRequester _requester; | |
487 | |
488 ProjectsResourceApi(commons.ApiRequester client) : | |
489 _requester = client; | |
490 | |
491 /** | 473 /** |
492 * Request that a new Project be created. The result is an Operation which | 474 * Updates the specified `Policy` on the resource. Creates a new `Policy` for |
493 * can be used to track the creation process. It is automatically deleted | 475 * that `Constraint` on the resource if one does not exist. |
494 * after a few hours, so there is no need to call DeleteOperation. | |
495 * | 476 * |
496 * Our SLO permits Project creation to take up to 30 seconds at the 90th | 477 * Not supplying an `etag` on the request `Policy` results in an unconditional |
497 * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile | 478 * write of the `Policy`. |
498 * latency. 95th percentile latency is around 11 seconds. We recommend | |
499 * polling at the 5th second with an exponential backoff. | |
500 * | 479 * |
501 * [request] - The metadata request object. | 480 * [request] - The metadata request object. |
502 * | 481 * |
503 * Request parameters: | 482 * Request parameters: |
504 * | 483 * |
505 * Completes with a [Operation]. | 484 * [resource] - Resource name of the resource to attach the `Policy`. |
| 485 * Value must have pattern "^folders/[^/]+$". |
| 486 * |
| 487 * Completes with a [OrgPolicy]. |
506 * | 488 * |
507 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 489 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
508 * error. | 490 * error. |
509 * | 491 * |
510 * If the used [http.Client] completes with an error when making a REST call, | 492 * If the used [http.Client] completes with an error when making a REST call, |
511 * this method will complete with the same error. | 493 * this method will complete with the same error. |
512 */ | 494 */ |
513 async.Future<Operation> create(Project request) { | 495 async.Future<OrgPolicy> setOrgPolicyV1(SetOrgPolicyRequest request, core.Strin
g resource) { |
514 var _url = null; | 496 var _url = null; |
515 var _queryParams = new core.Map(); | 497 var _queryParams = new core.Map(); |
516 var _uploadMedia = null; | 498 var _uploadMedia = null; |
517 var _uploadOptions = null; | 499 var _uploadOptions = null; |
518 var _downloadOptions = commons.DownloadOptions.Metadata; | 500 var _downloadOptions = commons.DownloadOptions.Metadata; |
519 var _body = null; | 501 var _body = null; |
520 | 502 |
521 if (request != null) { | 503 if (request != null) { |
522 _body = convert.JSON.encode((request).toJson()); | 504 _body = convert.JSON.encode((request).toJson()); |
523 } | 505 } |
| 506 if (resource == null) { |
| 507 throw new core.ArgumentError("Parameter resource is required."); |
| 508 } |
524 | 509 |
525 _url = 'v1/projects'; | 510 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setOrg
PolicyV1'; |
526 | 511 |
527 var _response = _requester.request(_url, | 512 var _response = _requester.request(_url, |
528 "POST", | 513 "POST", |
529 body: _body, | 514 body: _body, |
530 queryParams: _queryParams, | 515 queryParams: _queryParams, |
531 uploadOptions: _uploadOptions, | 516 uploadOptions: _uploadOptions, |
532 uploadMedia: _uploadMedia, | 517 uploadMedia: _uploadMedia, |
533 downloadOptions: _downloadOptions); | 518 downloadOptions: _downloadOptions); |
534 return _response.then((data) => new Operation.fromJson(data)); | 519 return _response.then((data) => new OrgPolicy.fromJson(data)); |
535 } | 520 } |
536 | 521 |
| 522 } |
| 523 |
| 524 |
| 525 class LiensResourceApi { |
| 526 final commons.ApiRequester _requester; |
| 527 |
| 528 LiensResourceApi(commons.ApiRequester client) : |
| 529 _requester = client; |
| 530 |
537 /** | 531 /** |
538 * Marks the Project identified by the specified | 532 * Create a Lien which applies to the resource denoted by the `parent` field. |
539 * `project_id` (for example, `my-project-123`) for deletion. | |
540 * This method will only affect the Project if the following criteria are met: | |
541 * | 533 * |
542 * + The Project does not have a billing account associated with it. | 534 * Callers of this method will require permission on the `parent` resource. |
543 * + The Project has a lifecycle state of | 535 * For example, applying to `projects/1234` requires permission |
544 * ACTIVE. | 536 * `resourcemanager.projects.updateLiens`. |
545 * | 537 * |
546 * This method changes the Project's lifecycle state from | 538 * NOTE: Some resources may limit the number of Liens which may be applied. |
547 * ACTIVE | |
548 * to DELETE_REQUESTED. | |
549 * The deletion starts at an unspecified time, | |
550 * at which point the Project is no longer accessible. | |
551 * | 539 * |
552 * Until the deletion completes, you can check the lifecycle state | 540 * [request] - The metadata request object. |
553 * checked by retrieving the Project with GetProject, | |
554 * and the Project remains visible to ListProjects. | |
555 * However, you cannot update the project. | |
556 * | |
557 * After the deletion completes, the Project is not retrievable by | |
558 * the GetProject and | |
559 * ListProjects methods. | |
560 * | |
561 * The caller must have modify permissions for this Project. | |
562 * | 541 * |
563 * Request parameters: | 542 * Request parameters: |
564 * | 543 * |
565 * [projectId] - The Project ID (for example, `foo-bar-123`). | 544 * Completes with a [Lien]. |
566 * | |
567 * Required. | |
568 * | |
569 * Completes with a [Empty]. | |
570 * | 545 * |
571 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 546 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
572 * error. | 547 * error. |
573 * | 548 * |
574 * If the used [http.Client] completes with an error when making a REST call, | 549 * If the used [http.Client] completes with an error when making a REST call, |
575 * this method will complete with the same error. | 550 * this method will complete with the same error. |
576 */ | 551 */ |
577 async.Future<Empty> delete(core.String projectId) { | 552 async.Future<Lien> create(Lien request) { |
578 var _url = null; | 553 var _url = null; |
579 var _queryParams = new core.Map(); | 554 var _queryParams = new core.Map(); |
580 var _uploadMedia = null; | 555 var _uploadMedia = null; |
581 var _uploadOptions = null; | 556 var _uploadOptions = null; |
582 var _downloadOptions = commons.DownloadOptions.Metadata; | 557 var _downloadOptions = commons.DownloadOptions.Metadata; |
583 var _body = null; | 558 var _body = null; |
584 | 559 |
| 560 if (request != null) { |
| 561 _body = convert.JSON.encode((request).toJson()); |
| 562 } |
| 563 |
| 564 _url = 'v1/liens'; |
| 565 |
| 566 var _response = _requester.request(_url, |
| 567 "POST", |
| 568 body: _body, |
| 569 queryParams: _queryParams, |
| 570 uploadOptions: _uploadOptions, |
| 571 uploadMedia: _uploadMedia, |
| 572 downloadOptions: _downloadOptions); |
| 573 return _response.then((data) => new Lien.fromJson(data)); |
| 574 } |
| 575 |
| 576 /** |
| 577 * Delete a Lien by `name`. |
| 578 * |
| 579 * Callers of this method will require permission on the `parent` resource. |
| 580 * For example, a Lien with a `parent` of `projects/1234` requires permission |
| 581 * `resourcemanager.projects.updateLiens`. |
| 582 * |
| 583 * Request parameters: |
| 584 * |
| 585 * [name] - The name/identifier of the Lien to delete. |
| 586 * Value must have pattern "^liens/.+$". |
| 587 * |
| 588 * Completes with a [Empty]. |
| 589 * |
| 590 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 591 * error. |
| 592 * |
| 593 * If the used [http.Client] completes with an error when making a REST call, |
| 594 * this method will complete with the same error. |
| 595 */ |
| 596 async.Future<Empty> delete(core.String name) { |
| 597 var _url = null; |
| 598 var _queryParams = new core.Map(); |
| 599 var _uploadMedia = null; |
| 600 var _uploadOptions = null; |
| 601 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 602 var _body = null; |
| 603 |
| 604 if (name == null) { |
| 605 throw new core.ArgumentError("Parameter name is required."); |
| 606 } |
| 607 |
| 608 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 609 |
| 610 var _response = _requester.request(_url, |
| 611 "DELETE", |
| 612 body: _body, |
| 613 queryParams: _queryParams, |
| 614 uploadOptions: _uploadOptions, |
| 615 uploadMedia: _uploadMedia, |
| 616 downloadOptions: _downloadOptions); |
| 617 return _response.then((data) => new Empty.fromJson(data)); |
| 618 } |
| 619 |
| 620 /** |
| 621 * List all Liens applied to the `parent` resource. |
| 622 * |
| 623 * Callers of this method will require permission on the `parent` resource. |
| 624 * For example, a Lien with a `parent` of `projects/1234` requires permission |
| 625 * `resourcemanager.projects.get`. |
| 626 * |
| 627 * Request parameters: |
| 628 * |
| 629 * [parent] - The name of the resource to list all attached Liens. |
| 630 * For example, `projects/1234`. |
| 631 * |
| 632 * [pageToken] - The `next_page_token` value returned from a previous List |
| 633 * request, if any. |
| 634 * |
| 635 * [pageSize] - The maximum number of items to return. This is a suggestion |
| 636 * for the server. |
| 637 * |
| 638 * Completes with a [ListLiensResponse]. |
| 639 * |
| 640 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 641 * error. |
| 642 * |
| 643 * If the used [http.Client] completes with an error when making a REST call, |
| 644 * this method will complete with the same error. |
| 645 */ |
| 646 async.Future<ListLiensResponse> list({core.String parent, core.String pageToke
n, core.int pageSize}) { |
| 647 var _url = null; |
| 648 var _queryParams = new core.Map(); |
| 649 var _uploadMedia = null; |
| 650 var _uploadOptions = null; |
| 651 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 652 var _body = null; |
| 653 |
| 654 if (parent != null) { |
| 655 _queryParams["parent"] = [parent]; |
| 656 } |
| 657 if (pageToken != null) { |
| 658 _queryParams["pageToken"] = [pageToken]; |
| 659 } |
| 660 if (pageSize != null) { |
| 661 _queryParams["pageSize"] = ["${pageSize}"]; |
| 662 } |
| 663 |
| 664 _url = 'v1/liens'; |
| 665 |
| 666 var _response = _requester.request(_url, |
| 667 "GET", |
| 668 body: _body, |
| 669 queryParams: _queryParams, |
| 670 uploadOptions: _uploadOptions, |
| 671 uploadMedia: _uploadMedia, |
| 672 downloadOptions: _downloadOptions); |
| 673 return _response.then((data) => new ListLiensResponse.fromJson(data)); |
| 674 } |
| 675 |
| 676 } |
| 677 |
| 678 |
| 679 class OperationsResourceApi { |
| 680 final commons.ApiRequester _requester; |
| 681 |
| 682 OperationsResourceApi(commons.ApiRequester client) : |
| 683 _requester = client; |
| 684 |
| 685 /** |
| 686 * Gets the latest state of a long-running operation. Clients can use this |
| 687 * method to poll the operation result at intervals as recommended by the API |
| 688 * service. |
| 689 * |
| 690 * Request parameters: |
| 691 * |
| 692 * [name] - The name of the operation resource. |
| 693 * Value must have pattern "^operations/.+$". |
| 694 * |
| 695 * Completes with a [Operation]. |
| 696 * |
| 697 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 698 * error. |
| 699 * |
| 700 * If the used [http.Client] completes with an error when making a REST call, |
| 701 * this method will complete with the same error. |
| 702 */ |
| 703 async.Future<Operation> get(core.String name) { |
| 704 var _url = null; |
| 705 var _queryParams = new core.Map(); |
| 706 var _uploadMedia = null; |
| 707 var _uploadOptions = null; |
| 708 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 709 var _body = null; |
| 710 |
| 711 if (name == null) { |
| 712 throw new core.ArgumentError("Parameter name is required."); |
| 713 } |
| 714 |
| 715 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 716 |
| 717 var _response = _requester.request(_url, |
| 718 "GET", |
| 719 body: _body, |
| 720 queryParams: _queryParams, |
| 721 uploadOptions: _uploadOptions, |
| 722 uploadMedia: _uploadMedia, |
| 723 downloadOptions: _downloadOptions); |
| 724 return _response.then((data) => new Operation.fromJson(data)); |
| 725 } |
| 726 |
| 727 } |
| 728 |
| 729 |
| 730 class OrganizationsResourceApi { |
| 731 final commons.ApiRequester _requester; |
| 732 |
| 733 OrganizationsResourceApi(commons.ApiRequester client) : |
| 734 _requester = client; |
| 735 |
| 736 /** |
| 737 * Clears a `Policy` from a resource. |
| 738 * |
| 739 * [request] - The metadata request object. |
| 740 * |
| 741 * Request parameters: |
| 742 * |
| 743 * [resource] - Name of the resource for the `Policy` to clear. |
| 744 * Value must have pattern "^organizations/[^/]+$". |
| 745 * |
| 746 * Completes with a [Empty]. |
| 747 * |
| 748 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 749 * error. |
| 750 * |
| 751 * If the used [http.Client] completes with an error when making a REST call, |
| 752 * this method will complete with the same error. |
| 753 */ |
| 754 async.Future<Empty> clearOrgPolicy(ClearOrgPolicyRequest request, core.String
resource) { |
| 755 var _url = null; |
| 756 var _queryParams = new core.Map(); |
| 757 var _uploadMedia = null; |
| 758 var _uploadOptions = null; |
| 759 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 760 var _body = null; |
| 761 |
| 762 if (request != null) { |
| 763 _body = convert.JSON.encode((request).toJson()); |
| 764 } |
| 765 if (resource == null) { |
| 766 throw new core.ArgumentError("Parameter resource is required."); |
| 767 } |
| 768 |
| 769 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':clearO
rgPolicy'; |
| 770 |
| 771 var _response = _requester.request(_url, |
| 772 "POST", |
| 773 body: _body, |
| 774 queryParams: _queryParams, |
| 775 uploadOptions: _uploadOptions, |
| 776 uploadMedia: _uploadMedia, |
| 777 downloadOptions: _downloadOptions); |
| 778 return _response.then((data) => new Empty.fromJson(data)); |
| 779 } |
| 780 |
| 781 /** |
| 782 * Clears a `Policy` from a resource. |
| 783 * |
| 784 * [request] - The metadata request object. |
| 785 * |
| 786 * Request parameters: |
| 787 * |
| 788 * [resource] - Name of the resource for the `Policy` to clear. |
| 789 * Value must have pattern "^organizations/[^/]+$". |
| 790 * |
| 791 * Completes with a [Empty]. |
| 792 * |
| 793 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 794 * error. |
| 795 * |
| 796 * If the used [http.Client] completes with an error when making a REST call, |
| 797 * this method will complete with the same error. |
| 798 */ |
| 799 async.Future<Empty> clearOrgPolicyV1(ClearOrgPolicyRequest request, core.Strin
g resource) { |
| 800 var _url = null; |
| 801 var _queryParams = new core.Map(); |
| 802 var _uploadMedia = null; |
| 803 var _uploadOptions = null; |
| 804 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 805 var _body = null; |
| 806 |
| 807 if (request != null) { |
| 808 _body = convert.JSON.encode((request).toJson()); |
| 809 } |
| 810 if (resource == null) { |
| 811 throw new core.ArgumentError("Parameter resource is required."); |
| 812 } |
| 813 |
| 814 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':clearO
rgPolicyV1'; |
| 815 |
| 816 var _response = _requester.request(_url, |
| 817 "POST", |
| 818 body: _body, |
| 819 queryParams: _queryParams, |
| 820 uploadOptions: _uploadOptions, |
| 821 uploadMedia: _uploadMedia, |
| 822 downloadOptions: _downloadOptions); |
| 823 return _response.then((data) => new Empty.fromJson(data)); |
| 824 } |
| 825 |
| 826 /** |
| 827 * Fetches an Organization resource identified by the specified resource name. |
| 828 * |
| 829 * Request parameters: |
| 830 * |
| 831 * [name] - The resource name of the Organization to fetch, e.g. |
| 832 * "organizations/1234". |
| 833 * Value must have pattern "^organizations/[^/]+$". |
| 834 * |
| 835 * Completes with a [Organization]. |
| 836 * |
| 837 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 838 * error. |
| 839 * |
| 840 * If the used [http.Client] completes with an error when making a REST call, |
| 841 * this method will complete with the same error. |
| 842 */ |
| 843 async.Future<Organization> get(core.String name) { |
| 844 var _url = null; |
| 845 var _queryParams = new core.Map(); |
| 846 var _uploadMedia = null; |
| 847 var _uploadOptions = null; |
| 848 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 849 var _body = null; |
| 850 |
| 851 if (name == null) { |
| 852 throw new core.ArgumentError("Parameter name is required."); |
| 853 } |
| 854 |
| 855 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 856 |
| 857 var _response = _requester.request(_url, |
| 858 "GET", |
| 859 body: _body, |
| 860 queryParams: _queryParams, |
| 861 uploadOptions: _uploadOptions, |
| 862 uploadMedia: _uploadMedia, |
| 863 downloadOptions: _downloadOptions); |
| 864 return _response.then((data) => new Organization.fromJson(data)); |
| 865 } |
| 866 |
| 867 /** |
| 868 * Gets the effective `Policy` on a resource. This is the result of merging |
| 869 * `Policies` in the resource hierarchy. The returned `Policy` will not have |
| 870 * an `etag`set because it is a computed `Policy` across multiple resources. |
| 871 * |
| 872 * [request] - The metadata request object. |
| 873 * |
| 874 * Request parameters: |
| 875 * |
| 876 * [resource] - The name of the resource to start computing the effective |
| 877 * `Policy`. |
| 878 * Value must have pattern "^organizations/[^/]+$". |
| 879 * |
| 880 * Completes with a [OrgPolicy]. |
| 881 * |
| 882 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 883 * error. |
| 884 * |
| 885 * If the used [http.Client] completes with an error when making a REST call, |
| 886 * this method will complete with the same error. |
| 887 */ |
| 888 async.Future<OrgPolicy> getEffectiveOrgPolicy(GetEffectiveOrgPolicyRequest req
uest, core.String resource) { |
| 889 var _url = null; |
| 890 var _queryParams = new core.Map(); |
| 891 var _uploadMedia = null; |
| 892 var _uploadOptions = null; |
| 893 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 894 var _body = null; |
| 895 |
| 896 if (request != null) { |
| 897 _body = convert.JSON.encode((request).toJson()); |
| 898 } |
| 899 if (resource == null) { |
| 900 throw new core.ArgumentError("Parameter resource is required."); |
| 901 } |
| 902 |
| 903 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getEff
ectiveOrgPolicy'; |
| 904 |
| 905 var _response = _requester.request(_url, |
| 906 "POST", |
| 907 body: _body, |
| 908 queryParams: _queryParams, |
| 909 uploadOptions: _uploadOptions, |
| 910 uploadMedia: _uploadMedia, |
| 911 downloadOptions: _downloadOptions); |
| 912 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 913 } |
| 914 |
| 915 /** |
| 916 * Gets the effective `Policy` on a resource. This is the result of merging |
| 917 * `Policies` in the resource hierarchy. The returned `Policy` will not have |
| 918 * an `etag`set because it is a computed `Policy` across multiple resources. |
| 919 * |
| 920 * [request] - The metadata request object. |
| 921 * |
| 922 * Request parameters: |
| 923 * |
| 924 * [resource] - The name of the resource to start computing the effective |
| 925 * `Policy`. |
| 926 * Value must have pattern "^organizations/[^/]+$". |
| 927 * |
| 928 * Completes with a [OrgPolicy]. |
| 929 * |
| 930 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 931 * error. |
| 932 * |
| 933 * If the used [http.Client] completes with an error when making a REST call, |
| 934 * this method will complete with the same error. |
| 935 */ |
| 936 async.Future<OrgPolicy> getEffectiveOrgPolicyV1(GetEffectiveOrgPolicyRequest r
equest, core.String resource) { |
| 937 var _url = null; |
| 938 var _queryParams = new core.Map(); |
| 939 var _uploadMedia = null; |
| 940 var _uploadOptions = null; |
| 941 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 942 var _body = null; |
| 943 |
| 944 if (request != null) { |
| 945 _body = convert.JSON.encode((request).toJson()); |
| 946 } |
| 947 if (resource == null) { |
| 948 throw new core.ArgumentError("Parameter resource is required."); |
| 949 } |
| 950 |
| 951 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getEff
ectiveOrgPolicyV1'; |
| 952 |
| 953 var _response = _requester.request(_url, |
| 954 "POST", |
| 955 body: _body, |
| 956 queryParams: _queryParams, |
| 957 uploadOptions: _uploadOptions, |
| 958 uploadMedia: _uploadMedia, |
| 959 downloadOptions: _downloadOptions); |
| 960 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 961 } |
| 962 |
| 963 /** |
| 964 * Gets the access control policy for an Organization resource. May be empty |
| 965 * if no such policy or resource exists. The `resource` field should be the |
| 966 * organization's resource name, e.g. "organizations/123". |
| 967 * |
| 968 * [request] - The metadata request object. |
| 969 * |
| 970 * Request parameters: |
| 971 * |
| 972 * [resource] - REQUIRED: The resource for which the policy is being |
| 973 * requested. |
| 974 * See the operation documentation for the appropriate value for this field. |
| 975 * Value must have pattern "^organizations/[^/]+$". |
| 976 * |
| 977 * Completes with a [Policy]. |
| 978 * |
| 979 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 980 * error. |
| 981 * |
| 982 * If the used [http.Client] completes with an error when making a REST call, |
| 983 * this method will complete with the same error. |
| 984 */ |
| 985 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { |
| 986 var _url = null; |
| 987 var _queryParams = new core.Map(); |
| 988 var _uploadMedia = null; |
| 989 var _uploadOptions = null; |
| 990 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 991 var _body = null; |
| 992 |
| 993 if (request != null) { |
| 994 _body = convert.JSON.encode((request).toJson()); |
| 995 } |
| 996 if (resource == null) { |
| 997 throw new core.ArgumentError("Parameter resource is required."); |
| 998 } |
| 999 |
| 1000 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam
Policy'; |
| 1001 |
| 1002 var _response = _requester.request(_url, |
| 1003 "POST", |
| 1004 body: _body, |
| 1005 queryParams: _queryParams, |
| 1006 uploadOptions: _uploadOptions, |
| 1007 uploadMedia: _uploadMedia, |
| 1008 downloadOptions: _downloadOptions); |
| 1009 return _response.then((data) => new Policy.fromJson(data)); |
| 1010 } |
| 1011 |
| 1012 /** |
| 1013 * Gets a `Policy` on a resource. |
| 1014 * |
| 1015 * If no `Policy` is set on the resource, a `Policy` is returned with default |
| 1016 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The |
| 1017 * `etag` value can be used with `SetOrgPolicy()` to create or update a |
| 1018 * `Policy` during read-modify-write. |
| 1019 * |
| 1020 * [request] - The metadata request object. |
| 1021 * |
| 1022 * Request parameters: |
| 1023 * |
| 1024 * [resource] - Name of the resource the `Policy` is set on. |
| 1025 * Value must have pattern "^organizations/[^/]+$". |
| 1026 * |
| 1027 * Completes with a [OrgPolicy]. |
| 1028 * |
| 1029 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1030 * error. |
| 1031 * |
| 1032 * If the used [http.Client] completes with an error when making a REST call, |
| 1033 * this method will complete with the same error. |
| 1034 */ |
| 1035 async.Future<OrgPolicy> getOrgPolicy(GetOrgPolicyRequest request, core.String
resource) { |
| 1036 var _url = null; |
| 1037 var _queryParams = new core.Map(); |
| 1038 var _uploadMedia = null; |
| 1039 var _uploadOptions = null; |
| 1040 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1041 var _body = null; |
| 1042 |
| 1043 if (request != null) { |
| 1044 _body = convert.JSON.encode((request).toJson()); |
| 1045 } |
| 1046 if (resource == null) { |
| 1047 throw new core.ArgumentError("Parameter resource is required."); |
| 1048 } |
| 1049 |
| 1050 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getOrg
Policy'; |
| 1051 |
| 1052 var _response = _requester.request(_url, |
| 1053 "POST", |
| 1054 body: _body, |
| 1055 queryParams: _queryParams, |
| 1056 uploadOptions: _uploadOptions, |
| 1057 uploadMedia: _uploadMedia, |
| 1058 downloadOptions: _downloadOptions); |
| 1059 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 1060 } |
| 1061 |
| 1062 /** |
| 1063 * Gets a `Policy` on a resource. |
| 1064 * |
| 1065 * If no `Policy` is set on the resource, a `Policy` is returned with default |
| 1066 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The |
| 1067 * `etag` value can be used with `SetOrgPolicy()` to create or update a |
| 1068 * `Policy` during read-modify-write. |
| 1069 * |
| 1070 * [request] - The metadata request object. |
| 1071 * |
| 1072 * Request parameters: |
| 1073 * |
| 1074 * [resource] - Name of the resource the `Policy` is set on. |
| 1075 * Value must have pattern "^organizations/[^/]+$". |
| 1076 * |
| 1077 * Completes with a [OrgPolicy]. |
| 1078 * |
| 1079 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1080 * error. |
| 1081 * |
| 1082 * If the used [http.Client] completes with an error when making a REST call, |
| 1083 * this method will complete with the same error. |
| 1084 */ |
| 1085 async.Future<OrgPolicy> getOrgPolicyV1(GetOrgPolicyRequest request, core.Strin
g resource) { |
| 1086 var _url = null; |
| 1087 var _queryParams = new core.Map(); |
| 1088 var _uploadMedia = null; |
| 1089 var _uploadOptions = null; |
| 1090 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1091 var _body = null; |
| 1092 |
| 1093 if (request != null) { |
| 1094 _body = convert.JSON.encode((request).toJson()); |
| 1095 } |
| 1096 if (resource == null) { |
| 1097 throw new core.ArgumentError("Parameter resource is required."); |
| 1098 } |
| 1099 |
| 1100 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getOrg
PolicyV1'; |
| 1101 |
| 1102 var _response = _requester.request(_url, |
| 1103 "POST", |
| 1104 body: _body, |
| 1105 queryParams: _queryParams, |
| 1106 uploadOptions: _uploadOptions, |
| 1107 uploadMedia: _uploadMedia, |
| 1108 downloadOptions: _downloadOptions); |
| 1109 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 1110 } |
| 1111 |
| 1112 /** |
| 1113 * Lists `Constraints` that could be applied on the specified resource. |
| 1114 * |
| 1115 * [request] - The metadata request object. |
| 1116 * |
| 1117 * Request parameters: |
| 1118 * |
| 1119 * [resource] - Name of the resource to list `Constraints` for. |
| 1120 * Value must have pattern "^organizations/[^/]+$". |
| 1121 * |
| 1122 * Completes with a [ListAvailableOrgPolicyConstraintsResponse]. |
| 1123 * |
| 1124 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1125 * error. |
| 1126 * |
| 1127 * If the used [http.Client] completes with an error when making a REST call, |
| 1128 * this method will complete with the same error. |
| 1129 */ |
| 1130 async.Future<ListAvailableOrgPolicyConstraintsResponse> listAvailableOrgPolicy
Constraints(ListAvailableOrgPolicyConstraintsRequest request, core.String resour
ce) { |
| 1131 var _url = null; |
| 1132 var _queryParams = new core.Map(); |
| 1133 var _uploadMedia = null; |
| 1134 var _uploadOptions = null; |
| 1135 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1136 var _body = null; |
| 1137 |
| 1138 if (request != null) { |
| 1139 _body = convert.JSON.encode((request).toJson()); |
| 1140 } |
| 1141 if (resource == null) { |
| 1142 throw new core.ArgumentError("Parameter resource is required."); |
| 1143 } |
| 1144 |
| 1145 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':listAv
ailableOrgPolicyConstraints'; |
| 1146 |
| 1147 var _response = _requester.request(_url, |
| 1148 "POST", |
| 1149 body: _body, |
| 1150 queryParams: _queryParams, |
| 1151 uploadOptions: _uploadOptions, |
| 1152 uploadMedia: _uploadMedia, |
| 1153 downloadOptions: _downloadOptions); |
| 1154 return _response.then((data) => new ListAvailableOrgPolicyConstraintsRespons
e.fromJson(data)); |
| 1155 } |
| 1156 |
| 1157 /** |
| 1158 * Lists all the `Policies` set for a particular resource. |
| 1159 * |
| 1160 * [request] - The metadata request object. |
| 1161 * |
| 1162 * Request parameters: |
| 1163 * |
| 1164 * [resource] - Name of the resource to list Policies for. |
| 1165 * Value must have pattern "^organizations/[^/]+$". |
| 1166 * |
| 1167 * Completes with a [ListOrgPoliciesResponse]. |
| 1168 * |
| 1169 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1170 * error. |
| 1171 * |
| 1172 * If the used [http.Client] completes with an error when making a REST call, |
| 1173 * this method will complete with the same error. |
| 1174 */ |
| 1175 async.Future<ListOrgPoliciesResponse> listOrgPolicies(ListOrgPoliciesRequest r
equest, core.String resource) { |
| 1176 var _url = null; |
| 1177 var _queryParams = new core.Map(); |
| 1178 var _uploadMedia = null; |
| 1179 var _uploadOptions = null; |
| 1180 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1181 var _body = null; |
| 1182 |
| 1183 if (request != null) { |
| 1184 _body = convert.JSON.encode((request).toJson()); |
| 1185 } |
| 1186 if (resource == null) { |
| 1187 throw new core.ArgumentError("Parameter resource is required."); |
| 1188 } |
| 1189 |
| 1190 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':listOr
gPolicies'; |
| 1191 |
| 1192 var _response = _requester.request(_url, |
| 1193 "POST", |
| 1194 body: _body, |
| 1195 queryParams: _queryParams, |
| 1196 uploadOptions: _uploadOptions, |
| 1197 uploadMedia: _uploadMedia, |
| 1198 downloadOptions: _downloadOptions); |
| 1199 return _response.then((data) => new ListOrgPoliciesResponse.fromJson(data)); |
| 1200 } |
| 1201 |
| 1202 /** |
| 1203 * Searches Organization resources that are visible to the user and satisfy |
| 1204 * the specified filter. This method returns Organizations in an unspecified |
| 1205 * order. New Organizations do not necessarily appear at the end of the |
| 1206 * results. |
| 1207 * |
| 1208 * [request] - The metadata request object. |
| 1209 * |
| 1210 * Request parameters: |
| 1211 * |
| 1212 * Completes with a [SearchOrganizationsResponse]. |
| 1213 * |
| 1214 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1215 * error. |
| 1216 * |
| 1217 * If the used [http.Client] completes with an error when making a REST call, |
| 1218 * this method will complete with the same error. |
| 1219 */ |
| 1220 async.Future<SearchOrganizationsResponse> search(SearchOrganizationsRequest re
quest) { |
| 1221 var _url = null; |
| 1222 var _queryParams = new core.Map(); |
| 1223 var _uploadMedia = null; |
| 1224 var _uploadOptions = null; |
| 1225 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1226 var _body = null; |
| 1227 |
| 1228 if (request != null) { |
| 1229 _body = convert.JSON.encode((request).toJson()); |
| 1230 } |
| 1231 |
| 1232 _url = 'v1/organizations:search'; |
| 1233 |
| 1234 var _response = _requester.request(_url, |
| 1235 "POST", |
| 1236 body: _body, |
| 1237 queryParams: _queryParams, |
| 1238 uploadOptions: _uploadOptions, |
| 1239 uploadMedia: _uploadMedia, |
| 1240 downloadOptions: _downloadOptions); |
| 1241 return _response.then((data) => new SearchOrganizationsResponse.fromJson(dat
a)); |
| 1242 } |
| 1243 |
| 1244 /** |
| 1245 * Sets the access control policy on an Organization resource. Replaces any |
| 1246 * existing policy. The `resource` field should be the organization's resource |
| 1247 * name, e.g. "organizations/123". |
| 1248 * |
| 1249 * [request] - The metadata request object. |
| 1250 * |
| 1251 * Request parameters: |
| 1252 * |
| 1253 * [resource] - REQUIRED: The resource for which the policy is being |
| 1254 * specified. |
| 1255 * See the operation documentation for the appropriate value for this field. |
| 1256 * Value must have pattern "^organizations/[^/]+$". |
| 1257 * |
| 1258 * Completes with a [Policy]. |
| 1259 * |
| 1260 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1261 * error. |
| 1262 * |
| 1263 * If the used [http.Client] completes with an error when making a REST call, |
| 1264 * this method will complete with the same error. |
| 1265 */ |
| 1266 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { |
| 1267 var _url = null; |
| 1268 var _queryParams = new core.Map(); |
| 1269 var _uploadMedia = null; |
| 1270 var _uploadOptions = null; |
| 1271 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1272 var _body = null; |
| 1273 |
| 1274 if (request != null) { |
| 1275 _body = convert.JSON.encode((request).toJson()); |
| 1276 } |
| 1277 if (resource == null) { |
| 1278 throw new core.ArgumentError("Parameter resource is required."); |
| 1279 } |
| 1280 |
| 1281 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam
Policy'; |
| 1282 |
| 1283 var _response = _requester.request(_url, |
| 1284 "POST", |
| 1285 body: _body, |
| 1286 queryParams: _queryParams, |
| 1287 uploadOptions: _uploadOptions, |
| 1288 uploadMedia: _uploadMedia, |
| 1289 downloadOptions: _downloadOptions); |
| 1290 return _response.then((data) => new Policy.fromJson(data)); |
| 1291 } |
| 1292 |
| 1293 /** |
| 1294 * Updates the specified `Policy` on the resource. Creates a new `Policy` for |
| 1295 * that `Constraint` on the resource if one does not exist. |
| 1296 * |
| 1297 * Not supplying an `etag` on the request `Policy` results in an unconditional |
| 1298 * write of the `Policy`. |
| 1299 * |
| 1300 * [request] - The metadata request object. |
| 1301 * |
| 1302 * Request parameters: |
| 1303 * |
| 1304 * [resource] - Resource name of the resource to attach the `Policy`. |
| 1305 * Value must have pattern "^organizations/[^/]+$". |
| 1306 * |
| 1307 * Completes with a [OrgPolicy]. |
| 1308 * |
| 1309 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1310 * error. |
| 1311 * |
| 1312 * If the used [http.Client] completes with an error when making a REST call, |
| 1313 * this method will complete with the same error. |
| 1314 */ |
| 1315 async.Future<OrgPolicy> setOrgPolicy(SetOrgPolicyRequest request, core.String
resource) { |
| 1316 var _url = null; |
| 1317 var _queryParams = new core.Map(); |
| 1318 var _uploadMedia = null; |
| 1319 var _uploadOptions = null; |
| 1320 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1321 var _body = null; |
| 1322 |
| 1323 if (request != null) { |
| 1324 _body = convert.JSON.encode((request).toJson()); |
| 1325 } |
| 1326 if (resource == null) { |
| 1327 throw new core.ArgumentError("Parameter resource is required."); |
| 1328 } |
| 1329 |
| 1330 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setOrg
Policy'; |
| 1331 |
| 1332 var _response = _requester.request(_url, |
| 1333 "POST", |
| 1334 body: _body, |
| 1335 queryParams: _queryParams, |
| 1336 uploadOptions: _uploadOptions, |
| 1337 uploadMedia: _uploadMedia, |
| 1338 downloadOptions: _downloadOptions); |
| 1339 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 1340 } |
| 1341 |
| 1342 /** |
| 1343 * Updates the specified `Policy` on the resource. Creates a new `Policy` for |
| 1344 * that `Constraint` on the resource if one does not exist. |
| 1345 * |
| 1346 * Not supplying an `etag` on the request `Policy` results in an unconditional |
| 1347 * write of the `Policy`. |
| 1348 * |
| 1349 * [request] - The metadata request object. |
| 1350 * |
| 1351 * Request parameters: |
| 1352 * |
| 1353 * [resource] - Resource name of the resource to attach the `Policy`. |
| 1354 * Value must have pattern "^organizations/[^/]+$". |
| 1355 * |
| 1356 * Completes with a [OrgPolicy]. |
| 1357 * |
| 1358 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1359 * error. |
| 1360 * |
| 1361 * If the used [http.Client] completes with an error when making a REST call, |
| 1362 * this method will complete with the same error. |
| 1363 */ |
| 1364 async.Future<OrgPolicy> setOrgPolicyV1(SetOrgPolicyRequest request, core.Strin
g resource) { |
| 1365 var _url = null; |
| 1366 var _queryParams = new core.Map(); |
| 1367 var _uploadMedia = null; |
| 1368 var _uploadOptions = null; |
| 1369 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1370 var _body = null; |
| 1371 |
| 1372 if (request != null) { |
| 1373 _body = convert.JSON.encode((request).toJson()); |
| 1374 } |
| 1375 if (resource == null) { |
| 1376 throw new core.ArgumentError("Parameter resource is required."); |
| 1377 } |
| 1378 |
| 1379 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setOrg
PolicyV1'; |
| 1380 |
| 1381 var _response = _requester.request(_url, |
| 1382 "POST", |
| 1383 body: _body, |
| 1384 queryParams: _queryParams, |
| 1385 uploadOptions: _uploadOptions, |
| 1386 uploadMedia: _uploadMedia, |
| 1387 downloadOptions: _downloadOptions); |
| 1388 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 1389 } |
| 1390 |
| 1391 /** |
| 1392 * Returns permissions that a caller has on the specified Organization. |
| 1393 * The `resource` field should be the organization's resource name, |
| 1394 * e.g. "organizations/123". |
| 1395 * |
| 1396 * [request] - The metadata request object. |
| 1397 * |
| 1398 * Request parameters: |
| 1399 * |
| 1400 * [resource] - REQUIRED: The resource for which the policy detail is being |
| 1401 * requested. |
| 1402 * See the operation documentation for the appropriate value for this field. |
| 1403 * Value must have pattern "^organizations/[^/]+$". |
| 1404 * |
| 1405 * Completes with a [TestIamPermissionsResponse]. |
| 1406 * |
| 1407 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1408 * error. |
| 1409 * |
| 1410 * If the used [http.Client] completes with an error when making a REST call, |
| 1411 * this method will complete with the same error. |
| 1412 */ |
| 1413 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions
Request request, core.String resource) { |
| 1414 var _url = null; |
| 1415 var _queryParams = new core.Map(); |
| 1416 var _uploadMedia = null; |
| 1417 var _uploadOptions = null; |
| 1418 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1419 var _body = null; |
| 1420 |
| 1421 if (request != null) { |
| 1422 _body = convert.JSON.encode((request).toJson()); |
| 1423 } |
| 1424 if (resource == null) { |
| 1425 throw new core.ArgumentError("Parameter resource is required."); |
| 1426 } |
| 1427 |
| 1428 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa
mPermissions'; |
| 1429 |
| 1430 var _response = _requester.request(_url, |
| 1431 "POST", |
| 1432 body: _body, |
| 1433 queryParams: _queryParams, |
| 1434 uploadOptions: _uploadOptions, |
| 1435 uploadMedia: _uploadMedia, |
| 1436 downloadOptions: _downloadOptions); |
| 1437 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data
)); |
| 1438 } |
| 1439 |
| 1440 } |
| 1441 |
| 1442 |
| 1443 class ProjectsResourceApi { |
| 1444 final commons.ApiRequester _requester; |
| 1445 |
| 1446 ProjectsResourceApi(commons.ApiRequester client) : |
| 1447 _requester = client; |
| 1448 |
| 1449 /** |
| 1450 * Clears a `Policy` from a resource. |
| 1451 * |
| 1452 * [request] - The metadata request object. |
| 1453 * |
| 1454 * Request parameters: |
| 1455 * |
| 1456 * [resource] - Name of the resource for the `Policy` to clear. |
| 1457 * Value must have pattern "^projects/[^/]+$". |
| 1458 * |
| 1459 * Completes with a [Empty]. |
| 1460 * |
| 1461 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1462 * error. |
| 1463 * |
| 1464 * If the used [http.Client] completes with an error when making a REST call, |
| 1465 * this method will complete with the same error. |
| 1466 */ |
| 1467 async.Future<Empty> clearOrgPolicy(ClearOrgPolicyRequest request, core.String
resource) { |
| 1468 var _url = null; |
| 1469 var _queryParams = new core.Map(); |
| 1470 var _uploadMedia = null; |
| 1471 var _uploadOptions = null; |
| 1472 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1473 var _body = null; |
| 1474 |
| 1475 if (request != null) { |
| 1476 _body = convert.JSON.encode((request).toJson()); |
| 1477 } |
| 1478 if (resource == null) { |
| 1479 throw new core.ArgumentError("Parameter resource is required."); |
| 1480 } |
| 1481 |
| 1482 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':clearO
rgPolicy'; |
| 1483 |
| 1484 var _response = _requester.request(_url, |
| 1485 "POST", |
| 1486 body: _body, |
| 1487 queryParams: _queryParams, |
| 1488 uploadOptions: _uploadOptions, |
| 1489 uploadMedia: _uploadMedia, |
| 1490 downloadOptions: _downloadOptions); |
| 1491 return _response.then((data) => new Empty.fromJson(data)); |
| 1492 } |
| 1493 |
| 1494 /** |
| 1495 * Clears a `Policy` from a resource. |
| 1496 * |
| 1497 * [request] - The metadata request object. |
| 1498 * |
| 1499 * Request parameters: |
| 1500 * |
| 1501 * [resource] - Name of the resource for the `Policy` to clear. |
| 1502 * Value must have pattern "^projects/[^/]+$". |
| 1503 * |
| 1504 * Completes with a [Empty]. |
| 1505 * |
| 1506 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1507 * error. |
| 1508 * |
| 1509 * If the used [http.Client] completes with an error when making a REST call, |
| 1510 * this method will complete with the same error. |
| 1511 */ |
| 1512 async.Future<Empty> clearOrgPolicyV1(ClearOrgPolicyRequest request, core.Strin
g resource) { |
| 1513 var _url = null; |
| 1514 var _queryParams = new core.Map(); |
| 1515 var _uploadMedia = null; |
| 1516 var _uploadOptions = null; |
| 1517 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1518 var _body = null; |
| 1519 |
| 1520 if (request != null) { |
| 1521 _body = convert.JSON.encode((request).toJson()); |
| 1522 } |
| 1523 if (resource == null) { |
| 1524 throw new core.ArgumentError("Parameter resource is required."); |
| 1525 } |
| 1526 |
| 1527 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':clearO
rgPolicyV1'; |
| 1528 |
| 1529 var _response = _requester.request(_url, |
| 1530 "POST", |
| 1531 body: _body, |
| 1532 queryParams: _queryParams, |
| 1533 uploadOptions: _uploadOptions, |
| 1534 uploadMedia: _uploadMedia, |
| 1535 downloadOptions: _downloadOptions); |
| 1536 return _response.then((data) => new Empty.fromJson(data)); |
| 1537 } |
| 1538 |
| 1539 /** |
| 1540 * Request that a new Project be created. The result is an Operation which |
| 1541 * can be used to track the creation process. It is automatically deleted |
| 1542 * after a few hours, so there is no need to call DeleteOperation. |
| 1543 * |
| 1544 * Our SLO permits Project creation to take up to 30 seconds at the 90th |
| 1545 * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile |
| 1546 * latency. 95th percentile latency is around 11 seconds. We recommend |
| 1547 * polling at the 5th second with an exponential backoff. |
| 1548 * |
| 1549 * [request] - The metadata request object. |
| 1550 * |
| 1551 * Request parameters: |
| 1552 * |
| 1553 * Completes with a [Operation]. |
| 1554 * |
| 1555 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1556 * error. |
| 1557 * |
| 1558 * If the used [http.Client] completes with an error when making a REST call, |
| 1559 * this method will complete with the same error. |
| 1560 */ |
| 1561 async.Future<Operation> create(Project request) { |
| 1562 var _url = null; |
| 1563 var _queryParams = new core.Map(); |
| 1564 var _uploadMedia = null; |
| 1565 var _uploadOptions = null; |
| 1566 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1567 var _body = null; |
| 1568 |
| 1569 if (request != null) { |
| 1570 _body = convert.JSON.encode((request).toJson()); |
| 1571 } |
| 1572 |
| 1573 _url = 'v1/projects'; |
| 1574 |
| 1575 var _response = _requester.request(_url, |
| 1576 "POST", |
| 1577 body: _body, |
| 1578 queryParams: _queryParams, |
| 1579 uploadOptions: _uploadOptions, |
| 1580 uploadMedia: _uploadMedia, |
| 1581 downloadOptions: _downloadOptions); |
| 1582 return _response.then((data) => new Operation.fromJson(data)); |
| 1583 } |
| 1584 |
| 1585 /** |
| 1586 * Marks the Project identified by the specified |
| 1587 * `project_id` (for example, `my-project-123`) for deletion. |
| 1588 * This method will only affect the Project if the following criteria are met: |
| 1589 * |
| 1590 * + The Project does not have a billing account associated with it. |
| 1591 * + The Project has a lifecycle state of |
| 1592 * ACTIVE. |
| 1593 * |
| 1594 * This method changes the Project's lifecycle state from |
| 1595 * ACTIVE |
| 1596 * to DELETE_REQUESTED. |
| 1597 * The deletion starts at an unspecified time, |
| 1598 * at which point the Project is no longer accessible. |
| 1599 * |
| 1600 * Until the deletion completes, you can check the lifecycle state |
| 1601 * checked by retrieving the Project with GetProject, |
| 1602 * and the Project remains visible to ListProjects. |
| 1603 * However, you cannot update the project. |
| 1604 * |
| 1605 * After the deletion completes, the Project is not retrievable by |
| 1606 * the GetProject and |
| 1607 * ListProjects methods. |
| 1608 * |
| 1609 * The caller must have modify permissions for this Project. |
| 1610 * |
| 1611 * Request parameters: |
| 1612 * |
| 1613 * [projectId] - The Project ID (for example, `foo-bar-123`). |
| 1614 * |
| 1615 * Required. |
| 1616 * |
| 1617 * Completes with a [Empty]. |
| 1618 * |
| 1619 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1620 * error. |
| 1621 * |
| 1622 * If the used [http.Client] completes with an error when making a REST call, |
| 1623 * this method will complete with the same error. |
| 1624 */ |
| 1625 async.Future<Empty> delete(core.String projectId) { |
| 1626 var _url = null; |
| 1627 var _queryParams = new core.Map(); |
| 1628 var _uploadMedia = null; |
| 1629 var _uploadOptions = null; |
| 1630 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1631 var _body = null; |
| 1632 |
585 if (projectId == null) { | 1633 if (projectId == null) { |
586 throw new core.ArgumentError("Parameter projectId is required."); | 1634 throw new core.ArgumentError("Parameter projectId is required."); |
587 } | 1635 } |
588 | 1636 |
589 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId'); | 1637 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId'); |
590 | 1638 |
591 var _response = _requester.request(_url, | 1639 var _response = _requester.request(_url, |
592 "DELETE", | 1640 "DELETE", |
593 body: _body, | 1641 body: _body, |
594 queryParams: _queryParams, | 1642 queryParams: _queryParams, |
(...skipping 12 matching lines...) Expand all Loading... |
607 * Request parameters: | 1655 * Request parameters: |
608 * | 1656 * |
609 * [projectId] - The Project ID (for example, `my-project-123`). | 1657 * [projectId] - The Project ID (for example, `my-project-123`). |
610 * | 1658 * |
611 * Required. | 1659 * Required. |
612 * | 1660 * |
613 * Completes with a [Project]. | 1661 * Completes with a [Project]. |
614 * | 1662 * |
615 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1663 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
616 * error. | 1664 * error. |
| 1665 * |
| 1666 * If the used [http.Client] completes with an error when making a REST call, |
| 1667 * this method will complete with the same error. |
| 1668 */ |
| 1669 async.Future<Project> get(core.String projectId) { |
| 1670 var _url = null; |
| 1671 var _queryParams = new core.Map(); |
| 1672 var _uploadMedia = null; |
| 1673 var _uploadOptions = null; |
| 1674 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1675 var _body = null; |
| 1676 |
| 1677 if (projectId == null) { |
| 1678 throw new core.ArgumentError("Parameter projectId is required."); |
| 1679 } |
| 1680 |
| 1681 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId'); |
| 1682 |
| 1683 var _response = _requester.request(_url, |
| 1684 "GET", |
| 1685 body: _body, |
| 1686 queryParams: _queryParams, |
| 1687 uploadOptions: _uploadOptions, |
| 1688 uploadMedia: _uploadMedia, |
| 1689 downloadOptions: _downloadOptions); |
| 1690 return _response.then((data) => new Project.fromJson(data)); |
| 1691 } |
| 1692 |
| 1693 /** |
| 1694 * Gets a list of ancestors in the resource hierarchy for the Project |
| 1695 * identified by the specified `project_id` (for example, `my-project-123`). |
| 1696 * |
| 1697 * The caller must have read permissions for this Project. |
| 1698 * |
| 1699 * [request] - The metadata request object. |
| 1700 * |
| 1701 * Request parameters: |
| 1702 * |
| 1703 * [projectId] - The Project ID (for example, `my-project-123`). |
| 1704 * |
| 1705 * Required. |
| 1706 * |
| 1707 * Completes with a [GetAncestryResponse]. |
| 1708 * |
| 1709 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1710 * error. |
| 1711 * |
| 1712 * If the used [http.Client] completes with an error when making a REST call, |
| 1713 * this method will complete with the same error. |
| 1714 */ |
| 1715 async.Future<GetAncestryResponse> getAncestry(GetAncestryRequest request, core
.String projectId) { |
| 1716 var _url = null; |
| 1717 var _queryParams = new core.Map(); |
| 1718 var _uploadMedia = null; |
| 1719 var _uploadOptions = null; |
| 1720 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1721 var _body = null; |
| 1722 |
| 1723 if (request != null) { |
| 1724 _body = convert.JSON.encode((request).toJson()); |
| 1725 } |
| 1726 if (projectId == null) { |
| 1727 throw new core.ArgumentError("Parameter projectId is required."); |
| 1728 } |
| 1729 |
| 1730 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + ':getA
ncestry'; |
| 1731 |
| 1732 var _response = _requester.request(_url, |
| 1733 "POST", |
| 1734 body: _body, |
| 1735 queryParams: _queryParams, |
| 1736 uploadOptions: _uploadOptions, |
| 1737 uploadMedia: _uploadMedia, |
| 1738 downloadOptions: _downloadOptions); |
| 1739 return _response.then((data) => new GetAncestryResponse.fromJson(data)); |
| 1740 } |
| 1741 |
| 1742 /** |
| 1743 * Gets the effective `Policy` on a resource. This is the result of merging |
| 1744 * `Policies` in the resource hierarchy. The returned `Policy` will not have |
| 1745 * an `etag`set because it is a computed `Policy` across multiple resources. |
| 1746 * |
| 1747 * [request] - The metadata request object. |
| 1748 * |
| 1749 * Request parameters: |
| 1750 * |
| 1751 * [resource] - The name of the resource to start computing the effective |
| 1752 * `Policy`. |
| 1753 * Value must have pattern "^projects/[^/]+$". |
| 1754 * |
| 1755 * Completes with a [OrgPolicy]. |
| 1756 * |
| 1757 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1758 * error. |
| 1759 * |
| 1760 * If the used [http.Client] completes with an error when making a REST call, |
| 1761 * this method will complete with the same error. |
| 1762 */ |
| 1763 async.Future<OrgPolicy> getEffectiveOrgPolicy(GetEffectiveOrgPolicyRequest req
uest, core.String resource) { |
| 1764 var _url = null; |
| 1765 var _queryParams = new core.Map(); |
| 1766 var _uploadMedia = null; |
| 1767 var _uploadOptions = null; |
| 1768 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1769 var _body = null; |
| 1770 |
| 1771 if (request != null) { |
| 1772 _body = convert.JSON.encode((request).toJson()); |
| 1773 } |
| 1774 if (resource == null) { |
| 1775 throw new core.ArgumentError("Parameter resource is required."); |
| 1776 } |
| 1777 |
| 1778 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getEff
ectiveOrgPolicy'; |
| 1779 |
| 1780 var _response = _requester.request(_url, |
| 1781 "POST", |
| 1782 body: _body, |
| 1783 queryParams: _queryParams, |
| 1784 uploadOptions: _uploadOptions, |
| 1785 uploadMedia: _uploadMedia, |
| 1786 downloadOptions: _downloadOptions); |
| 1787 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 1788 } |
| 1789 |
| 1790 /** |
| 1791 * Gets the effective `Policy` on a resource. This is the result of merging |
| 1792 * `Policies` in the resource hierarchy. The returned `Policy` will not have |
| 1793 * an `etag`set because it is a computed `Policy` across multiple resources. |
| 1794 * |
| 1795 * [request] - The metadata request object. |
| 1796 * |
| 1797 * Request parameters: |
| 1798 * |
| 1799 * [resource] - The name of the resource to start computing the effective |
| 1800 * `Policy`. |
| 1801 * Value must have pattern "^projects/[^/]+$". |
| 1802 * |
| 1803 * Completes with a [OrgPolicy]. |
| 1804 * |
| 1805 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1806 * error. |
| 1807 * |
| 1808 * If the used [http.Client] completes with an error when making a REST call, |
| 1809 * this method will complete with the same error. |
| 1810 */ |
| 1811 async.Future<OrgPolicy> getEffectiveOrgPolicyV1(GetEffectiveOrgPolicyRequest r
equest, core.String resource) { |
| 1812 var _url = null; |
| 1813 var _queryParams = new core.Map(); |
| 1814 var _uploadMedia = null; |
| 1815 var _uploadOptions = null; |
| 1816 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1817 var _body = null; |
| 1818 |
| 1819 if (request != null) { |
| 1820 _body = convert.JSON.encode((request).toJson()); |
| 1821 } |
| 1822 if (resource == null) { |
| 1823 throw new core.ArgumentError("Parameter resource is required."); |
| 1824 } |
| 1825 |
| 1826 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getEff
ectiveOrgPolicyV1'; |
| 1827 |
| 1828 var _response = _requester.request(_url, |
| 1829 "POST", |
| 1830 body: _body, |
| 1831 queryParams: _queryParams, |
| 1832 uploadOptions: _uploadOptions, |
| 1833 uploadMedia: _uploadMedia, |
| 1834 downloadOptions: _downloadOptions); |
| 1835 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 1836 } |
| 1837 |
| 1838 /** |
| 1839 * Returns the IAM access control policy for the specified Project. |
| 1840 * Permission is denied if the policy or the resource does not exist. |
| 1841 * |
| 1842 * [request] - The metadata request object. |
| 1843 * |
| 1844 * Request parameters: |
| 1845 * |
| 1846 * [resource] - REQUIRED: The resource for which the policy is being |
| 1847 * requested. |
| 1848 * See the operation documentation for the appropriate value for this field. |
| 1849 * |
| 1850 * Completes with a [Policy]. |
| 1851 * |
| 1852 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 1853 * error. |
617 * | 1854 * |
618 * If the used [http.Client] completes with an error when making a REST call, | 1855 * If the used [http.Client] completes with an error when making a REST call, |
619 * this method will complete with the same error. | 1856 * this method will complete with the same error. |
620 */ | 1857 */ |
621 async.Future<Project> get(core.String projectId) { | 1858 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { |
622 var _url = null; | 1859 var _url = null; |
623 var _queryParams = new core.Map(); | 1860 var _queryParams = new core.Map(); |
624 var _uploadMedia = null; | 1861 var _uploadMedia = null; |
625 var _uploadOptions = null; | 1862 var _uploadOptions = null; |
626 var _downloadOptions = commons.DownloadOptions.Metadata; | 1863 var _downloadOptions = commons.DownloadOptions.Metadata; |
627 var _body = null; | 1864 var _body = null; |
628 | 1865 |
629 if (projectId == null) { | 1866 if (request != null) { |
630 throw new core.ArgumentError("Parameter projectId is required."); | 1867 _body = convert.JSON.encode((request).toJson()); |
| 1868 } |
| 1869 if (resource == null) { |
| 1870 throw new core.ArgumentError("Parameter resource is required."); |
631 } | 1871 } |
632 | 1872 |
633 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId'); | 1873 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$resource') + ':getIa
mPolicy'; |
634 | 1874 |
635 var _response = _requester.request(_url, | 1875 var _response = _requester.request(_url, |
636 "GET", | 1876 "POST", |
637 body: _body, | 1877 body: _body, |
638 queryParams: _queryParams, | 1878 queryParams: _queryParams, |
639 uploadOptions: _uploadOptions, | 1879 uploadOptions: _uploadOptions, |
640 uploadMedia: _uploadMedia, | 1880 uploadMedia: _uploadMedia, |
641 downloadOptions: _downloadOptions); | 1881 downloadOptions: _downloadOptions); |
642 return _response.then((data) => new Project.fromJson(data)); | 1882 return _response.then((data) => new Policy.fromJson(data)); |
643 } | 1883 } |
644 | 1884 |
645 /** | 1885 /** |
646 * Gets a list of ancestors in the resource hierarchy for the Project | 1886 * Gets a `Policy` on a resource. |
647 * identified by the specified `project_id` (for example, `my-project-123`). | |
648 * | 1887 * |
649 * The caller must have read permissions for this Project. | 1888 * If no `Policy` is set on the resource, a `Policy` is returned with default |
| 1889 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The |
| 1890 * `etag` value can be used with `SetOrgPolicy()` to create or update a |
| 1891 * `Policy` during read-modify-write. |
650 * | 1892 * |
651 * [request] - The metadata request object. | 1893 * [request] - The metadata request object. |
652 * | 1894 * |
653 * Request parameters: | 1895 * Request parameters: |
654 * | 1896 * |
655 * [projectId] - The Project ID (for example, `my-project-123`). | 1897 * [resource] - Name of the resource the `Policy` is set on. |
| 1898 * Value must have pattern "^projects/[^/]+$". |
656 * | 1899 * |
657 * Required. | 1900 * Completes with a [OrgPolicy]. |
658 * | |
659 * Completes with a [GetAncestryResponse]. | |
660 * | 1901 * |
661 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1902 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
662 * error. | 1903 * error. |
663 * | 1904 * |
664 * If the used [http.Client] completes with an error when making a REST call, | 1905 * If the used [http.Client] completes with an error when making a REST call, |
665 * this method will complete with the same error. | 1906 * this method will complete with the same error. |
666 */ | 1907 */ |
667 async.Future<GetAncestryResponse> getAncestry(GetAncestryRequest request, core
.String projectId) { | 1908 async.Future<OrgPolicy> getOrgPolicy(GetOrgPolicyRequest request, core.String
resource) { |
668 var _url = null; | 1909 var _url = null; |
669 var _queryParams = new core.Map(); | 1910 var _queryParams = new core.Map(); |
670 var _uploadMedia = null; | 1911 var _uploadMedia = null; |
671 var _uploadOptions = null; | 1912 var _uploadOptions = null; |
672 var _downloadOptions = commons.DownloadOptions.Metadata; | 1913 var _downloadOptions = commons.DownloadOptions.Metadata; |
673 var _body = null; | 1914 var _body = null; |
674 | 1915 |
675 if (request != null) { | 1916 if (request != null) { |
676 _body = convert.JSON.encode((request).toJson()); | 1917 _body = convert.JSON.encode((request).toJson()); |
677 } | 1918 } |
678 if (projectId == null) { | 1919 if (resource == null) { |
679 throw new core.ArgumentError("Parameter projectId is required."); | 1920 throw new core.ArgumentError("Parameter resource is required."); |
680 } | 1921 } |
681 | 1922 |
682 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + ':getA
ncestry'; | 1923 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getOrg
Policy'; |
683 | 1924 |
684 var _response = _requester.request(_url, | 1925 var _response = _requester.request(_url, |
685 "POST", | 1926 "POST", |
686 body: _body, | 1927 body: _body, |
687 queryParams: _queryParams, | 1928 queryParams: _queryParams, |
688 uploadOptions: _uploadOptions, | 1929 uploadOptions: _uploadOptions, |
689 uploadMedia: _uploadMedia, | 1930 uploadMedia: _uploadMedia, |
690 downloadOptions: _downloadOptions); | 1931 downloadOptions: _downloadOptions); |
691 return _response.then((data) => new GetAncestryResponse.fromJson(data)); | 1932 return _response.then((data) => new OrgPolicy.fromJson(data)); |
692 } | 1933 } |
693 | 1934 |
694 /** | 1935 /** |
695 * Returns the IAM access control policy for the specified Project. | 1936 * Gets a `Policy` on a resource. |
696 * Permission is denied if the policy or the resource does not exist. | 1937 * |
| 1938 * If no `Policy` is set on the resource, a `Policy` is returned with default |
| 1939 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The |
| 1940 * `etag` value can be used with `SetOrgPolicy()` to create or update a |
| 1941 * `Policy` during read-modify-write. |
697 * | 1942 * |
698 * [request] - The metadata request object. | 1943 * [request] - The metadata request object. |
699 * | 1944 * |
700 * Request parameters: | 1945 * Request parameters: |
701 * | 1946 * |
702 * [resource] - REQUIRED: The resource for which the policy is being | 1947 * [resource] - Name of the resource the `Policy` is set on. |
703 * requested. | 1948 * Value must have pattern "^projects/[^/]+$". |
704 * See the operation documentation for the appropriate value for this field. | |
705 * | 1949 * |
706 * Completes with a [Policy]. | 1950 * Completes with a [OrgPolicy]. |
707 * | 1951 * |
708 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1952 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
709 * error. | 1953 * error. |
710 * | 1954 * |
711 * If the used [http.Client] completes with an error when making a REST call, | 1955 * If the used [http.Client] completes with an error when making a REST call, |
712 * this method will complete with the same error. | 1956 * this method will complete with the same error. |
713 */ | 1957 */ |
714 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { | 1958 async.Future<OrgPolicy> getOrgPolicyV1(GetOrgPolicyRequest request, core.Strin
g resource) { |
715 var _url = null; | 1959 var _url = null; |
716 var _queryParams = new core.Map(); | 1960 var _queryParams = new core.Map(); |
717 var _uploadMedia = null; | 1961 var _uploadMedia = null; |
718 var _uploadOptions = null; | 1962 var _uploadOptions = null; |
719 var _downloadOptions = commons.DownloadOptions.Metadata; | 1963 var _downloadOptions = commons.DownloadOptions.Metadata; |
720 var _body = null; | 1964 var _body = null; |
721 | 1965 |
722 if (request != null) { | 1966 if (request != null) { |
723 _body = convert.JSON.encode((request).toJson()); | 1967 _body = convert.JSON.encode((request).toJson()); |
724 } | 1968 } |
725 if (resource == null) { | 1969 if (resource == null) { |
726 throw new core.ArgumentError("Parameter resource is required."); | 1970 throw new core.ArgumentError("Parameter resource is required."); |
727 } | 1971 } |
728 | 1972 |
729 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$resource') + ':getIa
mPolicy'; | 1973 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getOrg
PolicyV1'; |
730 | 1974 |
731 var _response = _requester.request(_url, | 1975 var _response = _requester.request(_url, |
732 "POST", | 1976 "POST", |
733 body: _body, | 1977 body: _body, |
734 queryParams: _queryParams, | 1978 queryParams: _queryParams, |
735 uploadOptions: _uploadOptions, | 1979 uploadOptions: _uploadOptions, |
736 uploadMedia: _uploadMedia, | 1980 uploadMedia: _uploadMedia, |
737 downloadOptions: _downloadOptions); | 1981 downloadOptions: _downloadOptions); |
738 return _response.then((data) => new Policy.fromJson(data)); | 1982 return _response.then((data) => new OrgPolicy.fromJson(data)); |
739 } | 1983 } |
740 | 1984 |
741 /** | 1985 /** |
742 * Lists Projects that are visible to the user and satisfy the | 1986 * Lists Projects that are visible to the user and satisfy the |
743 * specified filter. This method returns Projects in an unspecified order. | 1987 * specified filter. This method returns Projects in an unspecified order. |
744 * New Projects do not necessarily appear at the end of the list. | 1988 * New Projects do not necessarily appear at the end of the list. |
745 * | 1989 * |
746 * Request parameters: | 1990 * Request parameters: |
747 * | 1991 * |
748 * [filter] - An expression for filtering the results of the request. Filter | 1992 * [filter] - An expression for filtering the results of the request. Filter |
749 * rules are | 1993 * rules are |
750 * case insensitive. The fields eligible for filtering are: | 1994 * case insensitive. The fields eligible for filtering are: |
751 * | 1995 * |
752 * + `name` | 1996 * + `name` |
753 * + `id` | 1997 * + `id` |
754 * + <code>labels.<em>key</em></code> where *key* is the name of a label | 1998 * + <code>labels.<em>key</em></code> where *key* is the name of a label |
755 * | 1999 * |
756 * Some examples of using labels as filters: | 2000 * Some examples of using labels as filters: |
757 * | 2001 * |
758 * |Filter|Description| | 2002 * |Filter|Description| |
759 * |------|-----------| | 2003 * |------|-----------| |
760 * |name:*|The project has a name.| | 2004 * |name:*|The project has a name.| |
761 * |name:Howl|The project's name is `Howl` or `howl`.| | 2005 * |name:Howl|The project's name is `Howl` or `howl`.| |
762 * |name:HOWL|Equivalent to above.| | 2006 * |name:HOWL|Equivalent to above.| |
763 * |NAME:howl|Equivalent to above.| | 2007 * |NAME:howl|Equivalent to above.| |
764 * |labels.color:*|The project has the label `color`.| | 2008 * |labels.color:*|The project has the label `color`.| |
765 * |labels.color:red|The project's label `color` has the value `red`.| | 2009 * |labels.color:red|The project's label `color` has the value `red`.| |
766 * |labels.color:red label.size:big|The project's label `color` has the | 2010 * |labels.color:red labels.size:big|The project's label `color` has the |
767 * value `red` and its label `size` has the value `big`. | 2011 * value `red` and its label `size` has the value `big`. |
768 * | 2012 * |
769 * Optional. | 2013 * Optional. |
770 * | 2014 * |
771 * [pageToken] - A pagination token returned from a previous call to | 2015 * [pageToken] - A pagination token returned from a previous call to |
772 * ListProjects | 2016 * ListProjects |
773 * that indicates from where listing should continue. | 2017 * that indicates from where listing should continue. |
774 * | 2018 * |
775 * Optional. | 2019 * Optional. |
776 * | 2020 * |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 "GET", | 2056 "GET", |
813 body: _body, | 2057 body: _body, |
814 queryParams: _queryParams, | 2058 queryParams: _queryParams, |
815 uploadOptions: _uploadOptions, | 2059 uploadOptions: _uploadOptions, |
816 uploadMedia: _uploadMedia, | 2060 uploadMedia: _uploadMedia, |
817 downloadOptions: _downloadOptions); | 2061 downloadOptions: _downloadOptions); |
818 return _response.then((data) => new ListProjectsResponse.fromJson(data)); | 2062 return _response.then((data) => new ListProjectsResponse.fromJson(data)); |
819 } | 2063 } |
820 | 2064 |
821 /** | 2065 /** |
| 2066 * Lists `Constraints` that could be applied on the specified resource. |
| 2067 * |
| 2068 * [request] - The metadata request object. |
| 2069 * |
| 2070 * Request parameters: |
| 2071 * |
| 2072 * [resource] - Name of the resource to list `Constraints` for. |
| 2073 * Value must have pattern "^projects/[^/]+$". |
| 2074 * |
| 2075 * Completes with a [ListAvailableOrgPolicyConstraintsResponse]. |
| 2076 * |
| 2077 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 2078 * error. |
| 2079 * |
| 2080 * If the used [http.Client] completes with an error when making a REST call, |
| 2081 * this method will complete with the same error. |
| 2082 */ |
| 2083 async.Future<ListAvailableOrgPolicyConstraintsResponse> listAvailableOrgPolicy
Constraints(ListAvailableOrgPolicyConstraintsRequest request, core.String resour
ce) { |
| 2084 var _url = null; |
| 2085 var _queryParams = new core.Map(); |
| 2086 var _uploadMedia = null; |
| 2087 var _uploadOptions = null; |
| 2088 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2089 var _body = null; |
| 2090 |
| 2091 if (request != null) { |
| 2092 _body = convert.JSON.encode((request).toJson()); |
| 2093 } |
| 2094 if (resource == null) { |
| 2095 throw new core.ArgumentError("Parameter resource is required."); |
| 2096 } |
| 2097 |
| 2098 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':listAv
ailableOrgPolicyConstraints'; |
| 2099 |
| 2100 var _response = _requester.request(_url, |
| 2101 "POST", |
| 2102 body: _body, |
| 2103 queryParams: _queryParams, |
| 2104 uploadOptions: _uploadOptions, |
| 2105 uploadMedia: _uploadMedia, |
| 2106 downloadOptions: _downloadOptions); |
| 2107 return _response.then((data) => new ListAvailableOrgPolicyConstraintsRespons
e.fromJson(data)); |
| 2108 } |
| 2109 |
| 2110 /** |
| 2111 * Lists all the `Policies` set for a particular resource. |
| 2112 * |
| 2113 * [request] - The metadata request object. |
| 2114 * |
| 2115 * Request parameters: |
| 2116 * |
| 2117 * [resource] - Name of the resource to list Policies for. |
| 2118 * Value must have pattern "^projects/[^/]+$". |
| 2119 * |
| 2120 * Completes with a [ListOrgPoliciesResponse]. |
| 2121 * |
| 2122 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 2123 * error. |
| 2124 * |
| 2125 * If the used [http.Client] completes with an error when making a REST call, |
| 2126 * this method will complete with the same error. |
| 2127 */ |
| 2128 async.Future<ListOrgPoliciesResponse> listOrgPolicies(ListOrgPoliciesRequest r
equest, core.String resource) { |
| 2129 var _url = null; |
| 2130 var _queryParams = new core.Map(); |
| 2131 var _uploadMedia = null; |
| 2132 var _uploadOptions = null; |
| 2133 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2134 var _body = null; |
| 2135 |
| 2136 if (request != null) { |
| 2137 _body = convert.JSON.encode((request).toJson()); |
| 2138 } |
| 2139 if (resource == null) { |
| 2140 throw new core.ArgumentError("Parameter resource is required."); |
| 2141 } |
| 2142 |
| 2143 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':listOr
gPolicies'; |
| 2144 |
| 2145 var _response = _requester.request(_url, |
| 2146 "POST", |
| 2147 body: _body, |
| 2148 queryParams: _queryParams, |
| 2149 uploadOptions: _uploadOptions, |
| 2150 uploadMedia: _uploadMedia, |
| 2151 downloadOptions: _downloadOptions); |
| 2152 return _response.then((data) => new ListOrgPoliciesResponse.fromJson(data)); |
| 2153 } |
| 2154 |
| 2155 /** |
822 * Sets the IAM access control policy for the specified Project. Replaces | 2156 * Sets the IAM access control policy for the specified Project. Replaces |
823 * any existing policy. | 2157 * any existing policy. |
824 * | 2158 * |
825 * The following constraints apply when using `setIamPolicy()`: | 2159 * The following constraints apply when using `setIamPolicy()`: |
826 * | 2160 * |
827 * + Project does not support `allUsers` and `allAuthenticatedUsers` as | 2161 * + Project does not support `allUsers` and `allAuthenticatedUsers` as |
828 * `members` in a `Binding` of a `Policy`. | 2162 * `members` in a `Binding` of a `Policy`. |
829 * | 2163 * |
830 * + The owner role can be granted only to `user` and `serviceAccount`. | 2164 * + The owner role can be granted only to `user` and `serviceAccount`. |
831 * | 2165 * |
832 * + Service accounts can be made owners of a project directly | 2166 * + Service accounts can be made owners of a project directly |
833 * without any restrictions. However, to be added as an owner, a user must be | 2167 * without any restrictions. However, to be added as an owner, a user must be |
834 * invited via Cloud Platform console and must accept the invitation. | 2168 * invited via Cloud Platform console and must accept the invitation. |
835 * | 2169 * |
836 * + A user cannot be granted the owner role using `setIamPolicy()`. The user | 2170 * + A user cannot be granted the owner role using `setIamPolicy()`. The user |
837 * must be granted the owner role using the Cloud Platform Console and must | 2171 * must be granted the owner role using the Cloud Platform Console and must |
838 * explicitly accept the invitation. | 2172 * explicitly accept the invitation. |
839 * | 2173 * |
840 * + Invitations to grant the owner role cannot be sent using | 2174 * + Invitations to grant the owner role cannot be sent using |
841 * `setIamPolicy()`; | 2175 * `setIamPolicy()`; |
842 * they must be sent only using the Cloud Platform Console. | 2176 * they must be sent only using the Cloud Platform Console. |
843 * | 2177 * |
844 * + Membership changes that leave the project without any owners that have | 2178 * + Membership changes that leave the project without any owners that have |
845 * accepted the Terms of Service (ToS) will be rejected. | 2179 * accepted the Terms of Service (ToS) will be rejected. |
846 * | 2180 * |
847 * + There must be at least one owner who has accepted the Terms of | 2181 * + There must be at least one owner who has accepted the Terms of |
848 * Service (ToS) agreement in the policy. Calling `setIamPolicy()` to | 2182 * Service (ToS) agreement in the policy. Calling `setIamPolicy()` to |
849 * to remove the last ToS-accepted owner from the policy will fail. This | 2183 * remove the last ToS-accepted owner from the policy will fail. This |
850 * restriction also applies to legacy projects that no longer have owners | 2184 * restriction also applies to legacy projects that no longer have owners |
851 * who have accepted the ToS. Edits to IAM policies will be rejected until | 2185 * who have accepted the ToS. Edits to IAM policies will be rejected until |
852 * the lack of a ToS-accepting owner is rectified. | 2186 * the lack of a ToS-accepting owner is rectified. |
853 * | 2187 * |
854 * + Calling this method requires enabling the App Engine Admin API. | 2188 * + Calling this method requires enabling the App Engine Admin API. |
855 * | 2189 * |
856 * Note: Removing service accounts from policies or changing their roles | 2190 * Note: Removing service accounts from policies or changing their roles |
857 * can render services completely inoperable. It is important to understand | 2191 * can render services completely inoperable. It is important to understand |
858 * how the service account is being used before removing or updating its | 2192 * how the service account is being used before removing or updating its |
859 * roles. | 2193 * roles. |
860 * | 2194 * |
861 * [request] - The metadata request object. | 2195 * [request] - The metadata request object. |
862 * | 2196 * |
863 * Request parameters: | 2197 * Request parameters: |
864 * | 2198 * |
865 * [resource] - REQUIRED: The resource for which the policy is being | 2199 * [resource] - REQUIRED: The resource for which the policy is being |
866 * specified. | 2200 * specified. |
867 * See the operation documentation for the appropriate value for this field. | 2201 * See the operation documentation for the appropriate value for this field. |
868 * | 2202 * |
869 * Completes with a [Policy]. | 2203 * Completes with a [Policy]. |
870 * | 2204 * |
871 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2205 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
872 * error. | 2206 * error. |
| 2207 * |
| 2208 * If the used [http.Client] completes with an error when making a REST call, |
| 2209 * this method will complete with the same error. |
| 2210 */ |
| 2211 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { |
| 2212 var _url = null; |
| 2213 var _queryParams = new core.Map(); |
| 2214 var _uploadMedia = null; |
| 2215 var _uploadOptions = null; |
| 2216 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2217 var _body = null; |
| 2218 |
| 2219 if (request != null) { |
| 2220 _body = convert.JSON.encode((request).toJson()); |
| 2221 } |
| 2222 if (resource == null) { |
| 2223 throw new core.ArgumentError("Parameter resource is required."); |
| 2224 } |
| 2225 |
| 2226 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$resource') + ':setIa
mPolicy'; |
| 2227 |
| 2228 var _response = _requester.request(_url, |
| 2229 "POST", |
| 2230 body: _body, |
| 2231 queryParams: _queryParams, |
| 2232 uploadOptions: _uploadOptions, |
| 2233 uploadMedia: _uploadMedia, |
| 2234 downloadOptions: _downloadOptions); |
| 2235 return _response.then((data) => new Policy.fromJson(data)); |
| 2236 } |
| 2237 |
| 2238 /** |
| 2239 * Updates the specified `Policy` on the resource. Creates a new `Policy` for |
| 2240 * that `Constraint` on the resource if one does not exist. |
| 2241 * |
| 2242 * Not supplying an `etag` on the request `Policy` results in an unconditional |
| 2243 * write of the `Policy`. |
| 2244 * |
| 2245 * [request] - The metadata request object. |
| 2246 * |
| 2247 * Request parameters: |
| 2248 * |
| 2249 * [resource] - Resource name of the resource to attach the `Policy`. |
| 2250 * Value must have pattern "^projects/[^/]+$". |
| 2251 * |
| 2252 * Completes with a [OrgPolicy]. |
| 2253 * |
| 2254 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 2255 * error. |
| 2256 * |
| 2257 * If the used [http.Client] completes with an error when making a REST call, |
| 2258 * this method will complete with the same error. |
| 2259 */ |
| 2260 async.Future<OrgPolicy> setOrgPolicy(SetOrgPolicyRequest request, core.String
resource) { |
| 2261 var _url = null; |
| 2262 var _queryParams = new core.Map(); |
| 2263 var _uploadMedia = null; |
| 2264 var _uploadOptions = null; |
| 2265 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2266 var _body = null; |
| 2267 |
| 2268 if (request != null) { |
| 2269 _body = convert.JSON.encode((request).toJson()); |
| 2270 } |
| 2271 if (resource == null) { |
| 2272 throw new core.ArgumentError("Parameter resource is required."); |
| 2273 } |
| 2274 |
| 2275 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setOrg
Policy'; |
| 2276 |
| 2277 var _response = _requester.request(_url, |
| 2278 "POST", |
| 2279 body: _body, |
| 2280 queryParams: _queryParams, |
| 2281 uploadOptions: _uploadOptions, |
| 2282 uploadMedia: _uploadMedia, |
| 2283 downloadOptions: _downloadOptions); |
| 2284 return _response.then((data) => new OrgPolicy.fromJson(data)); |
| 2285 } |
| 2286 |
| 2287 /** |
| 2288 * Updates the specified `Policy` on the resource. Creates a new `Policy` for |
| 2289 * that `Constraint` on the resource if one does not exist. |
| 2290 * |
| 2291 * Not supplying an `etag` on the request `Policy` results in an unconditional |
| 2292 * write of the `Policy`. |
| 2293 * |
| 2294 * [request] - The metadata request object. |
| 2295 * |
| 2296 * Request parameters: |
| 2297 * |
| 2298 * [resource] - Resource name of the resource to attach the `Policy`. |
| 2299 * Value must have pattern "^projects/[^/]+$". |
| 2300 * |
| 2301 * Completes with a [OrgPolicy]. |
| 2302 * |
| 2303 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 2304 * error. |
873 * | 2305 * |
874 * If the used [http.Client] completes with an error when making a REST call, | 2306 * If the used [http.Client] completes with an error when making a REST call, |
875 * this method will complete with the same error. | 2307 * this method will complete with the same error. |
876 */ | 2308 */ |
877 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { | 2309 async.Future<OrgPolicy> setOrgPolicyV1(SetOrgPolicyRequest request, core.Strin
g resource) { |
878 var _url = null; | 2310 var _url = null; |
879 var _queryParams = new core.Map(); | 2311 var _queryParams = new core.Map(); |
880 var _uploadMedia = null; | 2312 var _uploadMedia = null; |
881 var _uploadOptions = null; | 2313 var _uploadOptions = null; |
882 var _downloadOptions = commons.DownloadOptions.Metadata; | 2314 var _downloadOptions = commons.DownloadOptions.Metadata; |
883 var _body = null; | 2315 var _body = null; |
884 | 2316 |
885 if (request != null) { | 2317 if (request != null) { |
886 _body = convert.JSON.encode((request).toJson()); | 2318 _body = convert.JSON.encode((request).toJson()); |
887 } | 2319 } |
888 if (resource == null) { | 2320 if (resource == null) { |
889 throw new core.ArgumentError("Parameter resource is required."); | 2321 throw new core.ArgumentError("Parameter resource is required."); |
890 } | 2322 } |
891 | 2323 |
892 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$resource') + ':setIa
mPolicy'; | 2324 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setOrg
PolicyV1'; |
893 | 2325 |
894 var _response = _requester.request(_url, | 2326 var _response = _requester.request(_url, |
895 "POST", | 2327 "POST", |
896 body: _body, | 2328 body: _body, |
897 queryParams: _queryParams, | 2329 queryParams: _queryParams, |
898 uploadOptions: _uploadOptions, | 2330 uploadOptions: _uploadOptions, |
899 uploadMedia: _uploadMedia, | 2331 uploadMedia: _uploadMedia, |
900 downloadOptions: _downloadOptions); | 2332 downloadOptions: _downloadOptions); |
901 return _response.then((data) => new Policy.fromJson(data)); | 2333 return _response.then((data) => new OrgPolicy.fromJson(data)); |
902 } | 2334 } |
903 | 2335 |
904 /** | 2336 /** |
905 * Returns permissions that a caller has on the specified Project. | 2337 * Returns permissions that a caller has on the specified Project. |
906 * | 2338 * |
907 * [request] - The metadata request object. | 2339 * [request] - The metadata request object. |
908 * | 2340 * |
909 * Request parameters: | 2341 * Request parameters: |
910 * | 2342 * |
911 * [resource] - REQUIRED: The resource for which the policy detail is being | 2343 * [resource] - REQUIRED: The resource for which the policy detail is being |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 | 2499 |
1068 core.Map toJson() { | 2500 core.Map toJson() { |
1069 var _json = new core.Map(); | 2501 var _json = new core.Map(); |
1070 if (resourceId != null) { | 2502 if (resourceId != null) { |
1071 _json["resourceId"] = (resourceId).toJson(); | 2503 _json["resourceId"] = (resourceId).toJson(); |
1072 } | 2504 } |
1073 return _json; | 2505 return _json; |
1074 } | 2506 } |
1075 } | 2507 } |
1076 | 2508 |
| 2509 /** |
| 2510 * Specifies the audit configuration for a service. |
| 2511 * The configuration determines which permission types are logged, and what |
| 2512 * identities, if any, are exempted from logging. |
| 2513 * An AuditConifg must have one or more AuditLogConfigs. |
| 2514 * |
| 2515 * If there are AuditConfigs for both `allServices` and a specific service, |
| 2516 * the union of the two AuditConfigs is used for that service: the log_types |
| 2517 * specified in each AuditConfig are enabled, and the exempted_members in each |
| 2518 * AuditConfig are exempted. |
| 2519 * Example Policy with multiple AuditConfigs: |
| 2520 * { |
| 2521 * "audit_configs": [ |
| 2522 * { |
| 2523 * "service": "allServices" |
| 2524 * "audit_log_configs": [ |
| 2525 * { |
| 2526 * "log_type": "DATA_READ", |
| 2527 * "exempted_members": [ |
| 2528 * "user:foo@gmail.com" |
| 2529 * ] |
| 2530 * }, |
| 2531 * { |
| 2532 * "log_type": "DATA_WRITE", |
| 2533 * }, |
| 2534 * { |
| 2535 * "log_type": "ADMIN_READ", |
| 2536 * } |
| 2537 * ] |
| 2538 * }, |
| 2539 * { |
| 2540 * "service": "fooservice@googleapis.com" |
| 2541 * "audit_log_configs": [ |
| 2542 * { |
| 2543 * "log_type": "DATA_READ", |
| 2544 * }, |
| 2545 * { |
| 2546 * "log_type": "DATA_WRITE", |
| 2547 * "exempted_members": [ |
| 2548 * "user:bar@gmail.com" |
| 2549 * ] |
| 2550 * } |
| 2551 * ] |
| 2552 * } |
| 2553 * ] |
| 2554 * } |
| 2555 * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 2556 * logging. It also exempts foo@gmail.com from DATA_READ logging, and |
| 2557 * bar@gmail.com from DATA_WRITE logging. |
| 2558 */ |
| 2559 class AuditConfig { |
| 2560 /** |
| 2561 * The configuration for logging of each type of permission. |
| 2562 * Next ID: 4 |
| 2563 */ |
| 2564 core.List<AuditLogConfig> auditLogConfigs; |
| 2565 /** |
| 2566 * Specifies a service that will be enabled for audit logging. |
| 2567 * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 2568 * `allServices` is a special value that covers all services. |
| 2569 */ |
| 2570 core.String service; |
| 2571 |
| 2572 AuditConfig(); |
| 2573 |
| 2574 AuditConfig.fromJson(core.Map _json) { |
| 2575 if (_json.containsKey("auditLogConfigs")) { |
| 2576 auditLogConfigs = _json["auditLogConfigs"].map((value) => new AuditLogConf
ig.fromJson(value)).toList(); |
| 2577 } |
| 2578 if (_json.containsKey("service")) { |
| 2579 service = _json["service"]; |
| 2580 } |
| 2581 } |
| 2582 |
| 2583 core.Map toJson() { |
| 2584 var _json = new core.Map(); |
| 2585 if (auditLogConfigs != null) { |
| 2586 _json["auditLogConfigs"] = auditLogConfigs.map((value) => (value).toJson()
).toList(); |
| 2587 } |
| 2588 if (service != null) { |
| 2589 _json["service"] = service; |
| 2590 } |
| 2591 return _json; |
| 2592 } |
| 2593 } |
| 2594 |
| 2595 /** |
| 2596 * Provides the configuration for logging a type of permissions. |
| 2597 * Example: |
| 2598 * |
| 2599 * { |
| 2600 * "audit_log_configs": [ |
| 2601 * { |
| 2602 * "log_type": "DATA_READ", |
| 2603 * "exempted_members": [ |
| 2604 * "user:foo@gmail.com" |
| 2605 * ] |
| 2606 * }, |
| 2607 * { |
| 2608 * "log_type": "DATA_WRITE", |
| 2609 * } |
| 2610 * ] |
| 2611 * } |
| 2612 * |
| 2613 * This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 2614 * foo@gmail.com from DATA_READ logging. |
| 2615 */ |
| 2616 class AuditLogConfig { |
| 2617 /** |
| 2618 * Specifies the identities that do not cause logging for this type of |
| 2619 * permission. |
| 2620 * Follows the same format of Binding.members. |
| 2621 */ |
| 2622 core.List<core.String> exemptedMembers; |
| 2623 /** |
| 2624 * The log type that this config enables. |
| 2625 * Possible string values are: |
| 2626 * - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. |
| 2627 * - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy |
| 2628 * - "DATA_WRITE" : Data writes. Example: CloudSQL Users create |
| 2629 * - "DATA_READ" : Data reads. Example: CloudSQL Users list |
| 2630 */ |
| 2631 core.String logType; |
| 2632 |
| 2633 AuditLogConfig(); |
| 2634 |
| 2635 AuditLogConfig.fromJson(core.Map _json) { |
| 2636 if (_json.containsKey("exemptedMembers")) { |
| 2637 exemptedMembers = _json["exemptedMembers"]; |
| 2638 } |
| 2639 if (_json.containsKey("logType")) { |
| 2640 logType = _json["logType"]; |
| 2641 } |
| 2642 } |
| 2643 |
| 2644 core.Map toJson() { |
| 2645 var _json = new core.Map(); |
| 2646 if (exemptedMembers != null) { |
| 2647 _json["exemptedMembers"] = exemptedMembers; |
| 2648 } |
| 2649 if (logType != null) { |
| 2650 _json["logType"] = logType; |
| 2651 } |
| 2652 return _json; |
| 2653 } |
| 2654 } |
| 2655 |
1077 /** Associates `members` with a `role`. */ | 2656 /** Associates `members` with a `role`. */ |
1078 class Binding { | 2657 class Binding { |
1079 /** | 2658 /** |
1080 * Specifies the identities requesting access for a Cloud Platform resource. | 2659 * Specifies the identities requesting access for a Cloud Platform resource. |
1081 * `members` can have the following values: | 2660 * `members` can have the following values: |
1082 * | 2661 * |
1083 * * `allUsers`: A special identifier that represents anyone who is | 2662 * * `allUsers`: A special identifier that represents anyone who is |
1084 * on the internet; with or without a Google account. | 2663 * on the internet; with or without a Google account. |
1085 * | 2664 * |
1086 * * `allAuthenticatedUsers`: A special identifier that represents anyone | 2665 * * `allAuthenticatedUsers`: A special identifier that represents anyone |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 _json["members"] = members; | 2703 _json["members"] = members; |
1125 } | 2704 } |
1126 if (role != null) { | 2705 if (role != null) { |
1127 _json["role"] = role; | 2706 _json["role"] = role; |
1128 } | 2707 } |
1129 return _json; | 2708 return _json; |
1130 } | 2709 } |
1131 } | 2710 } |
1132 | 2711 |
1133 /** | 2712 /** |
| 2713 * A `Constraint` that is either enforced or not. |
| 2714 * |
| 2715 * For example a constraint `constraints/compute.disableSerialPortAccess`. |
| 2716 * If it is enforced on a VM instance, serial port connections will not be |
| 2717 * opened to that instance. |
| 2718 */ |
| 2719 class BooleanConstraint { |
| 2720 |
| 2721 BooleanConstraint(); |
| 2722 |
| 2723 BooleanConstraint.fromJson(core.Map _json) { |
| 2724 } |
| 2725 |
| 2726 core.Map toJson() { |
| 2727 var _json = new core.Map(); |
| 2728 return _json; |
| 2729 } |
| 2730 } |
| 2731 |
| 2732 /** |
| 2733 * Used in `policy_type` to specify how `boolean_policy` will behave at this |
| 2734 * resource. |
| 2735 */ |
| 2736 class BooleanPolicy { |
| 2737 /** |
| 2738 * If `true`, then the `Policy` is enforced. If `false`, then any |
| 2739 * configuration is acceptable. |
| 2740 * |
| 2741 * Suppose you have a `Constraint` |
| 2742 * `constraints/compute.disableSerialPortAccess` |
| 2743 * with `constraint_default` set to `ALLOW`. A `Policy` for that |
| 2744 * `Constraint` exhibits the following behavior: |
| 2745 * - If the `Policy` at this resource has enforced set to `false`, serial |
| 2746 * port connection attempts will be allowed. |
| 2747 * - If the `Policy` at this resource has enforced set to `true`, serial |
| 2748 * port connection attempts will be refused. |
| 2749 * - If the `Policy` at this resource is `RestoreDefault`, serial port |
| 2750 * connection attempts will be allowed. |
| 2751 * - If no `Policy` is set at this resource or anywhere higher in the |
| 2752 * resource hierarchy, serial port connection attempts will be allowed. |
| 2753 * - If no `Policy` is set at this resource, but one exists higher in the |
| 2754 * resource hierarchy, the behavior is as if the`Policy` were set at |
| 2755 * this resource. |
| 2756 * |
| 2757 * The following examples demonstrate the different possible layerings: |
| 2758 * |
| 2759 * Example 1 (nearest `Constraint` wins): |
| 2760 * `organizations/foo` has a `Policy` with: |
| 2761 * {enforced: false} |
| 2762 * `projects/bar` has no `Policy` set. |
| 2763 * The constraint at `projects/bar` and `organizations/foo` will not be |
| 2764 * enforced. |
| 2765 * |
| 2766 * Example 2 (enforcement gets replaced): |
| 2767 * `organizations/foo` has a `Policy` with: |
| 2768 * {enforced: false} |
| 2769 * `projects/bar` has a `Policy` with: |
| 2770 * {enforced: true} |
| 2771 * The constraint at `organizations/foo` is not enforced. |
| 2772 * The constraint at `projects/bar` is enforced. |
| 2773 * |
| 2774 * Example 3 (RestoreDefault): |
| 2775 * `organizations/foo` has a `Policy` with: |
| 2776 * {enforced: true} |
| 2777 * `projects/bar` has a `Policy` with: |
| 2778 * {RestoreDefault: {}} |
| 2779 * The constraint at `organizations/foo` is enforced. |
| 2780 * The constraint at `projects/bar` is not enforced, because |
| 2781 * `constraint_default` for the `Constraint` is `ALLOW`. |
| 2782 */ |
| 2783 core.bool enforced; |
| 2784 |
| 2785 BooleanPolicy(); |
| 2786 |
| 2787 BooleanPolicy.fromJson(core.Map _json) { |
| 2788 if (_json.containsKey("enforced")) { |
| 2789 enforced = _json["enforced"]; |
| 2790 } |
| 2791 } |
| 2792 |
| 2793 core.Map toJson() { |
| 2794 var _json = new core.Map(); |
| 2795 if (enforced != null) { |
| 2796 _json["enforced"] = enforced; |
| 2797 } |
| 2798 return _json; |
| 2799 } |
| 2800 } |
| 2801 |
| 2802 /** The request sent to the ClearOrgPolicy method. */ |
| 2803 class ClearOrgPolicyRequest { |
| 2804 /** Name of the `Constraint` of the `Policy` to clear. */ |
| 2805 core.String constraint; |
| 2806 /** |
| 2807 * The current version, for concurrency control. Not sending an `etag` |
| 2808 * will cause the `Policy` to be cleared blindly. |
| 2809 */ |
| 2810 core.String etag; |
| 2811 core.List<core.int> get etagAsBytes { |
| 2812 return convert.BASE64.decode(etag); |
| 2813 } |
| 2814 |
| 2815 void set etagAsBytes(core.List<core.int> _bytes) { |
| 2816 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
| 2817 } |
| 2818 |
| 2819 ClearOrgPolicyRequest(); |
| 2820 |
| 2821 ClearOrgPolicyRequest.fromJson(core.Map _json) { |
| 2822 if (_json.containsKey("constraint")) { |
| 2823 constraint = _json["constraint"]; |
| 2824 } |
| 2825 if (_json.containsKey("etag")) { |
| 2826 etag = _json["etag"]; |
| 2827 } |
| 2828 } |
| 2829 |
| 2830 core.Map toJson() { |
| 2831 var _json = new core.Map(); |
| 2832 if (constraint != null) { |
| 2833 _json["constraint"] = constraint; |
| 2834 } |
| 2835 if (etag != null) { |
| 2836 _json["etag"] = etag; |
| 2837 } |
| 2838 return _json; |
| 2839 } |
| 2840 } |
| 2841 |
| 2842 /** |
| 2843 * A `Constraint` describes a way in which a resource's configuration can be |
| 2844 * restricted. For example, it controls which cloud services can be activated |
| 2845 * across an organization, or whether a Compute Engine instance can have |
| 2846 * serial port connections established. `Constraints` can be configured by the |
| 2847 * organization's policy adminstrator to fit the needs of the organzation by |
| 2848 * setting Policies for `Constraints` at different locations in the |
| 2849 * organization's resource hierarchy. Policies are inherited down the resource |
| 2850 * hierarchy from higher levels, but can also be overridden. For details about |
| 2851 * the inheritance rules please read about |
| 2852 * Policies. |
| 2853 * |
| 2854 * `Constraints` have a default behavior determined by the `constraint_default` |
| 2855 * field, which is the enforcement behavior that is used in the absence of a |
| 2856 * `Policy` being defined or inherited for the resource in question. |
| 2857 */ |
| 2858 class Constraint { |
| 2859 /** Defines this constraint as being a BooleanConstraint. */ |
| 2860 BooleanConstraint booleanConstraint; |
| 2861 /** |
| 2862 * The evaluation behavior of this constraint in the absense of 'Policy'. |
| 2863 * Possible string values are: |
| 2864 * - "CONSTRAINT_DEFAULT_UNSPECIFIED" : This is only used for distinguishing |
| 2865 * unset values and should never be |
| 2866 * used. |
| 2867 * - "ALLOW" : Indicate that all values are allowed for list constraints. |
| 2868 * Indicate that enforcement is off for boolean constraints. |
| 2869 * - "DENY" : Indicate that all values are denied for list constraints. |
| 2870 * Indicate that enforcement is on for boolean constraints. |
| 2871 */ |
| 2872 core.String constraintDefault; |
| 2873 /** |
| 2874 * Detailed description of what this `Constraint` controls as well as how and |
| 2875 * where it is enforced. |
| 2876 * |
| 2877 * Mutable. |
| 2878 */ |
| 2879 core.String description; |
| 2880 /** |
| 2881 * The human readable name. |
| 2882 * |
| 2883 * Mutable. |
| 2884 */ |
| 2885 core.String displayName; |
| 2886 /** Defines this constraint as being a ListConstraint. */ |
| 2887 ListConstraint listConstraint; |
| 2888 /** |
| 2889 * Immutable value, required to globally be unique. For example, |
| 2890 * `constraints/serviceuser.services` |
| 2891 */ |
| 2892 core.String name; |
| 2893 /** Version of the `Constraint`. Default version is 0; */ |
| 2894 core.int version; |
| 2895 |
| 2896 Constraint(); |
| 2897 |
| 2898 Constraint.fromJson(core.Map _json) { |
| 2899 if (_json.containsKey("booleanConstraint")) { |
| 2900 booleanConstraint = new BooleanConstraint.fromJson(_json["booleanConstrain
t"]); |
| 2901 } |
| 2902 if (_json.containsKey("constraintDefault")) { |
| 2903 constraintDefault = _json["constraintDefault"]; |
| 2904 } |
| 2905 if (_json.containsKey("description")) { |
| 2906 description = _json["description"]; |
| 2907 } |
| 2908 if (_json.containsKey("displayName")) { |
| 2909 displayName = _json["displayName"]; |
| 2910 } |
| 2911 if (_json.containsKey("listConstraint")) { |
| 2912 listConstraint = new ListConstraint.fromJson(_json["listConstraint"]); |
| 2913 } |
| 2914 if (_json.containsKey("name")) { |
| 2915 name = _json["name"]; |
| 2916 } |
| 2917 if (_json.containsKey("version")) { |
| 2918 version = _json["version"]; |
| 2919 } |
| 2920 } |
| 2921 |
| 2922 core.Map toJson() { |
| 2923 var _json = new core.Map(); |
| 2924 if (booleanConstraint != null) { |
| 2925 _json["booleanConstraint"] = (booleanConstraint).toJson(); |
| 2926 } |
| 2927 if (constraintDefault != null) { |
| 2928 _json["constraintDefault"] = constraintDefault; |
| 2929 } |
| 2930 if (description != null) { |
| 2931 _json["description"] = description; |
| 2932 } |
| 2933 if (displayName != null) { |
| 2934 _json["displayName"] = displayName; |
| 2935 } |
| 2936 if (listConstraint != null) { |
| 2937 _json["listConstraint"] = (listConstraint).toJson(); |
| 2938 } |
| 2939 if (name != null) { |
| 2940 _json["name"] = name; |
| 2941 } |
| 2942 if (version != null) { |
| 2943 _json["version"] = version; |
| 2944 } |
| 2945 return _json; |
| 2946 } |
| 2947 } |
| 2948 |
| 2949 /** |
1134 * A generic empty message that you can re-use to avoid defining duplicated | 2950 * A generic empty message that you can re-use to avoid defining duplicated |
1135 * empty messages in your APIs. A typical example is to use it as the request | 2951 * empty messages in your APIs. A typical example is to use it as the request |
1136 * or the response type of an API method. For instance: | 2952 * or the response type of an API method. For instance: |
1137 * | 2953 * |
1138 * service Foo { | 2954 * service Foo { |
1139 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 2955 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
1140 * } | 2956 * } |
1141 * | 2957 * |
1142 * The JSON representation for `Empty` is empty JSON object `{}`. | 2958 * The JSON representation for `Empty` is empty JSON object `{}`. |
1143 */ | 2959 */ |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 * - "MAX_CHILD_FOLDERS_VIOLATION" : The attempted action would violate the | 3040 * - "MAX_CHILD_FOLDERS_VIOLATION" : The attempted action would violate the |
1225 * max child folders constraint. | 3041 * max child folders constraint. |
1226 * - "FOLDER_NAME_UNIQUENESS_VIOLATION" : The attempted action would violate | 3042 * - "FOLDER_NAME_UNIQUENESS_VIOLATION" : The attempted action would violate |
1227 * the locally-unique folder | 3043 * the locally-unique folder |
1228 * display_name constraint. | 3044 * display_name constraint. |
1229 * - "RESOURCE_DELETED" : The resource being moved has been deleted. | 3045 * - "RESOURCE_DELETED" : The resource being moved has been deleted. |
1230 * - "PARENT_DELETED" : The resource a folder was being added to has been | 3046 * - "PARENT_DELETED" : The resource a folder was being added to has been |
1231 * deleted. | 3047 * deleted. |
1232 * - "CYCLE_INTRODUCED_ERROR" : The attempted action would introduce cycle in | 3048 * - "CYCLE_INTRODUCED_ERROR" : The attempted action would introduce cycle in |
1233 * resource path. | 3049 * resource path. |
1234 * - "FOLDER_ALREADY_BEING_MOVED" : The attempted action would move a folder | 3050 * - "FOLDER_BEING_MOVED" : The attempted action would move a folder that is |
1235 * that is already being moved. | 3051 * already being moved. |
1236 * - "FOLDER_TO_DELETE_NON_EMPTY" : The folder the caller is trying to delete | 3052 * - "FOLDER_TO_DELETE_NON_EMPTY" : The folder the caller is trying to delete |
1237 * contains active resources. | 3053 * contains active resources. |
1238 */ | 3054 */ |
1239 core.String errorMessageId; | 3055 core.String errorMessageId; |
1240 | 3056 |
1241 FolderOperationError(); | 3057 FolderOperationError(); |
1242 | 3058 |
1243 FolderOperationError.fromJson(core.Map _json) { | 3059 FolderOperationError.fromJson(core.Map _json) { |
1244 if (_json.containsKey("errorMessageId")) { | 3060 if (_json.containsKey("errorMessageId")) { |
1245 errorMessageId = _json["errorMessageId"]; | 3061 errorMessageId = _json["errorMessageId"]; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 | 3108 |
1293 core.Map toJson() { | 3109 core.Map toJson() { |
1294 var _json = new core.Map(); | 3110 var _json = new core.Map(); |
1295 if (ancestor != null) { | 3111 if (ancestor != null) { |
1296 _json["ancestor"] = ancestor.map((value) => (value).toJson()).toList(); | 3112 _json["ancestor"] = ancestor.map((value) => (value).toJson()).toList(); |
1297 } | 3113 } |
1298 return _json; | 3114 return _json; |
1299 } | 3115 } |
1300 } | 3116 } |
1301 | 3117 |
| 3118 /** The request sent to the GetEffectiveOrgPolicy method. */ |
| 3119 class GetEffectiveOrgPolicyRequest { |
| 3120 /** The name of the `Constraint` to compute the effective `Policy`. */ |
| 3121 core.String constraint; |
| 3122 |
| 3123 GetEffectiveOrgPolicyRequest(); |
| 3124 |
| 3125 GetEffectiveOrgPolicyRequest.fromJson(core.Map _json) { |
| 3126 if (_json.containsKey("constraint")) { |
| 3127 constraint = _json["constraint"]; |
| 3128 } |
| 3129 } |
| 3130 |
| 3131 core.Map toJson() { |
| 3132 var _json = new core.Map(); |
| 3133 if (constraint != null) { |
| 3134 _json["constraint"] = constraint; |
| 3135 } |
| 3136 return _json; |
| 3137 } |
| 3138 } |
| 3139 |
1302 /** Request message for `GetIamPolicy` method. */ | 3140 /** Request message for `GetIamPolicy` method. */ |
1303 class GetIamPolicyRequest { | 3141 class GetIamPolicyRequest { |
1304 | 3142 |
1305 GetIamPolicyRequest(); | 3143 GetIamPolicyRequest(); |
1306 | 3144 |
1307 GetIamPolicyRequest.fromJson(core.Map _json) { | 3145 GetIamPolicyRequest.fromJson(core.Map _json) { |
1308 } | 3146 } |
1309 | 3147 |
1310 core.Map toJson() { | 3148 core.Map toJson() { |
1311 var _json = new core.Map(); | 3149 var _json = new core.Map(); |
1312 return _json; | 3150 return _json; |
1313 } | 3151 } |
1314 } | 3152 } |
| 3153 |
| 3154 /** The request sent to the GetOrgPolicy method. */ |
| 3155 class GetOrgPolicyRequest { |
| 3156 /** Name of the `Constraint` to get the `Policy`. */ |
| 3157 core.String constraint; |
| 3158 |
| 3159 GetOrgPolicyRequest(); |
| 3160 |
| 3161 GetOrgPolicyRequest.fromJson(core.Map _json) { |
| 3162 if (_json.containsKey("constraint")) { |
| 3163 constraint = _json["constraint"]; |
| 3164 } |
| 3165 } |
| 3166 |
| 3167 core.Map toJson() { |
| 3168 var _json = new core.Map(); |
| 3169 if (constraint != null) { |
| 3170 _json["constraint"] = constraint; |
| 3171 } |
| 3172 return _json; |
| 3173 } |
| 3174 } |
1315 | 3175 |
1316 /** | 3176 /** |
1317 * A Lien represents an encumbrance on the actions that can be performed on a | 3177 * A Lien represents an encumbrance on the actions that can be performed on a |
1318 * resource. | 3178 * resource. |
1319 */ | 3179 */ |
1320 class Lien { | 3180 class Lien { |
1321 /** The creation time of this Lien. */ | 3181 /** The creation time of this Lien. */ |
1322 core.String createTime; | 3182 core.String createTime; |
1323 /** | 3183 /** |
1324 * A system-generated unique identifier for this Lien. | 3184 * A system-generated unique identifier for this Lien. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 if (reason != null) { | 3259 if (reason != null) { |
1400 _json["reason"] = reason; | 3260 _json["reason"] = reason; |
1401 } | 3261 } |
1402 if (restrictions != null) { | 3262 if (restrictions != null) { |
1403 _json["restrictions"] = restrictions; | 3263 _json["restrictions"] = restrictions; |
1404 } | 3264 } |
1405 return _json; | 3265 return _json; |
1406 } | 3266 } |
1407 } | 3267 } |
1408 | 3268 |
| 3269 /** |
| 3270 * The request sent to the [ListAvailableOrgPolicyConstraints] |
| 3271 * google.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] method. |
| 3272 */ |
| 3273 class ListAvailableOrgPolicyConstraintsRequest { |
| 3274 /** |
| 3275 * Size of the pages to be returned. This is currently unsupported and will |
| 3276 * be ignored. The server may at any point start using this field to limit |
| 3277 * page size. |
| 3278 */ |
| 3279 core.int pageSize; |
| 3280 /** |
| 3281 * Page token used to retrieve the next page. This is currently unsupported |
| 3282 * and will be ignored. The server may at any point start using this field. |
| 3283 */ |
| 3284 core.String pageToken; |
| 3285 |
| 3286 ListAvailableOrgPolicyConstraintsRequest(); |
| 3287 |
| 3288 ListAvailableOrgPolicyConstraintsRequest.fromJson(core.Map _json) { |
| 3289 if (_json.containsKey("pageSize")) { |
| 3290 pageSize = _json["pageSize"]; |
| 3291 } |
| 3292 if (_json.containsKey("pageToken")) { |
| 3293 pageToken = _json["pageToken"]; |
| 3294 } |
| 3295 } |
| 3296 |
| 3297 core.Map toJson() { |
| 3298 var _json = new core.Map(); |
| 3299 if (pageSize != null) { |
| 3300 _json["pageSize"] = pageSize; |
| 3301 } |
| 3302 if (pageToken != null) { |
| 3303 _json["pageToken"] = pageToken; |
| 3304 } |
| 3305 return _json; |
| 3306 } |
| 3307 } |
| 3308 |
| 3309 /** |
| 3310 * The response returned from the ListAvailableOrgPolicyConstraints method. |
| 3311 * Returns all `Constraints` that could be set at this level of the hierarchy |
| 3312 * (contrast with the response from `ListPolicies`, which returns all policies |
| 3313 * which are set). |
| 3314 */ |
| 3315 class ListAvailableOrgPolicyConstraintsResponse { |
| 3316 /** |
| 3317 * The collection of constraints that are settable on the request resource. |
| 3318 */ |
| 3319 core.List<Constraint> constraints; |
| 3320 /** Page token used to retrieve the next page. This is currently not used. */ |
| 3321 core.String nextPageToken; |
| 3322 |
| 3323 ListAvailableOrgPolicyConstraintsResponse(); |
| 3324 |
| 3325 ListAvailableOrgPolicyConstraintsResponse.fromJson(core.Map _json) { |
| 3326 if (_json.containsKey("constraints")) { |
| 3327 constraints = _json["constraints"].map((value) => new Constraint.fromJson(
value)).toList(); |
| 3328 } |
| 3329 if (_json.containsKey("nextPageToken")) { |
| 3330 nextPageToken = _json["nextPageToken"]; |
| 3331 } |
| 3332 } |
| 3333 |
| 3334 core.Map toJson() { |
| 3335 var _json = new core.Map(); |
| 3336 if (constraints != null) { |
| 3337 _json["constraints"] = constraints.map((value) => (value).toJson()).toList
(); |
| 3338 } |
| 3339 if (nextPageToken != null) { |
| 3340 _json["nextPageToken"] = nextPageToken; |
| 3341 } |
| 3342 return _json; |
| 3343 } |
| 3344 } |
| 3345 |
| 3346 /** |
| 3347 * A `Constraint` that allows or disallows a list of string values, which are |
| 3348 * configured by an Organization's policy administrator with a `Policy`. |
| 3349 */ |
| 3350 class ListConstraint { |
| 3351 /** |
| 3352 * Optional. The Google Cloud Console will try to default to a configuration |
| 3353 * that matches the value specified in this `Constraint`. |
| 3354 */ |
| 3355 core.String suggestedValue; |
| 3356 |
| 3357 ListConstraint(); |
| 3358 |
| 3359 ListConstraint.fromJson(core.Map _json) { |
| 3360 if (_json.containsKey("suggestedValue")) { |
| 3361 suggestedValue = _json["suggestedValue"]; |
| 3362 } |
| 3363 } |
| 3364 |
| 3365 core.Map toJson() { |
| 3366 var _json = new core.Map(); |
| 3367 if (suggestedValue != null) { |
| 3368 _json["suggestedValue"] = suggestedValue; |
| 3369 } |
| 3370 return _json; |
| 3371 } |
| 3372 } |
| 3373 |
1409 /** The response message for Liens.ListLiens. */ | 3374 /** The response message for Liens.ListLiens. */ |
1410 class ListLiensResponse { | 3375 class ListLiensResponse { |
1411 /** A list of Liens. */ | 3376 /** A list of Liens. */ |
1412 core.List<Lien> liens; | 3377 core.List<Lien> liens; |
1413 /** | 3378 /** |
1414 * Token to retrieve the next page of results, or empty if there are no more | 3379 * Token to retrieve the next page of results, or empty if there are no more |
1415 * results in the list. | 3380 * results in the list. |
1416 */ | 3381 */ |
1417 core.String nextPageToken; | 3382 core.String nextPageToken; |
1418 | 3383 |
(...skipping 13 matching lines...) Expand all Loading... |
1432 if (liens != null) { | 3397 if (liens != null) { |
1433 _json["liens"] = liens.map((value) => (value).toJson()).toList(); | 3398 _json["liens"] = liens.map((value) => (value).toJson()).toList(); |
1434 } | 3399 } |
1435 if (nextPageToken != null) { | 3400 if (nextPageToken != null) { |
1436 _json["nextPageToken"] = nextPageToken; | 3401 _json["nextPageToken"] = nextPageToken; |
1437 } | 3402 } |
1438 return _json; | 3403 return _json; |
1439 } | 3404 } |
1440 } | 3405 } |
1441 | 3406 |
| 3407 /** The request sent to the ListOrgPolicies method. */ |
| 3408 class ListOrgPoliciesRequest { |
| 3409 /** |
| 3410 * Size of the pages to be returned. This is currently unsupported and will |
| 3411 * be ignored. The server may at any point start using this field to limit |
| 3412 * page size. |
| 3413 */ |
| 3414 core.int pageSize; |
| 3415 /** |
| 3416 * Page token used to retrieve the next page. This is currently unsupported |
| 3417 * and will be ignored. The server may at any point start using this field. |
| 3418 */ |
| 3419 core.String pageToken; |
| 3420 |
| 3421 ListOrgPoliciesRequest(); |
| 3422 |
| 3423 ListOrgPoliciesRequest.fromJson(core.Map _json) { |
| 3424 if (_json.containsKey("pageSize")) { |
| 3425 pageSize = _json["pageSize"]; |
| 3426 } |
| 3427 if (_json.containsKey("pageToken")) { |
| 3428 pageToken = _json["pageToken"]; |
| 3429 } |
| 3430 } |
| 3431 |
| 3432 core.Map toJson() { |
| 3433 var _json = new core.Map(); |
| 3434 if (pageSize != null) { |
| 3435 _json["pageSize"] = pageSize; |
| 3436 } |
| 3437 if (pageToken != null) { |
| 3438 _json["pageToken"] = pageToken; |
| 3439 } |
| 3440 return _json; |
| 3441 } |
| 3442 } |
| 3443 |
| 3444 /** |
| 3445 * The response returned from the ListOrgPolicies method. It will be empty |
| 3446 * if no `Policies` are set on the resource. |
| 3447 */ |
| 3448 class ListOrgPoliciesResponse { |
| 3449 /** |
| 3450 * Page token used to retrieve the next page. This is currently not used, but |
| 3451 * the server may at any point start supplying a valid token. |
| 3452 */ |
| 3453 core.String nextPageToken; |
| 3454 /** |
| 3455 * The `Policies` that are set on the resource. It will be empty if no |
| 3456 * `Policies` are set. |
| 3457 */ |
| 3458 core.List<OrgPolicy> policies; |
| 3459 |
| 3460 ListOrgPoliciesResponse(); |
| 3461 |
| 3462 ListOrgPoliciesResponse.fromJson(core.Map _json) { |
| 3463 if (_json.containsKey("nextPageToken")) { |
| 3464 nextPageToken = _json["nextPageToken"]; |
| 3465 } |
| 3466 if (_json.containsKey("policies")) { |
| 3467 policies = _json["policies"].map((value) => new OrgPolicy.fromJson(value))
.toList(); |
| 3468 } |
| 3469 } |
| 3470 |
| 3471 core.Map toJson() { |
| 3472 var _json = new core.Map(); |
| 3473 if (nextPageToken != null) { |
| 3474 _json["nextPageToken"] = nextPageToken; |
| 3475 } |
| 3476 if (policies != null) { |
| 3477 _json["policies"] = policies.map((value) => (value).toJson()).toList(); |
| 3478 } |
| 3479 return _json; |
| 3480 } |
| 3481 } |
| 3482 |
| 3483 /** |
| 3484 * Used in `policy_type` to specify how `list_policy` behaves at this |
| 3485 * resource. |
| 3486 * |
| 3487 * A `ListPolicy` can define specific values that are allowed or denied by |
| 3488 * setting either the `allowed_values` or `denied_values` fields. It can also |
| 3489 * be used to allow or deny all values, by setting the `all_values` field. If |
| 3490 * `all_values` is `ALL_VALUES_UNSPECIFIED`, exactly one of `allowed_values` |
| 3491 * or `denied_values` must be set (attempting to set both or neither will |
| 3492 * result in a failed request). If `all_values` is set to either `ALLOW` or |
| 3493 * `DENY`, `allowed_values` and `denied_values` must be unset. |
| 3494 */ |
| 3495 class ListPolicy { |
| 3496 /** |
| 3497 * The policy all_values state. |
| 3498 * Possible string values are: |
| 3499 * - "ALL_VALUES_UNSPECIFIED" : Indicates that either allowed_values or |
| 3500 * denied_values must be set. |
| 3501 * - "ALLOW" : A policy with this set allows all values. |
| 3502 * - "DENY" : A policy with this set denies all values. |
| 3503 */ |
| 3504 core.String allValues; |
| 3505 /** |
| 3506 * List of values allowed at this resource. an only be set if no values are |
| 3507 * set for `denied_values` and `all_values` is set to |
| 3508 * `ALL_VALUES_UNSPECIFIED`. |
| 3509 */ |
| 3510 core.List<core.String> allowedValues; |
| 3511 /** |
| 3512 * List of values denied at this resource. Can only be set if no values are |
| 3513 * set for `allowed_values` and `all_values` is set to |
| 3514 * `ALL_VALUES_UNSPECIFIED`. |
| 3515 */ |
| 3516 core.List<core.String> deniedValues; |
| 3517 /** |
| 3518 * Determines the inheritance behavior for this `Policy`. |
| 3519 * |
| 3520 * By default, a `ListPolicy` set at a resource supercedes any `Policy` set |
| 3521 * anywhere up the resource hierarchy. However, if `inherit_from_parent` is |
| 3522 * set to `true`, then the values from the effective `Policy` of the parent |
| 3523 * resource are inherited, meaning the values set in this `Policy` are |
| 3524 * added to the values inherited up the hierarchy. |
| 3525 * |
| 3526 * Setting `Policy` hierarchies that inherit both allowed values and denied |
| 3527 * values isn't recommended in most circumstances to keep the configuration |
| 3528 * simple and understandable. However, it is possible to set a `Policy` with |
| 3529 * `allowed_values` set that inherits a `Policy` with `denied_values` set. |
| 3530 * In this case, the values that are allowed must be in `allowed_values` and |
| 3531 * not present in `denied_values`. |
| 3532 * |
| 3533 * For example, suppose you have a `Constraint` |
| 3534 * `constraints/serviceuser.services`, which has a `constraint_type` of |
| 3535 * `list_constraint`, and with `constraint_default` set to `ALLOW`. |
| 3536 * Suppose that at the Organization level, a `Policy` is applied that |
| 3537 * restricts the allowed API activations to {`E1`, `E2`}. Then, if a |
| 3538 * `Policy` is applied to a project below the Organization that has |
| 3539 * `inherit_from_parent` set to `false` and field all_values set to DENY, |
| 3540 * then an attempt to activate any API will be denied. |
| 3541 * |
| 3542 * The following examples demonstrate different possible layerings: |
| 3543 * |
| 3544 * Example 1 (no inherited values): |
| 3545 * `organizations/foo` has a `Policy` with values: |
| 3546 * {allowed_values: “E1” allowed_values:”E2”} |
| 3547 * ``projects/bar`` has `inherit_from_parent` `false` and values: |
| 3548 * {allowed_values: "E3" allowed_values: "E4"} |
| 3549 * The accepted values at `organizations/foo` are `E1`, `E2`. |
| 3550 * The accepted values at `projects/bar` are `E3`, and `E4`. |
| 3551 * |
| 3552 * Example 2 (inherited values): |
| 3553 * `organizations/foo` has a `Policy` with values: |
| 3554 * {allowed_values: “E1” allowed_values:”E2”} |
| 3555 * `projects/bar` has a `Policy` with values: |
| 3556 * {value: “E3” value: ”E4” inherit_from_parent: true} |
| 3557 * The accepted values at `organizations/foo` are `E1`, `E2`. |
| 3558 * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. |
| 3559 * |
| 3560 * Example 3 (inheriting both allowed and denied values): |
| 3561 * `organizations/foo` has a `Policy` with values: |
| 3562 * {allowed_values: "E1" allowed_values: "E2"} |
| 3563 * `projects/bar` has a `Policy` with: |
| 3564 * {denied_values: "E1"} |
| 3565 * The accepted values at `organizations/foo` are `E1`, `E2`. |
| 3566 * The value accepted at `projects/bar` is `E2`. |
| 3567 * |
| 3568 * Example 4 (RestoreDefault): |
| 3569 * `organizations/foo` has a `Policy` with values: |
| 3570 * {allowed_values: “E1” allowed_values:”E2”} |
| 3571 * `projects/bar` has a `Policy` with values: |
| 3572 * {RestoreDefault: {}} |
| 3573 * The accepted values at `organizations/foo` are `E1`, `E2`. |
| 3574 * The accepted values at `projects/bar` are either all or none depending on |
| 3575 * the value of `constraint_default` (if `ALLOW`, all; if |
| 3576 * `DENY`, none). |
| 3577 * |
| 3578 * Example 5 (no policy inherits parent policy): |
| 3579 * `organizations/foo` has no `Policy` set. |
| 3580 * `projects/bar` has no `Policy` set. |
| 3581 * The accepted values at both levels are either all or none depending on |
| 3582 * the value of `constraint_default` (if `ALLOW`, all; if |
| 3583 * `DENY`, none). |
| 3584 * |
| 3585 * Example 6 (ListConstraint allowing all): |
| 3586 * `organizations/foo` has a `Policy` with values: |
| 3587 * {allowed_values: “E1” allowed_values: ”E2”} |
| 3588 * `projects/bar` has a `Policy` with: |
| 3589 * {all: ALLOW} |
| 3590 * The accepted values at `organizations/foo` are `E1`, E2`. |
| 3591 * Any value is accepted at `projects/bar`. |
| 3592 * |
| 3593 * Example 7 (ListConstraint allowing none): |
| 3594 * `organizations/foo` has a `Policy` with values: |
| 3595 * {allowed_values: “E1” allowed_values: ”E2”} |
| 3596 * `projects/bar` has a `Policy` with: |
| 3597 * {all: DENY} |
| 3598 * The accepted values at `organizations/foo` are `E1`, E2`. |
| 3599 * No value is accepted at `projects/bar`. |
| 3600 */ |
| 3601 core.bool inheritFromParent; |
| 3602 /** |
| 3603 * Optional. The Google Cloud Console will try to default to a configuration |
| 3604 * that matches the value specified in this `Policy`. If `suggested_value` |
| 3605 * is not set, it will inherit the value specified higher in the hierarchy, |
| 3606 * unless `inherit_from_parent` is `false`. |
| 3607 */ |
| 3608 core.String suggestedValue; |
| 3609 |
| 3610 ListPolicy(); |
| 3611 |
| 3612 ListPolicy.fromJson(core.Map _json) { |
| 3613 if (_json.containsKey("allValues")) { |
| 3614 allValues = _json["allValues"]; |
| 3615 } |
| 3616 if (_json.containsKey("allowedValues")) { |
| 3617 allowedValues = _json["allowedValues"]; |
| 3618 } |
| 3619 if (_json.containsKey("deniedValues")) { |
| 3620 deniedValues = _json["deniedValues"]; |
| 3621 } |
| 3622 if (_json.containsKey("inheritFromParent")) { |
| 3623 inheritFromParent = _json["inheritFromParent"]; |
| 3624 } |
| 3625 if (_json.containsKey("suggestedValue")) { |
| 3626 suggestedValue = _json["suggestedValue"]; |
| 3627 } |
| 3628 } |
| 3629 |
| 3630 core.Map toJson() { |
| 3631 var _json = new core.Map(); |
| 3632 if (allValues != null) { |
| 3633 _json["allValues"] = allValues; |
| 3634 } |
| 3635 if (allowedValues != null) { |
| 3636 _json["allowedValues"] = allowedValues; |
| 3637 } |
| 3638 if (deniedValues != null) { |
| 3639 _json["deniedValues"] = deniedValues; |
| 3640 } |
| 3641 if (inheritFromParent != null) { |
| 3642 _json["inheritFromParent"] = inheritFromParent; |
| 3643 } |
| 3644 if (suggestedValue != null) { |
| 3645 _json["suggestedValue"] = suggestedValue; |
| 3646 } |
| 3647 return _json; |
| 3648 } |
| 3649 } |
| 3650 |
1442 /** | 3651 /** |
1443 * A page of the response received from the | 3652 * A page of the response received from the |
1444 * ListProjects | 3653 * ListProjects |
1445 * method. | 3654 * method. |
1446 * | 3655 * |
1447 * A paginated response where more pages are available has | 3656 * A paginated response where more pages are available has |
1448 * `next_page_token` set. This token can be used in a subsequent request to | 3657 * `next_page_token` set. This token can be used in a subsequent request to |
1449 * retrieve the next request page. | 3658 * retrieve the next request page. |
1450 */ | 3659 */ |
1451 class ListProjectsResponse { | 3660 class ListProjectsResponse { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 _json["name"] = name; | 3780 _json["name"] = name; |
1572 } | 3781 } |
1573 if (response != null) { | 3782 if (response != null) { |
1574 _json["response"] = response; | 3783 _json["response"] = response; |
1575 } | 3784 } |
1576 return _json; | 3785 return _json; |
1577 } | 3786 } |
1578 } | 3787 } |
1579 | 3788 |
1580 /** | 3789 /** |
| 3790 * Defines a Cloud Organization `Policy` which is used to specify `Constraints` |
| 3791 * for configurations of Cloud Platform resources. |
| 3792 */ |
| 3793 class OrgPolicy { |
| 3794 /** For boolean `Constraints`, whether to enforce the `Constraint` or not. */ |
| 3795 BooleanPolicy booleanPolicy; |
| 3796 /** |
| 3797 * The name of the `Constraint` the `Policy` is configuring, for example, |
| 3798 * `constraints/serviceuser.services`. |
| 3799 * |
| 3800 * Immutable after creation. |
| 3801 */ |
| 3802 core.String constraint; |
| 3803 /** |
| 3804 * An opaque tag indicating the current version of the `Policy`, used for |
| 3805 * concurrency control. |
| 3806 * |
| 3807 * When the `Policy` is returned from either a `GetPolicy` or a |
| 3808 * `ListOrgPolicy` request, this `etag` indicates the version of the current |
| 3809 * `Policy` to use when executing a read-modify-write loop. |
| 3810 * |
| 3811 * When the `Policy` is returned from a `GetEffectivePolicy` request, the |
| 3812 * `etag` will be unset. |
| 3813 * |
| 3814 * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value |
| 3815 * that was returned from a `GetOrgPolicy` request as part of a |
| 3816 * read-modify-write loop for concurrency control. Not setting the `etag`in a |
| 3817 * `SetOrgPolicy` request will result in an unconditional write of the |
| 3818 * `Policy`. |
| 3819 */ |
| 3820 core.String etag; |
| 3821 core.List<core.int> get etagAsBytes { |
| 3822 return convert.BASE64.decode(etag); |
| 3823 } |
| 3824 |
| 3825 void set etagAsBytes(core.List<core.int> _bytes) { |
| 3826 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
| 3827 } |
| 3828 /** List of values either allowed or disallowed. */ |
| 3829 ListPolicy listPolicy; |
| 3830 /** |
| 3831 * Restores the default behavior of the constraint; independent of |
| 3832 * `Constraint` type. |
| 3833 */ |
| 3834 RestoreDefault restoreDefault; |
| 3835 /** |
| 3836 * The time stamp the `Policy` was previously updated. This is set by the |
| 3837 * server, not specified by the caller, and represents the last time a call to |
| 3838 * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will |
| 3839 * be ignored. |
| 3840 */ |
| 3841 core.String updateTime; |
| 3842 /** Version of the `Policy`. Default version is 0; */ |
| 3843 core.int version; |
| 3844 |
| 3845 OrgPolicy(); |
| 3846 |
| 3847 OrgPolicy.fromJson(core.Map _json) { |
| 3848 if (_json.containsKey("booleanPolicy")) { |
| 3849 booleanPolicy = new BooleanPolicy.fromJson(_json["booleanPolicy"]); |
| 3850 } |
| 3851 if (_json.containsKey("constraint")) { |
| 3852 constraint = _json["constraint"]; |
| 3853 } |
| 3854 if (_json.containsKey("etag")) { |
| 3855 etag = _json["etag"]; |
| 3856 } |
| 3857 if (_json.containsKey("listPolicy")) { |
| 3858 listPolicy = new ListPolicy.fromJson(_json["listPolicy"]); |
| 3859 } |
| 3860 if (_json.containsKey("restoreDefault")) { |
| 3861 restoreDefault = new RestoreDefault.fromJson(_json["restoreDefault"]); |
| 3862 } |
| 3863 if (_json.containsKey("updateTime")) { |
| 3864 updateTime = _json["updateTime"]; |
| 3865 } |
| 3866 if (_json.containsKey("version")) { |
| 3867 version = _json["version"]; |
| 3868 } |
| 3869 } |
| 3870 |
| 3871 core.Map toJson() { |
| 3872 var _json = new core.Map(); |
| 3873 if (booleanPolicy != null) { |
| 3874 _json["booleanPolicy"] = (booleanPolicy).toJson(); |
| 3875 } |
| 3876 if (constraint != null) { |
| 3877 _json["constraint"] = constraint; |
| 3878 } |
| 3879 if (etag != null) { |
| 3880 _json["etag"] = etag; |
| 3881 } |
| 3882 if (listPolicy != null) { |
| 3883 _json["listPolicy"] = (listPolicy).toJson(); |
| 3884 } |
| 3885 if (restoreDefault != null) { |
| 3886 _json["restoreDefault"] = (restoreDefault).toJson(); |
| 3887 } |
| 3888 if (updateTime != null) { |
| 3889 _json["updateTime"] = updateTime; |
| 3890 } |
| 3891 if (version != null) { |
| 3892 _json["version"] = version; |
| 3893 } |
| 3894 return _json; |
| 3895 } |
| 3896 } |
| 3897 |
| 3898 /** |
1581 * The root node in the resource hierarchy to which a particular entity's | 3899 * The root node in the resource hierarchy to which a particular entity's |
1582 * (e.g., company) resources belong. | 3900 * (e.g., company) resources belong. |
1583 */ | 3901 */ |
1584 class Organization { | 3902 class Organization { |
1585 /** | 3903 /** |
1586 * Timestamp when the Organization was created. Assigned by the server. | 3904 * Timestamp when the Organization was created. Assigned by the server. |
1587 * @OutputOnly | 3905 * @OutputOnly |
1588 */ | 3906 */ |
1589 core.String creationTime; | 3907 core.String creationTime; |
1590 /** | 3908 /** |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 * "role": "roles/viewer", | 4031 * "role": "roles/viewer", |
1714 * "members": ["user:sean@example.com"] | 4032 * "members": ["user:sean@example.com"] |
1715 * } | 4033 * } |
1716 * ] | 4034 * ] |
1717 * } | 4035 * } |
1718 * | 4036 * |
1719 * For a description of IAM and its features, see the | 4037 * For a description of IAM and its features, see the |
1720 * [IAM developer's guide](https://cloud.google.com/iam). | 4038 * [IAM developer's guide](https://cloud.google.com/iam). |
1721 */ | 4039 */ |
1722 class Policy { | 4040 class Policy { |
| 4041 /** Specifies cloud audit logging configuration for this policy. */ |
| 4042 core.List<AuditConfig> auditConfigs; |
1723 /** | 4043 /** |
1724 * Associates a list of `members` to a `role`. | 4044 * Associates a list of `members` to a `role`. |
1725 * Multiple `bindings` must not be specified for the same `role`. | 4045 * Multiple `bindings` must not be specified for the same `role`. |
1726 * `bindings` with no members will result in an error. | 4046 * `bindings` with no members will result in an error. |
1727 */ | 4047 */ |
1728 core.List<Binding> bindings; | 4048 core.List<Binding> bindings; |
1729 /** | 4049 /** |
1730 * `etag` is used for optimistic concurrency control as a way to help | 4050 * `etag` is used for optimistic concurrency control as a way to help |
1731 * prevent simultaneous updates of a policy from overwriting each other. | 4051 * prevent simultaneous updates of a policy from overwriting each other. |
1732 * It is strongly suggested that systems make use of the `etag` in the | 4052 * It is strongly suggested that systems make use of the `etag` in the |
(...skipping 12 matching lines...) Expand all Loading... |
1745 | 4065 |
1746 void set etagAsBytes(core.List<core.int> _bytes) { | 4066 void set etagAsBytes(core.List<core.int> _bytes) { |
1747 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 4067 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
1748 } | 4068 } |
1749 /** Version of the `Policy`. The default version is 0. */ | 4069 /** Version of the `Policy`. The default version is 0. */ |
1750 core.int version; | 4070 core.int version; |
1751 | 4071 |
1752 Policy(); | 4072 Policy(); |
1753 | 4073 |
1754 Policy.fromJson(core.Map _json) { | 4074 Policy.fromJson(core.Map _json) { |
| 4075 if (_json.containsKey("auditConfigs")) { |
| 4076 auditConfigs = _json["auditConfigs"].map((value) => new AuditConfig.fromJs
on(value)).toList(); |
| 4077 } |
1755 if (_json.containsKey("bindings")) { | 4078 if (_json.containsKey("bindings")) { |
1756 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); | 4079 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); |
1757 } | 4080 } |
1758 if (_json.containsKey("etag")) { | 4081 if (_json.containsKey("etag")) { |
1759 etag = _json["etag"]; | 4082 etag = _json["etag"]; |
1760 } | 4083 } |
1761 if (_json.containsKey("version")) { | 4084 if (_json.containsKey("version")) { |
1762 version = _json["version"]; | 4085 version = _json["version"]; |
1763 } | 4086 } |
1764 } | 4087 } |
1765 | 4088 |
1766 core.Map toJson() { | 4089 core.Map toJson() { |
1767 var _json = new core.Map(); | 4090 var _json = new core.Map(); |
| 4091 if (auditConfigs != null) { |
| 4092 _json["auditConfigs"] = auditConfigs.map((value) => (value).toJson()).toLi
st(); |
| 4093 } |
1768 if (bindings != null) { | 4094 if (bindings != null) { |
1769 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); | 4095 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); |
1770 } | 4096 } |
1771 if (etag != null) { | 4097 if (etag != null) { |
1772 _json["etag"] = etag; | 4098 _json["etag"] = etag; |
1773 } | 4099 } |
1774 if (version != null) { | 4100 if (version != null) { |
1775 _json["version"] = version; | 4101 _json["version"] = version; |
1776 } | 4102 } |
1777 return _json; | 4103 return _json; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 if (id != null) { | 4324 if (id != null) { |
1999 _json["id"] = id; | 4325 _json["id"] = id; |
2000 } | 4326 } |
2001 if (type != null) { | 4327 if (type != null) { |
2002 _json["type"] = type; | 4328 _json["type"] = type; |
2003 } | 4329 } |
2004 return _json; | 4330 return _json; |
2005 } | 4331 } |
2006 } | 4332 } |
2007 | 4333 |
| 4334 /** |
| 4335 * Ignores policies set above this resource and restores the |
| 4336 * `constraint_default` enforcement behavior of the specific `Constraint` at |
| 4337 * this resource. |
| 4338 * |
| 4339 * Suppose that `constraint_default` is set to `ALLOW` for the |
| 4340 * `Constraint` `constraints/serviceuser.services`. Suppose that organization |
| 4341 * foo.com sets a `Policy` at their Organization resource node that restricts |
| 4342 * the allowed service activations to deny all service activations. They |
| 4343 * could then set a `Policy` with the `policy_type` `restore_default` on |
| 4344 * several experimental projects, restoring the `constraint_default` |
| 4345 * enforcement of the `Constraint` for only those projects, allowing those |
| 4346 * projects to have all services activated. |
| 4347 */ |
| 4348 class RestoreDefault { |
| 4349 |
| 4350 RestoreDefault(); |
| 4351 |
| 4352 RestoreDefault.fromJson(core.Map _json) { |
| 4353 } |
| 4354 |
| 4355 core.Map toJson() { |
| 4356 var _json = new core.Map(); |
| 4357 return _json; |
| 4358 } |
| 4359 } |
| 4360 |
2008 /** The request sent to the `SearchOrganizations` method. */ | 4361 /** The request sent to the `SearchOrganizations` method. */ |
2009 class SearchOrganizationsRequest { | 4362 class SearchOrganizationsRequest { |
2010 /** | 4363 /** |
2011 * An optional query string used to filter the Organizations to return in | 4364 * An optional query string used to filter the Organizations to return in |
2012 * the response. Filter rules are case-insensitive. | 4365 * the response. Filter rules are case-insensitive. |
2013 * | 4366 * |
2014 * | 4367 * |
2015 * Organizations may be filtered by `owner.directoryCustomerId` or by | 4368 * Organizations may be filtered by `owner.directoryCustomerId` or by |
2016 * `domain`, where the domain is a Google for Work domain, for example: | 4369 * `domain`, where the domain is a Google for Work domain, for example: |
2017 * | 4370 * |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2106 | 4459 |
2107 /** Request message for `SetIamPolicy` method. */ | 4460 /** Request message for `SetIamPolicy` method. */ |
2108 class SetIamPolicyRequest { | 4461 class SetIamPolicyRequest { |
2109 /** | 4462 /** |
2110 * REQUIRED: The complete policy to be applied to the `resource`. The size of | 4463 * REQUIRED: The complete policy to be applied to the `resource`. The size of |
2111 * the policy is limited to a few 10s of KB. An empty policy is a | 4464 * the policy is limited to a few 10s of KB. An empty policy is a |
2112 * valid policy but certain Cloud Platform services (such as Projects) | 4465 * valid policy but certain Cloud Platform services (such as Projects) |
2113 * might reject them. | 4466 * might reject them. |
2114 */ | 4467 */ |
2115 Policy policy; | 4468 Policy policy; |
| 4469 /** |
| 4470 * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only |
| 4471 * the fields in the mask will be modified. If no mask is provided, the |
| 4472 * following default mask is used: |
| 4473 * paths: "bindings, etag" |
| 4474 * This field is only used by Cloud IAM. |
| 4475 */ |
| 4476 core.String updateMask; |
2116 | 4477 |
2117 SetIamPolicyRequest(); | 4478 SetIamPolicyRequest(); |
2118 | 4479 |
2119 SetIamPolicyRequest.fromJson(core.Map _json) { | 4480 SetIamPolicyRequest.fromJson(core.Map _json) { |
2120 if (_json.containsKey("policy")) { | 4481 if (_json.containsKey("policy")) { |
2121 policy = new Policy.fromJson(_json["policy"]); | 4482 policy = new Policy.fromJson(_json["policy"]); |
2122 } | 4483 } |
| 4484 if (_json.containsKey("updateMask")) { |
| 4485 updateMask = _json["updateMask"]; |
| 4486 } |
2123 } | 4487 } |
2124 | 4488 |
2125 core.Map toJson() { | 4489 core.Map toJson() { |
| 4490 var _json = new core.Map(); |
| 4491 if (policy != null) { |
| 4492 _json["policy"] = (policy).toJson(); |
| 4493 } |
| 4494 if (updateMask != null) { |
| 4495 _json["updateMask"] = updateMask; |
| 4496 } |
| 4497 return _json; |
| 4498 } |
| 4499 } |
| 4500 |
| 4501 /** The request sent to the SetOrgPolicyRequest method. */ |
| 4502 class SetOrgPolicyRequest { |
| 4503 /** `Policy` to set on the resource. */ |
| 4504 OrgPolicy policy; |
| 4505 |
| 4506 SetOrgPolicyRequest(); |
| 4507 |
| 4508 SetOrgPolicyRequest.fromJson(core.Map _json) { |
| 4509 if (_json.containsKey("policy")) { |
| 4510 policy = new OrgPolicy.fromJson(_json["policy"]); |
| 4511 } |
| 4512 } |
| 4513 |
| 4514 core.Map toJson() { |
2126 var _json = new core.Map(); | 4515 var _json = new core.Map(); |
2127 if (policy != null) { | 4516 if (policy != null) { |
2128 _json["policy"] = (policy).toJson(); | 4517 _json["policy"] = (policy).toJson(); |
2129 } | 4518 } |
2130 return _json; | 4519 return _json; |
2131 } | 4520 } |
2132 } | 4521 } |
2133 | 4522 |
2134 /** | 4523 /** |
2135 * The `Status` type defines a logical error model that is suitable for | 4524 * The `Status` type defines a logical error model that is suitable for |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 UndeleteProjectRequest(); | 4684 UndeleteProjectRequest(); |
2296 | 4685 |
2297 UndeleteProjectRequest.fromJson(core.Map _json) { | 4686 UndeleteProjectRequest.fromJson(core.Map _json) { |
2298 } | 4687 } |
2299 | 4688 |
2300 core.Map toJson() { | 4689 core.Map toJson() { |
2301 var _json = new core.Map(); | 4690 var _json = new core.Map(); |
2302 return _json; | 4691 return _json; |
2303 } | 4692 } |
2304 } | 4693 } |
OLD | NEW |