Data Policy Service provides APIs for managing the label-policy bindings. v1
Package
@google-cloud/bigquery-datapoliciesConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of DataPolicyServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
dataPolicyServiceStub
dataPolicyServiceStub?: Promise<{
[name: string]: Function;
}>;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
createDataPolicy(request, options)
createDataPolicy(request?: protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest | undefined),
{} | undefined
]>;
Creates a new data policy under a project with the given dataPolicyId
(used as the display name), policy tag, and data policy type.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the project that the data policy will belong to.
* The format is `projects/{project_number}/locations/{location_id}`.
*/
// const parent = 'abc123'
/**
* Required. The data policy to create. The `name` field does not need to be
* provided for the data policy creation.
*/
// const dataPolicy = {}
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callCreateDataPolicy() {
// Construct request
const request = {
parent,
dataPolicy,
};
// Run request
const response = await datapoliciesClient.createDataPolicy(request);
console.log(response);
}
callCreateDataPolicy();
createDataPolicy(request, options, callback)
createDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createDataPolicy(request, callback)
createDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
dataPolicyPath(project, location, dataPolicy)
dataPolicyPath(project: string, location: string, dataPolicy: string): string;
Return a fully-qualified dataPolicy resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
dataPolicy |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
deleteDataPolicy(request, options)
deleteDataPolicy(request?: protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest | undefined),
{} | undefined
]>;
Deletes the data policy specified by its resource name.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the data policy to delete. Format is
* `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
*/
// const name = 'abc123'
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callDeleteDataPolicy() {
// Construct request
const request = {
name,
};
// Run request
const response = await datapoliciesClient.deleteDataPolicy(request);
console.log(response);
}
callDeleteDataPolicy();
deleteDataPolicy(request, options, callback)
deleteDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteDataPolicy(request, callback)
deleteDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDataPolicy(request, options)
getDataPolicy(request?: protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest | undefined),
{} | undefined
]>;
Gets the data policy specified by its resource name.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the requested data policy. Format is
* `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
*/
// const name = 'abc123'
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callGetDataPolicy() {
// Construct request
const request = {
name,
};
// Run request
const response = await datapoliciesClient.getDataPolicy(request);
console.log(response);
}
callGetDataPolicy();
getDataPolicy(request, options, callback)
getDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDataPolicy(request, callback)
getDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getIamPolicy(request, options)
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]>;
Gets the IAM policy for the specified data policy.
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.IGetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`.
*/
// const options = {}
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callGetIamPolicy() {
// Construct request
const request = {
resource,
};
// Run request
const response = await datapoliciesClient.getIamPolicy(request);
console.log(response);
}
callGetIamPolicy();
getIamPolicy(request, options, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.IGetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getIamPolicy(request, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.IGetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
listDataPolicies(request, options)
listDataPolicies(request?: protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy[],
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest | null,
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse
]>;
List all of the data policies in the specified parent project.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy[],
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest | null,
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listDataPolicies(request, options, callback)
listDataPolicies(request: protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse | null | undefined, protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse | null | undefined, protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy>
|
Returns | |
---|---|
Type | Description |
void |
listDataPolicies(request, callback)
listDataPolicies(request: protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, callback: PaginationCallback<protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse | null | undefined, protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest
|
callback |
PaginationCallback<protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse | null | undefined, protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy>
|
Returns | |
---|---|
Type | Description |
void |
listDataPoliciesAsync(request, options)
listDataPoliciesAsync(request?: protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy>;
Equivalent to listDataPolicies
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the project for which to list data policies.
* Format is `projects/{project_number}/locations/{location_id}`.
*/
// const parent = 'abc123'
/**
* The maximum number of data policies to return. Must be a value between 1
* and 1000.
* If not set, defaults to 50.
*/
// const pageSize = 1234
/**
* The `nextPageToken` value returned from a previous list request, if any. If
* not set, defaults to an empty string.
*/
// const pageToken = 'abc123'
/**
* 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 use
* wildcard such as "policy_tag:
* `'projects/1/locations/us/taxonomies/2/*'`".
*/
// const filter = 'abc123'
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callListDataPolicies() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await datapoliciesClient.listDataPoliciesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListDataPolicies();
listDataPoliciesStream(request, options)
listDataPoliciesStream(request?: protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
locationPath(project, location)
locationPath(project: string, location: string): string;
Return a fully-qualified location resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
matchDataPolicyFromDataPolicyName(dataPolicyName)
matchDataPolicyFromDataPolicyName(dataPolicyName: string): string | number;
Parse the data_policy from DataPolicy resource.
Parameter | |
---|---|
Name | Description |
dataPolicyName |
string
A fully-qualified path representing DataPolicy resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the data_policy. |
matchLocationFromDataPolicyName(dataPolicyName)
matchLocationFromDataPolicyName(dataPolicyName: string): string | number;
Parse the location from DataPolicy resource.
Parameter | |
---|---|
Name | Description |
dataPolicyName |
string
A fully-qualified path representing DataPolicy resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;
Parse the location from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchProjectFromDataPolicyName(dataPolicyName)
matchProjectFromDataPolicyName(dataPolicyName: string): string | number;
Parse the project from DataPolicy resource.
Parameter | |
---|---|
Name | Description |
dataPolicyName |
string
A fully-qualified path representing DataPolicy resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;
Parse the project from Location resource.
Parameter | |
---|---|
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter | |
---|---|
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter | |
---|---|
Name | Description |
project |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
renameDataPolicy(request, options)
renameDataPolicy(request?: protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest | undefined),
{} | undefined
]>;
Renames the id (display name) of the specified data policy.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the data policy to rename. The format is
* `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`
*/
// const name = 'abc123'
/**
* Required. The new data policy id.
*/
// const newDataPolicyId = 'abc123'
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callRenameDataPolicy() {
// Construct request
const request = {
name,
newDataPolicyId,
};
// Run request
const response = await datapoliciesClient.renameDataPolicy(request);
console.log(response);
}
callRenameDataPolicy();
renameDataPolicy(request, options, callback)
renameDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
renameDataPolicy(request, callback)
renameDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setIamPolicy(request, options)
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]>;
Sets the IAM policy for the specified data policy.
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.ISetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* 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 Cloud Platform services (such as Projects)
* might reject them.
*/
// const policy = {}
/**
* 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"`
*/
// const updateMask = {}
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callSetIamPolicy() {
// Construct request
const request = {
resource,
policy,
};
// Run request
const response = await datapoliciesClient.setIamPolicy(request);
console.log(response);
}
callSetIamPolicy();
setIamPolicy(request, options, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.ISetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setIamPolicy(request, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.ISetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
testIamPermissions(request, options)
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]>;
Returns the caller's permission on the specified data policy resource.
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.ITestIamPermissionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* 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).
*/
// const permissions = 'abc123'
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callTestIamPermissions() {
// Construct request
const request = {
resource,
permissions,
};
// Run request
const response = await datapoliciesClient.testIamPermissions(request);
console.log(response);
}
callTestIamPermissions();
testIamPermissions(request, options, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.ITestIamPermissionsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
testIamPermissions(request, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.iam.v1.ITestIamPermissionsRequest
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDataPolicy(request, options)
updateDataPolicy(request?: protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest | undefined),
{} | undefined
]>;
Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy,
(protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Update the data policy's metadata.
* The target data policy is determined by the `name` field.
* Other fields are updated to the specified values based on the field masks.
*/
// const dataPolicy = {}
/**
* 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.
*/
// const updateMask = {}
// Imports the Datapolicies library
const {DataPolicyServiceClient} = require('@google-cloud/datapolicies').v1;
// Instantiates a client
const datapoliciesClient = new DataPolicyServiceClient();
async function callUpdateDataPolicy() {
// Construct request
const request = {
dataPolicy,
};
// Run request
const response = await datapoliciesClient.updateDataPolicy(request);
console.log(response);
}
callUpdateDataPolicy();
updateDataPolicy(request, options, callback)
updateDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDataPolicy(request, callback)
updateDataPolicy(request: protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest, callback: Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest
|
callback |
Callback<protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |