@maxim_mazurok/gapi.client.bigquerydatapolicy-v2 0.0.20251015

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.
Files changed (3) hide show
  1. package/index.d.ts +566 -0
  2. package/package.json +20 -0
  3. package/readme.md +78 -0
package/index.d.ts ADDED
@@ -0,0 +1,566 @@
1
+ /* Type definitions for non-npm package BigQuery Data Policy API v2 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=v2
12
+ // Revision: 20251015
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load BigQuery Data Policy API v2 */
18
+ function load(
19
+ urlOrObject: 'https://bigquerydatapolicy.googleapis.com/$discovery/rest?version=v2',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'bigquerydatapolicy', version: 'v2'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'bigquerydatapolicy',
26
+ version: 'v2',
27
+ callback: () => any,
28
+ ): void;
29
+
30
+ namespace bigquerydatapolicy {
31
+ interface AddGranteesRequest {
32
+ /** Required. IAM principal that should be granted Fine Grained Access to the underlying data goverened by the data policy. The target data policy is determined by the `data_policy` field. Uses the [IAM V2 principal syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2). Supported principal types: * User * Group * Service account */
33
+ grantees?: string[];
34
+ }
35
+ interface AuditConfig {
36
+ /** The configuration for logging of each type of permission. */
37
+ auditLogConfigs?: AuditLogConfig[];
38
+ /** 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 services. */
39
+ service?: string;
40
+ }
41
+ interface AuditLogConfig {
42
+ /** Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. */
43
+ exemptedMembers?: string[];
44
+ /** The log type that this config enables. */
45
+ logType?: string;
46
+ }
47
+ interface Binding {
48
+ /** 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`, 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 resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */
49
+ condition?: Expr;
50
+ /** 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 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 account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service 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]`. * `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 users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has 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 the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and 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 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 retains the role in the binding. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. */
51
+ members?: string[];
52
+ /** Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). */
53
+ role?: string;
54
+ }
55
+ interface CreateDataPolicyRequest {
56
+ /** Required. The data policy to create. The `name` field does not need to be provided for the data policy creation. */
57
+ dataPolicy?: DataPolicy;
58
+ /** Required. 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. */
59
+ dataPolicyId?: string;
60
+ }
61
+ interface DataMaskingPolicy {
62
+ /** Optional. A predefined masking expression. */
63
+ predefinedExpression?: string;
64
+ /** Optional. 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}`. */
65
+ routine?: string;
66
+ }
67
+ interface DataPolicy {
68
+ /** Optional. The data masking policy that specifies the data masking rule to use. It must be set if the data policy type is DATA_MASKING_POLICY. */
69
+ dataMaskingPolicy?: DataMaskingPolicy;
70
+ /** Output only. 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. */
71
+ dataPolicyId?: string;
72
+ /** Required. Type of data policy. */
73
+ dataPolicyType?: string;
74
+ /** The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls. */
75
+ etag?: string;
76
+ /** Optional. The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the [IAM V2 principal syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2) Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated. */
77
+ grantees?: string[];
78
+ /** Identifier. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
79
+ name?: string;
80
+ /** Output only. Policy tag resource name, in the format of `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. policy_tag is supported only for V1 data policies. */
81
+ policyTag?: string;
82
+ /** Output only. The version of the Data Policy resource. */
83
+ version?: string;
84
+ }
85
+ interface Empty {}
86
+ interface Expr {
87
+ /** Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. */
88
+ description?: string;
89
+ /** Textual representation of an expression in Common Expression Language syntax. */
90
+ expression?: string;
91
+ /** Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. */
92
+ location?: string;
93
+ /** 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. */
94
+ title?: string;
95
+ }
96
+ interface GetIamPolicyRequest {
97
+ /** OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. */
98
+ options?: GetPolicyOptions;
99
+ }
100
+ interface GetPolicyOptions {
101
+ /** 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 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 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 bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */
102
+ requestedPolicyVersion?: number;
103
+ }
104
+ interface ListDataPoliciesResponse {
105
+ /** Data policies that belong to the requested project. */
106
+ dataPolicies?: DataPolicy[];
107
+ /** Token used to retrieve the next page of results, or empty if there are no more results. */
108
+ nextPageToken?: string;
109
+ }
110
+ interface Policy {
111
+ /** Specifies cloud audit logging configuration for this policy. */
112
+ auditConfigs?: AuditConfig[];
113
+ /** 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` 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 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 1,450 principals to the `bindings` in the `Policy`. */
114
+ bindings?: Binding[];
115
+ /** `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 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 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 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` policy, and all of the conditions in the version `3` policy are lost. */
116
+ etag?: string;
117
+ /** 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 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 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 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` 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 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). */
118
+ version?: number;
119
+ }
120
+ interface RemoveGranteesRequest {
121
+ /** Required. IAM principal that should be revoked from Fine Grained Access to the underlying data goverened by the data policy. The target data policy is determined by the `data_policy` field. Uses the [IAM V2 principal syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2). Supported principal types: * User * Group * Service account */
122
+ grantees?: string[];
123
+ }
124
+ interface SetIamPolicyRequest {
125
+ /** 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 services (such as Projects) might reject them. */
126
+ policy?: Policy;
127
+ /** 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: `paths: "bindings, etag"` */
128
+ updateMask?: string;
129
+ }
130
+ interface TestIamPermissionsRequest {
131
+ /** The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). */
132
+ permissions?: string[];
133
+ }
134
+ interface TestIamPermissionsResponse {
135
+ /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */
136
+ permissions?: string[];
137
+ }
138
+ interface DataPoliciesResource {
139
+ /** Adds new grantees to a data policy. The new grantees will be added to the existing grantees. If the request contains a duplicate grantee, the grantee will be ignored. If the request contains a grantee that already exists, the grantee will be ignored. */
140
+ addGrantees(request: {
141
+ /** V1 error format. */
142
+ '$.xgafv'?: string;
143
+ /** OAuth access token. */
144
+ access_token?: string;
145
+ /** Data format for response. */
146
+ alt?: string;
147
+ /** JSONP */
148
+ callback?: string;
149
+ /** Required. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
150
+ dataPolicy: string;
151
+ /** Selector specifying which fields to include in a partial response. */
152
+ fields?: string;
153
+ /** 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. */
154
+ key?: string;
155
+ /** OAuth 2.0 token for the current user. */
156
+ oauth_token?: string;
157
+ /** Returns response with indentations and line breaks. */
158
+ prettyPrint?: boolean;
159
+ /** 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. */
160
+ quotaUser?: string;
161
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
162
+ upload_protocol?: string;
163
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
164
+ uploadType?: string;
165
+ /** Request body */
166
+ resource: AddGranteesRequest;
167
+ }): Request<DataPolicy>;
168
+ addGrantees(
169
+ request: {
170
+ /** V1 error format. */
171
+ '$.xgafv'?: string;
172
+ /** OAuth access token. */
173
+ access_token?: string;
174
+ /** Data format for response. */
175
+ alt?: string;
176
+ /** JSONP */
177
+ callback?: string;
178
+ /** Required. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
179
+ dataPolicy: string;
180
+ /** Selector specifying which fields to include in a partial response. */
181
+ fields?: string;
182
+ /** 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. */
183
+ key?: string;
184
+ /** OAuth 2.0 token for the current user. */
185
+ oauth_token?: string;
186
+ /** Returns response with indentations and line breaks. */
187
+ prettyPrint?: boolean;
188
+ /** 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. */
189
+ quotaUser?: string;
190
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
191
+ upload_protocol?: string;
192
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
193
+ uploadType?: string;
194
+ },
195
+ body: AddGranteesRequest,
196
+ ): Request<DataPolicy>;
197
+ /** Creates a new data policy under a project with the given `data_policy_id` (used as the display name), and data policy type. */
198
+ create(request: {
199
+ /** V1 error format. */
200
+ '$.xgafv'?: string;
201
+ /** OAuth access token. */
202
+ access_token?: string;
203
+ /** Data format for response. */
204
+ alt?: string;
205
+ /** JSONP */
206
+ callback?: string;
207
+ /** Selector specifying which fields to include in a partial response. */
208
+ fields?: string;
209
+ /** 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. */
210
+ key?: string;
211
+ /** OAuth 2.0 token for the current user. */
212
+ oauth_token?: string;
213
+ /** Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`. */
214
+ parent: string;
215
+ /** Returns response with indentations and line breaks. */
216
+ prettyPrint?: boolean;
217
+ /** 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. */
218
+ quotaUser?: string;
219
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
220
+ upload_protocol?: string;
221
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
222
+ uploadType?: string;
223
+ /** Request body */
224
+ resource: CreateDataPolicyRequest;
225
+ }): Request<DataPolicy>;
226
+ create(
227
+ request: {
228
+ /** V1 error format. */
229
+ '$.xgafv'?: string;
230
+ /** OAuth access token. */
231
+ access_token?: string;
232
+ /** Data format for response. */
233
+ alt?: string;
234
+ /** JSONP */
235
+ callback?: string;
236
+ /** Selector specifying which fields to include in a partial response. */
237
+ fields?: string;
238
+ /** 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. */
239
+ key?: string;
240
+ /** OAuth 2.0 token for the current user. */
241
+ oauth_token?: string;
242
+ /** Required. Resource name of the project that the data policy will belong to. The format is `projects/{project_number}/locations/{location_id}`. */
243
+ parent: 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
+ },
253
+ body: CreateDataPolicyRequest,
254
+ ): Request<DataPolicy>;
255
+ /** Deletes the data policy specified by its resource name. */
256
+ delete(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
+ /** 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. */
268
+ key?: string;
269
+ /** Required. Resource name of the data policy to delete. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{id}`. */
270
+ name: string;
271
+ /** OAuth 2.0 token for the current user. */
272
+ oauth_token?: string;
273
+ /** Returns response with indentations and line breaks. */
274
+ prettyPrint?: 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?: string;
277
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
278
+ upload_protocol?: string;
279
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
280
+ uploadType?: string;
281
+ }): Request<{}>;
282
+ /** Gets the data policy specified by its resource name. */
283
+ get(request?: {
284
+ /** V1 error format. */
285
+ '$.xgafv'?: string;
286
+ /** OAuth access token. */
287
+ access_token?: string;
288
+ /** Data format for response. */
289
+ alt?: string;
290
+ /** JSONP */
291
+ callback?: string;
292
+ /** Selector specifying which fields to include in a partial response. */
293
+ fields?: string;
294
+ /** 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. */
295
+ key?: string;
296
+ /** Required. Resource name of the requested data policy. Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{id}`. */
297
+ name: string;
298
+ /** OAuth 2.0 token for the current user. */
299
+ oauth_token?: string;
300
+ /** Returns response with indentations and line breaks. */
301
+ prettyPrint?: boolean;
302
+ /** 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. */
303
+ quotaUser?: string;
304
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
305
+ upload_protocol?: string;
306
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
307
+ uploadType?: string;
308
+ }): Request<DataPolicy>;
309
+ /** Gets the IAM policy for the specified data policy. */
310
+ getIamPolicy(
311
+ request: {
312
+ /** V1 error format. */
313
+ '$.xgafv'?: string;
314
+ /** OAuth access token. */
315
+ access_token?: string;
316
+ /** Data format for response. */
317
+ alt?: string;
318
+ /** JSONP */
319
+ callback?: string;
320
+ /** Selector specifying which fields to include in a partial response. */
321
+ fields?: string;
322
+ /** 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. */
323
+ key?: string;
324
+ /** OAuth 2.0 token for the current user. */
325
+ oauth_token?: string;
326
+ /** Returns response with indentations and line breaks. */
327
+ prettyPrint?: boolean;
328
+ /** 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. */
329
+ quotaUser?: string;
330
+ /** 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 field. */
331
+ resource: string;
332
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
333
+ upload_protocol?: string;
334
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
335
+ uploadType?: string;
336
+ },
337
+ body: GetIamPolicyRequest,
338
+ ): Request<Policy>;
339
+ /** List all of the data policies in the specified parent project. */
340
+ list(request?: {
341
+ /** V1 error format. */
342
+ '$.xgafv'?: string;
343
+ /** OAuth access token. */
344
+ access_token?: string;
345
+ /** Data format for response. */
346
+ alt?: string;
347
+ /** JSONP */
348
+ callback?: string;
349
+ /** Selector specifying which fields to include in a partial response. */
350
+ fields?: string;
351
+ /** Optional. 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 "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 predicates cannot be used with wildcard filters. */
352
+ filter?: string;
353
+ /** 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. */
354
+ key?: string;
355
+ /** OAuth 2.0 token for the current user. */
356
+ oauth_token?: string;
357
+ /** Optional. The maximum number of data policies to return. Must be a value between 1 and 1000. If not set, defaults to 50. */
358
+ pageSize?: number;
359
+ /** Optional. The `nextPageToken` value returned from a previous list request, if any. If not set, defaults to an empty string. */
360
+ pageToken?: string;
361
+ /** Required. Resource name of the project for which to list data policies. Format is `projects/{project_number}/locations/{location_id}`. */
362
+ parent: string;
363
+ /** Returns response with indentations and line breaks. */
364
+ prettyPrint?: boolean;
365
+ /** 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. */
366
+ quotaUser?: string;
367
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
368
+ upload_protocol?: string;
369
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
370
+ uploadType?: string;
371
+ }): Request<ListDataPoliciesResponse>;
372
+ /** Updates the metadata for an existing data policy. The target data policy can be specified by the resource name. */
373
+ patch(request: {
374
+ /** V1 error format. */
375
+ '$.xgafv'?: string;
376
+ /** OAuth access token. */
377
+ access_token?: string;
378
+ /** Optional. If set to true, and the data policy is not found, a new data policy will be created. In this situation, update_mask is ignored. */
379
+ allowMissing?: boolean;
380
+ /** Data format for response. */
381
+ alt?: string;
382
+ /** JSONP */
383
+ callback?: string;
384
+ /** Selector specifying which fields to include in a partial response. */
385
+ fields?: string;
386
+ /** 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. */
387
+ key?: string;
388
+ /** Identifier. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
389
+ name: string;
390
+ /** OAuth 2.0 token for the current user. */
391
+ oauth_token?: string;
392
+ /** Returns response with indentations and line breaks. */
393
+ prettyPrint?: boolean;
394
+ /** 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. */
395
+ quotaUser?: string;
396
+ /** Optional. 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, defaults to all of the fields that are allowed to update. Updates to the `name` and `dataPolicyId` fields are not allowed. */
397
+ updateMask?: string;
398
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
399
+ upload_protocol?: string;
400
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
401
+ uploadType?: string;
402
+ /** Request body */
403
+ resource: DataPolicy;
404
+ }): Request<DataPolicy>;
405
+ patch(
406
+ request: {
407
+ /** V1 error format. */
408
+ '$.xgafv'?: string;
409
+ /** OAuth access token. */
410
+ access_token?: string;
411
+ /** Optional. If set to true, and the data policy is not found, a new data policy will be created. In this situation, update_mask is ignored. */
412
+ allowMissing?: boolean;
413
+ /** Data format for response. */
414
+ alt?: string;
415
+ /** JSONP */
416
+ callback?: string;
417
+ /** Selector specifying which fields to include in a partial response. */
418
+ fields?: string;
419
+ /** 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. */
420
+ key?: string;
421
+ /** Identifier. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
422
+ name: string;
423
+ /** OAuth 2.0 token for the current user. */
424
+ oauth_token?: string;
425
+ /** Returns response with indentations and line breaks. */
426
+ prettyPrint?: boolean;
427
+ /** 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. */
428
+ quotaUser?: string;
429
+ /** Optional. 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, defaults to all of the fields that are allowed to update. Updates to the `name` and `dataPolicyId` fields are not allowed. */
430
+ updateMask?: string;
431
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
432
+ upload_protocol?: string;
433
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
434
+ uploadType?: string;
435
+ },
436
+ body: DataPolicy,
437
+ ): Request<DataPolicy>;
438
+ /** Removes grantees from a data policy. The grantees will be removed from the existing grantees. If the request contains a grantee that does not exist, the grantee will be ignored. */
439
+ removeGrantees(request: {
440
+ /** V1 error format. */
441
+ '$.xgafv'?: string;
442
+ /** OAuth access token. */
443
+ access_token?: string;
444
+ /** Data format for response. */
445
+ alt?: string;
446
+ /** JSONP */
447
+ callback?: string;
448
+ /** Required. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
449
+ dataPolicy: string;
450
+ /** Selector specifying which fields to include in a partial response. */
451
+ fields?: string;
452
+ /** 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. */
453
+ key?: string;
454
+ /** OAuth 2.0 token for the current user. */
455
+ oauth_token?: string;
456
+ /** Returns response with indentations and line breaks. */
457
+ prettyPrint?: boolean;
458
+ /** 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. */
459
+ quotaUser?: string;
460
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
461
+ upload_protocol?: string;
462
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
463
+ uploadType?: string;
464
+ /** Request body */
465
+ resource: RemoveGranteesRequest;
466
+ }): Request<DataPolicy>;
467
+ removeGrantees(
468
+ request: {
469
+ /** V1 error format. */
470
+ '$.xgafv'?: string;
471
+ /** OAuth access token. */
472
+ access_token?: string;
473
+ /** Data format for response. */
474
+ alt?: string;
475
+ /** JSONP */
476
+ callback?: string;
477
+ /** Required. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. */
478
+ dataPolicy: string;
479
+ /** Selector specifying which fields to include in a partial response. */
480
+ fields?: string;
481
+ /** 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. */
482
+ key?: string;
483
+ /** OAuth 2.0 token for the current user. */
484
+ oauth_token?: string;
485
+ /** Returns response with indentations and line breaks. */
486
+ prettyPrint?: boolean;
487
+ /** 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. */
488
+ quotaUser?: string;
489
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
490
+ upload_protocol?: string;
491
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
492
+ uploadType?: string;
493
+ },
494
+ body: RemoveGranteesRequest,
495
+ ): Request<DataPolicy>;
496
+ /** Sets the IAM policy for the specified data policy. */
497
+ setIamPolicy(
498
+ request: {
499
+ /** V1 error format. */
500
+ '$.xgafv'?: string;
501
+ /** OAuth access token. */
502
+ access_token?: string;
503
+ /** Data format for response. */
504
+ alt?: string;
505
+ /** JSONP */
506
+ callback?: string;
507
+ /** Selector specifying which fields to include in a partial response. */
508
+ fields?: string;
509
+ /** 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. */
510
+ key?: string;
511
+ /** OAuth 2.0 token for the current user. */
512
+ oauth_token?: string;
513
+ /** Returns response with indentations and line breaks. */
514
+ prettyPrint?: boolean;
515
+ /** 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. */
516
+ quotaUser?: string;
517
+ /** 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 field. */
518
+ resource: string;
519
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
520
+ upload_protocol?: string;
521
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
522
+ uploadType?: string;
523
+ },
524
+ body: SetIamPolicyRequest,
525
+ ): Request<Policy>;
526
+ /** Returns the caller's permission on the specified data policy resource. */
527
+ testIamPermissions(
528
+ request: {
529
+ /** V1 error format. */
530
+ '$.xgafv'?: string;
531
+ /** OAuth access token. */
532
+ access_token?: string;
533
+ /** Data format for response. */
534
+ alt?: string;
535
+ /** JSONP */
536
+ callback?: string;
537
+ /** Selector specifying which fields to include in a partial response. */
538
+ fields?: 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
+ /** OAuth 2.0 token for the current user. */
542
+ oauth_token?: string;
543
+ /** Returns response with indentations and line breaks. */
544
+ prettyPrint?: boolean;
545
+ /** 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. */
546
+ quotaUser?: string;
547
+ /** 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 this field. */
548
+ resource: string;
549
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
550
+ upload_protocol?: string;
551
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
552
+ uploadType?: string;
553
+ },
554
+ body: TestIamPermissionsRequest,
555
+ ): Request<TestIamPermissionsResponse>;
556
+ }
557
+ interface LocationsResource {
558
+ dataPolicies: DataPoliciesResource;
559
+ }
560
+ interface ProjectsResource {
561
+ locations: LocationsResource;
562
+ }
563
+
564
+ const projects: ProjectsResource;
565
+ }
566
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.bigquerydatapolicy-v2",
3
+ "version": "0.0.20251015",
4
+ "description": "TypeScript typings for BigQuery Data Policy API v2",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
13
+ "url": "https://maxim.mazurok.com"
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,78 @@
1
+ # TypeScript typings for BigQuery Data Policy API v2
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-v2 --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(
29
+ 'https://bigquerydatapolicy.googleapis.com/$discovery/rest?version=v2',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.bigquerydatapolicy
33
+ },
34
+ );
35
+ ```
36
+
37
+ ```typescript
38
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
39
+ gapi.client.load('bigquerydatapolicy', 'v2', () => {
40
+ // now we can use:
41
+ // gapi.client.bigquerydatapolicy
42
+ });
43
+ ```
44
+
45
+ Don't forget to authenticate your client before sending any request to resources:
46
+
47
+ ```typescript
48
+ // declare client_id registered in Google Developers Console
49
+ var client_id = '',
50
+ scope = [
51
+ // View and manage your data in Google BigQuery and see the email address for your Google Account
52
+ 'https://www.googleapis.com/auth/bigquery',
53
+
54
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
55
+ 'https://www.googleapis.com/auth/cloud-platform',
56
+ ],
57
+ immediate = true;
58
+ // ...
59
+
60
+ gapi.auth.authorize(
61
+ {client_id: client_id, scope: scope, immediate: immediate},
62
+ authResult => {
63
+ if (authResult && !authResult.error) {
64
+ /* handle successful authorization */
65
+ } else {
66
+ /* handle authorization error */
67
+ }
68
+ },
69
+ );
70
+ ```
71
+
72
+ After that you can use BigQuery Data Policy API resources: <!-- TODO: make this work for multiple namespaces -->
73
+
74
+ ```typescript
75
+
76
+ ```
77
+
78
+ For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.bigquerydatapolicy-v2#Provenance:~:text=none-,Provenance,-Built%20and%20signed)