@maxim_mazurok/gapi.client.iam-v2beta 0.0.20220728
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 +470 -0
- package/package.json +20 -0
- package/readme.md +93 -0
- package/tests.ts +138 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Identity and Access Management (IAM) API v2beta 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/iam/
|
|
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://iam.googleapis.com/$discovery/rest?version=v2beta
|
|
13
|
+
// Revision: 20220728
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Identity and Access Management (IAM) API v2beta */
|
|
19
|
+
function load(urlOrObject: "https://iam.googleapis.com/$discovery/rest?version=v2beta"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "iam", version: "v2beta"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "iam", version: "v2beta", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace iam {
|
|
26
|
+
interface GoogleIamAdminV1AuditData {
|
|
27
|
+
/** The permission_delta when when creating or updating a Role. */
|
|
28
|
+
permissionDelta?: GoogleIamAdminV1AuditDataPermissionDelta;
|
|
29
|
+
}
|
|
30
|
+
interface GoogleIamAdminV1AuditDataPermissionDelta {
|
|
31
|
+
/** Added permissions. */
|
|
32
|
+
addedPermissions?: string[];
|
|
33
|
+
/** Removed permissions. */
|
|
34
|
+
removedPermissions?: string[];
|
|
35
|
+
}
|
|
36
|
+
// tslint:disable-next-line:no-empty-interface
|
|
37
|
+
interface GoogleIamV1betaWorkloadIdentityPoolOperationMetadata {
|
|
38
|
+
}
|
|
39
|
+
interface GoogleIamV1BindingDelta {
|
|
40
|
+
/** The action that was performed on a Binding. Required */
|
|
41
|
+
action?: string;
|
|
42
|
+
/** The condition that is associated with this binding. */
|
|
43
|
+
condition?: GoogleTypeExpr;
|
|
44
|
+
/** A single identity requesting access for a Google Cloud resource. Follows the same format of Binding.members. Required */
|
|
45
|
+
member?: string;
|
|
46
|
+
/** Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Required */
|
|
47
|
+
role?: string;
|
|
48
|
+
}
|
|
49
|
+
interface GoogleIamV1LoggingAuditData {
|
|
50
|
+
/** Policy delta between the original policy and the newly set policy. */
|
|
51
|
+
policyDelta?: GoogleIamV1PolicyDelta;
|
|
52
|
+
}
|
|
53
|
+
interface GoogleIamV1PolicyDelta {
|
|
54
|
+
/** The delta for Bindings between two policies. */
|
|
55
|
+
bindingDeltas?: GoogleIamV1BindingDelta[];
|
|
56
|
+
}
|
|
57
|
+
interface GoogleIamV2betaDenyRule {
|
|
58
|
+
/**
|
|
59
|
+
* The condition that determines whether this deny rule applies to a request. If the condition expression evaluates to `true`, then the deny rule is applied; otherwise, the deny rule
|
|
60
|
+
* is not applied. Each deny rule is evaluated independently. If this deny rule does not apply to a request, other deny rules might still apply. The condition can use CEL functions
|
|
61
|
+
* that evaluate [resource tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other functions and operators are not supported.
|
|
62
|
+
*/
|
|
63
|
+
denialCondition?: GoogleTypeExpr;
|
|
64
|
+
/**
|
|
65
|
+
* The permissions that are explicitly denied by this rule. Each permission uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}` is the fully qualified domain
|
|
66
|
+
* name for the service. For example, `iam.googleapis.com/roles.list`.
|
|
67
|
+
*/
|
|
68
|
+
deniedPermissions?: string[];
|
|
69
|
+
/**
|
|
70
|
+
* The identities that are prevented from using one or more permissions on Google Cloud resources. This field can contain the following values: * `principalSet://goog/public:all`: A
|
|
71
|
+
* special identifier that represents any principal that is on the internet, even if they do not have a Google Account or are not logged in. * `principal://goog/subject/{email_id}`: A
|
|
72
|
+
* specific Google Account. Includes Gmail, Cloud Identity, and Google Workspace user accounts. For example, `principal://goog/subject/alice@example.com`. *
|
|
73
|
+
* `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific Google Account that was deleted recently. For example,
|
|
74
|
+
* `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If the Google Account is recovered, this identifier reverts to the standard identifier for a Google Account. *
|
|
75
|
+
* `principalSet://goog/group/{group_id}`: A Google group. For example, `principalSet://goog/group/admins@example.com`. * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A
|
|
76
|
+
* Google group that was deleted recently. For example, `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If the Google group is restored, this identifier reverts
|
|
77
|
+
* to the standard identifier for a Google group. * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`: A Google Cloud service account. For example,
|
|
78
|
+
* `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`. *
|
|
79
|
+
* `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`: A Google Cloud service account that was deleted recently. For example,
|
|
80
|
+
* `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`. If the service account is undeleted, this identifier
|
|
81
|
+
* reverts to the standard identifier for a service account. * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the principals associated with the specified Google
|
|
82
|
+
* Workspace or Cloud Identity customer ID. For example, `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
|
|
83
|
+
*/
|
|
84
|
+
deniedPrincipals?: string[];
|
|
85
|
+
/**
|
|
86
|
+
* Specifies the permissions that this rule excludes from the set of denied permissions given by `denied_permissions`. If a permission appears in `denied_permissions` _and_ in
|
|
87
|
+
* `exception_permissions` then it will _not_ be denied. The excluded permissions can be specified using the same syntax as `denied_permissions`.
|
|
88
|
+
*/
|
|
89
|
+
exceptionPermissions?: string[];
|
|
90
|
+
/**
|
|
91
|
+
* The identities that are excluded from the deny rule, even if they are listed in the `denied_principals`. For example, you could add a Google group to the `denied_principals`, then
|
|
92
|
+
* exclude specific users who belong to that group. This field can contain the same values as the `denied_principals` field, excluding `principalSet://goog/public:all`, which
|
|
93
|
+
* represents all users on the internet.
|
|
94
|
+
*/
|
|
95
|
+
exceptionPrincipals?: string[];
|
|
96
|
+
}
|
|
97
|
+
interface GoogleIamV2betaListPoliciesResponse {
|
|
98
|
+
/** A page token that you can use in a ListPoliciesRequest to retrieve the next page. If this field is omitted, there are no additional pages. */
|
|
99
|
+
nextPageToken?: string;
|
|
100
|
+
/** Metadata for the policies that are attached to the resource. */
|
|
101
|
+
policies?: GoogleIamV2betaPolicy[];
|
|
102
|
+
}
|
|
103
|
+
interface GoogleIamV2betaPolicy {
|
|
104
|
+
/** A key-value map to store arbitrary metadata for the `Policy`. Keys can be up to 63 characters. Values can be up to 255 characters. */
|
|
105
|
+
annotations?: { [P in string]: string };
|
|
106
|
+
/** Output only. The time when the `Policy` was created. */
|
|
107
|
+
createTime?: string;
|
|
108
|
+
/** Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted. */
|
|
109
|
+
deleteTime?: string;
|
|
110
|
+
/** A user-specified description of the `Policy`. This value can be up to 63 characters. */
|
|
111
|
+
displayName?: string;
|
|
112
|
+
/**
|
|
113
|
+
* An opaque tag that identifies the current version of the `Policy`. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by
|
|
114
|
+
* another. If this field is present in a CreatePolicy request, the value is ignored.
|
|
115
|
+
*/
|
|
116
|
+
etag?: string;
|
|
117
|
+
/** Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`. */
|
|
118
|
+
kind?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Immutable. The resource name of the `Policy`, which must be unique. Format: `policies/{attachment_point}/denypolicies/{policy_id}` The attachment point is identified by its
|
|
121
|
+
* URL-encoded full resource name, which means that the forward-slash character, `/`, must be written as `%2F`. For example,
|
|
122
|
+
* `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`. For organizations and folders, use the numeric ID in the full resource name. For
|
|
123
|
+
* projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.
|
|
124
|
+
*/
|
|
125
|
+
name?: string;
|
|
126
|
+
/** A list of rules that specify the behavior of the `Policy`. All of the rules should be of the `kind` specified in the `Policy`. */
|
|
127
|
+
rules?: GoogleIamV2betaPolicyRule[];
|
|
128
|
+
/** Immutable. The globally unique ID of the `Policy`. Assigned automatically when the `Policy` is created. */
|
|
129
|
+
uid?: string;
|
|
130
|
+
/** Output only. The time when the `Policy` was last updated. */
|
|
131
|
+
updateTime?: string;
|
|
132
|
+
}
|
|
133
|
+
interface GoogleIamV2betaPolicyOperationMetadata {
|
|
134
|
+
/** Timestamp when the `google.longrunning.Operation` was created. */
|
|
135
|
+
createTime?: string;
|
|
136
|
+
}
|
|
137
|
+
interface GoogleIamV2betaPolicyRule {
|
|
138
|
+
/** A rule for a deny policy. */
|
|
139
|
+
denyRule?: GoogleIamV2betaDenyRule;
|
|
140
|
+
/** A user-specified description of the rule. This value can be up to 256 characters. */
|
|
141
|
+
description?: string;
|
|
142
|
+
}
|
|
143
|
+
interface GoogleLongrunningOperation {
|
|
144
|
+
/** 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. */
|
|
145
|
+
done?: boolean;
|
|
146
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
147
|
+
error?: GoogleRpcStatus;
|
|
148
|
+
/**
|
|
149
|
+
* 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
|
|
150
|
+
* metadata. Any method that returns a long-running operation should document the metadata type, if any.
|
|
151
|
+
*/
|
|
152
|
+
metadata?: { [P in string]: any };
|
|
153
|
+
/**
|
|
154
|
+
* 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
|
|
155
|
+
* with `operations/{unique_id}`.
|
|
156
|
+
*/
|
|
157
|
+
name?: string;
|
|
158
|
+
/**
|
|
159
|
+
* 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
|
|
160
|
+
* 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
|
|
161
|
+
* original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
|
|
162
|
+
*/
|
|
163
|
+
response?: { [P in string]: any };
|
|
164
|
+
}
|
|
165
|
+
interface GoogleRpcStatus {
|
|
166
|
+
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
167
|
+
code?: number;
|
|
168
|
+
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
|
|
169
|
+
details?: Array<{ [P in string]: any }>;
|
|
170
|
+
/**
|
|
171
|
+
* 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
|
|
172
|
+
* client.
|
|
173
|
+
*/
|
|
174
|
+
message?: string;
|
|
175
|
+
}
|
|
176
|
+
interface GoogleTypeExpr {
|
|
177
|
+
/** Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. */
|
|
178
|
+
description?: string;
|
|
179
|
+
/** Textual representation of an expression in Common Expression Language syntax. */
|
|
180
|
+
expression?: string;
|
|
181
|
+
/** Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. */
|
|
182
|
+
location?: string;
|
|
183
|
+
/** 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. */
|
|
184
|
+
title?: string;
|
|
185
|
+
}
|
|
186
|
+
interface OperationsResource {
|
|
187
|
+
/** 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. */
|
|
188
|
+
get(request?: {
|
|
189
|
+
/** V1 error format. */
|
|
190
|
+
"$.xgafv"?: string;
|
|
191
|
+
/** OAuth access token. */
|
|
192
|
+
access_token?: string;
|
|
193
|
+
/** Data format for response. */
|
|
194
|
+
alt?: string;
|
|
195
|
+
/** JSONP */
|
|
196
|
+
callback?: string;
|
|
197
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
198
|
+
fields?: string;
|
|
199
|
+
/** 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. */
|
|
200
|
+
key?: string;
|
|
201
|
+
/** The name of the operation resource. */
|
|
202
|
+
name: string;
|
|
203
|
+
/** OAuth 2.0 token for the current user. */
|
|
204
|
+
oauth_token?: string;
|
|
205
|
+
/** Returns response with indentations and line breaks. */
|
|
206
|
+
prettyPrint?: boolean;
|
|
207
|
+
/** 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. */
|
|
208
|
+
quotaUser?: string;
|
|
209
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
210
|
+
upload_protocol?: string;
|
|
211
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
212
|
+
uploadType?: string;
|
|
213
|
+
}): Request<GoogleLongrunningOperation>;
|
|
214
|
+
}
|
|
215
|
+
interface PoliciesResource {
|
|
216
|
+
/** Creates a policy. */
|
|
217
|
+
createPolicy(request: {
|
|
218
|
+
/** V1 error format. */
|
|
219
|
+
"$.xgafv"?: string;
|
|
220
|
+
/** OAuth access token. */
|
|
221
|
+
access_token?: string;
|
|
222
|
+
/** Data format for response. */
|
|
223
|
+
alt?: string;
|
|
224
|
+
/** JSONP */
|
|
225
|
+
callback?: string;
|
|
226
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
227
|
+
fields?: string;
|
|
228
|
+
/** 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. */
|
|
229
|
+
key?: string;
|
|
230
|
+
/** OAuth 2.0 token for the current user. */
|
|
231
|
+
oauth_token?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Required. The resource that the policy is attached to, along with the kind of policy to create. Format: `policies/{attachment_point}/denypolicies` The attachment point is
|
|
234
|
+
* identified by its URL-encoded full resource name, which means that the forward-slash character, `/`, must be written as `%2F`. For example,
|
|
235
|
+
* `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. For organizations and folders, use the numeric ID in the full resource name. For projects,
|
|
236
|
+
* you can use the alphanumeric or the numeric ID.
|
|
237
|
+
*/
|
|
238
|
+
parent: string;
|
|
239
|
+
/**
|
|
240
|
+
* The ID to use for this policy, which will become the final component of the policy's resource name. The ID must contain 3 to 63 characters. It can contain lowercase letters and
|
|
241
|
+
* numbers, as well as dashes (`-`) and periods (`.`). The first character must be a lowercase letter.
|
|
242
|
+
*/
|
|
243
|
+
policyId?: string;
|
|
244
|
+
/** Returns response with indentations and line breaks. */
|
|
245
|
+
prettyPrint?: boolean;
|
|
246
|
+
/** 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. */
|
|
247
|
+
quotaUser?: string;
|
|
248
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
249
|
+
upload_protocol?: string;
|
|
250
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
251
|
+
uploadType?: string;
|
|
252
|
+
/** Request body */
|
|
253
|
+
resource: GoogleIamV2betaPolicy;
|
|
254
|
+
}): Request<GoogleLongrunningOperation>;
|
|
255
|
+
createPolicy(request: {
|
|
256
|
+
/** V1 error format. */
|
|
257
|
+
"$.xgafv"?: string;
|
|
258
|
+
/** OAuth access token. */
|
|
259
|
+
access_token?: string;
|
|
260
|
+
/** Data format for response. */
|
|
261
|
+
alt?: string;
|
|
262
|
+
/** JSONP */
|
|
263
|
+
callback?: string;
|
|
264
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
265
|
+
fields?: string;
|
|
266
|
+
/** 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. */
|
|
267
|
+
key?: string;
|
|
268
|
+
/** OAuth 2.0 token for the current user. */
|
|
269
|
+
oauth_token?: string;
|
|
270
|
+
/**
|
|
271
|
+
* Required. The resource that the policy is attached to, along with the kind of policy to create. Format: `policies/{attachment_point}/denypolicies` The attachment point is
|
|
272
|
+
* identified by its URL-encoded full resource name, which means that the forward-slash character, `/`, must be written as `%2F`. For example,
|
|
273
|
+
* `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. For organizations and folders, use the numeric ID in the full resource name. For projects,
|
|
274
|
+
* you can use the alphanumeric or the numeric ID.
|
|
275
|
+
*/
|
|
276
|
+
parent: string;
|
|
277
|
+
/**
|
|
278
|
+
* The ID to use for this policy, which will become the final component of the policy's resource name. The ID must contain 3 to 63 characters. It can contain lowercase letters and
|
|
279
|
+
* numbers, as well as dashes (`-`) and periods (`.`). The first character must be a lowercase letter.
|
|
280
|
+
*/
|
|
281
|
+
policyId?: string;
|
|
282
|
+
/** Returns response with indentations and line breaks. */
|
|
283
|
+
prettyPrint?: boolean;
|
|
284
|
+
/** 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. */
|
|
285
|
+
quotaUser?: string;
|
|
286
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
287
|
+
upload_protocol?: string;
|
|
288
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
289
|
+
uploadType?: string;
|
|
290
|
+
},
|
|
291
|
+
body: GoogleIamV2betaPolicy): Request<GoogleLongrunningOperation>;
|
|
292
|
+
/** Deletes a policy. This action is permanent. */
|
|
293
|
+
delete(request?: {
|
|
294
|
+
/** V1 error format. */
|
|
295
|
+
"$.xgafv"?: string;
|
|
296
|
+
/** OAuth access token. */
|
|
297
|
+
access_token?: string;
|
|
298
|
+
/** Data format for response. */
|
|
299
|
+
alt?: string;
|
|
300
|
+
/** JSONP */
|
|
301
|
+
callback?: string;
|
|
302
|
+
/**
|
|
303
|
+
* Optional. The expected `etag` of the policy to delete. If the value does not match the value that is stored in IAM, the request fails with a `409` error code and `ABORTED`
|
|
304
|
+
* status. If you omit this field, the policy is deleted regardless of its current `etag`.
|
|
305
|
+
*/
|
|
306
|
+
etag?: string;
|
|
307
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
308
|
+
fields?: string;
|
|
309
|
+
/** 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. */
|
|
310
|
+
key?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Required. The resource name of the policy to delete. Format: `policies/{attachment_point}/denypolicies/{policy_id}` Use the URL-encoded full resource name, which means that the
|
|
313
|
+
* forward-slash character, `/`, must be written as `%2F`. For example, `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. For
|
|
314
|
+
* organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID.
|
|
315
|
+
*/
|
|
316
|
+
name: string;
|
|
317
|
+
/** OAuth 2.0 token for the current user. */
|
|
318
|
+
oauth_token?: string;
|
|
319
|
+
/** Returns response with indentations and line breaks. */
|
|
320
|
+
prettyPrint?: boolean;
|
|
321
|
+
/** 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. */
|
|
322
|
+
quotaUser?: string;
|
|
323
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
324
|
+
upload_protocol?: string;
|
|
325
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
326
|
+
uploadType?: string;
|
|
327
|
+
}): Request<GoogleLongrunningOperation>;
|
|
328
|
+
/** Gets a policy. */
|
|
329
|
+
get(request?: {
|
|
330
|
+
/** V1 error format. */
|
|
331
|
+
"$.xgafv"?: string;
|
|
332
|
+
/** OAuth access token. */
|
|
333
|
+
access_token?: string;
|
|
334
|
+
/** Data format for response. */
|
|
335
|
+
alt?: string;
|
|
336
|
+
/** JSONP */
|
|
337
|
+
callback?: string;
|
|
338
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
339
|
+
fields?: string;
|
|
340
|
+
/** 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. */
|
|
341
|
+
key?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Required. The resource name of the policy to retrieve. Format: `policies/{attachment_point}/denypolicies/{policy_id}` Use the URL-encoded full resource name, which means that
|
|
344
|
+
* the forward-slash character, `/`, must be written as `%2F`. For example, `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. For
|
|
345
|
+
* organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID.
|
|
346
|
+
*/
|
|
347
|
+
name: string;
|
|
348
|
+
/** OAuth 2.0 token for the current user. */
|
|
349
|
+
oauth_token?: string;
|
|
350
|
+
/** Returns response with indentations and line breaks. */
|
|
351
|
+
prettyPrint?: boolean;
|
|
352
|
+
/** 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. */
|
|
353
|
+
quotaUser?: string;
|
|
354
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
355
|
+
upload_protocol?: string;
|
|
356
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
357
|
+
uploadType?: string;
|
|
358
|
+
}): Request<GoogleIamV2betaPolicy>;
|
|
359
|
+
/** Retrieves the policies of the specified kind that are attached to a resource. The response lists only policy metadata. In particular, policy rules are omitted. */
|
|
360
|
+
listPolicies(request?: {
|
|
361
|
+
/** V1 error format. */
|
|
362
|
+
"$.xgafv"?: string;
|
|
363
|
+
/** OAuth access token. */
|
|
364
|
+
access_token?: string;
|
|
365
|
+
/** Data format for response. */
|
|
366
|
+
alt?: string;
|
|
367
|
+
/** JSONP */
|
|
368
|
+
callback?: string;
|
|
369
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
370
|
+
fields?: string;
|
|
371
|
+
/** 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. */
|
|
372
|
+
key?: string;
|
|
373
|
+
/** OAuth 2.0 token for the current user. */
|
|
374
|
+
oauth_token?: string;
|
|
375
|
+
/** The maximum number of policies to return. IAM ignores this value and uses the value 1000. */
|
|
376
|
+
pageSize?: number;
|
|
377
|
+
/** A page token received in a ListPoliciesResponse. Provide this token to retrieve the next page. */
|
|
378
|
+
pageToken?: string;
|
|
379
|
+
/**
|
|
380
|
+
* Required. The resource that the policy is attached to, along with the kind of policy to list. Format: `policies/{attachment_point}/denypolicies` The attachment point is
|
|
381
|
+
* identified by its URL-encoded full resource name, which means that the forward-slash character, `/`, must be written as `%2F`. For example,
|
|
382
|
+
* `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. For organizations and folders, use the numeric ID in the full resource name. For projects,
|
|
383
|
+
* you can use the alphanumeric or the numeric ID.
|
|
384
|
+
*/
|
|
385
|
+
parent: string;
|
|
386
|
+
/** Returns response with indentations and line breaks. */
|
|
387
|
+
prettyPrint?: boolean;
|
|
388
|
+
/** 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. */
|
|
389
|
+
quotaUser?: string;
|
|
390
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
391
|
+
upload_protocol?: string;
|
|
392
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
393
|
+
uploadType?: string;
|
|
394
|
+
}): Request<GoogleIamV2betaListPoliciesResponse>;
|
|
395
|
+
/**
|
|
396
|
+
* Updates the specified policy. You can update only the rules and the display name for the policy. To update a policy, you should use a read-modify-write loop: 1. Use GetPolicy to
|
|
397
|
+
* read the current version of the policy. 2. Modify the policy as needed. 3. Use `UpdatePolicy` to write the updated policy. This pattern helps prevent conflicts between concurrent
|
|
398
|
+
* updates.
|
|
399
|
+
*/
|
|
400
|
+
update(request: {
|
|
401
|
+
/** V1 error format. */
|
|
402
|
+
"$.xgafv"?: string;
|
|
403
|
+
/** OAuth access token. */
|
|
404
|
+
access_token?: string;
|
|
405
|
+
/** Data format for response. */
|
|
406
|
+
alt?: string;
|
|
407
|
+
/** JSONP */
|
|
408
|
+
callback?: string;
|
|
409
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
410
|
+
fields?: string;
|
|
411
|
+
/** 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. */
|
|
412
|
+
key?: string;
|
|
413
|
+
/**
|
|
414
|
+
* Immutable. The resource name of the `Policy`, which must be unique. Format: `policies/{attachment_point}/denypolicies/{policy_id}` The attachment point is identified by its
|
|
415
|
+
* URL-encoded full resource name, which means that the forward-slash character, `/`, must be written as `%2F`. For example,
|
|
416
|
+
* `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`. For organizations and folders, use the numeric ID in the full resource name.
|
|
417
|
+
* For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.
|
|
418
|
+
*/
|
|
419
|
+
name: string;
|
|
420
|
+
/** OAuth 2.0 token for the current user. */
|
|
421
|
+
oauth_token?: string;
|
|
422
|
+
/** Returns response with indentations and line breaks. */
|
|
423
|
+
prettyPrint?: boolean;
|
|
424
|
+
/** 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. */
|
|
425
|
+
quotaUser?: string;
|
|
426
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
427
|
+
upload_protocol?: string;
|
|
428
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
429
|
+
uploadType?: string;
|
|
430
|
+
/** Request body */
|
|
431
|
+
resource: GoogleIamV2betaPolicy;
|
|
432
|
+
}): Request<GoogleLongrunningOperation>;
|
|
433
|
+
update(request: {
|
|
434
|
+
/** V1 error format. */
|
|
435
|
+
"$.xgafv"?: string;
|
|
436
|
+
/** OAuth access token. */
|
|
437
|
+
access_token?: string;
|
|
438
|
+
/** Data format for response. */
|
|
439
|
+
alt?: string;
|
|
440
|
+
/** JSONP */
|
|
441
|
+
callback?: string;
|
|
442
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
443
|
+
fields?: string;
|
|
444
|
+
/** 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. */
|
|
445
|
+
key?: string;
|
|
446
|
+
/**
|
|
447
|
+
* Immutable. The resource name of the `Policy`, which must be unique. Format: `policies/{attachment_point}/denypolicies/{policy_id}` The attachment point is identified by its
|
|
448
|
+
* URL-encoded full resource name, which means that the forward-slash character, `/`, must be written as `%2F`. For example,
|
|
449
|
+
* `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`. For organizations and folders, use the numeric ID in the full resource name.
|
|
450
|
+
* For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.
|
|
451
|
+
*/
|
|
452
|
+
name: string;
|
|
453
|
+
/** OAuth 2.0 token for the current user. */
|
|
454
|
+
oauth_token?: string;
|
|
455
|
+
/** Returns response with indentations and line breaks. */
|
|
456
|
+
prettyPrint?: boolean;
|
|
457
|
+
/** 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. */
|
|
458
|
+
quotaUser?: string;
|
|
459
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
460
|
+
upload_protocol?: string;
|
|
461
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
462
|
+
uploadType?: string;
|
|
463
|
+
},
|
|
464
|
+
body: GoogleIamV2betaPolicy): Request<GoogleLongrunningOperation>;
|
|
465
|
+
operations: OperationsResource;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const policies: PoliciesResource;
|
|
469
|
+
}
|
|
470
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.iam-v2beta",
|
|
3
|
+
"version": "0.0.20220728",
|
|
4
|
+
"description": "TypeScript typings for Identity and Access Management (IAM) API v2beta",
|
|
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,93 @@
|
|
|
1
|
+
# TypeScript typings for Identity and Access Management (IAM) API v2beta
|
|
2
|
+
|
|
3
|
+
Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/iam/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Identity and Access Management (IAM) API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.iam-v2beta --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://iam.googleapis.com/$discovery/rest?version=v2beta', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.iam
|
|
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('iam', 'v2beta', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.iam
|
|
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
|
+
immediate = true;
|
|
52
|
+
// ...
|
|
53
|
+
|
|
54
|
+
gapi.auth.authorize(
|
|
55
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
56
|
+
authResult => {
|
|
57
|
+
if (authResult && !authResult.error) {
|
|
58
|
+
/* handle successful authorization */
|
|
59
|
+
} else {
|
|
60
|
+
/* handle authorization error */
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After that you can use Identity and Access Management (IAM) API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
Creates a policy.
|
|
71
|
+
*/
|
|
72
|
+
await gapi.client.iam.policies.createPolicy({ parent: "parent", });
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
Deletes a policy. This action is permanent.
|
|
76
|
+
*/
|
|
77
|
+
await gapi.client.iam.policies.delete({ name: "name", });
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
Gets a policy.
|
|
81
|
+
*/
|
|
82
|
+
await gapi.client.iam.policies.get({ name: "name", });
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
Retrieves the policies of the specified kind that are attached to a resource. The response lists only policy metadata. In particular, policy rules are omitted.
|
|
86
|
+
*/
|
|
87
|
+
await gapi.client.iam.policies.listPolicies({ parent: "parent", });
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
Updates the specified policy. You can update only the rules and the display name for the policy. To update a policy, you should use a read-modify-write loop: 1. Use GetPolicy to read the current version of the policy. 2. Modify the policy as needed. 3. Use `UpdatePolicy` to write the updated policy. This pattern helps prevent conflicts between concurrent updates.
|
|
91
|
+
*/
|
|
92
|
+
await gapi.client.iam.policies.update({ name: "name", });
|
|
93
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.iam-v2beta 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: 20220728
|
|
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=v2beta');
|
|
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
|
+
/** Creates a policy. */
|
|
33
|
+
await gapi.client.iam.policies.createPolicy({
|
|
34
|
+
parent: "Test string",
|
|
35
|
+
policyId: "Test string",
|
|
36
|
+
}, {
|
|
37
|
+
annotations: {
|
|
38
|
+
A: "Test string"
|
|
39
|
+
},
|
|
40
|
+
createTime: "Test string",
|
|
41
|
+
deleteTime: "Test string",
|
|
42
|
+
displayName: "Test string",
|
|
43
|
+
etag: "Test string",
|
|
44
|
+
kind: "Test string",
|
|
45
|
+
name: "Test string",
|
|
46
|
+
rules: [
|
|
47
|
+
{
|
|
48
|
+
denyRule: {
|
|
49
|
+
denialCondition: {
|
|
50
|
+
description: "Test string",
|
|
51
|
+
expression: "Test string",
|
|
52
|
+
location: "Test string",
|
|
53
|
+
title: "Test string",
|
|
54
|
+
},
|
|
55
|
+
deniedPermissions: [
|
|
56
|
+
"Test string"
|
|
57
|
+
],
|
|
58
|
+
deniedPrincipals: [
|
|
59
|
+
"Test string"
|
|
60
|
+
],
|
|
61
|
+
exceptionPermissions: [
|
|
62
|
+
"Test string"
|
|
63
|
+
],
|
|
64
|
+
exceptionPrincipals: [
|
|
65
|
+
"Test string"
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
description: "Test string",
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
uid: "Test string",
|
|
72
|
+
updateTime: "Test string",
|
|
73
|
+
});
|
|
74
|
+
/** Deletes a policy. This action is permanent. */
|
|
75
|
+
await gapi.client.iam.policies.delete({
|
|
76
|
+
etag: "Test string",
|
|
77
|
+
name: "Test string",
|
|
78
|
+
});
|
|
79
|
+
/** Gets a policy. */
|
|
80
|
+
await gapi.client.iam.policies.get({
|
|
81
|
+
name: "Test string",
|
|
82
|
+
});
|
|
83
|
+
/** Retrieves the policies of the specified kind that are attached to a resource. The response lists only policy metadata. In particular, policy rules are omitted. */
|
|
84
|
+
await gapi.client.iam.policies.listPolicies({
|
|
85
|
+
pageSize: 42,
|
|
86
|
+
pageToken: "Test string",
|
|
87
|
+
parent: "Test string",
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Updates the specified policy. You can update only the rules and the display name for the policy. To update a policy, you should use a read-modify-write loop: 1. Use GetPolicy to read
|
|
91
|
+
* the current version of the policy. 2. Modify the policy as needed. 3. Use `UpdatePolicy` to write the updated policy. This pattern helps prevent conflicts between concurrent updates.
|
|
92
|
+
*/
|
|
93
|
+
await gapi.client.iam.policies.update({
|
|
94
|
+
name: "Test string",
|
|
95
|
+
}, {
|
|
96
|
+
annotations: {
|
|
97
|
+
A: "Test string"
|
|
98
|
+
},
|
|
99
|
+
createTime: "Test string",
|
|
100
|
+
deleteTime: "Test string",
|
|
101
|
+
displayName: "Test string",
|
|
102
|
+
etag: "Test string",
|
|
103
|
+
kind: "Test string",
|
|
104
|
+
name: "Test string",
|
|
105
|
+
rules: [
|
|
106
|
+
{
|
|
107
|
+
denyRule: {
|
|
108
|
+
denialCondition: {
|
|
109
|
+
description: "Test string",
|
|
110
|
+
expression: "Test string",
|
|
111
|
+
location: "Test string",
|
|
112
|
+
title: "Test string",
|
|
113
|
+
},
|
|
114
|
+
deniedPermissions: [
|
|
115
|
+
"Test string"
|
|
116
|
+
],
|
|
117
|
+
deniedPrincipals: [
|
|
118
|
+
"Test string"
|
|
119
|
+
],
|
|
120
|
+
exceptionPermissions: [
|
|
121
|
+
"Test string"
|
|
122
|
+
],
|
|
123
|
+
exceptionPrincipals: [
|
|
124
|
+
"Test string"
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
description: "Test string",
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
uid: "Test string",
|
|
131
|
+
updateTime: "Test string",
|
|
132
|
+
});
|
|
133
|
+
/** 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. */
|
|
134
|
+
await gapi.client.iam.policies.operations.get({
|
|
135
|
+
name: "Test string",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
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
|
+
}
|