@maxim_mazurok/gapi.client.policysimulator-v1beta 0.0.20230409

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,578 @@
1
+ /* Type definitions for non-npm package Policy Simulator API v1beta 0.0 */
2
+ // Project: https://cloud.google.com/iam/docs/simulating-access
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
+
8
+ // IMPORTANT
9
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
+ // Generated from: https://policysimulator.googleapis.com/$discovery/rest?version=v1beta
12
+ // Revision: 20230409
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Policy Simulator API v1beta */
18
+ function load(urlOrObject: "https://policysimulator.googleapis.com/$discovery/rest?version=v1beta"): Promise<void>;
19
+ /** @deprecated Please load APIs with discovery documents. */
20
+ function load(name: "policysimulator", version: "v1beta"): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: "policysimulator", version: "v1beta", callback: () => any): void;
23
+
24
+ namespace policysimulator {
25
+ interface GoogleCloudPolicysimulatorV1Replay {
26
+ /** Required. The configuration used for the `Replay`. */
27
+ config?: GoogleCloudPolicysimulatorV1ReplayConfig;
28
+ /**
29
+ * Output only. The resource name of the `Replay`, which has the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where
30
+ * `{resource-id}` is the ID of the project, folder, or organization that owns the Replay. Example:
31
+ * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
32
+ */
33
+ name?: string;
34
+ /** Output only. Summary statistics about the replayed log entries. */
35
+ resultsSummary?: GoogleCloudPolicysimulatorV1ReplayResultsSummary;
36
+ /** Output only. The current state of the `Replay`. */
37
+ state?: string;
38
+ }
39
+ interface GoogleCloudPolicysimulatorV1ReplayConfig {
40
+ /** The logs to use as input for the Replay. */
41
+ logSource?: string;
42
+ /**
43
+ * A mapping of the resources that you want to simulate policies for and the policies that you want to simulate. Keys are the full resource names for the resources. For example,
44
+ * `//cloudresourcemanager.googleapis.com/projects/my-project`. For examples of full resource names for Google Cloud services, see
45
+ * https://cloud.google.com/iam/help/troubleshooter/full-resource-names. Values are Policy objects representing the policies that you want to simulate. Replays automatically take into
46
+ * account any IAM policies inherited through the resource hierarchy, and any policies set on descendant resources. You do not need to include these policies in the policy overlay.
47
+ */
48
+ policyOverlay?: { [P in string]: GoogleIamV1Policy };
49
+ }
50
+ interface GoogleCloudPolicysimulatorV1ReplayOperationMetadata {
51
+ /** Time when the request was received. */
52
+ startTime?: string;
53
+ }
54
+ interface GoogleCloudPolicysimulatorV1ReplayResultsSummary {
55
+ /** The number of replayed log entries with a difference between baseline and simulated policies. */
56
+ differenceCount?: number;
57
+ /** The number of log entries that could not be replayed. */
58
+ errorCount?: number;
59
+ /** The total number of log entries replayed. */
60
+ logCount?: number;
61
+ /** The date of the newest log entry replayed. */
62
+ newestDate?: GoogleTypeDate;
63
+ /** The date of the oldest log entry replayed. */
64
+ oldestDate?: GoogleTypeDate;
65
+ /** The number of replayed log entries with no difference between baseline and simulated policies. */
66
+ unchangedCount?: number;
67
+ }
68
+ interface GoogleIamV1AuditConfig {
69
+ /** The configuration for logging of each type of permission. */
70
+ auditLogConfigs?: GoogleIamV1AuditLogConfig[];
71
+ /**
72
+ * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all
73
+ * services.
74
+ */
75
+ service?: string;
76
+ }
77
+ interface GoogleIamV1AuditLogConfig {
78
+ /** Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. */
79
+ exemptedMembers?: string[];
80
+ /** The log type that this config enables. */
81
+ logType?: string;
82
+ }
83
+ interface GoogleIamV1Binding {
84
+ /**
85
+ * The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`,
86
+ * then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which
87
+ * resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
88
+ */
89
+ condition?: GoogleTypeExpr;
90
+ /**
91
+ * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on
92
+ * the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service
93
+ * account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific
94
+ * Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example,
95
+ * `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service
96
+ * account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
97
+ * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the
98
+ * users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has
99
+ * been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains
100
+ * the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently
101
+ * deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and
102
+ * the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that
103
+ * has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group
104
+ * retains the role in the binding.
105
+ */
106
+ members?: string[];
107
+ /** Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */
108
+ role?: string;
109
+ }
110
+ interface GoogleIamV1Policy {
111
+ /** Specifies cloud audit logging configuration for this policy. */
112
+ auditConfigs?: GoogleIamV1AuditConfig[];
113
+ /**
114
+ * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings`
115
+ * must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a
116
+ * principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another
117
+ * 1,450 principals to the `bindings` in the `Policy`.
118
+ */
119
+ bindings?: GoogleIamV1Binding[];
120
+ /**
121
+ * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make
122
+ * use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems
123
+ * are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM
124
+ * Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1`
125
+ * policy, and all of the conditions in the version `3` policy are lost.
126
+ */
127
+ etag?: string;
128
+ /**
129
+ * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings
130
+ * must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a
131
+ * policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use
132
+ * IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1`
133
+ * policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave
134
+ * the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
135
+ */
136
+ version?: number;
137
+ }
138
+ interface GoogleLongrunningListOperationsResponse {
139
+ /** The standard List next-page token. */
140
+ nextPageToken?: string;
141
+ /** A list of operations that matches the specified filter in the request. */
142
+ operations?: GoogleLongrunningOperation[];
143
+ }
144
+ interface GoogleLongrunningOperation {
145
+ /** 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. */
146
+ done?: boolean;
147
+ /** The error result of the operation in case of failure or cancellation. */
148
+ error?: GoogleRpcStatus;
149
+ /**
150
+ * 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
151
+ * metadata. Any method that returns a long-running operation should document the metadata type, if any.
152
+ */
153
+ metadata?: { [P in string]: any };
154
+ /**
155
+ * 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
156
+ * with `operations/{unique_id}`.
157
+ */
158
+ name?: string;
159
+ /**
160
+ * 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
161
+ * 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
162
+ * original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
163
+ */
164
+ response?: { [P in string]: any };
165
+ }
166
+ interface GoogleRpcStatus {
167
+ /** The status code, which should be an enum value of google.rpc.Code. */
168
+ code?: number;
169
+ /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
170
+ details?: Array<{ [P in string]: any }>;
171
+ /**
172
+ * 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
173
+ * client.
174
+ */
175
+ message?: string;
176
+ }
177
+ interface GoogleTypeDate {
178
+ /** Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */
179
+ day?: number;
180
+ /** Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */
181
+ month?: number;
182
+ /** Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */
183
+ year?: number;
184
+ }
185
+ interface GoogleTypeExpr {
186
+ /** Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. */
187
+ description?: string;
188
+ /** Textual representation of an expression in Common Expression Language syntax. */
189
+ expression?: string;
190
+ /** Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. */
191
+ location?: string;
192
+ /** 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. */
193
+ title?: string;
194
+ }
195
+ interface OperationsResource {
196
+ /** 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. */
197
+ get(request?: {
198
+ /** V1 error format. */
199
+ "$.xgafv"?: string;
200
+ /** OAuth access token. */
201
+ access_token?: string;
202
+ /** Data format for response. */
203
+ alt?: string;
204
+ /** JSONP */
205
+ callback?: string;
206
+ /** Selector specifying which fields to include in a partial response. */
207
+ fields?: string;
208
+ /** 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. */
209
+ key?: string;
210
+ /** The name of the operation resource. */
211
+ name: string;
212
+ /** OAuth 2.0 token for the current user. */
213
+ oauth_token?: string;
214
+ /** Returns response with indentations and line breaks. */
215
+ prettyPrint?: boolean;
216
+ /** 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. */
217
+ quotaUser?: string;
218
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
219
+ upload_protocol?: string;
220
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
221
+ uploadType?: string;
222
+ }): Request<GoogleLongrunningOperation>;
223
+ }
224
+ interface OrgPolicyViolationsPreviewsResource {
225
+ operations: OperationsResource;
226
+ }
227
+ interface OperationsResource {
228
+ /** 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. */
229
+ get(request?: {
230
+ /** V1 error format. */
231
+ "$.xgafv"?: string;
232
+ /** OAuth access token. */
233
+ access_token?: string;
234
+ /** Data format for response. */
235
+ alt?: string;
236
+ /** JSONP */
237
+ callback?: string;
238
+ /** Selector specifying which fields to include in a partial response. */
239
+ fields?: string;
240
+ /** 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. */
241
+ key?: string;
242
+ /** The name of the operation resource. */
243
+ name: string;
244
+ /** OAuth 2.0 token for the current user. */
245
+ oauth_token?: string;
246
+ /** Returns response with indentations and line breaks. */
247
+ prettyPrint?: boolean;
248
+ /** 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. */
249
+ quotaUser?: string;
250
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
251
+ upload_protocol?: string;
252
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
253
+ uploadType?: string;
254
+ }): Request<GoogleLongrunningOperation>;
255
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
256
+ list(request?: {
257
+ /** V1 error format. */
258
+ "$.xgafv"?: string;
259
+ /** OAuth access token. */
260
+ access_token?: string;
261
+ /** Data format for response. */
262
+ alt?: string;
263
+ /** JSONP */
264
+ callback?: string;
265
+ /** Selector specifying which fields to include in a partial response. */
266
+ fields?: string;
267
+ /** The standard list filter. */
268
+ filter?: string;
269
+ /** 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. */
270
+ key?: string;
271
+ /** The name of the operation's parent resource. */
272
+ name: string;
273
+ /** OAuth 2.0 token for the current user. */
274
+ oauth_token?: string;
275
+ /** The standard list page size. */
276
+ pageSize?: number;
277
+ /** The standard list page token. */
278
+ pageToken?: string;
279
+ /** Returns response with indentations and line breaks. */
280
+ prettyPrint?: boolean;
281
+ /** 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. */
282
+ quotaUser?: string;
283
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
284
+ upload_protocol?: string;
285
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
286
+ uploadType?: string;
287
+ }): Request<GoogleLongrunningListOperationsResponse>;
288
+ }
289
+ interface ReplaysResource {
290
+ operations: OperationsResource;
291
+ }
292
+ interface LocationsResource {
293
+ orgPolicyViolationsPreviews: OrgPolicyViolationsPreviewsResource;
294
+ replays: ReplaysResource;
295
+ }
296
+ interface FoldersResource {
297
+ locations: LocationsResource;
298
+ }
299
+ interface OperationsResource {
300
+ /** 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. */
301
+ get(request?: {
302
+ /** V1 error format. */
303
+ "$.xgafv"?: string;
304
+ /** OAuth access token. */
305
+ access_token?: string;
306
+ /** Data format for response. */
307
+ alt?: string;
308
+ /** JSONP */
309
+ callback?: string;
310
+ /** Selector specifying which fields to include in a partial response. */
311
+ fields?: string;
312
+ /** 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. */
313
+ key?: string;
314
+ /** The name of the operation resource. */
315
+ name: string;
316
+ /** OAuth 2.0 token for the current user. */
317
+ oauth_token?: string;
318
+ /** Returns response with indentations and line breaks. */
319
+ prettyPrint?: boolean;
320
+ /** 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. */
321
+ quotaUser?: string;
322
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
323
+ upload_protocol?: string;
324
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
325
+ uploadType?: string;
326
+ }): Request<GoogleLongrunningOperation>;
327
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
328
+ list(request?: {
329
+ /** V1 error format. */
330
+ "$.xgafv"?: string;
331
+ /** OAuth access token. */
332
+ access_token?: string;
333
+ /** Data format for response. */
334
+ alt?: string;
335
+ /** JSONP */
336
+ callback?: string;
337
+ /** Selector specifying which fields to include in a partial response. */
338
+ fields?: string;
339
+ /** The standard list filter. */
340
+ filter?: string;
341
+ /** 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. */
342
+ key?: string;
343
+ /** The name of the operation's parent resource. */
344
+ name: string;
345
+ /** OAuth 2.0 token for the current user. */
346
+ oauth_token?: string;
347
+ /** The standard list page size. */
348
+ pageSize?: number;
349
+ /** The standard list page token. */
350
+ pageToken?: string;
351
+ /** Returns response with indentations and line breaks. */
352
+ prettyPrint?: boolean;
353
+ /** 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. */
354
+ quotaUser?: string;
355
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
356
+ upload_protocol?: string;
357
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
358
+ uploadType?: string;
359
+ }): Request<GoogleLongrunningListOperationsResponse>;
360
+ }
361
+ interface OperationsResource {
362
+ /** 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. */
363
+ get(request?: {
364
+ /** V1 error format. */
365
+ "$.xgafv"?: string;
366
+ /** OAuth access token. */
367
+ access_token?: string;
368
+ /** Data format for response. */
369
+ alt?: string;
370
+ /** JSONP */
371
+ callback?: string;
372
+ /** Selector specifying which fields to include in a partial response. */
373
+ fields?: string;
374
+ /** 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. */
375
+ key?: string;
376
+ /** The name of the operation resource. */
377
+ name: string;
378
+ /** OAuth 2.0 token for the current user. */
379
+ oauth_token?: string;
380
+ /** Returns response with indentations and line breaks. */
381
+ prettyPrint?: boolean;
382
+ /** 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. */
383
+ quotaUser?: string;
384
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
385
+ upload_protocol?: string;
386
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
387
+ uploadType?: string;
388
+ }): Request<GoogleLongrunningOperation>;
389
+ }
390
+ interface OrgPolicyViolationsPreviewsResource {
391
+ operations: OperationsResource;
392
+ }
393
+ interface OperationsResource {
394
+ /** 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. */
395
+ get(request?: {
396
+ /** V1 error format. */
397
+ "$.xgafv"?: string;
398
+ /** OAuth access token. */
399
+ access_token?: string;
400
+ /** Data format for response. */
401
+ alt?: string;
402
+ /** JSONP */
403
+ callback?: string;
404
+ /** Selector specifying which fields to include in a partial response. */
405
+ fields?: string;
406
+ /** 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. */
407
+ key?: string;
408
+ /** The name of the operation resource. */
409
+ name: string;
410
+ /** OAuth 2.0 token for the current user. */
411
+ oauth_token?: string;
412
+ /** Returns response with indentations and line breaks. */
413
+ prettyPrint?: boolean;
414
+ /** 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. */
415
+ quotaUser?: string;
416
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
417
+ upload_protocol?: string;
418
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
419
+ uploadType?: string;
420
+ }): Request<GoogleLongrunningOperation>;
421
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
422
+ list(request?: {
423
+ /** V1 error format. */
424
+ "$.xgafv"?: string;
425
+ /** OAuth access token. */
426
+ access_token?: string;
427
+ /** Data format for response. */
428
+ alt?: string;
429
+ /** JSONP */
430
+ callback?: string;
431
+ /** Selector specifying which fields to include in a partial response. */
432
+ fields?: string;
433
+ /** The standard list filter. */
434
+ filter?: string;
435
+ /** 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. */
436
+ key?: string;
437
+ /** The name of the operation's parent resource. */
438
+ name: string;
439
+ /** OAuth 2.0 token for the current user. */
440
+ oauth_token?: string;
441
+ /** The standard list page size. */
442
+ pageSize?: number;
443
+ /** The standard list page token. */
444
+ pageToken?: string;
445
+ /** Returns response with indentations and line breaks. */
446
+ prettyPrint?: boolean;
447
+ /** 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. */
448
+ quotaUser?: string;
449
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
450
+ upload_protocol?: string;
451
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
452
+ uploadType?: string;
453
+ }): Request<GoogleLongrunningListOperationsResponse>;
454
+ }
455
+ interface ReplaysResource {
456
+ operations: OperationsResource;
457
+ }
458
+ interface LocationsResource {
459
+ orgPolicyViolationsPreviews: OrgPolicyViolationsPreviewsResource;
460
+ replays: ReplaysResource;
461
+ }
462
+ interface OrganizationsResource {
463
+ locations: LocationsResource;
464
+ }
465
+ interface OperationsResource {
466
+ /** 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. */
467
+ get(request?: {
468
+ /** V1 error format. */
469
+ "$.xgafv"?: string;
470
+ /** OAuth access token. */
471
+ access_token?: string;
472
+ /** Data format for response. */
473
+ alt?: string;
474
+ /** JSONP */
475
+ callback?: string;
476
+ /** Selector specifying which fields to include in a partial response. */
477
+ fields?: string;
478
+ /** 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. */
479
+ key?: string;
480
+ /** The name of the operation resource. */
481
+ name: string;
482
+ /** OAuth 2.0 token for the current user. */
483
+ oauth_token?: string;
484
+ /** Returns response with indentations and line breaks. */
485
+ prettyPrint?: boolean;
486
+ /** 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. */
487
+ quotaUser?: string;
488
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
489
+ upload_protocol?: string;
490
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
491
+ uploadType?: string;
492
+ }): Request<GoogleLongrunningOperation>;
493
+ }
494
+ interface OrgPolicyViolationsPreviewsResource {
495
+ operations: OperationsResource;
496
+ }
497
+ interface OperationsResource {
498
+ /** 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. */
499
+ get(request?: {
500
+ /** V1 error format. */
501
+ "$.xgafv"?: string;
502
+ /** OAuth access token. */
503
+ access_token?: string;
504
+ /** Data format for response. */
505
+ alt?: string;
506
+ /** JSONP */
507
+ callback?: string;
508
+ /** Selector specifying which fields to include in a partial response. */
509
+ fields?: string;
510
+ /** 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. */
511
+ key?: string;
512
+ /** The name of the operation resource. */
513
+ name: string;
514
+ /** OAuth 2.0 token for the current user. */
515
+ oauth_token?: string;
516
+ /** Returns response with indentations and line breaks. */
517
+ prettyPrint?: boolean;
518
+ /** 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. */
519
+ quotaUser?: string;
520
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
521
+ upload_protocol?: string;
522
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
523
+ uploadType?: string;
524
+ }): Request<GoogleLongrunningOperation>;
525
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
526
+ list(request?: {
527
+ /** V1 error format. */
528
+ "$.xgafv"?: string;
529
+ /** OAuth access token. */
530
+ access_token?: string;
531
+ /** Data format for response. */
532
+ alt?: string;
533
+ /** JSONP */
534
+ callback?: string;
535
+ /** Selector specifying which fields to include in a partial response. */
536
+ fields?: string;
537
+ /** The standard list filter. */
538
+ filter?: string;
539
+ /** 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. */
540
+ key?: string;
541
+ /** The name of the operation's parent resource. */
542
+ name: string;
543
+ /** OAuth 2.0 token for the current user. */
544
+ oauth_token?: string;
545
+ /** The standard list page size. */
546
+ pageSize?: number;
547
+ /** The standard list page token. */
548
+ pageToken?: string;
549
+ /** Returns response with indentations and line breaks. */
550
+ prettyPrint?: boolean;
551
+ /** 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. */
552
+ quotaUser?: string;
553
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
554
+ upload_protocol?: string;
555
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
556
+ uploadType?: string;
557
+ }): Request<GoogleLongrunningListOperationsResponse>;
558
+ }
559
+ interface ReplaysResource {
560
+ operations: OperationsResource;
561
+ }
562
+ interface LocationsResource {
563
+ orgPolicyViolationsPreviews: OrgPolicyViolationsPreviewsResource;
564
+ replays: ReplaysResource;
565
+ }
566
+ interface ProjectsResource {
567
+ locations: LocationsResource;
568
+ }
569
+
570
+ const folders: FoldersResource;
571
+
572
+ const operations: OperationsResource;
573
+
574
+ const organizations: OrganizationsResource;
575
+
576
+ const projects: ProjectsResource;
577
+ }
578
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.policysimulator-v1beta",
3
+ "version": "0.0.20230409",
4
+ "description": "TypeScript typings for Policy Simulator API v1beta",
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,78 @@
1
+ # TypeScript typings for Policy Simulator API v1beta
2
+
3
+ Policy Simulator is a collection of endpoints for creating, running, and viewing a Replay. A `Replay` is a type of simulation that lets you see how your members' access to resources might change if you changed your IAM policy. During a `Replay`, Policy Simulator re-evaluates, or replays, past access attempts under both the current policy and your proposed policy, and compares those results to determine how your members' access might change under the proposed policy.
4
+ For detailed description please check [documentation](https://cloud.google.com/iam/docs/simulating-access).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Policy Simulator API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.policysimulator-v1beta --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://policysimulator.googleapis.com/$discovery/rest?version=v1beta', () => {
29
+ // now we can use:
30
+ // gapi.client.policysimulator
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('policysimulator', 'v1beta', () => {
37
+ // now we can use:
38
+ // gapi.client.policysimulator
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 Policy Simulator API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+
69
+ /*
70
+ 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.
71
+ */
72
+ await gapi.client.policysimulator.operations.get({ name: "name", });
73
+
74
+ /*
75
+ Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
76
+ */
77
+ await gapi.client.policysimulator.operations.list({ name: "name", });
78
+ ```
package/tests.ts ADDED
@@ -0,0 +1,89 @@
1
+ /* This is stub file for gapi.client.policysimulator-v1beta 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: 20230409
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://policysimulator.googleapis.com/$discovery/rest?version=v1beta');
12
+ /** now we can use gapi.client.policysimulator */
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
+ /** 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. */
33
+ await gapi.client.policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get({
34
+ name: "Test string",
35
+ });
36
+ /** 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. */
37
+ await gapi.client.policysimulator.folders.locations.replays.operations.get({
38
+ name: "Test string",
39
+ });
40
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
41
+ await gapi.client.policysimulator.folders.locations.replays.operations.list({
42
+ filter: "Test string",
43
+ name: "Test string",
44
+ pageSize: 42,
45
+ pageToken: "Test string",
46
+ });
47
+ /** 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. */
48
+ await gapi.client.policysimulator.operations.get({
49
+ name: "Test string",
50
+ });
51
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
52
+ await gapi.client.policysimulator.operations.list({
53
+ filter: "Test string",
54
+ name: "Test string",
55
+ pageSize: 42,
56
+ pageToken: "Test string",
57
+ });
58
+ /** 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. */
59
+ await gapi.client.policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get({
60
+ name: "Test string",
61
+ });
62
+ /** 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. */
63
+ await gapi.client.policysimulator.organizations.locations.replays.operations.get({
64
+ name: "Test string",
65
+ });
66
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
67
+ await gapi.client.policysimulator.organizations.locations.replays.operations.list({
68
+ filter: "Test string",
69
+ name: "Test string",
70
+ pageSize: 42,
71
+ pageToken: "Test string",
72
+ });
73
+ /** 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. */
74
+ await gapi.client.policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get({
75
+ name: "Test string",
76
+ });
77
+ /** 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. */
78
+ await gapi.client.policysimulator.projects.locations.replays.operations.get({
79
+ name: "Test string",
80
+ });
81
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
82
+ await gapi.client.policysimulator.projects.locations.replays.operations.list({
83
+ filter: "Test string",
84
+ name: "Test string",
85
+ pageSize: 42,
86
+ pageToken: "Test string",
87
+ });
88
+ }
89
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }