Skip to content

Commit

Permalink
Merge branch 'master' into geo-reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Amundson committed Mar 1, 2024
2 parents 4b44f29 + a3cc7aa commit 0c45e1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
4 changes: 2 additions & 2 deletions examples/us-enrichment-api/universal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func main() {

lookup := us_enrichment.Lookup{
SmartyKey: smartyKey,
//Include: "group_structural,sale_date", // optional: only include these attributes in the returned data
Include: "group_structural,sale_date", // optional: only include these attributes in the returned data
Exclude: "", // optional: exclude attributes from the returned data
ETag: "", // optional: check if the record has been updated
}

// Universal lookup works with all datasets and optional subsets.
// Returns JSON bytes
// Note: The DataSubset field can be an empty string for datasets that have no subsets.
err, results := client.SendUniversalLookup(&lookup, "property", "financial")
err, results := client.SendUniversalLookup(&lookup, "property", "principal")

if err != nil {
// If ETag was supplied in the lookup, this status will be returned if the ETag value for the record is current
Expand Down
9 changes: 0 additions & 9 deletions internal/sdk/http_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package sdk

import (
"io"
"maps"
"net/http"

"github.com/smartystreets/smartystreets-go-sdk"
Expand Down Expand Up @@ -54,11 +53,3 @@ func interpret(response *http.Response, content []byte) ([]byte, error) {
}
return nil, sdk.NewHTTPStatusError(response.StatusCode, content)
}

func interpretAndReturnHeaders(response *http.Response, content []byte, headers http.Header) ([]byte, http.Header, error) {
if response.StatusCode == http.StatusOK {
maps.Copy(headers, response.Header)
return content, headers, nil
}
return nil, nil, sdk.NewHTTPStatusError(response.StatusCode, content)
}
4 changes: 2 additions & 2 deletions us-enrichment-api/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (f *ClientFixture) TestDeserializationErrorPreventsDeserialization() {
}

func (f *ClientFixture) TestGenericLookupUnmarshallingWithEtag() {
lookup := genericLookup{
lookup := universalLookup{
Response: []byte(validFinancialResponse),
}
httpHeaders := http.Header{"Etag": []string{"ABCDEFG"}}
Expand All @@ -105,7 +105,7 @@ func (f *ClientFixture) TestGenericLookupUnmarshallingWithEtag() {
}

func (f *ClientFixture) TestGenericLookupUnmarshallingWithNoEtag() {
lookup := genericLookup{
lookup := universalLookup{
Response: []byte(validPrincipalResponse),
}

Expand Down

0 comments on commit 0c45e1b

Please sign in to comment.