-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement V1 enrichment sdk implemented full enrichment sdk functionality.
- Loading branch information
1 parent
00e8028
commit f9f77c7
Showing
6 changed files
with
631 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,61 @@ | ||
package us_enrichment | ||
|
||
// Lookup fields defined here: https://smarty.com/docs/cloud/us-enrichment-api#http-request-input-fields | ||
type Lookup struct { | ||
import ( | ||
"encoding/json" | ||
) | ||
|
||
type enrichmentLookup interface { | ||
GetSmartyKey() string | ||
GetDataSet() string | ||
GetDataSubset() string | ||
|
||
UnmarshalResponse([]byte) error | ||
} | ||
|
||
type financialLookup struct { | ||
SmartyKey string | ||
DataSet string | ||
Response []*FinancialResponse | ||
} | ||
|
||
func (f *financialLookup) GetSmartyKey() string { | ||
return f.SmartyKey | ||
} | ||
|
||
func (f *financialLookup) GetDataSet() string { | ||
return propertyDataSet | ||
} | ||
|
||
Response []*Response | ||
func (f *financialLookup) GetDataSubset() string { | ||
return financialDataSubset | ||
} | ||
|
||
func (f *financialLookup) UnmarshalResponse(bytes []byte) error { | ||
return json.Unmarshal(bytes, &f.Response) | ||
} | ||
|
||
type principalLookup struct { | ||
SmartyKey string | ||
Response []*PrincipalResponse | ||
} | ||
|
||
func (p *principalLookup) GetSmartyKey() string { | ||
return p.SmartyKey | ||
} | ||
|
||
func (p *principalLookup) GetDataSet() string { | ||
return propertyDataSet | ||
} | ||
|
||
func (p *principalLookup) GetDataSubset() string { | ||
return principalDataSubset | ||
} | ||
|
||
func (p *principalLookup) UnmarshalResponse(bytes []byte) error { | ||
return json.Unmarshal(bytes, &p.Response) | ||
} | ||
|
||
const ( | ||
financialDataSubset = "financial" | ||
principalDataSubset = "principal" | ||
propertyDataSet = "property" | ||
) |
Oops, something went wrong.