@maxim_mazurok/gapi.client.bigquerydatapolicy-v1 0.0.20231106

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,731 @@
1
+ /* Type definitions for non-npm package BigQuery Data Policy API v1 0.0 */
2
+ // Project: https://cloud.google.com/bigquery/docs/column-data-masking
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://bigquerydatapolicy.googleapis.com/$discovery/rest?version=v1
12
+ // Revision: 20231106
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load BigQuery Data Policy API v1 */
18
+ function load(urlOrObject: "https://bigquerydatapolicy.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
19
+ /** @deprecated Please load APIs with discovery documents. */
20
+ function load(name: "bigquerydatapolicy", version: "v1"): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: "bigquerydatapolicy", version: "v1", callback: () => any): void;
23
+
24
+ namespace bigquerydatapolicy {
25
+ interface AuditConfig {
26
+ /** The configuration for logging of each type of permission. */
27
+ auditLogConfigs?:
28
+ AuditLogConfig[];
29
+ /**
30
+ * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all
31
+ * services.
32
+ */
33
+ service?:
34
+ string;
35
+ }
36
+ interface AuditLogConfig {
37
+ /** Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. */
38
+ exemptedMembers?:
39
+ string[];
40
+ /** The log type that this config enables. */
41
+ logType?:
42
+ string;
43
+ }
44
+ interface Binding {
45
+ /**
46
+ * 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`,
47
+ * 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
48
+ * resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
49
+ */
50
+ condition?:
51
+ Expr;
52
+ /**
53
+ * 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
54
+ * 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
55
+ * account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific
56
+ * Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example,
57
+ * `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service
58
+ * 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]`. *
59
+ * `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
60
+ * 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
61
+ * 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
62
+ * the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently
63
+ * deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and
64
+ * 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
65
+ * 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
66
+ * retains the role in the binding.
67
+ */
68
+ members?:
69
+ string[];
70
+ /** Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */
71
+ role?:
72
+ string;
73
+ }
74
+ interface DataMaskingPolicy {
75
+ /** A predefined masking expression. */
76
+ predefinedExpression?:
77
+ string;
78
+ /** The name of the BigQuery routine that contains the custom masking routine, in the format of `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`. */
79
+ routine?:
80
+ string;
81
+ }
82
+ interface DataPolicy {
83
+ /** The data masking policy that specifies the data masking rule to use. */
84
+ dataMaskingPolicy?:
85
+ DataMaskingPolicy;
86
+ /** User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {data_policy_id} in part of the resource name. */
87
+ dataPolicyId?:
88
+ string;
89
+ /** Type of data policy. */
90
+ dataPolicyType?:
91
+ string;
92
+ /** Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
93
+ name?:
94
+ string;
95
+ /** Policy tag resource name, in the format of `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. */
96
+ policyTag?:
97
+ string;
98
+ }
99
+ // tslint:disable-next-line:no-empty-interface
100
+ interface Empty {
101
+ }
102
+ interface Expr {
103
+ /** Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. */
104
+ description?:
105
+ string;
106
+ /** Textual representation of an expression in Common Expression Language syntax. */
107
+ expression?:
108
+ string;
109
+ /** Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. */
110
+ location?:
111
+ string;
112
+ /** 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. */
113
+ title?:
114
+ string;
115
+ }
116
+ interface GetIamPolicyRequest {
117
+ /** OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. */
118
+ options?:
119
+ GetPolicyOptions;
120
+ }
121
+ interface GetPolicyOptions {
122
+ /**
123
+ * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for
124
+ * policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in
125
+ * the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role
126
+ * bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM
127
+ * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
128
+ */
129
+ requestedPolicyVersion?:
130
+ number;
131
+ }
132
+ interface ListDataPoliciesResponse {
133
+ /** Data policies that belong to the requested project. */
134
+ dataPolicies?:
135
+ DataPolicy[];
136
+ /** Token used to retrieve the next page of results, or empty if there are no more results. */
137
+ nextPageToken?:
138
+ string;
139
+ }
140
+ interface Policy {
141
+ /** Specifies cloud audit logging configuration for this policy. */
142
+ auditConfigs?:
143
+ AuditConfig[];
144
+ /**
145
+ * 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`
146
+ * 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
147
+ * 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
148
+ * 1,450 principals to the `bindings` in the `Policy`.
149
+ */
150
+ bindings?:
151
+ Binding[];
152
+ /**
153
+ * `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
154
+ * 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
155
+ * 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
156
+ * 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`
157
+ * policy, and all of the conditions in the version `3` policy are lost.
158
+ */
159
+ etag?:
160
+ string;
161
+ /**
162
+ * 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
163
+ * 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
164
+ * 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
165
+ * 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`
166
+ * 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
167
+ * 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).
168
+ */
169
+ version?:
170
+ number;
171
+ }
172
+ interface RenameDataPolicyRequest {
173
+ /** Required. The new data policy id. */
174
+ newDataPolicyId?:
175
+ string;
176
+ }
177
+ interface SetIamPolicyRequest {
178
+ /**
179
+ * REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud
180
+ * services (such as Projects) might reject them.
181
+ */
182
+ policy?:
183
+ Policy;
184
+ /**
185
+ * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:
186
+ * `paths: "bindings, etag"`
187
+ */
188
+ updateMask?:
189
+ string;
190
+ }
191
+ interface TestIamPermissionsRequest {
192
+ /**
193
+ * The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM
194
+ * Overview](https://cloud.google.com/iam/docs/overview#permissions).
195
+ */
196
+ permissions?:
197
+ string[];
198
+ }
199
+ interface TestIamPermissionsResponse {
200
+ /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */
201
+ permissions?:
202
+ string[];
203
+ }
204
+ interface DataPoliciesResource {
205
+ /** Creates a new data policy under a project with the given `dataPolicyId` (used as the display name), policy tag, and data policy type. */
206
+ create(request: {
207
+ /** V1 error format. */
208
+ "$.xgafv"?:
209
+ string;
210
+ /** OAuth access token. */
211
+ access_token?:
212
+ string;
213
+ /** Data format for response. */
214
+ alt?:
215
+ string;
216
+ /** JSONP */
217
+ callback?:
218
+ string;
219
+ /** Selector specifying which fields to include in a partial response. */
220
+ fields?:
221
+ string;
222
+ /** 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. */
223
+ key?:
224
+ string;
225
+ /** OAuth 2.0 token for the current user. */
226
+ oauth_token?:
227
+ string;
228
+ /** Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`. */
229
+ parent:
230
+ string;
231
+ /** Returns response with indentations and line breaks. */
232
+ prettyPrint?:
233
+ boolean;
234
+ /** 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. */
235
+ quotaUser?:
236
+ string;
237
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
238
+ upload_protocol?:
239
+ string;
240
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
241
+ uploadType?:
242
+ string;
243
+ /** Request body */
244
+ resource:
245
+ DataPolicy;
246
+ }): Request<DataPolicy>;
247
+ create(request: {
248
+ /** V1 error format. */
249
+ "$.xgafv"?:
250
+ string;
251
+ /** OAuth access token. */
252
+ access_token?:
253
+ string;
254
+ /** Data format for response. */
255
+ alt?:
256
+ string;
257
+ /** JSONP */
258
+ callback?:
259
+ string;
260
+ /** Selector specifying which fields to include in a partial response. */
261
+ fields?:
262
+ string;
263
+ /** 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. */
264
+ key?:
265
+ string;
266
+ /** OAuth 2.0 token for the current user. */
267
+ oauth_token?:
268
+ string;
269
+ /** Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`. */
270
+ parent:
271
+ string;
272
+ /** Returns response with indentations and line breaks. */
273
+ prettyPrint?:
274
+ boolean;
275
+ /** 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. */
276
+ quotaUser?:
277
+ string;
278
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
279
+ upload_protocol?:
280
+ string;
281
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
282
+ uploadType?:
283
+ string;
284
+ },
285
+ body: DataPolicy): Request<DataPolicy>;
286
+ /** Deletes the data policy specified by its resource name. */
287
+ delete(request?: {
288
+ /** V1 error format. */
289
+ "$.xgafv"?:
290
+ string;
291
+ /** OAuth access token. */
292
+ access_token?:
293
+ string;
294
+ /** Data format for response. */
295
+ alt?:
296
+ string;
297
+ /** JSONP */
298
+ callback?:
299
+ string;
300
+ /** Selector specifying which fields to include in a partial response. */
301
+ fields?:
302
+ string;
303
+ /** 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. */
304
+ key?:
305
+ string;
306
+ /** Required. Resource name of the data policy to delete. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
307
+ name:
308
+ string;
309
+ /** OAuth 2.0 token for the current user. */
310
+ oauth_token?:
311
+ string;
312
+ /** Returns response with indentations and line breaks. */
313
+ prettyPrint?:
314
+ boolean;
315
+ /** 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. */
316
+ quotaUser?:
317
+ string;
318
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
319
+ upload_protocol?:
320
+ string;
321
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
322
+ uploadType?:
323
+ string;
324
+ }): Request<{}>;
325
+ /** Gets the data policy specified by its resource name. */
326
+ get(request?: {
327
+ /** V1 error format. */
328
+ "$.xgafv"?:
329
+ string;
330
+ /** OAuth access token. */
331
+ access_token?:
332
+ string;
333
+ /** Data format for response. */
334
+ alt?:
335
+ string;
336
+ /** JSONP */
337
+ callback?:
338
+ string;
339
+ /** Selector specifying which fields to include in a partial response. */
340
+ fields?:
341
+ string;
342
+ /** 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. */
343
+ key?:
344
+ string;
345
+ /** Required. Resource name of the requested data policy. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
346
+ name:
347
+ string;
348
+ /** OAuth 2.0 token for the current user. */
349
+ oauth_token?:
350
+ string;
351
+ /** Returns response with indentations and line breaks. */
352
+ prettyPrint?:
353
+ boolean;
354
+ /** 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. */
355
+ quotaUser?:
356
+ string;
357
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
358
+ upload_protocol?:
359
+ string;
360
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
361
+ uploadType?:
362
+ string;
363
+ }): Request<DataPolicy>;
364
+ /** Gets the IAM policy for the specified data policy. */
365
+ getIamPolicy(request: {
366
+ /** V1 error format. */
367
+ "$.xgafv"?:
368
+ string;
369
+ /** OAuth access token. */
370
+ access_token?:
371
+ string;
372
+ /** Data format for response. */
373
+ alt?:
374
+ string;
375
+ /** JSONP */
376
+ callback?:
377
+ string;
378
+ /** Selector specifying which fields to include in a partial response. */
379
+ fields?:
380
+ string;
381
+ /** 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. */
382
+ key?:
383
+ string;
384
+ /** OAuth 2.0 token for the current user. */
385
+ oauth_token?:
386
+ string;
387
+ /** Returns response with indentations and line breaks. */
388
+ prettyPrint?:
389
+ boolean;
390
+ /** 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. */
391
+ quotaUser?:
392
+ string;
393
+ /**
394
+ * REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
395
+ * field.
396
+ */
397
+ resource:
398
+ string;
399
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
400
+ upload_protocol?:
401
+ string;
402
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
403
+ uploadType?:
404
+ string;
405
+ },
406
+ body: GetIamPolicyRequest): Request<Policy>;
407
+ /** List all of the data policies in the specified parent project. */
408
+ list(request?: {
409
+ /** V1 error format. */
410
+ "$.xgafv"?:
411
+ string;
412
+ /** OAuth access token. */
413
+ access_token?:
414
+ string;
415
+ /** Data format for response. */
416
+ alt?:
417
+ string;
418
+ /** JSONP */
419
+ callback?:
420
+ string;
421
+ /** Selector specifying which fields to include in a partial response. */
422
+ fields?:
423
+ string;
424
+ /**
425
+ * Filters the data policies by policy tags that they are associated with. Currently filter only supports "policy_tag" based filtering and OR based predicates. Sample filter can be
426
+ * "policy_tag: projects/1/locations/us/taxonomies/2/policyTags/3". You may also use wildcard such as "policy_tag: projects/1/locations/us/taxonomies/2*". Please note that OR
427
+ * predicates cannot be used with wildcard filters.
428
+ */
429
+ filter?:
430
+ string;
431
+ /** 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. */
432
+ key?:
433
+ string;
434
+ /** OAuth 2.0 token for the current user. */
435
+ oauth_token?:
436
+ string;
437
+ /** The maximum number of data policies to return. Must be a value between 1 and 1000. If not set, defaults to 50. */
438
+ pageSize?:
439
+ number;
440
+ /** The `nextPageToken` value returned from a previous list request, if any. If not set, defaults to an empty string. */
441
+ pageToken?:
442
+ string;
443
+ /** Required. Resource name of the project for which to list data policies. Format is `projects/{project_number}/locations/{location_id}`. */
444
+ parent:
445
+ string;
446
+ /** Returns response with indentations and line breaks. */
447
+ prettyPrint?:
448
+ boolean;
449
+ /** 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. */
450
+ quotaUser?:
451
+ string;
452
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
453
+ upload_protocol?:
454
+ string;
455
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
456
+ uploadType?:
457
+ string;
458
+ }): Request<ListDataPoliciesResponse>;
459
+ /** Updates the metadata for an existing data policy. The target data policy can be specified by the resource name. */
460
+ patch(request: {
461
+ /** V1 error format. */
462
+ "$.xgafv"?:
463
+ string;
464
+ /** OAuth access token. */
465
+ access_token?:
466
+ string;
467
+ /** Data format for response. */
468
+ alt?:
469
+ string;
470
+ /** JSONP */
471
+ callback?:
472
+ string;
473
+ /** Selector specifying which fields to include in a partial response. */
474
+ fields?:
475
+ string;
476
+ /** 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. */
477
+ key?:
478
+ string;
479
+ /** Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
480
+ name:
481
+ string;
482
+ /** OAuth 2.0 token for the current user. */
483
+ oauth_token?:
484
+ string;
485
+ /** Returns response with indentations and line breaks. */
486
+ prettyPrint?:
487
+ boolean;
488
+ /** 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. */
489
+ quotaUser?:
490
+ string;
491
+ /**
492
+ * The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set,
493
+ * defaults to all of the fields that are allowed to update. Updates to the `name` and `dataPolicyId` fields are not allowed.
494
+ */
495
+ updateMask?:
496
+ string;
497
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
498
+ upload_protocol?:
499
+ string;
500
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
501
+ uploadType?:
502
+ string;
503
+ /** Request body */
504
+ resource:
505
+ DataPolicy;
506
+ }): Request<DataPolicy>;
507
+ patch(request: {
508
+ /** V1 error format. */
509
+ "$.xgafv"?:
510
+ string;
511
+ /** OAuth access token. */
512
+ access_token?:
513
+ string;
514
+ /** Data format for response. */
515
+ alt?:
516
+ string;
517
+ /** JSONP */
518
+ callback?:
519
+ string;
520
+ /** Selector specifying which fields to include in a partial response. */
521
+ fields?:
522
+ string;
523
+ /** 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. */
524
+ key?:
525
+ string;
526
+ /** Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
527
+ name:
528
+ string;
529
+ /** OAuth 2.0 token for the current user. */
530
+ oauth_token?:
531
+ string;
532
+ /** Returns response with indentations and line breaks. */
533
+ prettyPrint?:
534
+ boolean;
535
+ /** 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. */
536
+ quotaUser?:
537
+ string;
538
+ /**
539
+ * The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set,
540
+ * defaults to all of the fields that are allowed to update. Updates to the `name` and `dataPolicyId` fields are not allowed.
541
+ */
542
+ updateMask?:
543
+ string;
544
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
545
+ upload_protocol?:
546
+ string;
547
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
548
+ uploadType?:
549
+ string;
550
+ },
551
+ body: DataPolicy): Request<DataPolicy>;
552
+ /** Renames the id (display name) of the specified data policy. */
553
+ rename(request: {
554
+ /** V1 error format. */
555
+ "$.xgafv"?:
556
+ string;
557
+ /** OAuth access token. */
558
+ access_token?:
559
+ string;
560
+ /** Data format for response. */
561
+ alt?:
562
+ string;
563
+ /** JSONP */
564
+ callback?:
565
+ string;
566
+ /** Selector specifying which fields to include in a partial response. */
567
+ fields?:
568
+ string;
569
+ /** 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. */
570
+ key?:
571
+ string;
572
+ /** Required. Resource name of the data policy to rename. The format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}` */
573
+ name:
574
+ string;
575
+ /** OAuth 2.0 token for the current user. */
576
+ oauth_token?:
577
+ string;
578
+ /** Returns response with indentations and line breaks. */
579
+ prettyPrint?:
580
+ boolean;
581
+ /** 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. */
582
+ quotaUser?:
583
+ string;
584
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
585
+ upload_protocol?:
586
+ string;
587
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
588
+ uploadType?:
589
+ string;
590
+ /** Request body */
591
+ resource:
592
+ RenameDataPolicyRequest;
593
+ }): Request<DataPolicy>;
594
+ rename(request: {
595
+ /** V1 error format. */
596
+ "$.xgafv"?:
597
+ string;
598
+ /** OAuth access token. */
599
+ access_token?:
600
+ string;
601
+ /** Data format for response. */
602
+ alt?:
603
+ string;
604
+ /** JSONP */
605
+ callback?:
606
+ string;
607
+ /** Selector specifying which fields to include in a partial response. */
608
+ fields?:
609
+ string;
610
+ /** 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. */
611
+ key?:
612
+ string;
613
+ /** Required. Resource name of the data policy to rename. The format is `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}` */
614
+ name:
615
+ string;
616
+ /** OAuth 2.0 token for the current user. */
617
+ oauth_token?:
618
+ string;
619
+ /** Returns response with indentations and line breaks. */
620
+ prettyPrint?:
621
+ boolean;
622
+ /** 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. */
623
+ quotaUser?:
624
+ string;
625
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
626
+ upload_protocol?:
627
+ string;
628
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
629
+ uploadType?:
630
+ string;
631
+ },
632
+ body: RenameDataPolicyRequest): Request<DataPolicy>;
633
+ /** Sets the IAM policy for the specified data policy. */
634
+ setIamPolicy(request: {
635
+ /** V1 error format. */
636
+ "$.xgafv"?:
637
+ string;
638
+ /** OAuth access token. */
639
+ access_token?:
640
+ string;
641
+ /** Data format for response. */
642
+ alt?:
643
+ string;
644
+ /** JSONP */
645
+ callback?:
646
+ string;
647
+ /** Selector specifying which fields to include in a partial response. */
648
+ fields?:
649
+ string;
650
+ /** 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. */
651
+ key?:
652
+ string;
653
+ /** OAuth 2.0 token for the current user. */
654
+ oauth_token?:
655
+ string;
656
+ /** Returns response with indentations and line breaks. */
657
+ prettyPrint?:
658
+ boolean;
659
+ /** 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. */
660
+ quotaUser?:
661
+ string;
662
+ /**
663
+ * REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
664
+ * field.
665
+ */
666
+ resource:
667
+ string;
668
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
669
+ upload_protocol?:
670
+ string;
671
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
672
+ uploadType?:
673
+ string;
674
+ },
675
+ body: SetIamPolicyRequest): Request<Policy>;
676
+ /** Returns the caller's permission on the specified data policy resource. */
677
+ testIamPermissions(request: {
678
+ /** V1 error format. */
679
+ "$.xgafv"?:
680
+ string;
681
+ /** OAuth access token. */
682
+ access_token?:
683
+ string;
684
+ /** Data format for response. */
685
+ alt?:
686
+ string;
687
+ /** JSONP */
688
+ callback?:
689
+ string;
690
+ /** Selector specifying which fields to include in a partial response. */
691
+ fields?:
692
+ string;
693
+ /** 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. */
694
+ key?:
695
+ string;
696
+ /** OAuth 2.0 token for the current user. */
697
+ oauth_token?:
698
+ string;
699
+ /** Returns response with indentations and line breaks. */
700
+ prettyPrint?:
701
+ boolean;
702
+ /** 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. */
703
+ quotaUser?:
704
+ string;
705
+ /**
706
+ * REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
707
+ * this field.
708
+ */
709
+ resource:
710
+ string;
711
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
712
+ upload_protocol?:
713
+ string;
714
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
715
+ uploadType?:
716
+ string;
717
+ },
718
+ body: TestIamPermissionsRequest): Request<TestIamPermissionsResponse>;
719
+ }
720
+ interface LocationsResource {
721
+ dataPolicies:
722
+ DataPoliciesResource;
723
+ }
724
+ interface ProjectsResource {
725
+ locations:
726
+ LocationsResource;
727
+ }
728
+
729
+ const projects: ProjectsResource;
730
+ }
731
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.bigquerydatapolicy-v1",
3
+ "version": "0.0.20231106",
4
+ "description": "TypeScript typings for BigQuery Data Policy API v1",
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-v1": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,71 @@
1
+ # TypeScript typings for BigQuery Data Policy API v1
2
+
3
+ Allows users to manage BigQuery data policies.
4
+ For detailed description please check [documentation](https://cloud.google.com/bigquery/docs/column-data-masking).
5
+
6
+ ## Installing
7
+
8
+ Install typings for BigQuery Data Policy API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.bigquerydatapolicy-v1 --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://bigquerydatapolicy.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.bigquerydatapolicy
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('bigquerydatapolicy', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.bigquerydatapolicy
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
+ // View and manage your data in Google BigQuery and see the email address for your Google Account
49
+ 'https://www.googleapis.com/auth/bigquery',
50
+
51
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
52
+ 'https://www.googleapis.com/auth/cloud-platform',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ { client_id: client_id, scope: scope, immediate: immediate },
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ });
66
+ ```
67
+
68
+ After that you can use BigQuery Data Policy API resources: <!-- TODO: make this work for multiple namespaces -->
69
+
70
+ ```typescript
71
+ ```
package/tests.ts ADDED
@@ -0,0 +1,136 @@
1
+ /* This is stub file for gapi.client.bigquerydatapolicy-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: 20231106
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://bigquerydatapolicy.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.bigquerydatapolicy */
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
+ /** View and manage your data in Google BigQuery and see the email address for your Google Account */
19
+ 'https://www.googleapis.com/auth/bigquery',
20
+ /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
21
+ 'https://www.googleapis.com/auth/cloud-platform',
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
+ /** Creates a new data policy under a project with the given `dataPolicyId` (used as the display name), policy tag, and data policy type. */
35
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.create({
36
+ parent: "Test string",
37
+ }, {
38
+ dataMaskingPolicy: {
39
+ predefinedExpression: "Test string",
40
+ routine: "Test string",
41
+ },
42
+ dataPolicyId: "Test string",
43
+ dataPolicyType: "Test string",
44
+ name: "Test string",
45
+ policyTag: "Test string",
46
+ });
47
+ /** Deletes the data policy specified by its resource name. */
48
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.delete({
49
+ name: "Test string",
50
+ });
51
+ /** Gets the data policy specified by its resource name. */
52
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.get({
53
+ name: "Test string",
54
+ });
55
+ /** Gets the IAM policy for the specified data policy. */
56
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.getIamPolicy({
57
+ resource: "Test string",
58
+ }, {
59
+ options: {
60
+ requestedPolicyVersion: 42,
61
+ },
62
+ });
63
+ /** List all of the data policies in the specified parent project. */
64
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.list({
65
+ filter: "Test string",
66
+ pageSize: 42,
67
+ pageToken: "Test string",
68
+ parent: "Test string",
69
+ });
70
+ /** Updates the metadata for an existing data policy. The target data policy can be specified by the resource name. */
71
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.patch({
72
+ name: "Test string",
73
+ updateMask: "Test string",
74
+ }, {
75
+ dataMaskingPolicy: {
76
+ predefinedExpression: "Test string",
77
+ routine: "Test string",
78
+ },
79
+ dataPolicyId: "Test string",
80
+ dataPolicyType: "Test string",
81
+ name: "Test string",
82
+ policyTag: "Test string",
83
+ });
84
+ /** Renames the id (display name) of the specified data policy. */
85
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.rename({
86
+ name: "Test string",
87
+ }, {
88
+ newDataPolicyId: "Test string",
89
+ });
90
+ /** Sets the IAM policy for the specified data policy. */
91
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.setIamPolicy({
92
+ resource: "Test string",
93
+ }, {
94
+ policy: {
95
+ auditConfigs: [
96
+ {
97
+ auditLogConfigs: [
98
+ {
99
+ exemptedMembers: [
100
+ "Test string"
101
+ ],
102
+ logType: "Test string",
103
+ }
104
+ ],
105
+ service: "Test string",
106
+ }
107
+ ],
108
+ bindings: [
109
+ {
110
+ condition: {
111
+ description: "Test string",
112
+ expression: "Test string",
113
+ location: "Test string",
114
+ title: "Test string",
115
+ },
116
+ members: [
117
+ "Test string"
118
+ ],
119
+ role: "Test string",
120
+ }
121
+ ],
122
+ etag: "Test string",
123
+ version: 42,
124
+ },
125
+ updateMask: "Test string",
126
+ });
127
+ /** Returns the caller's permission on the specified data policy resource. */
128
+ await gapi.client.bigquerydatapolicy.projects.locations.dataPolicies.testIamPermissions({
129
+ resource: "Test string",
130
+ }, {
131
+ permissions: [
132
+ "Test string"
133
+ ],
134
+ });
135
+ }
136
+ });
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
+ }