leaseweb-rest-api 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/leaseweb-rest-api.gemspec +1 -1
- data/lib/leaseweb-rest-api.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3367557a3d75e9e48b611e83de1dfd476f8aba1
|
4
|
+
data.tar.gz: 10ac30331b52b00aa9c3219648b5c46972138cf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd89e031b50a353211b5e5b48f6d490b032d8da3937e36059a6b76d017127732afc9e152e0408cf75a867789760ad4a3b072b3c7ed89aa25b9bcfc9e792f82f4
|
7
|
+
data.tar.gz: 8173ee01c443ac43074eb45d1c8d3e7d0797a25d38e33d07ee729b4e4689a3fbab3264b7137e975e2b1d1335804cf90f825b32b3d9949c2747495f4a5c02f070
|
data/leaseweb-rest-api.gemspec
CHANGED
data/lib/leaseweb-rest-api.rb
CHANGED
@@ -18,7 +18,9 @@ class LeasewebAPI
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def getOauthToken(clientId, clientSecret)
|
21
|
-
self.class.post('https://auth.leaseweb.com/token', basic_auth: { username: clientId, password: clientSecret }, body: { grant_type: 'client_credentials' })
|
21
|
+
response = self.class.post('https://auth.leaseweb.com/token', basic_auth: { username: clientId, password: clientSecret }, body: { grant_type: 'client_credentials' })
|
22
|
+
access_token = response.parsed_response['access_token']
|
23
|
+
|
22
24
|
@options = { headers: { 'Authorization' => "Bearer #{access_token}" } }
|
23
25
|
end
|
24
26
|
|
@@ -34,7 +36,7 @@ class LeasewebAPI
|
|
34
36
|
data = []
|
35
37
|
|
36
38
|
loop do
|
37
|
-
response = self.class.get(url
|
39
|
+
response = self.class.get("#{url}&offset=#{offset}&limit=#{limit}", @options)
|
38
40
|
total = response.parsed_response['_metadata']['totalCount']
|
39
41
|
|
40
42
|
data += response.parsed_response[key]
|