@@ -3,6 +3,7 @@ package fullcontact
3
3
import (
4
4
"bytes"
5
5
"encoding/json"
6
+ "io"
6
7
"io/ioutil"
7
8
"net/http"
8
9
"time"
@@ -141,8 +142,11 @@ func sendToChannel(ch chan *APIResponse, response *http.Response, url string, er
141
142
return
142
143
}
143
144
144
- /* FullContact V3 Person Enrich API, takes an PersonRequest and returns a channel of type APIResponse.
145
- Request is converted to JSON and sends a Asynchronous request */
145
+ /*
146
+ FullContact V3 Person Enrich API, takes an PersonRequest and returns a channel of type APIResponse.
147
+
148
+ Request is converted to JSON and sends a Asynchronous request
149
+ */
146
150
func (fcClient * fullContactClient ) PersonEnrich (personRequest * PersonRequest ) chan * APIResponse {
147
151
ch := make (chan * APIResponse )
148
152
@@ -166,8 +170,11 @@ func (fcClient *fullContactClient) PersonEnrich(personRequest *PersonRequest) ch
166
170
return ch
167
171
}
168
172
169
- /* FullContact V3 Company Enrich API, takes an CompanyRequest and returns a channel of type APIResponse.
170
- Request is converted to JSON and sends a Asynchronous request */
173
+ /*
174
+ FullContact V3 Company Enrich API, takes an CompanyRequest and returns a channel of type APIResponse.
175
+
176
+ Request is converted to JSON and sends a Asynchronous request
177
+ */
171
178
func (fcClient * fullContactClient ) CompanyEnrich (companyRequest * CompanyRequest ) chan * APIResponse {
172
179
ch := make (chan * APIResponse )
173
180
if companyRequest == nil {
@@ -190,9 +197,12 @@ func (fcClient *fullContactClient) CompanyEnrich(companyRequest *CompanyRequest)
190
197
return ch
191
198
}
192
199
193
- /* Resolve
200
+ /*
201
+ Resolve
202
+
194
203
FullContact Resolve API - IdentityMap, takes an ResolveRequest and returns a channel of type APIResponse.
195
- Request is converted to JSON and sends a Asynchronous request */
204
+ Request is converted to JSON and sends a Asynchronous request
205
+ */
196
206
func (fcClient * fullContactClient ) IdentityMap (resolveRequest * ResolveRequest ) chan * APIResponse {
197
207
ch := make (chan * APIResponse )
198
208
if resolveRequest == nil {
@@ -207,9 +217,12 @@ func (fcClient *fullContactClient) IdentityMap(resolveRequest *ResolveRequest) c
207
217
return fcClient .resolveRequest (ch , resolveRequest , identityMapUrl )
208
218
}
209
219
210
- /* Resolve
220
+ /*
221
+ Resolve
222
+
211
223
FullContact Resolve API - IdentityResolve, takes an ResolveRequest and returns a channel of type APIResponse.
212
- Request is converted to JSON and sends a Asynchronous request */
224
+ Request is converted to JSON and sends a Asynchronous request
225
+ */
213
226
func (fcClient * fullContactClient ) IdentityResolve (resolveRequest * ResolveRequest ) chan * APIResponse {
214
227
ch := make (chan * APIResponse )
215
228
if resolveRequest == nil {
@@ -224,9 +237,12 @@ func (fcClient *fullContactClient) IdentityResolve(resolveRequest *ResolveReques
224
237
return fcClient .resolveRequest (ch , resolveRequest , identityResolveUrl )
225
238
}
226
239
227
- /* Resolve
240
+ /*
241
+ Resolve
242
+
228
243
FullContact Resolve API - IdentityMapResolve, takes an ResolveRequest and returns a channel of type APIResponse.
229
- Request is converted to JSON and sends a Asynchronous request */
244
+ Request is converted to JSON and sends a Asynchronous request
245
+ */
230
246
func (fcClient * fullContactClient ) IdentityMapResolve (resolveRequest * ResolveRequest ) chan * APIResponse {
231
247
ch := make (chan * APIResponse )
232
248
if resolveRequest == nil {
@@ -241,9 +257,12 @@ func (fcClient *fullContactClient) IdentityMapResolve(resolveRequest *ResolveReq
241
257
return fcClient .resolveRequest (ch , resolveRequest , identityMapResolveUrl )
242
258
}
243
259
244
- /* Resolve
260
+ /*
261
+ Resolve
262
+
245
263
FullContact Resolve API - IdentityResolve with Tags in response, takes an ResolveRequest and returns a channel of type APIResponse.
246
- Request is converted to JSON and sends a Asynchronous request */
264
+ Request is converted to JSON and sends a Asynchronous request
265
+ */
247
266
func (fcClient * fullContactClient ) IdentityResolveWithTags (resolveRequest * ResolveRequest ) chan * APIResponse {
248
267
ch := make (chan * APIResponse )
249
268
if resolveRequest == nil {
@@ -258,9 +277,12 @@ func (fcClient *fullContactClient) IdentityResolveWithTags(resolveRequest *Resol
258
277
return fcClient .resolveRequest (ch , resolveRequest , identityResolveWithTagsUrl )
259
278
}
260
279
261
- /* Resolve
280
+ /*
281
+ Resolve
282
+
262
283
FullContact Resolve API - IdentityDelete, takes an ResolveRequest and returns a channel of type APIResponse.
263
- Request is converted to JSON and sends a Asynchronous request */
284
+ Request is converted to JSON and sends a Asynchronous request
285
+ */
264
286
func (fcClient * fullContactClient ) IdentityDelete (resolveRequest * ResolveRequest ) chan * APIResponse {
265
287
ch := make (chan * APIResponse )
266
288
if resolveRequest == nil {
@@ -286,8 +308,11 @@ func (fcClient *fullContactClient) resolveRequest(ch chan *APIResponse, resolveR
286
308
return ch
287
309
}
288
310
289
- /* FullContact API for adding/creating tags for any recordId in your PIC, takes a TagsRequest and returns a channel of type APIResponse.
290
- Request is converted to JSON and sends a Asynchronous request */
311
+ /*
312
+ FullContact API for adding/creating tags for any recordId in your PIC, takes a TagsRequest and returns a channel of type APIResponse.
313
+
314
+ Request is converted to JSON and sends a Asynchronous request
315
+ */
291
316
func (fcClient * fullContactClient ) TagsCreate (tagsRequest * TagsRequest ) chan * APIResponse {
292
317
ch := make (chan * APIResponse )
293
318
if tagsRequest == nil {
@@ -305,8 +330,11 @@ func (fcClient *fullContactClient) TagsCreate(tagsRequest *TagsRequest) chan *AP
305
330
return ch
306
331
}
307
332
308
- /* FullContact API for getting all tags for any recordId in your PIC, takes a 'recordId' and returns a channel of type APIResponse.
309
- Request is converted to JSON and sends a Asynchronous request */
333
+ /*
334
+ FullContact API for getting all tags for any recordId in your PIC, takes a 'recordId' and returns a channel of type APIResponse.
335
+
336
+ Request is converted to JSON and sends a Asynchronous request
337
+ */
310
338
func (fcClient * fullContactClient ) TagsGet (recordId string ) chan * APIResponse {
311
339
ch := make (chan * APIResponse )
312
340
if ! isPopulated (recordId ) {
@@ -320,8 +348,11 @@ func (fcClient *fullContactClient) TagsGet(recordId string) chan *APIResponse {
320
348
return ch
321
349
}
322
350
323
- /* FullContact API for deleting any tag(s) for any recordId in your PIC, takes a TagsRequest and returns a channel of type APIResponse.
324
- Request is converted to JSON and sends a Asynchronous request */
351
+ /*
352
+ FullContact API for deleting any tag(s) for any recordId in your PIC, takes a TagsRequest and returns a channel of type APIResponse.
353
+
354
+ Request is converted to JSON and sends a Asynchronous request
355
+ */
325
356
func (fcClient * fullContactClient ) TagsDelete (tagsRequest * TagsRequest ) chan * APIResponse {
326
357
ch := make (chan * APIResponse )
327
358
if tagsRequest == nil {
@@ -339,8 +370,11 @@ func (fcClient *fullContactClient) TagsDelete(tagsRequest *TagsRequest) chan *AP
339
370
return ch
340
371
}
341
372
342
- /* FullContact API for creating Audience based on tags from your PIC, takes a AudienceRequest and returns a channel of type APIResponse.
343
- Request is converted to JSON and sends a Asynchronous request */
373
+ /*
374
+ FullContact API for creating Audience based on tags from your PIC, takes a AudienceRequest and returns a channel of type APIResponse.
375
+
376
+ Request is converted to JSON and sends a Asynchronous request
377
+ */
344
378
func (fcClient * fullContactClient ) AudienceCreate (audienceRequest * AudienceRequest ) chan * APIResponse {
345
379
ch := make (chan * APIResponse )
346
380
if audienceRequest == nil {
@@ -358,8 +392,11 @@ func (fcClient *fullContactClient) AudienceCreate(audienceRequest *AudienceReque
358
392
return ch
359
393
}
360
394
361
- /* FullContact API for downloading Audience created using 'AudienceCreate', takes a requestId and returns a channel of type APIResponse.
362
- Request is converted to JSON and sends a Asynchronous request */
395
+ /*
396
+ FullContact API for downloading Audience created using 'AudienceCreate', takes a requestId and returns a channel of type APIResponse.
397
+
398
+ Request is converted to JSON and sends a Asynchronous request
399
+ */
363
400
func (fcClient * fullContactClient ) AudienceDownload (requestId string ) chan * APIResponse {
364
401
ch := make (chan * APIResponse )
365
402
if ! isPopulated (requestId ) {
@@ -373,9 +410,12 @@ func (fcClient *fullContactClient) AudienceDownload(requestId string) chan *APIR
373
410
return ch
374
411
}
375
412
376
- /* Permission
413
+ /*
414
+ Permission
415
+
377
416
FullContact Permission API - PermissionCreate, takes an PermissionRequest and returns a channel of type APIResponse.
378
- Request is converted to JSON and sends a Asynchronous request */
417
+ Request is converted to JSON and sends a Asynchronous request
418
+ */
379
419
func (fcClient * fullContactClient ) PermissionCreate (permissionRequest * PermissionRequest ) chan * APIResponse {
380
420
ch := make (chan * APIResponse )
381
421
if permissionRequest == nil {
@@ -398,26 +438,38 @@ func (fcClient *fullContactClient) PermissionCreate(permissionRequest *Permissio
398
438
return ch
399
439
}
400
440
401
- /* FullContact Permission API - PermissionDelete, takes an PermissionRequest and returns a channel of type APIResponse.
402
- Request is converted to JSON and sends a Asynchronous request */
441
+ /*
442
+ FullContact Permission API - PermissionDelete, takes an PermissionRequest and returns a channel of type APIResponse.
443
+
444
+ Request is converted to JSON and sends a Asynchronous request
445
+ */
403
446
func (fcClient * fullContactClient ) PermissionDelete (multifieldRequest * MultifieldRequest ) chan * APIResponse {
404
447
return fcClient .validateAndSendMultiFieldRequestAsync (permissionDeleteUrl , multifieldRequest )
405
448
}
406
449
407
- /* FullContact Permission API - PermissionFind, takes an PermissionRequest and returns a channel of type APIResponse.
408
- Request is converted to JSON and sends a Asynchronous request */
450
+ /*
451
+ FullContact Permission API - PermissionFind, takes an PermissionRequest and returns a channel of type APIResponse.
452
+
453
+ Request is converted to JSON and sends a Asynchronous request
454
+ */
409
455
func (fcClient * fullContactClient ) PermissionFind (multifieldRequest * MultifieldRequest ) chan * APIResponse {
410
456
return fcClient .validateAndSendMultiFieldRequestAsync (permissionFindUrl , multifieldRequest )
411
457
}
412
458
413
- /* FullContact Permission API - PermissionCurrent, takes an PermissionRequest and returns a channel of type APIResponse.
414
- Request is converted to JSON and sends a Asynchronous request */
459
+ /*
460
+ FullContact Permission API - PermissionCurrent, takes an PermissionRequest and returns a channel of type APIResponse.
461
+
462
+ Request is converted to JSON and sends a Asynchronous request
463
+ */
415
464
func (fcClient * fullContactClient ) PermissionCurrent (multifieldRequest * MultifieldRequest ) chan * APIResponse {
416
465
return fcClient .validateAndSendMultiFieldRequestAsync (permissionCurrentUrl , multifieldRequest )
417
466
}
418
467
419
- /* FullContact Permission API - PermissionVerify, takes an PermissionRequest and returns a channel of type APIResponse.
420
- Request is converted to JSON and sends a Asynchronous request */
468
+ /*
469
+ FullContact Permission API - PermissionVerify, takes an PermissionRequest and returns a channel of type APIResponse.
470
+
471
+ Request is converted to JSON and sends a Asynchronous request
472
+ */
421
473
func (fcClient * fullContactClient ) PermissionVerify (permissionRequest * PermissionRequest ) chan * APIResponse {
422
474
ch := make (chan * APIResponse )
423
475
if permissionRequest == nil {
@@ -471,11 +523,11 @@ func (fcClient *fullContactClient) VerifyActivity(multifieldRequest *MultifieldR
471
523
}
472
524
473
525
/*
474
- This function will perform the `MultifieldRequest` validations and if
475
- there are no errors then it'll be marshalled and a `MultifieldRequest` will be
476
- made to the specified `url`
526
+ This function will perform the `MultifieldRequest` validations and if
527
+ there are no errors then it'll be marshalled and a `MultifieldRequest` will be
528
+ made to the specified `url`
477
529
478
- Returns a channel frm which the request response can be obtained
530
+ Returns a channel frm which the request response can be obtained
479
531
*/
480
532
func (fcClient * fullContactClient ) validateAndSendMultiFieldRequestAsync (url string , multifieldRequest * MultifieldRequest ) chan * APIResponse {
481
533
ch := make (chan * APIResponse )
@@ -531,7 +583,7 @@ func setCompanyResponse(apiResponse *APIResponse) {
531
583
532
584
// Reset the buffer so that it can be re-read by the caller.
533
585
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
534
-
586
+
535
587
if err != nil {
536
588
apiResponse .Err = err
537
589
return
@@ -556,7 +608,7 @@ func setResolveResponse(apiResponse *APIResponse) {
556
608
557
609
// Reset the buffer so that it can be re-read by the caller.
558
610
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
559
-
611
+
560
612
if err != nil {
561
613
apiResponse .Err = err
562
614
return
@@ -581,7 +633,7 @@ func setResolveResponseWithTags(apiResponse *APIResponse) {
581
633
582
634
// Reset the buffer so that it can be re-read by the caller.
583
635
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
584
-
636
+
585
637
if err != nil {
586
638
apiResponse .Err = err
587
639
return
@@ -606,7 +658,7 @@ func setTagsResponse(apiResponse *APIResponse) {
606
658
607
659
// Reset the buffer so that it can be re-read by the caller.
608
660
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
609
-
661
+
610
662
if err != nil {
611
663
apiResponse .Err = err
612
664
return
@@ -632,7 +684,7 @@ func setAudienceResponse(apiResponse *APIResponse) {
632
684
633
685
// Reset the buffer so that it can be re-read by the caller.
634
686
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
635
-
687
+
636
688
if err != nil {
637
689
apiResponse .Err = err
638
690
return
@@ -656,12 +708,12 @@ func setAudienceResponse(apiResponse *APIResponse) {
656
708
}
657
709
658
710
func setPermissionCreateResponse (apiResponse * APIResponse ) {
659
- _ , err := ioutil .ReadAll (apiResponse .RawHttpResponse .Body )
711
+ bodyBytes , err := ioutil .ReadAll (apiResponse .RawHttpResponse .Body )
660
712
defer apiResponse .RawHttpResponse .Body .Close ()
661
713
662
714
// Reset the buffer so that it can be re-read by the caller.
663
715
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
664
-
716
+
665
717
if err != nil {
666
718
apiResponse .Err = err
667
719
return
@@ -672,12 +724,12 @@ func setPermissionCreateResponse(apiResponse *APIResponse) {
672
724
}
673
725
674
726
func setPermissionDeleteResponse (apiResponse * APIResponse ) {
675
- _ , err := ioutil .ReadAll (apiResponse .RawHttpResponse .Body )
727
+ bodyBytes , err := ioutil .ReadAll (apiResponse .RawHttpResponse .Body )
676
728
defer apiResponse .RawHttpResponse .Body .Close ()
677
729
678
730
// Reset the buffer so that it can be re-read by the caller.
679
731
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
680
-
732
+
681
733
if err != nil {
682
734
apiResponse .Err = err
683
735
return
@@ -693,7 +745,7 @@ func setPermissionFindResponse(apiResponse *APIResponse) {
693
745
694
746
// Reset the buffer so that it can be re-read by the caller.
695
747
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
696
-
748
+
697
749
if err != nil {
698
750
apiResponse .Err = err
699
751
return
@@ -718,7 +770,7 @@ func setPermissionVerifyResponse(apiResponse *APIResponse) {
718
770
719
771
// Reset the buffer so that it can be re-read by the caller.
720
772
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
721
-
773
+
722
774
if err != nil {
723
775
apiResponse .Err = err
724
776
return
@@ -743,7 +795,7 @@ func setPermissionCurrentResponse(apiResponse *APIResponse) {
743
795
744
796
// Reset the buffer so that it can be re-read by the caller.
745
797
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
746
-
798
+
747
799
if err != nil {
748
800
apiResponse .Err = err
749
801
return
@@ -768,7 +820,7 @@ func setVerfiySignalsResponse(apiResponse *APIResponse) {
768
820
769
821
// Reset the buffer so that it can be re-read by the caller.
770
822
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
771
-
823
+
772
824
if err != nil {
773
825
apiResponse .Err = err
774
826
return
@@ -793,7 +845,7 @@ func setVerfiyMatchResponse(apiResponse *APIResponse) {
793
845
794
846
// Reset the buffer so that it can be re-read by the caller.
795
847
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
796
-
848
+
797
849
if err != nil {
798
850
apiResponse .Err = err
799
851
return
@@ -818,7 +870,7 @@ func setVerfiyActivityResponse(apiResponse *APIResponse) {
818
870
819
871
// Reset the buffer so that it can be re-read by the caller.
820
872
apiResponse .RawHttpResponse .Body = io .NopCloser (bytes .NewBuffer (bodyBytes ))
821
-
873
+
822
874
if err != nil {
823
875
apiResponse .Err = err
824
876
return
0 commit comments