Skip to content

Commit

Permalink
Add dataset_version to Person, Company, IP Response (#34)
Browse files Browse the repository at this point in the history
* add dataset version to responses

* update version

* update tests
  • Loading branch information
vvillait88 authored May 20, 2024
1 parent 6e28c75 commit d4405ec
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Change gender to sex in Person Schema
- Add job_last_changed to Person Schema
- Add job_last_verified to Person Schema

## [2.0.1] - 2024-05-13

- Add DatasetVersion to Company Schema
- Add DatasetVersion to IP Schema
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img src="https://img.shields.io/badge/repo%20status-Active-limegreen" alt="Repo Status">
</a>&nbsp;
<a href="https://pkg.go.dev/github.com/peopledatalabs/peopledatalabs-go">
<img src="https://img.shields.io/github/go-mod/go-version/peopledatalabs/peopledatalabs-go" alt="Go 2.0.0" />
<img src="https://img.shields.io/github/go-mod/go-version/peopledatalabs/peopledatalabs-go" alt="Go 2.0.1" />
</a>&nbsp;
<a href="https://github.com/peopledatalabs/peopledatalabs-go/actions/workflows/test.yaml">
<img src="https://github.com/peopledatalabs/peopledatalabs-go/actions/workflows/test.yaml/badge.svg" alt="Tests Status" />
Expand Down
8 changes: 4 additions & 4 deletions api/person_sandbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ func TestPerson_Enrich_Sandbox(t *testing.T) {

// test
params := model.EnrichPersonParams{
PersonParams: model.PersonParams{Email: []string{"fletcherveronica@example.com"}},
PersonParams: model.PersonParams{Email: []string{"reneewillis74@aol.com"}},
AdditionalParams: model.AdditionalParams{MinLikelihood: 6},
}
resp, err := person.Enrich(context.Background(), params)

// assertions
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, resp.Status)
assert.Equal(t, "twitter.com/omarmendez", resp.Data.TwitterUrl)
assert.Equal(t, "twitter.com/rc1994", resp.Data.TwitterUrl)
assert.GreaterOrEqual(t, resp.Likelihood, 6)
}

Expand All @@ -42,7 +42,7 @@ func TestPerson_Identify_Sandbox(t *testing.T) {
// test
params := model.IdentifyPersonParams{
PersonParams: model.PersonParams{
Company: []string{"walmart"},
Company: []string{"adams group"},
},
}
resp, err := person.Identify(context.Background(), params)
Expand All @@ -67,7 +67,7 @@ func TestPerson_Search_Sandbox(t *testing.T) {
params := model.SearchParams{
BaseParams: model.BaseParams{Size: numResults},
SearchBaseParams: model.SearchBaseParams{
SQL: "SELECT * FROM person WHERE location_country='mexico';",
SQL: "SELECT * FROM person WHERE location_country='united states';",
},
}
resp, err := person.Search(context.Background(), params)
Expand Down
26 changes: 14 additions & 12 deletions model/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type IPParams struct {

func (params IPParams) Validate() error {
if params.IP == "" {
return errors.New("ip: 'IP' para must not be empty")
return errors.New("ip: 'IP' parameter must not be empty")
}
return nil
}
Expand All @@ -30,9 +30,10 @@ type IPResponse struct {
}

type IPResult struct {
IP IPInfo `json:"ip"`
Company IPCompany `json:"company"`
Person IPPerson `json:"person"`
IP IPInfo `json:"ip"`
Company IPCompany `json:"company"`
Person IPPerson `json:"person"`
DatasetVersion string `json:"dataset_version"` // Explains the release number.
}

type IPInfo struct {
Expand All @@ -42,14 +43,15 @@ type IPInfo struct {
}

type IPMetadata struct {
Version int `json:"version"`
Mobile bool `json:"mobile"`
Hosting bool `json:"hosting"`
Proxy bool `json:"proxy"`
Tor bool `json:"tor"`
VPN bool `json:"vpn"`
Relay bool `json:"relay"`
Service bool `json:"service"`
Version int `json:"version"`
Mobile bool `json:"mobile"`
Hosting bool `json:"hosting"`
Proxy bool `json:"proxy"`
Tor bool `json:"tor"`
VPN bool `json:"vpn"`
Relay bool `json:"relay"`
Service bool `json:"service"`
ASNDomain string `json:"asn_domain"`
}

type IPLocation struct {
Expand Down
1 change: 1 addition & 0 deletions model/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ type Company struct {
EmployeeCount int `json:"employee_count"` // The current number of employees working at the company based on number of PDL profiles.
LinkedInEmployeeCount int `json:"linkedin_employee_count"` // The current number of employees working at the company based on number of LinkedIn profiles.
Id string `json:"id"` // PDL company ID. This is currently non-persistent and generated from the company's primary linkedin username
DatasetVersion string `json:"dataset_version"` // Explains the current major or minor release number.
Founded int `json:"founded"` // The founded year of the company
Industry string `json:"industry"` // Self reported industry
LinkedInSlug string `json:"linkedin_slug"` // The company's main linkedin slug
Expand Down
2 changes: 1 addition & 1 deletion pld.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/peopledatalabs/peopledatalabs-go/v2/api"
)

const Version = "2.0.0"
const Version = "2.0.1"

type pld struct {
Person api.Person
Expand Down

0 comments on commit d4405ec

Please sign in to comment.