// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dlp.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dlp = google.dlp('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dlp.projects.storedInfoTypes.delete({
// Required. Resource name of the organization and storedInfoType to be deleted, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342.
name: 'projects/my-project/storedInfoTypes/my-storedInfoType',
});
console.log(res.data);
// Example response
// {}
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dlp.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dlp = google.dlp('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dlp.projects.storedInfoTypes.patch({
// Required. Resource name of organization and storedInfoType to be updated, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342.
name: 'projects/my-project/storedInfoTypes/my-storedInfoType',
// Request body metadata
requestBody: {
// request body parameters
// {
// "config": {},
// "updateMask": "my_updateMask"
// }
},
});
console.log(res.data);
// Example response
// {
// "currentVersion": {},
// "name": "my_name",
// "pendingVersions": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dlp.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dlp = google.dlp('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dlp.projects.locations.storedInfoTypes.list({
// Deprecated. This field has no effect.
locationId: 'placeholder-value',
// Comma separated list of fields to order by, followed by `asc` or `desc` postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant. Example: `name asc, display_name, create_time desc` Supported fields are: - `create_time`: corresponds to time the most recent version of the resource was created. - `state`: corresponds to the state of the resource. - `name`: corresponds to resource name. - `display_name`: corresponds to info type's display name.
orderBy: 'placeholder-value',
// Size of the page, can be limited by server. If zero server returns a page of max size 100.
pageSize: 'placeholder-value',
// Page token to continue retrieval. Comes from previous call to `ListStoredInfoTypes`.
pageToken: 'placeholder-value',
// Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/dlp/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3
parent: 'projects/my-project/locations/my-location',
});
console.log(res.data);
// Example response
// {
// "nextPageToken": "my_nextPageToken",
// "storedInfoTypes": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dlp.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dlp = google.dlp('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dlp.projects.locations.storedInfoTypes.patch({
// Required. Resource name of organization and storedInfoType to be updated, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342.
name: 'projects/my-project/locations/my-location/storedInfoTypes/my-storedInfoType',
// Request body metadata
requestBody: {
// request body parameters
// {
// "config": {},
// "updateMask": "my_updateMask"
// }
},
});
console.log(res.data);
// Example response
// {
// "currentVersion": {},
// "name": "my_name",
// "pendingVersions": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dlp.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dlp = google.dlp('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dlp.projects.storedInfoTypes.list({
// Deprecated. This field has no effect.
locationId: 'placeholder-value',
// Comma separated list of fields to order by, followed by `asc` or `desc` postfix. This list is case-insensitive, default sorting order is ascending, redundant space characters are insignificant. Example: `name asc, display_name, create_time desc` Supported fields are: - `create_time`: corresponds to time the most recent version of the resource was created. - `state`: corresponds to the state of the resource. - `name`: corresponds to resource name. - `display_name`: corresponds to info type's display name.
orderBy: 'placeholder-value',
// Size of the page, can be limited by server. If zero server returns a page of max size 100.
pageSize: 'placeholder-value',
// Page token to continue retrieval. Comes from previous call to `ListStoredInfoTypes`.
pageToken: 'placeholder-value',
// Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/dlp/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3
parent: 'projects/my-project',
});
console.log(res.data);
// Example response
// {
// "nextPageToken": "my_nextPageToken",
// "storedInfoTypes": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});