@@ -26,10 +26,9 @@ import * as phishingprotectionservicev1beta1Module from '../src';
2626import { protobuf } from 'google-gax' ;
2727
2828function generateSampleMessage < T extends object > ( instance : T ) {
29- const filledObject = ( instance . constructor as typeof protobuf . Message ) . toObject (
30- instance as protobuf . Message < T > ,
31- { defaults : true }
32- ) ;
29+ const filledObject = (
30+ instance . constructor as typeof protobuf . Message
31+ ) . toObject ( instance as protobuf . Message < T > , { defaults : true } ) ;
3332 return ( instance . constructor as typeof protobuf . Message ) . fromObject (
3433 filledObject
3534 ) as T ;
@@ -74,49 +73,54 @@ describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => {
7473 } ) ;
7574
7675 it ( 'should create a client with no option' , ( ) => {
77- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client ( ) ;
76+ const client =
77+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client ( ) ;
7878 assert ( client ) ;
7979 } ) ;
8080
8181 it ( 'should create a client with gRPC fallback' , ( ) => {
82- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
83- {
84- fallback : true ,
85- }
86- ) ;
82+ const client =
83+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
84+ {
85+ fallback : true ,
86+ }
87+ ) ;
8788 assert ( client ) ;
8889 } ) ;
8990
9091 it ( 'has initialize method and supports deferred initialization' , async ( ) => {
91- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
92- {
93- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
94- projectId : 'bogus' ,
95- }
96- ) ;
92+ const client =
93+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
94+ {
95+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
96+ projectId : 'bogus' ,
97+ }
98+ ) ;
9799 assert . strictEqual ( client . phishingProtectionServiceV1Beta1Stub , undefined ) ;
98100 await client . initialize ( ) ;
99101 assert ( client . phishingProtectionServiceV1Beta1Stub ) ;
100102 } ) ;
101103
102104 it ( 'has close method' , ( ) => {
103- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
104- {
105- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
106- projectId : 'bogus' ,
107- }
108- ) ;
105+ const client =
106+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
107+ {
108+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
109+ projectId : 'bogus' ,
110+ }
111+ ) ;
109112 client . close ( ) ;
110113 } ) ;
111114
112115 it ( 'has getProjectId method' , async ( ) => {
113116 const fakeProjectId = 'fake-project-id' ;
114- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
115- {
116- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
117- projectId : 'bogus' ,
118- }
119- ) ;
117+ const client =
118+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
119+ {
120+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
121+ projectId : 'bogus' ,
122+ }
123+ ) ;
120124 client . auth . getProjectId = sinon . stub ( ) . resolves ( fakeProjectId ) ;
121125 const result = await client . getProjectId ( ) ;
122126 assert . strictEqual ( result , fakeProjectId ) ;
@@ -125,12 +129,13 @@ describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => {
125129
126130 it ( 'has getProjectId method with callback' , async ( ) => {
127131 const fakeProjectId = 'fake-project-id' ;
128- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
129- {
130- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
131- projectId : 'bogus' ,
132- }
133- ) ;
132+ const client =
133+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
134+ {
135+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
136+ projectId : 'bogus' ,
137+ }
138+ ) ;
134139 client . auth . getProjectId = sinon
135140 . stub ( )
136141 . callsArgWith ( 0 , null , fakeProjectId ) ;
@@ -149,12 +154,13 @@ describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => {
149154
150155 describe ( 'reportPhishing' , ( ) => {
151156 it ( 'invokes reportPhishing without error' , async ( ) => {
152- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
153- {
154- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
155- projectId : 'bogus' ,
156- }
157- ) ;
157+ const client =
158+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
159+ {
160+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
161+ projectId : 'bogus' ,
162+ }
163+ ) ;
158164 client . initialize ( ) ;
159165 const request = generateSampleMessage (
160166 new protos . google . cloud . phishingprotection . v1beta1 . ReportPhishingRequest ( )
@@ -182,12 +188,13 @@ describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => {
182188 } ) ;
183189
184190 it ( 'invokes reportPhishing without error using callback' , async ( ) => {
185- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
186- {
187- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
188- projectId : 'bogus' ,
189- }
190- ) ;
191+ const client =
192+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
193+ {
194+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
195+ projectId : 'bogus' ,
196+ }
197+ ) ;
191198 client . initialize ( ) ;
192199 const request = generateSampleMessage (
193200 new protos . google . cloud . phishingprotection . v1beta1 . ReportPhishingRequest ( )
@@ -204,9 +211,8 @@ describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => {
204211 const expectedResponse = generateSampleMessage (
205212 new protos . google . cloud . phishingprotection . v1beta1 . ReportPhishingResponse ( )
206213 ) ;
207- client . innerApiCalls . reportPhishing = stubSimpleCallWithCallback (
208- expectedResponse
209- ) ;
214+ client . innerApiCalls . reportPhishing =
215+ stubSimpleCallWithCallback ( expectedResponse ) ;
210216 const promise = new Promise ( ( resolve , reject ) => {
211217 client . reportPhishing (
212218 request ,
@@ -232,12 +238,13 @@ describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => {
232238 } ) ;
233239
234240 it ( 'invokes reportPhishing with error' , async ( ) => {
235- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
236- {
237- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
238- projectId : 'bogus' ,
239- }
240- ) ;
241+ const client =
242+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
243+ {
244+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
245+ projectId : 'bogus' ,
246+ }
247+ ) ;
241248 client . initialize ( ) ;
242249 const request = generateSampleMessage (
243250 new protos . google . cloud . phishingprotection . v1beta1 . ReportPhishingRequest ( )
@@ -271,12 +278,13 @@ describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => {
271278 const expectedParameters = {
272279 project : 'projectValue' ,
273280 } ;
274- const client = new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
275- {
276- credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
277- projectId : 'bogus' ,
278- }
279- ) ;
281+ const client =
282+ new phishingprotectionservicev1beta1Module . v1beta1 . PhishingProtectionServiceV1Beta1Client (
283+ {
284+ credentials : { client_email : 'bogus' , private_key : 'bogus' } ,
285+ projectId : 'bogus' ,
286+ }
287+ ) ;
280288 client . initialize ( ) ;
281289 client . pathTemplates . projectPathTemplate . render = sinon
282290 . stub ( )
0 commit comments