@maxim_mazurok/gapi.client.iam-v1 0.0.20231012 → 0.0.20231130

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/tests.ts DELETED
@@ -1,879 +0,0 @@
1
- /* This is stub file for gapi.client.iam-v1 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: 20231012
7
-
8
- gapi.load('client', async () => {
9
- /** now we can use gapi.client */
10
-
11
- await gapi.client.load('https://iam.googleapis.com/$discovery/rest?version=v1');
12
- /** now we can use gapi.client.iam */
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
- ];
21
- const immediate = false;
22
- gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
23
- if (authResult && !authResult.error) {
24
- /** handle successful authorization */
25
- run();
26
- } else {
27
- /** handle authorization error */
28
- }
29
- });
30
-
31
- async function run() {
32
- /**
33
- * Lints, or validates, an IAM policy. Currently checks the google.iam.v1.Binding.condition field, which contains a condition expression for a role binding. Successful calls to this method
34
- * always return an HTTP `200 OK` status code, even if the linter detects an issue in the IAM policy.
35
- */
36
- await gapi.client.iam.iamPolicies.lintPolicy({
37
- }, {
38
- condition: {
39
- description: "Test string",
40
- expression: "Test string",
41
- location: "Test string",
42
- title: "Test string",
43
- },
44
- fullResourceName: "Test string",
45
- });
46
- /**
47
- * Returns a list of services that allow you to opt into audit logs that are not generated by default. To learn more about audit logs, see the [Logging
48
- * documentation](https://cloud.google.com/logging/docs/audit).
49
- */
50
- await gapi.client.iam.iamPolicies.queryAuditableServices({
51
- }, {
52
- fullResourceName: "Test string",
53
- });
54
- /** Creates a new WorkforcePool. You cannot reuse the name of a deleted pool until 30 days after deletion. */
55
- await gapi.client.iam.locations.workforcePools.create({
56
- location: "Test string",
57
- workforcePoolId: "Test string",
58
- }, {
59
- description: "Test string",
60
- disabled: true,
61
- displayName: "Test string",
62
- expireTime: "Test string",
63
- name: "Test string",
64
- parent: "Test string",
65
- sessionDuration: "Test string",
66
- state: "Test string",
67
- });
68
- /**
69
- * Deletes a WorkforcePool. You cannot use a deleted WorkforcePool to exchange external credentials for Google Cloud credentials. However, deletion does not revoke credentials that have
70
- * already been issued. Credentials issued for a deleted pool do not grant access to resources. If the pool is undeleted, and the credentials are not expired, they grant access again. You
71
- * can undelete a pool for 30 days. After 30 days, deletion is permanent. You cannot update deleted pools. However, you can view and list them.
72
- */
73
- await gapi.client.iam.locations.workforcePools.delete({
74
- name: "Test string",
75
- });
76
- /** Gets an individual WorkforcePool. */
77
- await gapi.client.iam.locations.workforcePools.get({
78
- name: "Test string",
79
- });
80
- /** Gets IAM policies on a WorkforcePool. */
81
- await gapi.client.iam.locations.workforcePools.getIamPolicy({
82
- resource: "Test string",
83
- }, {
84
- options: {
85
- requestedPolicyVersion: 42,
86
- },
87
- });
88
- /** Lists all non-deleted WorkforcePools under the specified parent. If `show_deleted` is set to `true`, then deleted pools are also listed. */
89
- await gapi.client.iam.locations.workforcePools.list({
90
- location: "Test string",
91
- pageSize: 42,
92
- pageToken: "Test string",
93
- parent: "Test string",
94
- showDeleted: true,
95
- });
96
- /** Updates an existing WorkforcePool. */
97
- await gapi.client.iam.locations.workforcePools.patch({
98
- name: "Test string",
99
- updateMask: "Test string",
100
- }, {
101
- description: "Test string",
102
- disabled: true,
103
- displayName: "Test string",
104
- expireTime: "Test string",
105
- name: "Test string",
106
- parent: "Test string",
107
- sessionDuration: "Test string",
108
- state: "Test string",
109
- });
110
- /** Sets IAM policies on a WorkforcePool. */
111
- await gapi.client.iam.locations.workforcePools.setIamPolicy({
112
- resource: "Test string",
113
- }, {
114
- policy: {
115
- auditConfigs: [
116
- {
117
- auditLogConfigs: [
118
- {
119
- exemptedMembers: [
120
- "Test string"
121
- ],
122
- logType: "Test string",
123
- }
124
- ],
125
- service: "Test string",
126
- }
127
- ],
128
- bindings: [
129
- {
130
- condition: {
131
- description: "Test string",
132
- expression: "Test string",
133
- location: "Test string",
134
- title: "Test string",
135
- },
136
- members: [
137
- "Test string"
138
- ],
139
- role: "Test string",
140
- }
141
- ],
142
- etag: "Test string",
143
- version: 42,
144
- },
145
- updateMask: "Test string",
146
- });
147
- /** Returns the caller's permissions on the WorkforcePool. If the pool does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. */
148
- await gapi.client.iam.locations.workforcePools.testIamPermissions({
149
- resource: "Test string",
150
- }, {
151
- permissions: [
152
- "Test string"
153
- ],
154
- });
155
- /** Undeletes a WorkforcePool, as long as it was deleted fewer than 30 days ago. */
156
- await gapi.client.iam.locations.workforcePools.undelete({
157
- name: "Test string",
158
- }, {
159
- });
160
- /** 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. */
161
- await gapi.client.iam.locations.workforcePools.operations.get({
162
- name: "Test string",
163
- });
164
- /** Creates a new WorkforcePoolProvider in a WorkforcePool. You cannot reuse the name of a deleted provider until 30 days after deletion. */
165
- await gapi.client.iam.locations.workforcePools.providers.create({
166
- parent: "Test string",
167
- workforcePoolProviderId: "Test string",
168
- }, {
169
- attributeCondition: "Test string",
170
- attributeMapping: {
171
- A: "Test string"
172
- },
173
- description: "Test string",
174
- disabled: true,
175
- displayName: "Test string",
176
- expireTime: "Test string",
177
- name: "Test string",
178
- oidc: {
179
- clientId: "Test string",
180
- clientSecret: {
181
- value: {
182
- plainText: "Test string",
183
- thumbprint: "Test string",
184
- },
185
- },
186
- issuerUri: "Test string",
187
- jwksJson: "Test string",
188
- webSsoConfig: {
189
- additionalScopes: [
190
- "Test string"
191
- ],
192
- assertionClaimsBehavior: "Test string",
193
- responseType: "Test string",
194
- },
195
- },
196
- saml: {
197
- idpMetadataXml: "Test string",
198
- },
199
- state: "Test string",
200
- });
201
- /**
202
- * Deletes a WorkforcePoolProvider. Deleting a provider does not revoke credentials that have already been\ issued; they continue to grant access. You can undelete a provider for 30 days.
203
- * After 30 days, deletion is permanent. You cannot update deleted providers. However, you can view and list them.
204
- */
205
- await gapi.client.iam.locations.workforcePools.providers.delete({
206
- name: "Test string",
207
- });
208
- /** Gets an individual WorkforcePoolProvider. */
209
- await gapi.client.iam.locations.workforcePools.providers.get({
210
- name: "Test string",
211
- });
212
- /** Lists all non-deleted WorkforcePoolProviders in a WorkforcePool. If `show_deleted` is set to `true`, then deleted providers are also listed. */
213
- await gapi.client.iam.locations.workforcePools.providers.list({
214
- pageSize: 42,
215
- pageToken: "Test string",
216
- parent: "Test string",
217
- showDeleted: true,
218
- });
219
- /** Updates an existing WorkforcePoolProvider. */
220
- await gapi.client.iam.locations.workforcePools.providers.patch({
221
- name: "Test string",
222
- updateMask: "Test string",
223
- }, {
224
- attributeCondition: "Test string",
225
- attributeMapping: {
226
- A: "Test string"
227
- },
228
- description: "Test string",
229
- disabled: true,
230
- displayName: "Test string",
231
- expireTime: "Test string",
232
- name: "Test string",
233
- oidc: {
234
- clientId: "Test string",
235
- clientSecret: {
236
- value: {
237
- plainText: "Test string",
238
- thumbprint: "Test string",
239
- },
240
- },
241
- issuerUri: "Test string",
242
- jwksJson: "Test string",
243
- webSsoConfig: {
244
- additionalScopes: [
245
- "Test string"
246
- ],
247
- assertionClaimsBehavior: "Test string",
248
- responseType: "Test string",
249
- },
250
- },
251
- saml: {
252
- idpMetadataXml: "Test string",
253
- },
254
- state: "Test string",
255
- });
256
- /** Undeletes a WorkforcePoolProvider, as long as it was deleted fewer than 30 days ago. */
257
- await gapi.client.iam.locations.workforcePools.providers.undelete({
258
- name: "Test string",
259
- }, {
260
- });
261
- /** Creates a new WorkforcePoolProviderKey in a WorkforcePoolProvider. */
262
- await gapi.client.iam.locations.workforcePools.providers.keys.create({
263
- parent: "Test string",
264
- workforcePoolProviderKeyId: "Test string",
265
- }, {
266
- expireTime: "Test string",
267
- keyData: {
268
- format: "Test string",
269
- key: "Test string",
270
- keySpec: "Test string",
271
- notAfterTime: "Test string",
272
- notBeforeTime: "Test string",
273
- },
274
- name: "Test string",
275
- state: "Test string",
276
- use: "Test string",
277
- });
278
- /** Deletes a WorkforcePoolProviderKey. You can undelete a key for 30 days. After 30 days, deletion is permanent. */
279
- await gapi.client.iam.locations.workforcePools.providers.keys.delete({
280
- name: "Test string",
281
- });
282
- /** Gets a WorkforcePoolProviderKey. */
283
- await gapi.client.iam.locations.workforcePools.providers.keys.get({
284
- name: "Test string",
285
- });
286
- /** Lists all non-deleted WorkforcePoolProviderKeys in a WorkforcePoolProvider. If `show_deleted` is set to `true`, then deleted keys are also listed. */
287
- await gapi.client.iam.locations.workforcePools.providers.keys.list({
288
- pageSize: 42,
289
- pageToken: "Test string",
290
- parent: "Test string",
291
- showDeleted: true,
292
- });
293
- /** Undeletes a WorkforcePoolProviderKey, as long as it was deleted fewer than 30 days ago. */
294
- await gapi.client.iam.locations.workforcePools.providers.keys.undelete({
295
- name: "Test string",
296
- }, {
297
- });
298
- /** 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. */
299
- await gapi.client.iam.locations.workforcePools.providers.keys.operations.get({
300
- name: "Test string",
301
- });
302
- /** 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. */
303
- await gapi.client.iam.locations.workforcePools.providers.operations.get({
304
- name: "Test string",
305
- });
306
- /**
307
- * Deletes a WorkforcePoolSubject. Subject must not already be in a deleted state. A WorkforcePoolSubject is automatically created the first time an external credential is exchanged for a
308
- * Google Cloud credential with a mapped `google.subject` attribute. There is no path to manually create WorkforcePoolSubjects. Once deleted, the WorkforcePoolSubject may not be used for
309
- * 30 days. After 30 days, the WorkforcePoolSubject will be deleted forever and can be reused in token exchanges with Google Cloud STS. This will automatically create a new
310
- * WorkforcePoolSubject that is independent of the previously deleted WorkforcePoolSubject with the same google.subject value.
311
- */
312
- await gapi.client.iam.locations.workforcePools.subjects.delete({
313
- name: "Test string",
314
- });
315
- /** Undeletes a WorkforcePoolSubject, as long as it was deleted fewer than 30 days ago. */
316
- await gapi.client.iam.locations.workforcePools.subjects.undelete({
317
- name: "Test string",
318
- }, {
319
- });
320
- /** 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. */
321
- await gapi.client.iam.locations.workforcePools.subjects.operations.get({
322
- name: "Test string",
323
- });
324
- /** Creates a new custom Role. */
325
- await gapi.client.iam.organizations.roles.create({
326
- parent: "Test string",
327
- }, {
328
- role: {
329
- deleted: true,
330
- description: "Test string",
331
- etag: "Test string",
332
- includedPermissions: [
333
- "Test string"
334
- ],
335
- name: "Test string",
336
- stage: "Test string",
337
- title: "Test string",
338
- },
339
- roleId: "Test string",
340
- });
341
- /**
342
- * Deletes a custom Role. When you delete a custom role, the following changes occur immediately: * You cannot bind a principal to the custom role in an IAM Policy. * Existing bindings to
343
- * the custom role are not changed, but they have no effect. * By default, the response from ListRoles does not include the custom role. You have 7 days to undelete the custom role. After
344
- * 7 days, the following changes occur: * The custom role is permanently deleted and cannot be recovered. * If an IAM policy contains a binding to the custom role, the binding is
345
- * permanently removed.
346
- */
347
- await gapi.client.iam.organizations.roles.delete({
348
- etag: "Test string",
349
- name: "Test string",
350
- });
351
- /** Gets the definition of a Role. */
352
- await gapi.client.iam.organizations.roles.get({
353
- name: "Test string",
354
- });
355
- /** Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project. */
356
- await gapi.client.iam.organizations.roles.list({
357
- pageSize: 42,
358
- pageToken: "Test string",
359
- parent: "Test string",
360
- showDeleted: true,
361
- view: "Test string",
362
- });
363
- /** Updates the definition of a custom Role. */
364
- await gapi.client.iam.organizations.roles.patch({
365
- name: "Test string",
366
- updateMask: "Test string",
367
- }, {
368
- deleted: true,
369
- description: "Test string",
370
- etag: "Test string",
371
- includedPermissions: [
372
- "Test string"
373
- ],
374
- name: "Test string",
375
- stage: "Test string",
376
- title: "Test string",
377
- });
378
- /** Undeletes a custom Role. */
379
- await gapi.client.iam.organizations.roles.undelete({
380
- name: "Test string",
381
- }, {
382
- etag: "Test string",
383
- });
384
- /** Lists every permission that you can test on a resource. A permission is testable if you can check whether a principal has that permission on the resource. */
385
- await gapi.client.iam.permissions.queryTestablePermissions({
386
- }, {
387
- fullResourceName: "Test string",
388
- pageSize: 42,
389
- pageToken: "Test string",
390
- });
391
- /** Creates a new WorkloadIdentityPool. You cannot reuse the name of a deleted pool until 30 days after deletion. */
392
- await gapi.client.iam.projects.locations.workloadIdentityPools.create({
393
- parent: "Test string",
394
- workloadIdentityPoolId: "Test string",
395
- }, {
396
- description: "Test string",
397
- disabled: true,
398
- displayName: "Test string",
399
- expireTime: "Test string",
400
- name: "Test string",
401
- state: "Test string",
402
- });
403
- /**
404
- * Deletes a WorkloadIdentityPool. You cannot use a deleted pool to exchange external credentials for Google Cloud credentials. However, deletion does not revoke credentials that have
405
- * already been issued. Credentials issued for a deleted pool do not grant access to resources. If the pool is undeleted, and the credentials are not expired, they grant access again. You
406
- * can undelete a pool for 30 days. After 30 days, deletion is permanent. You cannot update deleted pools. However, you can view and list them.
407
- */
408
- await gapi.client.iam.projects.locations.workloadIdentityPools.delete({
409
- name: "Test string",
410
- });
411
- /** Gets an individual WorkloadIdentityPool. */
412
- await gapi.client.iam.projects.locations.workloadIdentityPools.get({
413
- name: "Test string",
414
- });
415
- /** Lists all non-deleted WorkloadIdentityPools in a project. If `show_deleted` is set to `true`, then deleted pools are also listed. */
416
- await gapi.client.iam.projects.locations.workloadIdentityPools.list({
417
- pageSize: 42,
418
- pageToken: "Test string",
419
- parent: "Test string",
420
- showDeleted: true,
421
- });
422
- /** Updates an existing WorkloadIdentityPool. */
423
- await gapi.client.iam.projects.locations.workloadIdentityPools.patch({
424
- name: "Test string",
425
- updateMask: "Test string",
426
- }, {
427
- description: "Test string",
428
- disabled: true,
429
- displayName: "Test string",
430
- expireTime: "Test string",
431
- name: "Test string",
432
- state: "Test string",
433
- });
434
- /** Undeletes a WorkloadIdentityPool, as long as it was deleted fewer than 30 days ago. */
435
- await gapi.client.iam.projects.locations.workloadIdentityPools.undelete({
436
- name: "Test string",
437
- }, {
438
- });
439
- /** 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. */
440
- await gapi.client.iam.projects.locations.workloadIdentityPools.namespaces.managedIdentities.operations.get({
441
- name: "Test string",
442
- });
443
- /** 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. */
444
- await gapi.client.iam.projects.locations.workloadIdentityPools.namespaces.managedIdentities.workloadSources.operations.get({
445
- name: "Test string",
446
- });
447
- /** 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. */
448
- await gapi.client.iam.projects.locations.workloadIdentityPools.namespaces.operations.get({
449
- name: "Test string",
450
- });
451
- /** 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. */
452
- await gapi.client.iam.projects.locations.workloadIdentityPools.operations.get({
453
- name: "Test string",
454
- });
455
- /** Creates a new WorkloadIdentityPoolProvider in a WorkloadIdentityPool. You cannot reuse the name of a deleted provider until 30 days after deletion. */
456
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.create({
457
- parent: "Test string",
458
- workloadIdentityPoolProviderId: "Test string",
459
- }, {
460
- attributeCondition: "Test string",
461
- attributeMapping: {
462
- A: "Test string"
463
- },
464
- aws: {
465
- accountId: "Test string",
466
- },
467
- description: "Test string",
468
- disabled: true,
469
- displayName: "Test string",
470
- expireTime: "Test string",
471
- name: "Test string",
472
- oidc: {
473
- allowedAudiences: [
474
- "Test string"
475
- ],
476
- issuerUri: "Test string",
477
- jwksJson: "Test string",
478
- },
479
- saml: {
480
- idpMetadataXml: "Test string",
481
- },
482
- state: "Test string",
483
- });
484
- /**
485
- * Deletes a WorkloadIdentityPoolProvider. Deleting a provider does not revoke credentials that have already been issued; they continue to grant access. You can undelete a provider for 30
486
- * days. After 30 days, deletion is permanent. You cannot update deleted providers. However, you can view and list them.
487
- */
488
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.delete({
489
- name: "Test string",
490
- });
491
- /** Gets an individual WorkloadIdentityPoolProvider. */
492
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.get({
493
- name: "Test string",
494
- });
495
- /** Lists all non-deleted WorkloadIdentityPoolProviders in a WorkloadIdentityPool. If `show_deleted` is set to `true`, then deleted providers are also listed. */
496
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.list({
497
- pageSize: 42,
498
- pageToken: "Test string",
499
- parent: "Test string",
500
- showDeleted: true,
501
- });
502
- /** Updates an existing WorkloadIdentityPoolProvider. */
503
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.patch({
504
- name: "Test string",
505
- updateMask: "Test string",
506
- }, {
507
- attributeCondition: "Test string",
508
- attributeMapping: {
509
- A: "Test string"
510
- },
511
- aws: {
512
- accountId: "Test string",
513
- },
514
- description: "Test string",
515
- disabled: true,
516
- displayName: "Test string",
517
- expireTime: "Test string",
518
- name: "Test string",
519
- oidc: {
520
- allowedAudiences: [
521
- "Test string"
522
- ],
523
- issuerUri: "Test string",
524
- jwksJson: "Test string",
525
- },
526
- saml: {
527
- idpMetadataXml: "Test string",
528
- },
529
- state: "Test string",
530
- });
531
- /** Undeletes a WorkloadIdentityPoolProvider, as long as it was deleted fewer than 30 days ago. */
532
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.undelete({
533
- name: "Test string",
534
- }, {
535
- });
536
- /** Create a new WorkloadIdentityPoolProviderKey in a WorkloadIdentityPoolProvider. */
537
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.keys.create({
538
- parent: "Test string",
539
- workloadIdentityPoolProviderKeyId: "Test string",
540
- }, {
541
- expireTime: "Test string",
542
- keyData: {
543
- format: "Test string",
544
- key: "Test string",
545
- keySpec: "Test string",
546
- notAfterTime: "Test string",
547
- notBeforeTime: "Test string",
548
- },
549
- name: "Test string",
550
- state: "Test string",
551
- use: "Test string",
552
- });
553
- /** Deletes an WorkloadIdentityPoolProviderKey. You can undelete a key for 30 days. After 30 days, deletion is permanent. */
554
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.keys.delete({
555
- name: "Test string",
556
- });
557
- /** Gets an individual WorkloadIdentityPoolProviderKey. */
558
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.keys.get({
559
- name: "Test string",
560
- });
561
- /** Lists all non-deleted WorkloadIdentityPoolProviderKeys in a project. If show_deleted is set to `true`, then deleted pools are also listed. */
562
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.keys.list({
563
- pageSize: 42,
564
- pageToken: "Test string",
565
- parent: "Test string",
566
- showDeleted: true,
567
- });
568
- /** Undeletes an WorkloadIdentityPoolProviderKey, as long as it was deleted fewer than 30 days ago. */
569
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.keys.undelete({
570
- name: "Test string",
571
- }, {
572
- });
573
- /** 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. */
574
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.keys.operations.get({
575
- name: "Test string",
576
- });
577
- /** 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. */
578
- await gapi.client.iam.projects.locations.workloadIdentityPools.providers.operations.get({
579
- name: "Test string",
580
- });
581
- /** Creates a new custom Role. */
582
- await gapi.client.iam.projects.roles.create({
583
- parent: "Test string",
584
- }, {
585
- role: {
586
- deleted: true,
587
- description: "Test string",
588
- etag: "Test string",
589
- includedPermissions: [
590
- "Test string"
591
- ],
592
- name: "Test string",
593
- stage: "Test string",
594
- title: "Test string",
595
- },
596
- roleId: "Test string",
597
- });
598
- /**
599
- * Deletes a custom Role. When you delete a custom role, the following changes occur immediately: * You cannot bind a principal to the custom role in an IAM Policy. * Existing bindings to
600
- * the custom role are not changed, but they have no effect. * By default, the response from ListRoles does not include the custom role. You have 7 days to undelete the custom role. After
601
- * 7 days, the following changes occur: * The custom role is permanently deleted and cannot be recovered. * If an IAM policy contains a binding to the custom role, the binding is
602
- * permanently removed.
603
- */
604
- await gapi.client.iam.projects.roles.delete({
605
- etag: "Test string",
606
- name: "Test string",
607
- });
608
- /** Gets the definition of a Role. */
609
- await gapi.client.iam.projects.roles.get({
610
- name: "Test string",
611
- });
612
- /** Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project. */
613
- await gapi.client.iam.projects.roles.list({
614
- pageSize: 42,
615
- pageToken: "Test string",
616
- parent: "Test string",
617
- showDeleted: true,
618
- view: "Test string",
619
- });
620
- /** Updates the definition of a custom Role. */
621
- await gapi.client.iam.projects.roles.patch({
622
- name: "Test string",
623
- updateMask: "Test string",
624
- }, {
625
- deleted: true,
626
- description: "Test string",
627
- etag: "Test string",
628
- includedPermissions: [
629
- "Test string"
630
- ],
631
- name: "Test string",
632
- stage: "Test string",
633
- title: "Test string",
634
- });
635
- /** Undeletes a custom Role. */
636
- await gapi.client.iam.projects.roles.undelete({
637
- name: "Test string",
638
- }, {
639
- etag: "Test string",
640
- });
641
- /** Creates a ServiceAccount. */
642
- await gapi.client.iam.projects.serviceAccounts.create({
643
- name: "Test string",
644
- }, {
645
- accountId: "Test string",
646
- serviceAccount: {
647
- description: "Test string",
648
- disabled: true,
649
- displayName: "Test string",
650
- email: "Test string",
651
- etag: "Test string",
652
- name: "Test string",
653
- oauth2ClientId: "Test string",
654
- projectId: "Test string",
655
- uniqueId: "Test string",
656
- },
657
- });
658
- /**
659
- * Deletes a ServiceAccount. **Warning:** After you delete a service account, you might not be able to undelete it. If you know that you need to re-enable the service account in the
660
- * future, use DisableServiceAccount instead. If you delete a service account, IAM permanently removes the service account 30 days later. Google Cloud cannot recover the service account
661
- * after it is permanently removed, even if you file a support request. To help avoid unplanned outages, we recommend that you disable the service account before you delete it. Use
662
- * DisableServiceAccount to disable the service account, then wait at least 24 hours and watch for unintended consequences. If there are no unintended consequences, you can delete the
663
- * service account.
664
- */
665
- await gapi.client.iam.projects.serviceAccounts.delete({
666
- name: "Test string",
667
- });
668
- /**
669
- * Disables a ServiceAccount immediately. If an application uses the service account to authenticate, that application can no longer call Google APIs or access Google Cloud resources.
670
- * Existing access tokens for the service account are rejected, and requests for new access tokens will fail. To re-enable the service account, use EnableServiceAccount. After you
671
- * re-enable the service account, its existing access tokens will be accepted, and you can request new access tokens. To help avoid unplanned outages, we recommend that you disable the
672
- * service account before you delete it. Use this method to disable the service account, then wait at least 24 hours and watch for unintended consequences. If there are no unintended
673
- * consequences, you can delete the service account with DeleteServiceAccount.
674
- */
675
- await gapi.client.iam.projects.serviceAccounts.disable({
676
- name: "Test string",
677
- }, {
678
- });
679
- /**
680
- * Enables a ServiceAccount that was disabled by DisableServiceAccount. If the service account is already enabled, then this method has no effect. If the service account was disabled by
681
- * other means—for example, if Google disabled the service account because it was compromised—you cannot use this method to enable the service account.
682
- */
683
- await gapi.client.iam.projects.serviceAccounts.enable({
684
- name: "Test string",
685
- }, {
686
- });
687
- /** Gets a ServiceAccount. */
688
- await gapi.client.iam.projects.serviceAccounts.get({
689
- name: "Test string",
690
- });
691
- /**
692
- * Gets the IAM policy that is attached to a ServiceAccount. This IAM policy specifies which principals have access to the service account. This method does not tell you whether the
693
- * service account has been granted any roles on other resources. To check whether a service account has role grants on a resource, use the `getIamPolicy` method for that resource. For
694
- * example, to view the role grants for a project, call the Resource Manager API's
695
- * [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy) method.
696
- */
697
- await gapi.client.iam.projects.serviceAccounts.getIamPolicy({
698
- "options.requestedPolicyVersion": 42,
699
- resource: "Test string",
700
- });
701
- /** Lists every ServiceAccount that belongs to a specific project. */
702
- await gapi.client.iam.projects.serviceAccounts.list({
703
- name: "Test string",
704
- pageSize: 42,
705
- pageToken: "Test string",
706
- });
707
- /** Patches a ServiceAccount. */
708
- await gapi.client.iam.projects.serviceAccounts.patch({
709
- name: "Test string",
710
- }, {
711
- serviceAccount: {
712
- description: "Test string",
713
- disabled: true,
714
- displayName: "Test string",
715
- email: "Test string",
716
- etag: "Test string",
717
- name: "Test string",
718
- oauth2ClientId: "Test string",
719
- projectId: "Test string",
720
- uniqueId: "Test string",
721
- },
722
- updateMask: "Test string",
723
- });
724
- /**
725
- * Sets the IAM policy that is attached to a ServiceAccount. Use this method to grant or revoke access to the service account. For example, you could grant a principal the ability to
726
- * impersonate the service account. This method does not enable the service account to access other resources. To grant roles to a service account on a resource, follow these steps: 1.
727
- * Call the resource's `getIamPolicy` method to get its current IAM policy. 2. Edit the policy so that it binds the service account to an IAM role for the resource. 3. Call the resource's
728
- * `setIamPolicy` method to update its IAM policy. For detailed instructions, see [Manage access to project, folders, and
729
- * organizations](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts) or [Manage access to other
730
- * resources](https://cloud.google.com/iam/help/access/manage-other-resources).
731
- */
732
- await gapi.client.iam.projects.serviceAccounts.setIamPolicy({
733
- resource: "Test string",
734
- }, {
735
- policy: {
736
- auditConfigs: [
737
- {
738
- auditLogConfigs: [
739
- {
740
- exemptedMembers: [
741
- "Test string"
742
- ],
743
- logType: "Test string",
744
- }
745
- ],
746
- service: "Test string",
747
- }
748
- ],
749
- bindings: [
750
- {
751
- condition: {
752
- description: "Test string",
753
- expression: "Test string",
754
- location: "Test string",
755
- title: "Test string",
756
- },
757
- members: [
758
- "Test string"
759
- ],
760
- role: "Test string",
761
- }
762
- ],
763
- etag: "Test string",
764
- version: 42,
765
- },
766
- updateMask: "Test string",
767
- });
768
- /**
769
- * **Note:** This method is deprecated. Use the [`signBlob`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signBlob) method in the IAM Service Account
770
- * Credentials API instead. If you currently use this method, see the [migration guide](https://cloud.google.com/iam/help/credentials/migrate-api) for instructions. Signs a blob using the
771
- * system-managed private key for a ServiceAccount.
772
- */
773
- await gapi.client.iam.projects.serviceAccounts.signBlob({
774
- name: "Test string",
775
- }, {
776
- bytesToSign: "Test string",
777
- });
778
- /**
779
- * **Note:** This method is deprecated. Use the [`signJwt`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signJwt) method in the IAM Service Account
780
- * Credentials API instead. If you currently use this method, see the [migration guide](https://cloud.google.com/iam/help/credentials/migrate-api) for instructions. Signs a JSON Web Token
781
- * (JWT) using the system-managed private key for a ServiceAccount.
782
- */
783
- await gapi.client.iam.projects.serviceAccounts.signJwt({
784
- name: "Test string",
785
- }, {
786
- payload: "Test string",
787
- });
788
- /** Tests whether the caller has the specified permissions on a ServiceAccount. */
789
- await gapi.client.iam.projects.serviceAccounts.testIamPermissions({
790
- resource: "Test string",
791
- }, {
792
- permissions: [
793
- "Test string"
794
- ],
795
- });
796
- /**
797
- * Restores a deleted ServiceAccount. **Important:** It is not always possible to restore a deleted service account. Use this method only as a last resort. After you delete a service
798
- * account, IAM permanently removes the service account 30 days later. There is no way to restore a deleted service account that has been permanently removed.
799
- */
800
- await gapi.client.iam.projects.serviceAccounts.undelete({
801
- name: "Test string",
802
- }, {
803
- });
804
- /** **Note:** We are in the process of deprecating this method. Use PatchServiceAccount instead. Updates a ServiceAccount. You can update only the `display_name` field. */
805
- await gapi.client.iam.projects.serviceAccounts.update({
806
- name: "Test string",
807
- }, {
808
- description: "Test string",
809
- disabled: true,
810
- displayName: "Test string",
811
- email: "Test string",
812
- etag: "Test string",
813
- name: "Test string",
814
- oauth2ClientId: "Test string",
815
- projectId: "Test string",
816
- uniqueId: "Test string",
817
- });
818
- /** Creates a ServiceAccountKey. */
819
- await gapi.client.iam.projects.serviceAccounts.keys.create({
820
- name: "Test string",
821
- }, {
822
- keyAlgorithm: "Test string",
823
- privateKeyType: "Test string",
824
- });
825
- /** Deletes a ServiceAccountKey. Deleting a service account key does not revoke short-lived credentials that have been issued based on the service account key. */
826
- await gapi.client.iam.projects.serviceAccounts.keys.delete({
827
- name: "Test string",
828
- });
829
- /** Disable a ServiceAccountKey. A disabled service account key can be re-enabled with EnableServiceAccountKey. */
830
- await gapi.client.iam.projects.serviceAccounts.keys.disable({
831
- name: "Test string",
832
- }, {
833
- });
834
- /** Enable a ServiceAccountKey. */
835
- await gapi.client.iam.projects.serviceAccounts.keys.enable({
836
- name: "Test string",
837
- }, {
838
- });
839
- /** Gets a ServiceAccountKey. */
840
- await gapi.client.iam.projects.serviceAccounts.keys.get({
841
- name: "Test string",
842
- publicKeyType: "Test string",
843
- });
844
- /** Lists every ServiceAccountKey for a service account. */
845
- await gapi.client.iam.projects.serviceAccounts.keys.list({
846
- keyTypes: "Test string",
847
- name: "Test string",
848
- });
849
- /**
850
- * Uploads the public key portion of a key pair that you manage, and associates the public key with a ServiceAccount. After you upload the public key, you can use the private key from the
851
- * key pair as a service account key.
852
- */
853
- await gapi.client.iam.projects.serviceAccounts.keys.upload({
854
- name: "Test string",
855
- }, {
856
- publicKeyData: "Test string",
857
- });
858
- /** Gets the definition of a Role. */
859
- await gapi.client.iam.roles.get({
860
- name: "Test string",
861
- });
862
- /** Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project. */
863
- await gapi.client.iam.roles.list({
864
- pageSize: 42,
865
- pageToken: "Test string",
866
- parent: "Test string",
867
- showDeleted: true,
868
- view: "Test string",
869
- });
870
- /** Lists roles that can be granted on a Google Cloud resource. A role is grantable if the IAM policy for the resource can contain bindings to the role. */
871
- await gapi.client.iam.roles.queryGrantableRoles({
872
- }, {
873
- fullResourceName: "Test string",
874
- pageSize: 42,
875
- pageToken: "Test string",
876
- view: "Test string",
877
- });
878
- }
879
- });