@maxim_mazurok/gapi.client.cloudresourcemanager-v2 0.0.20220807

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,885 @@
1
+ /* Type definitions for non-npm package Cloud Resource Manager API v2 0.0 */
2
+ // Project: https://cloud.google.com/resource-manager
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+ // TypeScript Version: 2.8
8
+
9
+ // IMPORTANT
10
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
11
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
12
+ // Generated from: https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v2
13
+ // Revision: 20220807
14
+
15
+ /// <reference types="gapi.client" />
16
+
17
+ declare namespace gapi.client {
18
+ /** Load Cloud Resource Manager API v2 */
19
+ function load(urlOrObject: "https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v2"): Promise<void>;
20
+ /** @deprecated Please load APIs with discovery documents. */
21
+ function load(name: "cloudresourcemanager", version: "v2"): Promise<void>;
22
+ /** @deprecated Please load APIs with discovery documents. */
23
+ function load(name: "cloudresourcemanager", version: "v2", callback: () => any): void;
24
+
25
+ namespace cloudresourcemanager {
26
+ interface AuditConfig {
27
+ /** The configuration for logging of each type of permission. */
28
+ auditLogConfigs?: AuditLogConfig[];
29
+ /**
30
+ * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all
31
+ * services.
32
+ */
33
+ service?: string;
34
+ }
35
+ interface AuditLogConfig {
36
+ /** Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. */
37
+ exemptedMembers?: string[];
38
+ /** The log type that this config enables. */
39
+ logType?: string;
40
+ }
41
+ interface Binding {
42
+ /**
43
+ * The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`,
44
+ * then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which
45
+ * resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
46
+ */
47
+ condition?: Expr;
48
+ /**
49
+ * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on
50
+ * the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service
51
+ * account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
52
+ * represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier
53
+ * for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example,
54
+ * `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. *
55
+ * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example,
56
+ * `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. *
57
+ * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example,
58
+ * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service
59
+ * account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently
60
+ * deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in
61
+ * the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
62
+ */
63
+ members?: string[];
64
+ /** Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */
65
+ role?: string;
66
+ }
67
+ interface CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation {
68
+ /** The resource name of the folder or organization we are either creating the folder under or moving the folder to. */
69
+ destinationParent?: string;
70
+ /** The display name of the folder. */
71
+ displayName?: string;
72
+ /** The type of this operation. */
73
+ operationType?: string;
74
+ /** The resource name of the folder's parent. Only applicable when the operation_type is MOVE. */
75
+ sourceParent?: string;
76
+ }
77
+ interface CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation {
78
+ /** The resource name of the folder or organization we are either creating the folder under or moving the folder to. */
79
+ destinationParent?: string;
80
+ /** The display name of the folder. */
81
+ displayName?: string;
82
+ /** The type of this operation. */
83
+ operationType?: string;
84
+ /** The resource name of the folder's parent. Only applicable when the operation_type is MOVE. */
85
+ sourceParent?: string;
86
+ }
87
+ interface CreateFolderMetadata {
88
+ /** The display name of the folder. */
89
+ displayName?: string;
90
+ /** The resource name of the folder or organization we are creating the folder under. */
91
+ parent?: string;
92
+ }
93
+ interface CreateProjectMetadata {
94
+ /** Creation time of the project creation workflow. */
95
+ createTime?: string;
96
+ /** True if the project can be retrieved using `GetProject`. No other operations on the project are guaranteed to work until the project creation is complete. */
97
+ gettable?: boolean;
98
+ /** True if the project creation process is complete. */
99
+ ready?: boolean;
100
+ }
101
+ // tslint:disable-next-line:no-empty-interface
102
+ interface CreateTagBindingMetadata {
103
+ }
104
+ // tslint:disable-next-line:no-empty-interface
105
+ interface CreateTagKeyMetadata {
106
+ }
107
+ // tslint:disable-next-line:no-empty-interface
108
+ interface CreateTagValueMetadata {
109
+ }
110
+ // tslint:disable-next-line:no-empty-interface
111
+ interface DeleteFolderMetadata {
112
+ }
113
+ // tslint:disable-next-line:no-empty-interface
114
+ interface DeleteOrganizationMetadata {
115
+ }
116
+ // tslint:disable-next-line:no-empty-interface
117
+ interface DeleteProjectMetadata {
118
+ }
119
+ // tslint:disable-next-line:no-empty-interface
120
+ interface DeleteTagBindingMetadata {
121
+ }
122
+ // tslint:disable-next-line:no-empty-interface
123
+ interface DeleteTagKeyMetadata {
124
+ }
125
+ // tslint:disable-next-line:no-empty-interface
126
+ interface DeleteTagValueMetadata {
127
+ }
128
+ interface Expr {
129
+ /** Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. */
130
+ description?: string;
131
+ /** Textual representation of an expression in Common Expression Language syntax. */
132
+ expression?: string;
133
+ /** Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. */
134
+ location?: string;
135
+ /** Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. */
136
+ title?: string;
137
+ }
138
+ interface Folder {
139
+ /** Output only. Timestamp when the Folder was created. Assigned by the server. */
140
+ createTime?: string;
141
+ /**
142
+ * The folder's display name. A folder's display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name
143
+ * must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. This is captured by the regular
144
+ * expression: `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`.
145
+ */
146
+ displayName?: string;
147
+ /** Output only. The lifecycle state of the folder. Updates to the lifecycle_state must be performed via DeleteFolder and UndeleteFolder. */
148
+ lifecycleState?: string;
149
+ /** Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234". */
150
+ name?: string;
151
+ /** Required. The Folder's parent's resource name. Updates to the folder's parent must be performed via MoveFolder. */
152
+ parent?: string;
153
+ }
154
+ interface FolderOperation {
155
+ /** The resource name of the folder or organization we are either creating the folder under or moving the folder to. */
156
+ destinationParent?: string;
157
+ /** The display name of the folder. */
158
+ displayName?: string;
159
+ /** The type of this operation. */
160
+ operationType?: string;
161
+ /** The resource name of the folder's parent. Only applicable when the operation_type is MOVE. */
162
+ sourceParent?: string;
163
+ }
164
+ interface FolderOperationError {
165
+ /** The type of operation error experienced. */
166
+ errorMessageId?: string;
167
+ }
168
+ interface GetIamPolicyRequest {
169
+ /** OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. */
170
+ options?: GetPolicyOptions;
171
+ }
172
+ interface GetPolicyOptions {
173
+ /**
174
+ * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for
175
+ * policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in
176
+ * the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role
177
+ * bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM
178
+ * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
179
+ */
180
+ requestedPolicyVersion?: number;
181
+ }
182
+ interface ListFoldersResponse {
183
+ /** A possibly paginated list of Folders that are direct descendants of the specified parent resource. */
184
+ folders?: Folder[];
185
+ /** A pagination token returned from a previous call to `ListFolders` that indicates from where listing should continue. */
186
+ nextPageToken?: string;
187
+ }
188
+ interface MoveFolderMetadata {
189
+ /** The resource name of the folder or organization to move the folder to. */
190
+ destinationParent?: string;
191
+ /** The display name of the folder. */
192
+ displayName?: string;
193
+ /** The resource name of the folder's parent. */
194
+ sourceParent?: string;
195
+ }
196
+ interface MoveFolderRequest {
197
+ /** Required. The resource name of the Folder or Organization to reparent the folder under. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. */
198
+ destinationParent?: string;
199
+ }
200
+ // tslint:disable-next-line:no-empty-interface
201
+ interface MoveProjectMetadata {
202
+ }
203
+ interface Operation {
204
+ /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
205
+ done?: boolean;
206
+ /** The error result of the operation in case of failure or cancellation. */
207
+ error?: Status;
208
+ /**
209
+ * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such
210
+ * metadata. Any method that returns a long-running operation should document the metadata type, if any.
211
+ */
212
+ metadata?: { [P in string]: any };
213
+ /**
214
+ * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending
215
+ * with `operations/{unique_id}`.
216
+ */
217
+ name?: string;
218
+ /**
219
+ * The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the
220
+ * original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the
221
+ * original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
222
+ */
223
+ response?: { [P in string]: any };
224
+ }
225
+ interface Policy {
226
+ /** Specifies cloud audit logging configuration for this policy. */
227
+ auditConfigs?: AuditConfig[];
228
+ /**
229
+ * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings`
230
+ * must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a
231
+ * principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another
232
+ * 1,450 principals to the `bindings` in the `Policy`.
233
+ */
234
+ bindings?: Binding[];
235
+ /**
236
+ * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make
237
+ * use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems
238
+ * are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM
239
+ * Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1`
240
+ * policy, and all of the conditions in the version `3` policy are lost.
241
+ */
242
+ etag?: string;
243
+ /**
244
+ * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings
245
+ * must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a
246
+ * policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use
247
+ * IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1`
248
+ * policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave
249
+ * the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
250
+ */
251
+ version?: number;
252
+ }
253
+ interface ProjectCreationStatus {
254
+ /** Creation time of the project creation workflow. */
255
+ createTime?: string;
256
+ /** True if the project can be retrieved using GetProject. No other operations on the project are guaranteed to work until the project creation is complete. */
257
+ gettable?: boolean;
258
+ /** True if the project creation process is complete. */
259
+ ready?: boolean;
260
+ }
261
+ interface SearchFoldersRequest {
262
+ /** Optional. The maximum number of folders to return in the response. The server can return fewer folders than requested. If unspecified, server picks an appropriate default. */
263
+ pageSize?: number;
264
+ /** Optional. A pagination token returned from a previous call to `SearchFolders` that indicates from where search should continue. */
265
+ pageToken?: string;
266
+ /**
267
+ * Search criteria used to select the Folders to return. If no search criteria is specified then all accessible folders will be returned. Query expressions can be used to restrict
268
+ * results based upon displayName, lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` can be used along with the suffix wildcard symbol `*`. The displayName
269
+ * field in a query expression should use escaped quotes for values that include whitespace to prevent unexpected behavior. Some example queries are: * Query `displayName=Test*`
270
+ * returns Folder resources whose display name starts with "Test". * Query `lifecycleState=ACTIVE` returns Folder resources with `lifecycleState` set to `ACTIVE`. * Query
271
+ * `parent=folders/123` returns Folder resources that have `folders/123` as a parent resource. * Query `parent=folders/123 AND lifecycleState=ACTIVE` returns active Folder resources
272
+ * that have `folders/123` as a parent resource. * Query `displayName=\\"Test String\\"` returns Folder resources with display names that include both "Test" and "String".
273
+ */
274
+ query?: string;
275
+ }
276
+ interface SearchFoldersResponse {
277
+ /** A possibly paginated folder search results. the specified parent resource. */
278
+ folders?: Folder[];
279
+ /** A pagination token returned from a previous call to `SearchFolders` that indicates from where searching should continue. */
280
+ nextPageToken?: string;
281
+ }
282
+ interface SetIamPolicyRequest {
283
+ /**
284
+ * REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud
285
+ * services (such as Projects) might reject them.
286
+ */
287
+ policy?: Policy;
288
+ /**
289
+ * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:
290
+ * `paths: "bindings, etag"`
291
+ */
292
+ updateMask?: string;
293
+ }
294
+ interface Status {
295
+ /** The status code, which should be an enum value of google.rpc.Code. */
296
+ code?: number;
297
+ /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
298
+ details?: Array<{ [P in string]: any }>;
299
+ /**
300
+ * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the
301
+ * client.
302
+ */
303
+ message?: string;
304
+ }
305
+ interface TestIamPermissionsRequest {
306
+ /**
307
+ * The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM
308
+ * Overview](https://cloud.google.com/iam/docs/overview#permissions).
309
+ */
310
+ permissions?: string[];
311
+ }
312
+ interface TestIamPermissionsResponse {
313
+ /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */
314
+ permissions?: string[];
315
+ }
316
+ // tslint:disable-next-line:no-empty-interface
317
+ interface UndeleteFolderMetadata {
318
+ }
319
+ // tslint:disable-next-line:no-empty-interface
320
+ interface UndeleteFolderRequest {
321
+ }
322
+ // tslint:disable-next-line:no-empty-interface
323
+ interface UndeleteOrganizationMetadata {
324
+ }
325
+ // tslint:disable-next-line:no-empty-interface
326
+ interface UndeleteProjectMetadata {
327
+ }
328
+ // tslint:disable-next-line:no-empty-interface
329
+ interface UpdateFolderMetadata {
330
+ }
331
+ // tslint:disable-next-line:no-empty-interface
332
+ interface UpdateProjectMetadata {
333
+ }
334
+ // tslint:disable-next-line:no-empty-interface
335
+ interface UpdateTagKeyMetadata {
336
+ }
337
+ // tslint:disable-next-line:no-empty-interface
338
+ interface UpdateTagValueMetadata {
339
+ }
340
+ interface FoldersResource {
341
+ /**
342
+ * Creates a Folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success the Operation.response field
343
+ * will be populated with the created Folder. In order to succeed, the addition of this new Folder must not violate the Folder naming, height or fanout constraints. + The Folder's
344
+ * display_name must be distinct from all other Folders that share its parent. + The addition of the Folder must not cause the active Folder hierarchy to exceed a height of 10. Note,
345
+ * the full active + deleted Folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders. + The addition of
346
+ * the Folder must not cause the total number of Folders under its parent to exceed 300. If the operation fails due to a folder constraint violation, some errors may be returned by the
347
+ * CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific
348
+ * PreconditionFailure returned via the details list in the Operation.error field. The caller must have `resourcemanager.folders.create` permission on the identified parent.
349
+ */
350
+ create(request: {
351
+ /** V1 error format. */
352
+ "$.xgafv"?: string;
353
+ /** OAuth access token. */
354
+ access_token?: string;
355
+ /** Data format for response. */
356
+ alt?: string;
357
+ /** JSONP */
358
+ callback?: string;
359
+ /** Selector specifying which fields to include in a partial response. */
360
+ fields?: string;
361
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
362
+ key?: string;
363
+ /** OAuth 2.0 token for the current user. */
364
+ oauth_token?: string;
365
+ /** Required. The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. */
366
+ parent?: string;
367
+ /** Returns response with indentations and line breaks. */
368
+ prettyPrint?: boolean;
369
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
370
+ quotaUser?: string;
371
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
372
+ upload_protocol?: string;
373
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
374
+ uploadType?: string;
375
+ /** Request body */
376
+ resource: Folder;
377
+ }): Request<Operation>;
378
+ create(request: {
379
+ /** V1 error format. */
380
+ "$.xgafv"?: string;
381
+ /** OAuth access token. */
382
+ access_token?: string;
383
+ /** Data format for response. */
384
+ alt?: string;
385
+ /** JSONP */
386
+ callback?: string;
387
+ /** Selector specifying which fields to include in a partial response. */
388
+ fields?: string;
389
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
390
+ key?: string;
391
+ /** OAuth 2.0 token for the current user. */
392
+ oauth_token?: string;
393
+ /** Required. The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. */
394
+ parent?: string;
395
+ /** Returns response with indentations and line breaks. */
396
+ prettyPrint?: boolean;
397
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
398
+ quotaUser?: string;
399
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
400
+ upload_protocol?: string;
401
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
402
+ uploadType?: string;
403
+ },
404
+ body: Folder): Request<Operation>;
405
+ /**
406
+ * Requests deletion of a Folder. The Folder is moved into the DELETE_REQUESTED state immediately, and is deleted approximately 30 days later. This method may only be called on an
407
+ * empty Folder in the ACTIVE state, where a Folder is empty if it doesn't contain any Folders or Projects in the ACTIVE state. The caller must have `resourcemanager.folders.delete`
408
+ * permission on the identified folder.
409
+ */
410
+ delete(request?: {
411
+ /** V1 error format. */
412
+ "$.xgafv"?: string;
413
+ /** OAuth access token. */
414
+ access_token?: string;
415
+ /** Data format for response. */
416
+ alt?: string;
417
+ /** JSONP */
418
+ callback?: string;
419
+ /** Selector specifying which fields to include in a partial response. */
420
+ fields?: string;
421
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
422
+ key?: string;
423
+ /** Required. the resource name of the Folder to be deleted. Must be of the form `folders/{folder_id}`. */
424
+ name: string;
425
+ /** OAuth 2.0 token for the current user. */
426
+ oauth_token?: string;
427
+ /** Returns response with indentations and line breaks. */
428
+ prettyPrint?: boolean;
429
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
430
+ quotaUser?: string;
431
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
432
+ upload_protocol?: string;
433
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
434
+ uploadType?: string;
435
+ }): Request<Folder>;
436
+ /**
437
+ * Retrieves a Folder identified by the supplied resource name. Valid Folder resource names have the format `folders/{folder_id}` (for example, `folders/1234`). The caller must have
438
+ * `resourcemanager.folders.get` permission on the identified folder.
439
+ */
440
+ get(request?: {
441
+ /** V1 error format. */
442
+ "$.xgafv"?: string;
443
+ /** OAuth access token. */
444
+ access_token?: string;
445
+ /** Data format for response. */
446
+ alt?: string;
447
+ /** JSONP */
448
+ callback?: string;
449
+ /** Selector specifying which fields to include in a partial response. */
450
+ fields?: string;
451
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
452
+ key?: string;
453
+ /** Required. The resource name of the Folder to retrieve. Must be of the form `folders/{folder_id}`. */
454
+ name: string;
455
+ /** OAuth 2.0 token for the current user. */
456
+ oauth_token?: string;
457
+ /** Returns response with indentations and line breaks. */
458
+ prettyPrint?: boolean;
459
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
460
+ quotaUser?: string;
461
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
462
+ upload_protocol?: string;
463
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
464
+ uploadType?: string;
465
+ }): Request<Folder>;
466
+ /**
467
+ * Gets the access control policy for a Folder. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the Folder's resource name, e.g.
468
+ * "folders/1234". The caller must have `resourcemanager.folders.getIamPolicy` permission on the identified folder.
469
+ */
470
+ getIamPolicy(request: {
471
+ /** V1 error format. */
472
+ "$.xgafv"?: string;
473
+ /** OAuth access token. */
474
+ access_token?: string;
475
+ /** Data format for response. */
476
+ alt?: string;
477
+ /** JSONP */
478
+ callback?: string;
479
+ /** Selector specifying which fields to include in a partial response. */
480
+ fields?: string;
481
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
482
+ key?: string;
483
+ /** OAuth 2.0 token for the current user. */
484
+ oauth_token?: string;
485
+ /** Returns response with indentations and line breaks. */
486
+ prettyPrint?: boolean;
487
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
488
+ quotaUser?: string;
489
+ /**
490
+ * REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
491
+ * field.
492
+ */
493
+ resource: string;
494
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
495
+ upload_protocol?: string;
496
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
497
+ uploadType?: string;
498
+ },
499
+ body: GetIamPolicyRequest): Request<Policy>;
500
+ /**
501
+ * Lists the Folders that are direct descendants of supplied parent resource. List provides a strongly consistent view of the Folders underneath the specified parent resource. List
502
+ * returns Folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have `resourcemanager.folders.list` permission on the identified parent.
503
+ */
504
+ list(request?: {
505
+ /** V1 error format. */
506
+ "$.xgafv"?: string;
507
+ /** OAuth access token. */
508
+ access_token?: string;
509
+ /** Data format for response. */
510
+ alt?: string;
511
+ /** JSONP */
512
+ callback?: string;
513
+ /** Selector specifying which fields to include in a partial response. */
514
+ fields?: string;
515
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
516
+ key?: string;
517
+ /** OAuth 2.0 token for the current user. */
518
+ oauth_token?: string;
519
+ /** Optional. The maximum number of Folders to return in the response. The server can return fewer folders than requested. If unspecified, server picks an appropriate default. */
520
+ pageSize?: number;
521
+ /** Optional. A pagination token returned from a previous call to `ListFolders` that indicates where this listing should continue from. */
522
+ pageToken?: string;
523
+ /**
524
+ * Required. The resource name of the Organization or Folder whose Folders are being listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to this
525
+ * method is controlled by checking the `resourcemanager.folders.list` permission on the `parent`.
526
+ */
527
+ parent?: string;
528
+ /** Returns response with indentations and line breaks. */
529
+ prettyPrint?: boolean;
530
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
531
+ quotaUser?: string;
532
+ /** Optional. Controls whether Folders in the DELETE_REQUESTED state should be returned. Defaults to false. */
533
+ showDeleted?: boolean;
534
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
535
+ upload_protocol?: string;
536
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
537
+ uploadType?: string;
538
+ }): Request<ListFoldersResponse>;
539
+ /**
540
+ * Moves a Folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success the Operation.response field will
541
+ * be populated with the moved Folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the
542
+ * FolderOperationError will be returned via the Status.details field and if it occurs asynchronously then the FolderOperation will be returned via the Operation.error field. In
543
+ * addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the
544
+ * naming, height or fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.move` permission on the folder's current and proposed
545
+ * new parent.
546
+ */
547
+ move(request: {
548
+ /** V1 error format. */
549
+ "$.xgafv"?: string;
550
+ /** OAuth access token. */
551
+ access_token?: string;
552
+ /** Data format for response. */
553
+ alt?: string;
554
+ /** JSONP */
555
+ callback?: string;
556
+ /** Selector specifying which fields to include in a partial response. */
557
+ fields?: string;
558
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
559
+ key?: string;
560
+ /** Required. The resource name of the Folder to move. Must be of the form folders/{folder_id} */
561
+ name: string;
562
+ /** OAuth 2.0 token for the current user. */
563
+ oauth_token?: string;
564
+ /** Returns response with indentations and line breaks. */
565
+ prettyPrint?: boolean;
566
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
567
+ quotaUser?: string;
568
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
569
+ upload_protocol?: string;
570
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
571
+ uploadType?: string;
572
+ /** Request body */
573
+ resource: MoveFolderRequest;
574
+ }): Request<Operation>;
575
+ move(request: {
576
+ /** V1 error format. */
577
+ "$.xgafv"?: string;
578
+ /** OAuth access token. */
579
+ access_token?: string;
580
+ /** Data format for response. */
581
+ alt?: string;
582
+ /** JSONP */
583
+ callback?: string;
584
+ /** Selector specifying which fields to include in a partial response. */
585
+ fields?: string;
586
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
587
+ key?: string;
588
+ /** Required. The resource name of the Folder to move. Must be of the form folders/{folder_id} */
589
+ name: string;
590
+ /** OAuth 2.0 token for the current user. */
591
+ oauth_token?: string;
592
+ /** Returns response with indentations and line breaks. */
593
+ prettyPrint?: boolean;
594
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
595
+ quotaUser?: string;
596
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
597
+ upload_protocol?: string;
598
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
599
+ uploadType?: string;
600
+ },
601
+ body: MoveFolderRequest): Request<Operation>;
602
+ /**
603
+ * Updates a Folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or naming constraints
604
+ * described in the CreateFolder documentation. The Folder's display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and
605
+ * can be between 3 and 30 characters. This is captured by the regular expression: `\p{L}\p{N}{1,28}[\p{L}\p{N}]`. The caller must have `resourcemanager.folders.update` permission on
606
+ * the identified folder. If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.
607
+ */
608
+ patch(request: {
609
+ /** V1 error format. */
610
+ "$.xgafv"?: string;
611
+ /** OAuth access token. */
612
+ access_token?: string;
613
+ /** Data format for response. */
614
+ alt?: string;
615
+ /** JSONP */
616
+ callback?: string;
617
+ /** Selector specifying which fields to include in a partial response. */
618
+ fields?: string;
619
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
620
+ key?: string;
621
+ /** Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234". */
622
+ name: string;
623
+ /** OAuth 2.0 token for the current user. */
624
+ oauth_token?: string;
625
+ /** Returns response with indentations and line breaks. */
626
+ prettyPrint?: boolean;
627
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
628
+ quotaUser?: string;
629
+ /** Required. Fields to be updated. Only the `display_name` can be updated. */
630
+ updateMask?: string;
631
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
632
+ upload_protocol?: string;
633
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
634
+ uploadType?: string;
635
+ /** Request body */
636
+ resource: Folder;
637
+ }): Request<Folder>;
638
+ patch(request: {
639
+ /** V1 error format. */
640
+ "$.xgafv"?: string;
641
+ /** OAuth access token. */
642
+ access_token?: string;
643
+ /** Data format for response. */
644
+ alt?: string;
645
+ /** JSONP */
646
+ callback?: string;
647
+ /** Selector specifying which fields to include in a partial response. */
648
+ fields?: string;
649
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
650
+ key?: string;
651
+ /** Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234". */
652
+ name: string;
653
+ /** OAuth 2.0 token for the current user. */
654
+ oauth_token?: string;
655
+ /** Returns response with indentations and line breaks. */
656
+ prettyPrint?: boolean;
657
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
658
+ quotaUser?: string;
659
+ /** Required. Fields to be updated. Only the `display_name` can be updated. */
660
+ updateMask?: string;
661
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
662
+ upload_protocol?: string;
663
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
664
+ uploadType?: string;
665
+ },
666
+ body: Folder): Request<Folder>;
667
+ /**
668
+ * Search for folders that match specific filter criteria. Search provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria.
669
+ * This will only return folders on which the caller has the permission `resourcemanager.folders.get`.
670
+ */
671
+ search(request: {
672
+ /** V1 error format. */
673
+ "$.xgafv"?: string;
674
+ /** OAuth access token. */
675
+ access_token?: string;
676
+ /** Data format for response. */
677
+ alt?: string;
678
+ /** JSONP */
679
+ callback?: string;
680
+ /** Selector specifying which fields to include in a partial response. */
681
+ fields?: string;
682
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
683
+ key?: string;
684
+ /** OAuth 2.0 token for the current user. */
685
+ oauth_token?: string;
686
+ /** Returns response with indentations and line breaks. */
687
+ prettyPrint?: boolean;
688
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
689
+ quotaUser?: string;
690
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
691
+ upload_protocol?: string;
692
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
693
+ uploadType?: string;
694
+ /** Request body */
695
+ resource: SearchFoldersRequest;
696
+ }): Request<SearchFoldersResponse>;
697
+ search(request: {
698
+ /** V1 error format. */
699
+ "$.xgafv"?: string;
700
+ /** OAuth access token. */
701
+ access_token?: string;
702
+ /** Data format for response. */
703
+ alt?: string;
704
+ /** JSONP */
705
+ callback?: string;
706
+ /** Selector specifying which fields to include in a partial response. */
707
+ fields?: string;
708
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
709
+ key?: string;
710
+ /** OAuth 2.0 token for the current user. */
711
+ oauth_token?: string;
712
+ /** Returns response with indentations and line breaks. */
713
+ prettyPrint?: boolean;
714
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
715
+ quotaUser?: string;
716
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
717
+ upload_protocol?: string;
718
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
719
+ uploadType?: string;
720
+ },
721
+ body: SearchFoldersRequest): Request<SearchFoldersResponse>;
722
+ /**
723
+ * Sets the access control policy on a Folder, replacing any existing policy. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have
724
+ * `resourcemanager.folders.setIamPolicy` permission on the identified folder.
725
+ */
726
+ setIamPolicy(request: {
727
+ /** V1 error format. */
728
+ "$.xgafv"?: string;
729
+ /** OAuth access token. */
730
+ access_token?: string;
731
+ /** Data format for response. */
732
+ alt?: string;
733
+ /** JSONP */
734
+ callback?: string;
735
+ /** Selector specifying which fields to include in a partial response. */
736
+ fields?: string;
737
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
738
+ key?: string;
739
+ /** OAuth 2.0 token for the current user. */
740
+ oauth_token?: string;
741
+ /** Returns response with indentations and line breaks. */
742
+ prettyPrint?: boolean;
743
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
744
+ quotaUser?: string;
745
+ /**
746
+ * REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
747
+ * field.
748
+ */
749
+ resource: string;
750
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
751
+ upload_protocol?: string;
752
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
753
+ uploadType?: string;
754
+ },
755
+ body: SetIamPolicyRequest): Request<Policy>;
756
+ /**
757
+ * Returns permissions that a caller has on the specified Folder. The `resource` field should be the Folder's resource name, e.g. "folders/1234". There are no permissions required for
758
+ * making this API call.
759
+ */
760
+ testIamPermissions(request: {
761
+ /** V1 error format. */
762
+ "$.xgafv"?: string;
763
+ /** OAuth access token. */
764
+ access_token?: string;
765
+ /** Data format for response. */
766
+ alt?: string;
767
+ /** JSONP */
768
+ callback?: string;
769
+ /** Selector specifying which fields to include in a partial response. */
770
+ fields?: string;
771
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
772
+ key?: string;
773
+ /** OAuth 2.0 token for the current user. */
774
+ oauth_token?: string;
775
+ /** Returns response with indentations and line breaks. */
776
+ prettyPrint?: boolean;
777
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
778
+ quotaUser?: string;
779
+ /**
780
+ * REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
781
+ * this field.
782
+ */
783
+ resource: string;
784
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
785
+ upload_protocol?: string;
786
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
787
+ uploadType?: string;
788
+ },
789
+ body: TestIamPermissionsRequest): Request<TestIamPermissionsResponse>;
790
+ /**
791
+ * Cancels the deletion request for a Folder. This method may only be called on a Folder in the DELETE_REQUESTED state. In order to succeed, the Folder's parent must be in the ACTIVE
792
+ * state. In addition, reintroducing the folder into the tree must not violate folder naming, height and fanout constraints described in the CreateFolder documentation. The caller must
793
+ * have `resourcemanager.folders.undelete` permission on the identified folder.
794
+ */
795
+ undelete(request: {
796
+ /** V1 error format. */
797
+ "$.xgafv"?: string;
798
+ /** OAuth access token. */
799
+ access_token?: string;
800
+ /** Data format for response. */
801
+ alt?: string;
802
+ /** JSONP */
803
+ callback?: string;
804
+ /** Selector specifying which fields to include in a partial response. */
805
+ fields?: string;
806
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
807
+ key?: string;
808
+ /** Required. The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`. */
809
+ name: string;
810
+ /** OAuth 2.0 token for the current user. */
811
+ oauth_token?: string;
812
+ /** Returns response with indentations and line breaks. */
813
+ prettyPrint?: boolean;
814
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
815
+ quotaUser?: string;
816
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
817
+ upload_protocol?: string;
818
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
819
+ uploadType?: string;
820
+ /** Request body */
821
+ resource: UndeleteFolderRequest;
822
+ }): Request<Folder>;
823
+ undelete(request: {
824
+ /** V1 error format. */
825
+ "$.xgafv"?: string;
826
+ /** OAuth access token. */
827
+ access_token?: string;
828
+ /** Data format for response. */
829
+ alt?: string;
830
+ /** JSONP */
831
+ callback?: string;
832
+ /** Selector specifying which fields to include in a partial response. */
833
+ fields?: string;
834
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
835
+ key?: string;
836
+ /** Required. The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`. */
837
+ name: string;
838
+ /** OAuth 2.0 token for the current user. */
839
+ oauth_token?: string;
840
+ /** Returns response with indentations and line breaks. */
841
+ prettyPrint?: boolean;
842
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
843
+ quotaUser?: string;
844
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
845
+ upload_protocol?: string;
846
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
847
+ uploadType?: string;
848
+ },
849
+ body: UndeleteFolderRequest): Request<Folder>;
850
+ }
851
+ interface OperationsResource {
852
+ /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
853
+ get(request?: {
854
+ /** V1 error format. */
855
+ "$.xgafv"?: string;
856
+ /** OAuth access token. */
857
+ access_token?: string;
858
+ /** Data format for response. */
859
+ alt?: string;
860
+ /** JSONP */
861
+ callback?: string;
862
+ /** Selector specifying which fields to include in a partial response. */
863
+ fields?: string;
864
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
865
+ key?: string;
866
+ /** The name of the operation resource. */
867
+ name: string;
868
+ /** OAuth 2.0 token for the current user. */
869
+ oauth_token?: string;
870
+ /** Returns response with indentations and line breaks. */
871
+ prettyPrint?: boolean;
872
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
873
+ quotaUser?: string;
874
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
875
+ upload_protocol?: string;
876
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
877
+ uploadType?: string;
878
+ }): Request<Operation>;
879
+ }
880
+
881
+ const folders: FoldersResource;
882
+
883
+ const operations: OperationsResource;
884
+ }
885
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.cloudresourcemanager-v2",
3
+ "version": "0.0.20220807",
4
+ "description": "TypeScript typings for Cloud Resource Manager API v2",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,131 @@
1
+ # TypeScript typings for Cloud Resource Manager API v2
2
+
3
+ Creates, reads, and updates metadata for Google Cloud Platform resource containers.
4
+ For detailed description please check [documentation](https://cloud.google.com/resource-manager).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Cloud Resource Manager API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.cloudresourcemanager-v2 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v2', () => {
29
+ // now we can use:
30
+ // gapi.client.cloudresourcemanager
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('cloudresourcemanager', 'v2', () => {
37
+ // now we can use:
38
+ // gapi.client.cloudresourcemanager
39
+ });
40
+ ```
41
+
42
+ Don't forget to authenticate your client before sending any request to resources:
43
+
44
+ ```typescript
45
+ // declare client_id registered in Google Developers Console
46
+ var client_id = '',
47
+ scope = [
48
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
49
+ 'https://www.googleapis.com/auth/cloud-platform',
50
+
51
+ // View your data across Google Cloud services and see the email address of your Google Account
52
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ { client_id: client_id, scope: scope, immediate: immediate },
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ });
66
+ ```
67
+
68
+ After that you can use Cloud Resource Manager API resources: <!-- TODO: make this work for multiple namespaces -->
69
+
70
+ ```typescript
71
+
72
+ /*
73
+ Creates a Folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success the Operation.response field will be populated with the created Folder. In order to succeed, the addition of this new Folder must not violate the Folder naming, height or fanout constraints. + The Folder's display_name must be distinct from all other Folders that share its parent. + The addition of the Folder must not cause the active Folder hierarchy to exceed a height of 10. Note, the full active + deleted Folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders. + The addition of the Folder must not cause the total number of Folders under its parent to exceed 300. If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned via the details list in the Operation.error field. The caller must have `resourcemanager.folders.create` permission on the identified parent.
74
+ */
75
+ await gapi.client.cloudresourcemanager.folders.create({ });
76
+
77
+ /*
78
+ Requests deletion of a Folder. The Folder is moved into the DELETE_REQUESTED state immediately, and is deleted approximately 30 days later. This method may only be called on an empty Folder in the ACTIVE state, where a Folder is empty if it doesn't contain any Folders or Projects in the ACTIVE state. The caller must have `resourcemanager.folders.delete` permission on the identified folder.
79
+ */
80
+ await gapi.client.cloudresourcemanager.folders.delete({ name: "name", });
81
+
82
+ /*
83
+ Retrieves a Folder identified by the supplied resource name. Valid Folder resource names have the format `folders/{folder_id}` (for example, `folders/1234`). The caller must have `resourcemanager.folders.get` permission on the identified folder.
84
+ */
85
+ await gapi.client.cloudresourcemanager.folders.get({ name: "name", });
86
+
87
+ /*
88
+ Gets the access control policy for a Folder. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have `resourcemanager.folders.getIamPolicy` permission on the identified folder.
89
+ */
90
+ await gapi.client.cloudresourcemanager.folders.getIamPolicy({ resource: "resource", });
91
+
92
+ /*
93
+ Lists the Folders that are direct descendants of supplied parent resource. List provides a strongly consistent view of the Folders underneath the specified parent resource. List returns Folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have `resourcemanager.folders.list` permission on the identified parent.
94
+ */
95
+ await gapi.client.cloudresourcemanager.folders.list({ });
96
+
97
+ /*
98
+ Moves a Folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success the Operation.response field will be populated with the moved Folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned via the Status.details field and if it occurs asynchronously then the FolderOperation will be returned via the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height or fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.move` permission on the folder's current and proposed new parent.
99
+ */
100
+ await gapi.client.cloudresourcemanager.folders.move({ name: "name", });
101
+
102
+ /*
103
+ Updates a Folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or naming constraints described in the CreateFolder documentation. The Folder's display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: `\p{L}\p{N}{1,28}[\p{L}\p{N}]`. The caller must have `resourcemanager.folders.update` permission on the identified folder. If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.
104
+ */
105
+ await gapi.client.cloudresourcemanager.folders.patch({ name: "name", });
106
+
107
+ /*
108
+ Search for folders that match specific filter criteria. Search provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria. This will only return folders on which the caller has the permission `resourcemanager.folders.get`.
109
+ */
110
+ await gapi.client.cloudresourcemanager.folders.search({ });
111
+
112
+ /*
113
+ Sets the access control policy on a Folder, replacing any existing policy. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have `resourcemanager.folders.setIamPolicy` permission on the identified folder.
114
+ */
115
+ await gapi.client.cloudresourcemanager.folders.setIamPolicy({ resource: "resource", });
116
+
117
+ /*
118
+ Returns permissions that a caller has on the specified Folder. The `resource` field should be the Folder's resource name, e.g. "folders/1234". There are no permissions required for making this API call.
119
+ */
120
+ await gapi.client.cloudresourcemanager.folders.testIamPermissions({ resource: "resource", });
121
+
122
+ /*
123
+ Cancels the deletion request for a Folder. This method may only be called on a Folder in the DELETE_REQUESTED state. In order to succeed, the Folder's parent must be in the ACTIVE state. In addition, reintroducing the folder into the tree must not violate folder naming, height and fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.undelete` permission on the identified folder.
124
+ */
125
+ await gapi.client.cloudresourcemanager.folders.undelete({ name: "name", });
126
+
127
+ /*
128
+ Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
129
+ */
130
+ await gapi.client.cloudresourcemanager.operations.get({ name: "name", });
131
+ ```
package/tests.ts ADDED
@@ -0,0 +1,191 @@
1
+ /* This is stub file for gapi.client.cloudresourcemanager-v2 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20220807
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v2');
12
+ /** now we can use gapi.client.cloudresourcemanager */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
19
+ 'https://www.googleapis.com/auth/cloud-platform',
20
+ /** View your data across Google Cloud services and see the email address of your Google Account */
21
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
22
+ ];
23
+ const immediate = false;
24
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
25
+ if (authResult && !authResult.error) {
26
+ /** handle successful authorization */
27
+ run();
28
+ } else {
29
+ /** handle authorization error */
30
+ }
31
+ });
32
+
33
+ async function run() {
34
+ /**
35
+ * Creates a Folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success the Operation.response field will
36
+ * be populated with the created Folder. In order to succeed, the addition of this new Folder must not violate the Folder naming, height or fanout constraints. + The Folder's display_name
37
+ * must be distinct from all other Folders that share its parent. + The addition of the Folder must not cause the active Folder hierarchy to exceed a height of 10. Note, the full active +
38
+ * deleted Folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders. + The addition of the Folder must not
39
+ * cause the total number of Folders under its parent to exceed 300. If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request,
40
+ * with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned
41
+ * via the details list in the Operation.error field. The caller must have `resourcemanager.folders.create` permission on the identified parent.
42
+ */
43
+ await gapi.client.cloudresourcemanager.folders.create({
44
+ parent: "Test string",
45
+ }, {
46
+ createTime: "Test string",
47
+ displayName: "Test string",
48
+ lifecycleState: "Test string",
49
+ name: "Test string",
50
+ parent: "Test string",
51
+ });
52
+ /**
53
+ * Requests deletion of a Folder. The Folder is moved into the DELETE_REQUESTED state immediately, and is deleted approximately 30 days later. This method may only be called on an empty
54
+ * Folder in the ACTIVE state, where a Folder is empty if it doesn't contain any Folders or Projects in the ACTIVE state. The caller must have `resourcemanager.folders.delete` permission
55
+ * on the identified folder.
56
+ */
57
+ await gapi.client.cloudresourcemanager.folders.delete({
58
+ name: "Test string",
59
+ });
60
+ /**
61
+ * Retrieves a Folder identified by the supplied resource name. Valid Folder resource names have the format `folders/{folder_id}` (for example, `folders/1234`). The caller must have
62
+ * `resourcemanager.folders.get` permission on the identified folder.
63
+ */
64
+ await gapi.client.cloudresourcemanager.folders.get({
65
+ name: "Test string",
66
+ });
67
+ /**
68
+ * Gets the access control policy for a Folder. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the Folder's resource name, e.g.
69
+ * "folders/1234". The caller must have `resourcemanager.folders.getIamPolicy` permission on the identified folder.
70
+ */
71
+ await gapi.client.cloudresourcemanager.folders.getIamPolicy({
72
+ resource: "Test string",
73
+ }, {
74
+ options: {
75
+ requestedPolicyVersion: 42,
76
+ },
77
+ });
78
+ /**
79
+ * Lists the Folders that are direct descendants of supplied parent resource. List provides a strongly consistent view of the Folders underneath the specified parent resource. List returns
80
+ * Folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have `resourcemanager.folders.list` permission on the identified parent.
81
+ */
82
+ await gapi.client.cloudresourcemanager.folders.list({
83
+ pageSize: 42,
84
+ pageToken: "Test string",
85
+ parent: "Test string",
86
+ showDeleted: true,
87
+ });
88
+ /**
89
+ * Moves a Folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success the Operation.response field will be
90
+ * populated with the moved Folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError
91
+ * will be returned via the Status.details field and if it occurs asynchronously then the FolderOperation will be returned via the Operation.error field. In addition, the
92
+ * Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height or
93
+ * fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.move` permission on the folder's current and proposed new parent.
94
+ */
95
+ await gapi.client.cloudresourcemanager.folders.move({
96
+ name: "Test string",
97
+ }, {
98
+ destinationParent: "Test string",
99
+ });
100
+ /**
101
+ * Updates a Folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or naming constraints described
102
+ * in the CreateFolder documentation. The Folder's display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3
103
+ * and 30 characters. This is captured by the regular expression: `\p{L}\p{N}{1,28}[\p{L}\p{N}]`. The caller must have `resourcemanager.folders.update` permission on the identified folder.
104
+ * If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.
105
+ */
106
+ await gapi.client.cloudresourcemanager.folders.patch({
107
+ name: "Test string",
108
+ updateMask: "Test string",
109
+ }, {
110
+ createTime: "Test string",
111
+ displayName: "Test string",
112
+ lifecycleState: "Test string",
113
+ name: "Test string",
114
+ parent: "Test string",
115
+ });
116
+ /**
117
+ * Search for folders that match specific filter criteria. Search provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria. This
118
+ * will only return folders on which the caller has the permission `resourcemanager.folders.get`.
119
+ */
120
+ await gapi.client.cloudresourcemanager.folders.search({
121
+ }, {
122
+ pageSize: 42,
123
+ pageToken: "Test string",
124
+ query: "Test string",
125
+ });
126
+ /**
127
+ * Sets the access control policy on a Folder, replacing any existing policy. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have
128
+ * `resourcemanager.folders.setIamPolicy` permission on the identified folder.
129
+ */
130
+ await gapi.client.cloudresourcemanager.folders.setIamPolicy({
131
+ resource: "Test string",
132
+ }, {
133
+ policy: {
134
+ auditConfigs: [
135
+ {
136
+ auditLogConfigs: [
137
+ {
138
+ exemptedMembers: [
139
+ "Test string"
140
+ ],
141
+ logType: "Test string",
142
+ }
143
+ ],
144
+ service: "Test string",
145
+ }
146
+ ],
147
+ bindings: [
148
+ {
149
+ condition: {
150
+ description: "Test string",
151
+ expression: "Test string",
152
+ location: "Test string",
153
+ title: "Test string",
154
+ },
155
+ members: [
156
+ "Test string"
157
+ ],
158
+ role: "Test string",
159
+ }
160
+ ],
161
+ etag: "Test string",
162
+ version: 42,
163
+ },
164
+ updateMask: "Test string",
165
+ });
166
+ /**
167
+ * Returns permissions that a caller has on the specified Folder. The `resource` field should be the Folder's resource name, e.g. "folders/1234". There are no permissions required for
168
+ * making this API call.
169
+ */
170
+ await gapi.client.cloudresourcemanager.folders.testIamPermissions({
171
+ resource: "Test string",
172
+ }, {
173
+ permissions: [
174
+ "Test string"
175
+ ],
176
+ });
177
+ /**
178
+ * Cancels the deletion request for a Folder. This method may only be called on a Folder in the DELETE_REQUESTED state. In order to succeed, the Folder's parent must be in the ACTIVE
179
+ * state. In addition, reintroducing the folder into the tree must not violate folder naming, height and fanout constraints described in the CreateFolder documentation. The caller must
180
+ * have `resourcemanager.folders.undelete` permission on the identified folder.
181
+ */
182
+ await gapi.client.cloudresourcemanager.folders.undelete({
183
+ name: "Test string",
184
+ }, {
185
+ });
186
+ /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
187
+ await gapi.client.cloudresourcemanager.operations.get({
188
+ name: "Test string",
189
+ });
190
+ }
191
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }