File tree Expand file tree Collapse file tree
packages/google-cloud-securitycenter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,14 +56,18 @@ class SecurityCenterClient {
5656 * API remote host.
5757 */
5858 constructor ( opts ) {
59+ opts = opts || { } ;
5960 this . _descriptors = { } ;
6061
62+ const servicePath =
63+ opts . servicePath || opts . apiEndpoint || this . constructor . servicePath ;
64+
6165 // Ensure that options include the service address and port.
6266 opts = Object . assign (
6367 {
6468 clientConfig : { } ,
6569 port : this . constructor . port ,
66- servicePath : this . constructor . servicePath ,
70+ servicePath,
6771 } ,
6872 opts
6973 ) ;
@@ -257,6 +261,14 @@ class SecurityCenterClient {
257261 return 'securitycenter.googleapis.com' ;
258262 }
259263
264+ /**
265+ * The DNS address for this API service - same as servicePath(),
266+ * exists for compatibility reasons.
267+ */
268+ static get apiEndpoint ( ) {
269+ return 'securitycenter.googleapis.com' ;
270+ }
271+
260272 /**
261273 * The port for this API service.
262274 */
Original file line number Diff line number Diff line change @@ -56,14 +56,18 @@ class SecurityCenterClient {
5656 * API remote host.
5757 */
5858 constructor ( opts ) {
59+ opts = opts || { } ;
5960 this . _descriptors = { } ;
6061
62+ const servicePath =
63+ opts . servicePath || opts . apiEndpoint || this . constructor . servicePath ;
64+
6165 // Ensure that options include the service address and port.
6266 opts = Object . assign (
6367 {
6468 clientConfig : { } ,
6569 port : this . constructor . port ,
66- servicePath : this . constructor . servicePath ,
70+ servicePath,
6771 } ,
6872 opts
6973 ) ;
@@ -248,6 +252,14 @@ class SecurityCenterClient {
248252 return 'securitycenter.googleapis.com' ;
249253 }
250254
255+ /**
256+ * The DNS address for this API service - same as servicePath(),
257+ * exists for compatibility reasons.
258+ */
259+ static get apiEndpoint ( ) {
260+ return 'securitycenter.googleapis.com' ;
261+ }
262+
251263 /**
252264 * The port for this API service.
253265 */
Original file line number Diff line number Diff line change 11{
2- "updateTime": "2019-05-23T20:32:45.718938Z ",
2+ "updateTime": "2019-06-05T14:25:08.839987Z ",
33 "sources": [
44 {
55 "generator": {
66 "name": "artman",
7- "version": "0.20.0 ",
8- "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec "
7+ "version": "0.23.1 ",
8+ "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0 "
99 }
1010 },
1111 {
1212 "git": {
1313 "name": "googleapis",
1414 "remote": "https://github.com/googleapis/googleapis.git",
15- "sha": "6a2f0244d6a07f2683e4a8cec514425bb27cfa03 ",
16- "internalRef": "249677018 "
15+ "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b ",
16+ "internalRef": "251635729 "
1717 }
1818 },
1919 {
Original file line number Diff line number Diff line change @@ -23,6 +23,29 @@ const error = new Error();
2323error . code = FAKE_STATUS_CODE ;
2424
2525describe ( 'SecurityCenterClient' , ( ) => {
26+ it ( 'has servicePath' , ( ) => {
27+ const servicePath =
28+ securityCenterModule . v1 . SecurityCenterClient . servicePath ;
29+ assert ( servicePath ) ;
30+ } ) ;
31+
32+ it ( 'has apiEndpoint' , ( ) => {
33+ const apiEndpoint =
34+ securityCenterModule . v1 . SecurityCenterClient . apiEndpoint ;
35+ assert ( apiEndpoint ) ;
36+ } ) ;
37+
38+ it ( 'has port' , ( ) => {
39+ const port = securityCenterModule . v1 . SecurityCenterClient . port ;
40+ assert ( port ) ;
41+ assert ( typeof port === 'number' ) ;
42+ } ) ;
43+
44+ it ( 'should create a client with no options' , ( ) => {
45+ const client = new securityCenterModule . v1 . SecurityCenterClient ( ) ;
46+ assert ( client ) ;
47+ } ) ;
48+
2649 describe ( 'createSource' , ( ) => {
2750 it ( 'invokes createSource without error' , done => {
2851 const client = new securityCenterModule . v1 . SecurityCenterClient ( {
Original file line number Diff line number Diff line change @@ -23,6 +23,29 @@ const error = new Error();
2323error . code = FAKE_STATUS_CODE ;
2424
2525describe ( 'SecurityCenterClient' , ( ) => {
26+ it ( 'has servicePath' , ( ) => {
27+ const servicePath =
28+ securityCenterModule . v1beta1 . SecurityCenterClient . servicePath ;
29+ assert ( servicePath ) ;
30+ } ) ;
31+
32+ it ( 'has apiEndpoint' , ( ) => {
33+ const apiEndpoint =
34+ securityCenterModule . v1beta1 . SecurityCenterClient . apiEndpoint ;
35+ assert ( apiEndpoint ) ;
36+ } ) ;
37+
38+ it ( 'has port' , ( ) => {
39+ const port = securityCenterModule . v1beta1 . SecurityCenterClient . port ;
40+ assert ( port ) ;
41+ assert ( typeof port === 'number' ) ;
42+ } ) ;
43+
44+ it ( 'should create a client with no options' , ( ) => {
45+ const client = new securityCenterModule . v1beta1 . SecurityCenterClient ( ) ;
46+ assert ( client ) ;
47+ } ) ;
48+
2649 describe ( 'createSource' , ( ) => {
2750 it ( 'invokes createSource without error' , done => {
2851 const client = new securityCenterModule . v1beta1 . SecurityCenterClient ( {
You can’t perform that action at this time.
0 commit comments