diff --git a/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.js b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.js index b0c8ed41fa6..fa888988639 100644 --- a/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.js +++ b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.js @@ -55,14 +55,18 @@ class PhishingProtectionServiceV1Beta1Client { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -149,6 +153,14 @@ class PhishingProtectionServiceV1Beta1Client { return 'phishingprotection.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'phishingprotection.googleapis.com'; + } + /** * The port for this API service. */ diff --git a/packages/google-cloud-phishingprotection/synth.metadata b/packages/google-cloud-phishingprotection/synth.metadata index 2fbfaff9b7f..966fda74599 100644 --- a/packages/google-cloud-phishingprotection/synth.metadata +++ b/packages/google-cloud-phishingprotection/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-05-23T22:05:10.387551Z", + "updateTime": "2019-06-05T14:22:23.222028Z", "sources": [ { "generator": { "name": "artman", - "version": "0.20.0", - "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" + "version": "0.23.1", + "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2e95f389aff85e3be30ec6bb84eb0cfc36826f9f", - "internalRef": "249721027" + "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", + "internalRef": "251635729" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], diff --git a/packages/google-cloud-phishingprotection/test/gapic-v1beta1.js b/packages/google-cloud-phishingprotection/test/gapic-v1beta1.js index 9bef3a44061..78402e12db8 100644 --- a/packages/google-cloud-phishingprotection/test/gapic-v1beta1.js +++ b/packages/google-cloud-phishingprotection/test/gapic-v1beta1.js @@ -23,6 +23,33 @@ const error = new Error(); error.code = FAKE_STATUS_CODE; describe('PhishingProtectionServiceV1Beta1Client', () => { + it('has servicePath', () => { + const servicePath = + phishingprotectionModule.v1beta1.PhishingProtectionServiceV1Beta1Client + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + phishingprotectionModule.v1beta1.PhishingProtectionServiceV1Beta1Client + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + phishingprotectionModule.v1beta1.PhishingProtectionServiceV1Beta1Client + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new phishingprotectionModule.v1beta1.PhishingProtectionServiceV1Beta1Client(); + assert(client); + }); + describe('reportPhishing', () => { it('invokes reportPhishing without error', done => { const client = new phishingprotectionModule.v1beta1.PhishingProtectionServiceV1Beta1Client(