Skip to content

DLP library (GAPIC-only) #2323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 4, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
25 changes: 25 additions & 0 deletions packages/dlp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Node.js Client for DLP API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-node#versioning))

Idiomatic Node.js client for [DLP API][Product Documentation]
- [Client Library Documentation][]
- [Product Documentation][]

## Quick Start
In order to use this library, you first need to go through the following steps:

1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
2. [Enable the dlp api.](https://console.cloud.google.com/apis/api/dlp)

This comment was marked as spam.

This comment was marked as spam.

3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/master/guides/authentication)

### Installation
```
$ npm install @google-cloud/dlp

This comment was marked as spam.

This comment was marked as spam.

```

### Next Steps
- Read the [Client Library Documentation][] for DLP API to see other available methods on the client.
- Read the [DLP API Product documentation][Product Documentation] to learn more about the product and see How-to Guides.
- View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/README.md) to see the full list of Cloud APIs that we cover.

[Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/dlp
[Product Documentation]: https://cloud.google.com/dlp
21 changes: 13 additions & 8 deletions packages/dlp/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"repository": "GoogleCloudPlatform/google-cloud-node",
"name": "dlp",
"version": "0.0.0",
"name": "@google-cloud/dlp",
"version": "0.7.1",

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

"author": "Google Inc",
"description": "DLP API client for Node.js",
"url": "https://github.com/googleapis/googleapis",

This comment was marked as spam.

This comment was marked as spam.

"main": "src/index.js",
"files": [
"src"
"src",
"AUTHORS",
"CONTRIBUTING",
"COPYING"
],
"keywords": [
"google apis client",
Expand All @@ -22,16 +26,17 @@
"DLP API"
],
"dependencies": {
"google-proto-files": "^0.12.0",
"google-gax": "^0.12.2",
"google-proto-files": "^0.8.6",

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

"google-gax": "^0.13.2",
"extend": "^3.0.0"
},
"devDependencies": {
"mocha": "3.2.0",
"through2": "2.0.3"
"mocha": "^3.2.0",
"through2": "^2.0.3"
},
"scripts": {
"test": "mocha"
"test": "mocha",
"publish-module": "node ../../scripts/publish.js dlp"
},
"license": "Apache-2.0",
"engines": {
Expand Down
42 changes: 22 additions & 20 deletions packages/dlp/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2016 Google Inc. All rights reserved.
* Copyright 2017, Google Inc. All rights reserved.
*
* 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
* 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,
Expand All @@ -15,8 +15,9 @@
*/
'use strict';

var extend = require('extend');
var gapic = {
v2beta1: require('./v2beta1'),
v2beta1: require('./v2beta1')
};

const VERSION = require('../package.json').version;
Expand All @@ -25,27 +26,28 @@ const VERSION = require('../package.json').version;
* Create an dlpServiceClient with additional helpers for common
* tasks.
*
* @param {Object=} opts - The optional parameters.
* @param {String=} opts.servicePath
* The domain name of the API remote host.
* @param {number=} opts.port
* The port on which to connect to the remote host.
* @param {grpc.ClientCredentials=} opts.sslCreds
* A ClientCredentials for use with an SSL-enabled channel.
* @param {Object=} opts.clientConfig
* The customized config to build the call settings. See
* {@link gax.constructSettings} for the format.
* The DLP API is a service that allows clients
* to detect the presence of Personally Identifiable Information (PII) and other
* privacy-sensitive data in user-supplied, unstructured data streams, like text
* blocks or images.
* The service also includes methods for sensitive data redaction and
* scheduling of data scans on Google Cloud Platform based data sets.
*
* @param {object=} options - [Configuration object](#/docs).
* @param {number=} options.port - The port on which to connect to the remote host.
* @param {string=} options.servicePath - The domain name of the API remote host.
*/
function dlp_v2beta1(opts) {
function dlpV2beta1(options) {
// Define the header options.
opts = opts || {};
opts.libName = 'gccl';
opts.libVersion = VERSION;
options = extend({}, options, {
libName: 'gccl',
libVersion: VERSION
});

// Create the image annotator client with the provided options.
var client = gapic.v2beta1(opts).dlpServiceClient(opts);
var client = gapic.v2beta1(options).dlpServiceClient(options);
return client;
}

module.exports = dlp_v2beta1;
module.exports.v2beta1 = dlp_v2beta1;
module.exports = dlpV2beta1;
module.exports.v2beta1 = dlpV2beta1;
6 changes: 3 additions & 3 deletions packages/dlp/src/v2beta1/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2016 Google Inc. All rights reserved.
* Copyright 2017, Google Inc. All rights reserved.
*
* 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
* 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,
Expand All @@ -31,4 +31,4 @@ v2beta1.GAPIC_VERSION = '0.7.1';
v2beta1.SERVICE_ADDRESS = dlpServiceClient.SERVICE_ADDRESS;
v2beta1.ALL_SCOPES = dlpServiceClient.ALL_SCOPES;

module.exports = v2beta1;
module.exports = v2beta1;
4 changes: 2 additions & 2 deletions packages/dlp/test/gapic-v2beta1.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2016 Google Inc. All rights reserved.
* Copyright 2017, Google Inc. All rights reserved.
*
* 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
* 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,
Expand Down