From c4570eadc047ed9752c42d60b062e6b2ec46d294 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 May 2023 21:15:35 -0700 Subject: [PATCH] Send `infer: false` in the request when sending a PersonRequest using WithInfer(false). --- fc/person_request.go | 4 ++-- fc/person_request_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fc/person_request.go b/fc/person_request.go index d60fef6..4574aa9 100644 --- a/fc/person_request.go +++ b/fc/person_request.go @@ -16,7 +16,7 @@ type PersonRequest struct { PartnerId string `json:"partnerId,omitempty"` LiNonId string `json:"li_nonid,omitempty"` Confidence string `json:"confidence,omitempty"` - Infer bool `json:"infer,omitempty"` + Infer *bool `json:"infer,omitempty"` Placekey string `json:"placekey,omitempty"` MaxMaids int `json:"maxMaids,omitempty"` PanoramaId string `json:"panoramaId,omitempty"` @@ -216,7 +216,7 @@ func WithConfidence(confidence string) PersonRequestOption { func WithInfer(infer bool) PersonRequestOption { return func(pr *PersonRequest) { - pr.Infer = infer + pr.Infer = &infer } } diff --git a/fc/person_request_test.go b/fc/person_request_test.go index 5ed0daa..77f1b0d 100644 --- a/fc/person_request_test.go +++ b/fc/person_request_test.go @@ -13,7 +13,7 @@ func TestMarshallNewPersonRequest(t *testing.T) { assert.NoError(t, err) profile2, err := NewProfile(WithUrl("https://twitter.com/mcreedytest")) assert.NoError(t, err) - requestJson := "{\"emails\":[\"marianrd97@outlook.com\",\"test1@gmail.com\",\"test2@outlook.com\"],\"phones\":[\"123-4567890\"],\"dataFilter\":[\"individual\",\"social\"],\"maids\":[\"abcd-123-abcd-1234-abcdlkjhasdfgh\",\"1234-snbk-lkldiemvmruixp-2kdp-vdm\"],\"location\":{\"addressLine1\":\"123/23\",\"addressLine2\":\"Some Street\",\"city\":\"Denver\",\"region\":\"Denver\",\"regionCode\":\"123123\",\"postalCode\":\"23124\"},\"name\":{\"given\":\"Marian\",\"family\":\"Reed\",\"full\":\"Marian C Reed\"},\"profiles\":[{\"url\":\"https://twitter.com/mcreedy\"},{\"url\":\"https://twitter.com/mcreedytest\"}],\"webhookUrl\":\"http://www.fullcontact.com/hook\",\"recordId\":\"customer123\",\"personId\":\"VS1OPPPPvxHcCNPezUbvYBCDEAOdSj5AI0adsA2bLmh12345\",\"confidence\":\"HIGH\",\"maxMaids\":5,\"panoramaId\":\"panoramaId\"}" + requestJson := "{\"emails\":[\"marianrd97@outlook.com\",\"test1@gmail.com\",\"test2@outlook.com\"],\"phones\":[\"123-4567890\"],\"dataFilter\":[\"individual\",\"social\"],\"maids\":[\"abcd-123-abcd-1234-abcdlkjhasdfgh\",\"1234-snbk-lkldiemvmruixp-2kdp-vdm\"],\"location\":{\"addressLine1\":\"123/23\",\"addressLine2\":\"Some Street\",\"city\":\"Denver\",\"region\":\"Denver\",\"regionCode\":\"123123\",\"postalCode\":\"23124\"},\"name\":{\"given\":\"Marian\",\"family\":\"Reed\",\"full\":\"Marian C Reed\"},\"profiles\":[{\"url\":\"https://twitter.com/mcreedy\"},{\"url\":\"https://twitter.com/mcreedytest\"}],\"webhookUrl\":\"http://www.fullcontact.com/hook\",\"recordId\":\"customer123\",\"personId\":\"VS1OPPPPvxHcCNPezUbvYBCDEAOdSj5AI0adsA2bLmh12345\",\"confidence\":\"HIGH\",\"infer\":false,\"maxMaids\":5,\"panoramaId\":\"panoramaId\"}" pr, err := NewPersonRequest( WithName(NewPersonName(WithFull("Marian C Reed"), WithFamily("Reed"), WithGiven("Marian"))), WithEmail("marianrd97@outlook.com"),