peopledatalabs 1.0.1 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peopledatalabs/api_resource.rb +28 -14
- data/lib/peopledatalabs/resources/autocomplete.rb +5 -2
- data/lib/peopledatalabs/resources/bulk.rb +5 -3
- data/lib/peopledatalabs/resources/cleaner.rb +15 -9
- data/lib/peopledatalabs/resources/enrichment.rb +10 -6
- data/lib/peopledatalabs/resources/identify.rb +5 -3
- data/lib/peopledatalabs/resources/retrieve.rb +5 -3
- data/lib/peopledatalabs/resources/search.rb +5 -3
- data/lib/peopledatalabs/version.rb +1 -1
- data/lib/peopledatalabs.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e90cb306466c21bc1a3ea7f1b20aa847caa6d35407b5994b9b116693a9ac8c6
|
4
|
+
data.tar.gz: 2a8d78cd61c7273c56382ca000f56f26ebc7f33701625c58f2236feade30fe3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6bf87839450649eb8a335c66a5da21bf7014fb6355a47f578a09faf5d9c98d04d029fda1191c999a50eed808c7b99523414b75b3ad3e6a6e7baba6b244b1bc2
|
7
|
+
data.tar.gz: 3d3882243f63423c55ab43ee2c240c836777dbf450e0c9cdd07c9be12e5a04246d9504565259a7e093bf8f7689282501432a98c4b9b888ba5d5c6dd47c1bb386
|
@@ -10,9 +10,10 @@ module Peopledatalabs
|
|
10
10
|
return request unless request['status'] == 200
|
11
11
|
|
12
12
|
response = HTTP
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
.use(:auto_inflate)
|
14
|
+
.timeout(Peopledatalabs.read_timeout)
|
15
|
+
.headers(headers)
|
16
|
+
.get(url(path), params: query_authentication(params))
|
16
17
|
handle_response(response)
|
17
18
|
end
|
18
19
|
|
@@ -21,9 +22,10 @@ module Peopledatalabs
|
|
21
22
|
return request unless request['status'] == 200
|
22
23
|
|
23
24
|
response = HTTP
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
.use(:auto_inflate)
|
26
|
+
.timeout(Peopledatalabs.read_timeout)
|
27
|
+
.headers(header_authentication(headers))
|
28
|
+
.post(url(path), json: body)
|
27
29
|
handle_response(response)
|
28
30
|
end
|
29
31
|
|
@@ -97,15 +99,27 @@ module Peopledatalabs
|
|
97
99
|
# 'data' => response.parse
|
98
100
|
# }
|
99
101
|
|
102
|
+
rate_limit_remaining = response.headers['X-RateLimit-Remaining'] ? JSON.parse(response.headers['X-RateLimit-Remaining'].gsub("'",'"')) : {}
|
103
|
+
rate_limit_limit = response.headers['X-RateLimit-Limit'] ? JSON.parse(response.headers['X-RateLimit-Limit'].gsub("'",'"')) : {}
|
104
|
+
|
100
105
|
rate_limit = {
|
101
|
-
'
|
102
|
-
'
|
103
|
-
'
|
104
|
-
'
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
106
|
+
'call_credits_spent' => to_number(response.headers['X-Call-Credits-Spent']),
|
107
|
+
'call_credits_type' => response.headers['X-Call-Credits-Type'],
|
108
|
+
'rate_limit_reset' => response.headers['X-RateLimit-Reset'],
|
109
|
+
'rate_limit_remaining' => {
|
110
|
+
'minute' => to_number(rate_limit_remaining['minute']),
|
111
|
+
'day' => to_number(rate_limit_remaining['day']),
|
112
|
+
'month' => to_number(rate_limit_remaining['month'])
|
113
|
+
},
|
114
|
+
'rate_limit_limit' => {
|
115
|
+
'minute' => to_number(rate_limit_limit['minute']),
|
116
|
+
'day' => to_number(rate_limit_limit['day']),
|
117
|
+
'month' => to_number(rate_limit_limit['month'])
|
118
|
+
},
|
119
|
+
'lifetime_used' => to_number(response.headers['X-Lifetime-Used']),
|
120
|
+
'total_limit_remaining' => to_number(response.headers['X-TotalLimit-Remaining']),
|
121
|
+
'total_limit_purchased_remaining' => to_number(response.headers['X-TotalLimit-Purchased-Remaining']),
|
122
|
+
'total_limit_overages_remaining' => to_number(response.headers['X-TotalLimit-Overages-Remaining'])
|
109
123
|
}
|
110
124
|
|
111
125
|
parsed_response = response.parse
|
@@ -11,8 +11,11 @@ module Peopledatalabs
|
|
11
11
|
'pretty' => pretty,
|
12
12
|
};
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
headers = {
|
15
|
+
'Accept-Encoding' => 'gzip',
|
16
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
17
|
+
}
|
18
|
+
get(path: '/v5/autocomplete', headers: headers, params: params)
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
@@ -3,9 +3,11 @@
|
|
3
3
|
module Peopledatalabs
|
4
4
|
class Bulk < APIResource
|
5
5
|
def self.people(params:)
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
headers = {
|
7
|
+
'Accept-Encoding' => 'gzip',
|
8
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
9
|
+
}
|
10
|
+
post(path: '/v5/person/bulk', headers: headers, body: params)
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
@@ -3,21 +3,27 @@
|
|
3
3
|
module Peopledatalabs
|
4
4
|
class Cleaner < APIResource
|
5
5
|
def self.company(kind:, value:)
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
headers = {
|
7
|
+
'Accept-Encoding' => 'gzip',
|
8
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
9
|
+
}
|
10
|
+
get(path: '/v5/company/clean', headers: headers, params: { kind => value })
|
9
11
|
end
|
10
12
|
|
11
13
|
def self.school(kind:, value:)
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
headers = {
|
15
|
+
'Accept-Encoding' => 'gzip',
|
16
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
17
|
+
}
|
18
|
+
get(path: '/v5/school/clean', headers: headers, params: { kind => value })
|
15
19
|
end
|
16
20
|
|
17
21
|
def self.location(value:)
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
headers = {
|
23
|
+
'Accept-Encoding' => 'gzip',
|
24
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
25
|
+
}
|
26
|
+
get(path: '/v5/location/clean', headers: headers, params: { 'location' => value })
|
21
27
|
end
|
22
28
|
|
23
29
|
|
@@ -3,15 +3,19 @@
|
|
3
3
|
module Peopledatalabs
|
4
4
|
class Enrichment < APIResource
|
5
5
|
def self.person(params:)
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
headers = {
|
7
|
+
'Accept-Encoding' => 'gzip',
|
8
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
9
|
+
}
|
10
|
+
get(path: '/v5/person/enrich', headers: headers, params: params)
|
9
11
|
end
|
10
12
|
|
11
13
|
def self.company(params:)
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
headers = {
|
15
|
+
'Accept-Encoding' => 'gzip',
|
16
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
17
|
+
}
|
18
|
+
get(path: '/v5/company/enrich', headers: headers, params: params)
|
15
19
|
end
|
16
20
|
|
17
21
|
end
|
@@ -3,9 +3,11 @@
|
|
3
3
|
module Peopledatalabs
|
4
4
|
class Identify < APIResource
|
5
5
|
def self.person(params:)
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
headers = {
|
7
|
+
'Accept-Encoding' => 'gzip',
|
8
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
9
|
+
}
|
10
|
+
get(path: '/v5/person/identify', headers: headers, params: params)
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
@@ -3,9 +3,11 @@
|
|
3
3
|
module Peopledatalabs
|
4
4
|
class Retrieve < APIResource
|
5
5
|
def self.person(person_id:, pretty: false)
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
headers = {
|
7
|
+
'Accept-Encoding' => 'gzip',
|
8
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
9
|
+
}
|
10
|
+
get(path: "/v5/person/retrieve/#{person_id}", headers: headers, params: { 'pretty' => pretty })
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
@@ -33,9 +33,11 @@ module Peopledatalabs
|
|
33
33
|
'scroll_token' => scroll_token
|
34
34
|
}
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
headers = {
|
37
|
+
'Accept-Encoding' => 'gzip',
|
38
|
+
'User-Agent' => 'PDL-RUBY-SDK',
|
39
|
+
}
|
40
|
+
post(path: "/v5/#{kind}/search", headers: headers, body: body)
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
data/lib/peopledatalabs.rb
CHANGED
@@ -13,9 +13,10 @@ require 'peopledatalabs/resources/bulk'
|
|
13
13
|
|
14
14
|
|
15
15
|
# gem build peopledatalabs.gemspec
|
16
|
-
# gem install ./peopledatalabs-1.0.
|
16
|
+
# gem install ./peopledatalabs-1.0.4.gem
|
17
17
|
# irb
|
18
18
|
# require 'peopledatalabs'
|
19
|
+
# rake spec PDL_API_KEY=API_KEY
|
19
20
|
|
20
21
|
# Usage
|
21
22
|
# First set api key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peopledatalabs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- People Data Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|