Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions samples/generated/v2/dlp_service.activate_job_trigger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name) {
// [START dlp_v2_generated_DlpService_ActivateJobTrigger_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the trigger to activate, for example
* `projects/dlp-test-project/jobTriggers/53234423`.
*/
// const name = 'abc123'

// Imports the Dlp library
const {DlpServiceClient} = require('@google-cloud/dlp').v2;

// Instantiates a client
const dlpClient = new DlpServiceClient();

async function activateJobTrigger() {
// Construct request
const request = {
name,
};

// Run request
const response = await dlpClient.activateJobTrigger(request);
console.log(response);
}

activateJobTrigger();
// [END dlp_v2_generated_DlpService_ActivateJobTrigger_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
52 changes: 52 additions & 0 deletions samples/generated/v2/dlp_service.cancel_dlp_job.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name) {
// [START dlp_v2_generated_DlpService_CancelDlpJob_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the DlpJob resource to be cancelled.
*/
// const name = 'abc123'

// Imports the Dlp library
const {DlpServiceClient} = require('@google-cloud/dlp').v2;

// Instantiates a client
const dlpClient = new DlpServiceClient();

async function cancelDlpJob() {
// Construct request
const request = {
name,
};

// Run request
const response = await dlpClient.cancelDlpJob(request);
console.log(response);
}

cancelDlpJob();
// [END dlp_v2_generated_DlpService_CancelDlpJob_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
83 changes: 83 additions & 0 deletions samples/generated/v2/dlp_service.create_deidentify_template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent, deidentifyTemplate) {
// [START dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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:<br/>
* `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
* + Projects scope, no location specified (defaults to global):<br/>
* `projects/`<var>PROJECT_ID</var>
* + Organizations scope, location specified:<br/>
* `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
* + Organizations scope, no location specified (defaults to global):<br/>
* `organizations/`<var>ORG_ID</var>
* 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
*/
// const parent = 'abc123'
/**
* Required. The DeidentifyTemplate to create.
*/
// const deidentifyTemplate = ''
/**
* The template id can contain uppercase and lowercase letters,
* numbers, and hyphens; that is, it must match the regular
* expression: `[a-zA-Z\d-_]+`. The maximum length is 100
* characters. Can be empty to allow the system to generate one.
*/
// const templateId = 'abc123'
/**
* Deprecated. This field has no effect.
*/
// const locationId = 'abc123'

// Imports the Dlp library
const {DlpServiceClient} = require('@google-cloud/dlp').v2;

// Instantiates a client
const dlpClient = new DlpServiceClient();

async function createDeidentifyTemplate() {
// Construct request
const request = {
parent,
deidentifyTemplate,
};

// Run request
const response = await dlpClient.createDeidentifyTemplate(request);
console.log(response);
}

createDeidentifyTemplate();
// [END dlp_v2_generated_DlpService_CreateDeidentifyTemplate_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
82 changes: 82 additions & 0 deletions samples/generated/v2/dlp_service.create_dlp_job.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent) {
// [START dlp_v2_generated_DlpService_CreateDlpJob_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent resource name.
* The format of this value varies depending on whether you have [specified a
* processing
* location](https://cloud.google.com/dlp/docs/specifying-location):
* + Projects scope, location specified:<br/>
* `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
* + Projects scope, no location specified (defaults to global):<br/>
* `projects/`<var>PROJECT_ID</var>
* 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
*/
// const parent = 'abc123'
/**
* Set to control what and how to inspect.
*/
// const inspectJob = ''
/**
* Set to choose what metric to calculate.
*/
// const riskJob = ''
/**
* The job id can contain uppercase and lowercase letters,
* numbers, and hyphens; that is, it must match the regular
* expression: `[a-zA-Z\d-_]+`. The maximum length is 100
* characters. Can be empty to allow the system to generate one.
*/
// const jobId = 'abc123'
/**
* Deprecated. This field has no effect.
*/
// const locationId = 'abc123'

// Imports the Dlp library
const {DlpServiceClient} = require('@google-cloud/dlp').v2;

// Instantiates a client
const dlpClient = new DlpServiceClient();

async function createDlpJob() {
// Construct request
const request = {
parent,
};

// Run request
const response = await dlpClient.createDlpJob(request);
console.log(response);
}

createDlpJob();
// [END dlp_v2_generated_DlpService_CreateDlpJob_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
83 changes: 83 additions & 0 deletions samples/generated/v2/dlp_service.create_inspect_template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent, inspectTemplate) {
// [START dlp_v2_generated_DlpService_CreateInspectTemplate_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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:<br/>
* `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
* + Projects scope, no location specified (defaults to global):<br/>
* `projects/`<var>PROJECT_ID</var>
* + Organizations scope, location specified:<br/>
* `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
* + Organizations scope, no location specified (defaults to global):<br/>
* `organizations/`<var>ORG_ID</var>
* 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
*/
// const parent = 'abc123'
/**
* Required. The InspectTemplate to create.
*/
// const inspectTemplate = ''
/**
* The template id can contain uppercase and lowercase letters,
* numbers, and hyphens; that is, it must match the regular
* expression: `[a-zA-Z\d-_]+`. The maximum length is 100
* characters. Can be empty to allow the system to generate one.
*/
// const templateId = 'abc123'
/**
* Deprecated. This field has no effect.
*/
// const locationId = 'abc123'

// Imports the Dlp library
const {DlpServiceClient} = require('@google-cloud/dlp').v2;

// Instantiates a client
const dlpClient = new DlpServiceClient();

async function createInspectTemplate() {
// Construct request
const request = {
parent,
inspectTemplate,
};

// Run request
const response = await dlpClient.createInspectTemplate(request);
console.log(response);
}

createInspectTemplate();
// [END dlp_v2_generated_DlpService_CreateInspectTemplate_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading