@maxim_mazurok/gapi.client.cloudresourcemanager-v1 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 +1951 -0
- package/package.json +20 -0
- package/readme.md +261 -0
- package/tests.ts +515 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/tests.ts
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.cloudresourcemanager-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: 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=v1');
|
|
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
|
+
/** Clears a `Policy` from a resource. */
|
|
35
|
+
await gapi.client.cloudresourcemanager.folders.clearOrgPolicy({
|
|
36
|
+
resource: "Test string",
|
|
37
|
+
}, {
|
|
38
|
+
constraint: "Test string",
|
|
39
|
+
etag: "Test string",
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed
|
|
43
|
+
* `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.
|
|
44
|
+
*/
|
|
45
|
+
await gapi.client.cloudresourcemanager.folders.getEffectiveOrgPolicy({
|
|
46
|
+
resource: "Test string",
|
|
47
|
+
}, {
|
|
48
|
+
constraint: "Test string",
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag`
|
|
52
|
+
* value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.
|
|
53
|
+
*/
|
|
54
|
+
await gapi.client.cloudresourcemanager.folders.getOrgPolicy({
|
|
55
|
+
resource: "Test string",
|
|
56
|
+
}, {
|
|
57
|
+
constraint: "Test string",
|
|
58
|
+
});
|
|
59
|
+
/** Lists `Constraints` that could be applied on the specified resource. */
|
|
60
|
+
await gapi.client.cloudresourcemanager.folders.listAvailableOrgPolicyConstraints({
|
|
61
|
+
resource: "Test string",
|
|
62
|
+
}, {
|
|
63
|
+
pageSize: 42,
|
|
64
|
+
pageToken: "Test string",
|
|
65
|
+
});
|
|
66
|
+
/** Lists all the `Policies` set for a particular resource. */
|
|
67
|
+
await gapi.client.cloudresourcemanager.folders.listOrgPolicies({
|
|
68
|
+
resource: "Test string",
|
|
69
|
+
}, {
|
|
70
|
+
pageSize: 42,
|
|
71
|
+
pageToken: "Test string",
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy`
|
|
75
|
+
* results in an unconditional write of the `Policy`.
|
|
76
|
+
*/
|
|
77
|
+
await gapi.client.cloudresourcemanager.folders.setOrgPolicy({
|
|
78
|
+
resource: "Test string",
|
|
79
|
+
}, {
|
|
80
|
+
policy: {
|
|
81
|
+
booleanPolicy: {
|
|
82
|
+
enforced: true,
|
|
83
|
+
},
|
|
84
|
+
constraint: "Test string",
|
|
85
|
+
etag: "Test string",
|
|
86
|
+
listPolicy: {
|
|
87
|
+
allowedValues: [
|
|
88
|
+
"Test string"
|
|
89
|
+
],
|
|
90
|
+
allValues: "Test string",
|
|
91
|
+
deniedValues: [
|
|
92
|
+
"Test string"
|
|
93
|
+
],
|
|
94
|
+
inheritFromParent: true,
|
|
95
|
+
suggestedValue: "Test string",
|
|
96
|
+
},
|
|
97
|
+
restoreDefault: {
|
|
98
|
+
},
|
|
99
|
+
updateTime: "Test string",
|
|
100
|
+
version: 42,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
/**
|
|
104
|
+
* Create a Lien which applies to the resource denoted by the `parent` field. Callers of this method will require permission on the `parent` resource. For example, applying to
|
|
105
|
+
* `projects/1234` requires permission `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the number of Liens which may be applied.
|
|
106
|
+
*/
|
|
107
|
+
await gapi.client.cloudresourcemanager.liens.create({
|
|
108
|
+
}, {
|
|
109
|
+
createTime: "Test string",
|
|
110
|
+
name: "Test string",
|
|
111
|
+
origin: "Test string",
|
|
112
|
+
parent: "Test string",
|
|
113
|
+
reason: "Test string",
|
|
114
|
+
restrictions: [
|
|
115
|
+
"Test string"
|
|
116
|
+
],
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Delete a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission
|
|
120
|
+
* `resourcemanager.projects.updateLiens`.
|
|
121
|
+
*/
|
|
122
|
+
await gapi.client.cloudresourcemanager.liens.delete({
|
|
123
|
+
name: "Test string",
|
|
124
|
+
});
|
|
125
|
+
/**
|
|
126
|
+
* Retrieve a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission
|
|
127
|
+
* `resourcemanager.projects.get`
|
|
128
|
+
*/
|
|
129
|
+
await gapi.client.cloudresourcemanager.liens.get({
|
|
130
|
+
name: "Test string",
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* List all Liens applied to the `parent` resource. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires
|
|
134
|
+
* permission `resourcemanager.projects.get`.
|
|
135
|
+
*/
|
|
136
|
+
await gapi.client.cloudresourcemanager.liens.list({
|
|
137
|
+
pageSize: 42,
|
|
138
|
+
pageToken: "Test string",
|
|
139
|
+
parent: "Test string",
|
|
140
|
+
});
|
|
141
|
+
/** 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. */
|
|
142
|
+
await gapi.client.cloudresourcemanager.operations.get({
|
|
143
|
+
name: "Test string",
|
|
144
|
+
});
|
|
145
|
+
/** Clears a `Policy` from a resource. */
|
|
146
|
+
await gapi.client.cloudresourcemanager.organizations.clearOrgPolicy({
|
|
147
|
+
resource: "Test string",
|
|
148
|
+
}, {
|
|
149
|
+
constraint: "Test string",
|
|
150
|
+
etag: "Test string",
|
|
151
|
+
});
|
|
152
|
+
/** Fetches an Organization resource identified by the specified resource name. */
|
|
153
|
+
await gapi.client.cloudresourcemanager.organizations.get({
|
|
154
|
+
name: "Test string",
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed
|
|
158
|
+
* `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.
|
|
159
|
+
*/
|
|
160
|
+
await gapi.client.cloudresourcemanager.organizations.getEffectiveOrgPolicy({
|
|
161
|
+
resource: "Test string",
|
|
162
|
+
}, {
|
|
163
|
+
constraint: "Test string",
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* Gets the access control policy for an Organization resource. May be empty if no such policy or resource exists. The `resource` field should be the organization's resource name, e.g.
|
|
167
|
+
* "organizations/123". Authorization requires the Google IAM permission `resourcemanager.organizations.getIamPolicy` on the specified organization
|
|
168
|
+
*/
|
|
169
|
+
await gapi.client.cloudresourcemanager.organizations.getIamPolicy({
|
|
170
|
+
resource: "Test string",
|
|
171
|
+
}, {
|
|
172
|
+
options: {
|
|
173
|
+
requestedPolicyVersion: 42,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
/**
|
|
177
|
+
* Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag`
|
|
178
|
+
* value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.
|
|
179
|
+
*/
|
|
180
|
+
await gapi.client.cloudresourcemanager.organizations.getOrgPolicy({
|
|
181
|
+
resource: "Test string",
|
|
182
|
+
}, {
|
|
183
|
+
constraint: "Test string",
|
|
184
|
+
});
|
|
185
|
+
/** Lists `Constraints` that could be applied on the specified resource. */
|
|
186
|
+
await gapi.client.cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints({
|
|
187
|
+
resource: "Test string",
|
|
188
|
+
}, {
|
|
189
|
+
pageSize: 42,
|
|
190
|
+
pageToken: "Test string",
|
|
191
|
+
});
|
|
192
|
+
/** Lists all the `Policies` set for a particular resource. */
|
|
193
|
+
await gapi.client.cloudresourcemanager.organizations.listOrgPolicies({
|
|
194
|
+
resource: "Test string",
|
|
195
|
+
}, {
|
|
196
|
+
pageSize: 42,
|
|
197
|
+
pageToken: "Test string",
|
|
198
|
+
});
|
|
199
|
+
/**
|
|
200
|
+
* Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not
|
|
201
|
+
* necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get`
|
|
202
|
+
*/
|
|
203
|
+
await gapi.client.cloudresourcemanager.organizations.search({
|
|
204
|
+
}, {
|
|
205
|
+
filter: "Test string",
|
|
206
|
+
pageSize: 42,
|
|
207
|
+
pageToken: "Test string",
|
|
208
|
+
});
|
|
209
|
+
/**
|
|
210
|
+
* Sets the access control policy on an Organization resource. Replaces any existing policy. The `resource` field should be the organization's resource name, e.g. "organizations/123".
|
|
211
|
+
* Authorization requires the Google IAM permission `resourcemanager.organizations.setIamPolicy` on the specified organization
|
|
212
|
+
*/
|
|
213
|
+
await gapi.client.cloudresourcemanager.organizations.setIamPolicy({
|
|
214
|
+
resource: "Test string",
|
|
215
|
+
}, {
|
|
216
|
+
policy: {
|
|
217
|
+
auditConfigs: [
|
|
218
|
+
{
|
|
219
|
+
auditLogConfigs: [
|
|
220
|
+
{
|
|
221
|
+
exemptedMembers: [
|
|
222
|
+
"Test string"
|
|
223
|
+
],
|
|
224
|
+
logType: "Test string",
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
service: "Test string",
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
bindings: [
|
|
231
|
+
{
|
|
232
|
+
condition: {
|
|
233
|
+
description: "Test string",
|
|
234
|
+
expression: "Test string",
|
|
235
|
+
location: "Test string",
|
|
236
|
+
title: "Test string",
|
|
237
|
+
},
|
|
238
|
+
members: [
|
|
239
|
+
"Test string"
|
|
240
|
+
],
|
|
241
|
+
role: "Test string",
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
etag: "Test string",
|
|
245
|
+
version: 42,
|
|
246
|
+
},
|
|
247
|
+
updateMask: "Test string",
|
|
248
|
+
});
|
|
249
|
+
/**
|
|
250
|
+
* Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy`
|
|
251
|
+
* results in an unconditional write of the `Policy`.
|
|
252
|
+
*/
|
|
253
|
+
await gapi.client.cloudresourcemanager.organizations.setOrgPolicy({
|
|
254
|
+
resource: "Test string",
|
|
255
|
+
}, {
|
|
256
|
+
policy: {
|
|
257
|
+
booleanPolicy: {
|
|
258
|
+
enforced: true,
|
|
259
|
+
},
|
|
260
|
+
constraint: "Test string",
|
|
261
|
+
etag: "Test string",
|
|
262
|
+
listPolicy: {
|
|
263
|
+
allowedValues: [
|
|
264
|
+
"Test string"
|
|
265
|
+
],
|
|
266
|
+
allValues: "Test string",
|
|
267
|
+
deniedValues: [
|
|
268
|
+
"Test string"
|
|
269
|
+
],
|
|
270
|
+
inheritFromParent: true,
|
|
271
|
+
suggestedValue: "Test string",
|
|
272
|
+
},
|
|
273
|
+
restoreDefault: {
|
|
274
|
+
},
|
|
275
|
+
updateTime: "Test string",
|
|
276
|
+
version: 42,
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
/**
|
|
280
|
+
* Returns permissions that a caller has on the specified Organization. The `resource` field should be the organization's resource name, e.g. "organizations/123". There are no permissions
|
|
281
|
+
* required for making this API call.
|
|
282
|
+
*/
|
|
283
|
+
await gapi.client.cloudresourcemanager.organizations.testIamPermissions({
|
|
284
|
+
resource: "Test string",
|
|
285
|
+
}, {
|
|
286
|
+
permissions: [
|
|
287
|
+
"Test string"
|
|
288
|
+
],
|
|
289
|
+
});
|
|
290
|
+
/** Clears a `Policy` from a resource. */
|
|
291
|
+
await gapi.client.cloudresourcemanager.projects.clearOrgPolicy({
|
|
292
|
+
resource: "Test string",
|
|
293
|
+
}, {
|
|
294
|
+
constraint: "Test string",
|
|
295
|
+
etag: "Test string",
|
|
296
|
+
});
|
|
297
|
+
/**
|
|
298
|
+
* Request that a new Project be created. The result is an Operation which can be used to track the creation process. This process usually takes a few seconds, but can sometimes take much
|
|
299
|
+
* longer. The tracking Operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. Authorization requires the Google IAM permission
|
|
300
|
+
* `resourcemanager.projects.create` on the specified parent for the new project. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as
|
|
301
|
+
* organization. This method does not associate the new project with a billing account. You can set or update the billing account associated with a project using the
|
|
302
|
+
* [`projects.updateBillingInfo`] (/billing/reference/rest/v1/projects/updateBillingInfo) method.
|
|
303
|
+
*/
|
|
304
|
+
await gapi.client.cloudresourcemanager.projects.create({
|
|
305
|
+
}, {
|
|
306
|
+
createTime: "Test string",
|
|
307
|
+
labels: {
|
|
308
|
+
A: "Test string"
|
|
309
|
+
},
|
|
310
|
+
lifecycleState: "Test string",
|
|
311
|
+
name: "Test string",
|
|
312
|
+
parent: {
|
|
313
|
+
id: "Test string",
|
|
314
|
+
type: "Test string",
|
|
315
|
+
},
|
|
316
|
+
projectId: "Test string",
|
|
317
|
+
projectNumber: "Test string",
|
|
318
|
+
});
|
|
319
|
+
/**
|
|
320
|
+
* Marks the Project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the Project if it has a lifecycle state of ACTIVE.
|
|
321
|
+
* This method changes the Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion starts at an unspecified time, at which point the Project is no longer accessible. Until
|
|
322
|
+
* the deletion completes, you can check the lifecycle state checked by retrieving the Project with GetProject, and the Project remains visible to ListProjects. However, you cannot update
|
|
323
|
+
* the project. After the deletion completes, the Project is not retrievable by the GetProject and ListProjects methods. The caller must have delete permissions for this Project.
|
|
324
|
+
*/
|
|
325
|
+
await gapi.client.cloudresourcemanager.projects.delete({
|
|
326
|
+
projectId: "Test string",
|
|
327
|
+
});
|
|
328
|
+
/** Retrieves the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project. */
|
|
329
|
+
await gapi.client.cloudresourcemanager.projects.get({
|
|
330
|
+
projectId: "Test string",
|
|
331
|
+
});
|
|
332
|
+
/**
|
|
333
|
+
* Gets a list of ancestors in the resource hierarchy for the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for
|
|
334
|
+
* this Project.
|
|
335
|
+
*/
|
|
336
|
+
await gapi.client.cloudresourcemanager.projects.getAncestry({
|
|
337
|
+
projectId: "Test string",
|
|
338
|
+
}, {
|
|
339
|
+
});
|
|
340
|
+
/**
|
|
341
|
+
* Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed
|
|
342
|
+
* `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.
|
|
343
|
+
*/
|
|
344
|
+
await gapi.client.cloudresourcemanager.projects.getEffectiveOrgPolicy({
|
|
345
|
+
resource: "Test string",
|
|
346
|
+
}, {
|
|
347
|
+
constraint: "Test string",
|
|
348
|
+
});
|
|
349
|
+
/**
|
|
350
|
+
* Returns the IAM access control policy for the specified Project. Permission is denied if the policy or the resource does not exist. Authorization requires the Google IAM permission
|
|
351
|
+
* `resourcemanager.projects.getIamPolicy` on the project. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource
|
|
352
|
+
* Names](https://cloud.google.com/apis/design/resource_names).
|
|
353
|
+
*/
|
|
354
|
+
await gapi.client.cloudresourcemanager.projects.getIamPolicy({
|
|
355
|
+
resource: "Test string",
|
|
356
|
+
}, {
|
|
357
|
+
options: {
|
|
358
|
+
requestedPolicyVersion: 42,
|
|
359
|
+
},
|
|
360
|
+
});
|
|
361
|
+
/**
|
|
362
|
+
* Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag`
|
|
363
|
+
* value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.
|
|
364
|
+
*/
|
|
365
|
+
await gapi.client.cloudresourcemanager.projects.getOrgPolicy({
|
|
366
|
+
resource: "Test string",
|
|
367
|
+
}, {
|
|
368
|
+
constraint: "Test string",
|
|
369
|
+
});
|
|
370
|
+
/**
|
|
371
|
+
* Lists Projects that the caller has the `resourcemanager.projects.get` permission on and satisfy the specified filter. This method returns Projects in an unspecified order. This method
|
|
372
|
+
* is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in
|
|
373
|
+
* the results. To retrieve the latest state of a project, use the GetProject method. NOTE: If the request filter contains a `parent.type` and `parent.id` and the caller has the
|
|
374
|
+
* `resourcemanager.projects.list` permission on the parent, the results will be drawn from an alternate index which provides more consistent results. In future versions of this API, this
|
|
375
|
+
* List method will be split into List and Search to properly capture the behavioral difference.
|
|
376
|
+
*/
|
|
377
|
+
await gapi.client.cloudresourcemanager.projects.list({
|
|
378
|
+
filter: "Test string",
|
|
379
|
+
pageSize: 42,
|
|
380
|
+
pageToken: "Test string",
|
|
381
|
+
});
|
|
382
|
+
/** Lists `Constraints` that could be applied on the specified resource. */
|
|
383
|
+
await gapi.client.cloudresourcemanager.projects.listAvailableOrgPolicyConstraints({
|
|
384
|
+
resource: "Test string",
|
|
385
|
+
}, {
|
|
386
|
+
pageSize: 42,
|
|
387
|
+
pageToken: "Test string",
|
|
388
|
+
});
|
|
389
|
+
/** Lists all the `Policies` set for a particular resource. */
|
|
390
|
+
await gapi.client.cloudresourcemanager.projects.listOrgPolicies({
|
|
391
|
+
resource: "Test string",
|
|
392
|
+
}, {
|
|
393
|
+
pageSize: 42,
|
|
394
|
+
pageToken: "Test string",
|
|
395
|
+
});
|
|
396
|
+
/**
|
|
397
|
+
* Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing
|
|
398
|
+
* service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or
|
|
399
|
+
* updating its roles. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource
|
|
400
|
+
* Names](https://cloud.google.com/apis/design/resource_names). The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and
|
|
401
|
+
* `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For
|
|
402
|
+
* example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service
|
|
403
|
+
* accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the
|
|
404
|
+
* invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the
|
|
405
|
+
* invitation. + You can only grant ownership of a project to a member by using the GCP Console. Inviting a member will deliver an invitation email that they must accept. An invitation
|
|
406
|
+
* email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + If the project is not part of
|
|
407
|
+
* an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner
|
|
408
|
+
* from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack
|
|
409
|
+
* of a ToS-accepting owner is rectified. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible. Authorization requires the
|
|
410
|
+
* Google IAM permission `resourcemanager.projects.setIamPolicy` on the project
|
|
411
|
+
*/
|
|
412
|
+
await gapi.client.cloudresourcemanager.projects.setIamPolicy({
|
|
413
|
+
resource: "Test string",
|
|
414
|
+
}, {
|
|
415
|
+
policy: {
|
|
416
|
+
auditConfigs: [
|
|
417
|
+
{
|
|
418
|
+
auditLogConfigs: [
|
|
419
|
+
{
|
|
420
|
+
exemptedMembers: [
|
|
421
|
+
"Test string"
|
|
422
|
+
],
|
|
423
|
+
logType: "Test string",
|
|
424
|
+
}
|
|
425
|
+
],
|
|
426
|
+
service: "Test string",
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
bindings: [
|
|
430
|
+
{
|
|
431
|
+
condition: {
|
|
432
|
+
description: "Test string",
|
|
433
|
+
expression: "Test string",
|
|
434
|
+
location: "Test string",
|
|
435
|
+
title: "Test string",
|
|
436
|
+
},
|
|
437
|
+
members: [
|
|
438
|
+
"Test string"
|
|
439
|
+
],
|
|
440
|
+
role: "Test string",
|
|
441
|
+
}
|
|
442
|
+
],
|
|
443
|
+
etag: "Test string",
|
|
444
|
+
version: 42,
|
|
445
|
+
},
|
|
446
|
+
updateMask: "Test string",
|
|
447
|
+
});
|
|
448
|
+
/**
|
|
449
|
+
* Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy`
|
|
450
|
+
* results in an unconditional write of the `Policy`.
|
|
451
|
+
*/
|
|
452
|
+
await gapi.client.cloudresourcemanager.projects.setOrgPolicy({
|
|
453
|
+
resource: "Test string",
|
|
454
|
+
}, {
|
|
455
|
+
policy: {
|
|
456
|
+
booleanPolicy: {
|
|
457
|
+
enforced: true,
|
|
458
|
+
},
|
|
459
|
+
constraint: "Test string",
|
|
460
|
+
etag: "Test string",
|
|
461
|
+
listPolicy: {
|
|
462
|
+
allowedValues: [
|
|
463
|
+
"Test string"
|
|
464
|
+
],
|
|
465
|
+
allValues: "Test string",
|
|
466
|
+
deniedValues: [
|
|
467
|
+
"Test string"
|
|
468
|
+
],
|
|
469
|
+
inheritFromParent: true,
|
|
470
|
+
suggestedValue: "Test string",
|
|
471
|
+
},
|
|
472
|
+
restoreDefault: {
|
|
473
|
+
},
|
|
474
|
+
updateTime: "Test string",
|
|
475
|
+
version: 42,
|
|
476
|
+
},
|
|
477
|
+
});
|
|
478
|
+
/**
|
|
479
|
+
* Returns permissions that a caller has on the specified Project. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource
|
|
480
|
+
* Names](https://cloud.google.com/apis/design/resource_names). There are no permissions required for making this API call.
|
|
481
|
+
*/
|
|
482
|
+
await gapi.client.cloudresourcemanager.projects.testIamPermissions({
|
|
483
|
+
resource: "Test string",
|
|
484
|
+
}, {
|
|
485
|
+
permissions: [
|
|
486
|
+
"Test string"
|
|
487
|
+
],
|
|
488
|
+
});
|
|
489
|
+
/**
|
|
490
|
+
* Restores the Project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a Project that has a lifecycle state of DELETE_REQUESTED.
|
|
491
|
+
* After deletion starts, the Project cannot be restored. The caller must have undelete permissions for this Project.
|
|
492
|
+
*/
|
|
493
|
+
await gapi.client.cloudresourcemanager.projects.undelete({
|
|
494
|
+
projectId: "Test string",
|
|
495
|
+
}, {
|
|
496
|
+
});
|
|
497
|
+
/** Updates the attributes of the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this Project. */
|
|
498
|
+
await gapi.client.cloudresourcemanager.projects.update({
|
|
499
|
+
projectId: "Test string",
|
|
500
|
+
}, {
|
|
501
|
+
createTime: "Test string",
|
|
502
|
+
labels: {
|
|
503
|
+
A: "Test string"
|
|
504
|
+
},
|
|
505
|
+
lifecycleState: "Test string",
|
|
506
|
+
name: "Test string",
|
|
507
|
+
parent: {
|
|
508
|
+
id: "Test string",
|
|
509
|
+
type: "Test string",
|
|
510
|
+
},
|
|
511
|
+
projectId: "Test string",
|
|
512
|
+
projectNumber: "Test string",
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
});
|
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
|
+
}
|