reso_api 0.5.1 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bfeffc2a9629c46003d493b06585b6be940ce6ff282991bc86d89e9858e8da8
4
- data.tar.gz: 430c407fcbf090aa10ebf96c98b0742a01e20be21672cd77de49131b7ab7d016
3
+ metadata.gz: 73aa7cfde3a1c862ae24af151a7e179e56f7765d5f71a54fee103a4ef2963750
4
+ data.tar.gz: 9949c7a9f28e1c2e54a3ae3ad4aed9657ddab43650a28fccf162d5426aa83b71
5
5
  SHA512:
6
- metadata.gz: e4a5fa56805f806d78434f978c31603e4b2150d2c573e2d8b637f9170e8f87506b71670581df16c24f615d0a10404197f8b0477721173f025b17f107769de543
7
- data.tar.gz: 4b9117e4a8c9d7ff0848160afe64d412a5d84849e7f600c2b28e0053c184ba48832624efe64c687a292704bcfa2796396361da359c2486aad8f4d105c088bae5
6
+ metadata.gz: e92d18c780a60e380993082eb42a8cc81b7612800fa0cc87979a32bb5a4f203256c9452cdedef53c88f9e6da6245796e4c6e82b8b967fec570303f3776dc3e6e
7
+ data.tar.gz: 4858d6e61f634d7e03dfcf49ed49080645a3084f5c884e37ea1a1935641a193c6c815713fe2fbdefd33fea15ab01514318ca1adefc5b41a9ace65f067f5b4dd1
@@ -130,7 +130,7 @@ module RESO
130
130
  end
131
131
 
132
132
  def fresh_oauth2_payload
133
- @oauth2_payload = oauth2_client.client_credentials.get_token
133
+ @oauth2_payload = oauth2_client.client_credentials.get_token('client_id' => client_id, 'client_secret' => client_secret)
134
134
  File.write(oauth2_token_path, @oauth2_payload.to_hash.to_json)
135
135
  return @oauth2_payload
136
136
  end
@@ -148,7 +148,7 @@ module RESO
148
148
  persisted = File.read(oauth2_token_path)
149
149
  payload = OAuth2::AccessToken.from_hash(oauth2_client, JSON.parse(persisted))
150
150
  else
151
- payload = oauth2_client.client_credentials.get_token
151
+ payload = oauth2_client.client_credentials.get_token('client_id' => client_id, 'client_secret' => client_secret)
152
152
  File.write(oauth2_token_path, payload.to_hash.to_json)
153
153
  end
154
154
  return payload
@@ -180,6 +180,9 @@ module RESO
180
180
  raise StandardError
181
181
  elsif response.is_a?(Hash) && response.has_key?("error")
182
182
  raise StandardError
183
+ elsif response.is_a?(Hash) && response.has_key?("retry-after")
184
+ sleep response["retry-after"].to_i
185
+ raise StandardError
183
186
  end
184
187
  rescue Net::ReadTimeout, StandardError
185
188
  if (retries += 1) <= 5
@@ -1,3 +1,3 @@
1
1
  module ResoApi
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.4"
3
3
  end
data/license.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Michael Edlund
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reso_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Edlund
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,6 +103,7 @@ files:
103
103
  - lib/reso_api/app/models/reso/api/client.rb
104
104
  - lib/reso_api/config/inflections.rb
105
105
  - lib/reso_api/version.rb
106
+ - license.md
106
107
  - reso_api.gemspec
107
108
  homepage: https://github.com/arcticleo/reso_api
108
109
  licenses: []