// 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.organizations.storedInfoTypes.get({
// Required. Resource name of the organization and storedInfoType to be read, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342.
name: 'organizations/my-organization/storedInfoTypes/my-storedInfoType',
});
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.organizations.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: 'organizations/my-organization/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.organizations.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: 'organizations/my-organization/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;
});