seatsio 32.5.0 → 32.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +10 -1
- data/lib/seatsio/chart_reports.rb +2 -2
- data/lib/seatsio/charts.rb +2 -2
- data/lib/seatsio/event_reports.rb +2 -2
- data/lib/seatsio/events.rb +2 -2
- data/lib/seatsio/hold_tokens.rb +2 -2
- data/lib/seatsio/httpClient.rb +3 -2
- data/lib/seatsio/subaccounts.rb +2 -2
- data/lib/seatsio/usage_reports.rb +2 -2
- data/lib/seatsio/version.rb +1 -1
- data/lib/seatsio/workspaces.rb +2 -2
- data/lib/seatsio.rb +12 -9
- 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: c59ef6860b18c605ab3c844cac4f320215a981421129ca2eb7d537acaea1f738
|
4
|
+
data.tar.gz: 25cd36b90507702986d11172e2f0345686e2bf14a372f3af42323b50b37196a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dee64ba2af519b0b0ae00cbbb68a936d280aa2aafc130c3c7d4ca9dbdcefb302971ac577d15b43b1b3e1a89620501825d02e877f298a2763cbdbdc9b08dbfed
|
7
|
+
data.tar.gz: 6788d6eea52021eb3d04b97533f9594270af300cee70fe80a6e822407d940a3fccd1f821a151ac78f2218d1db22618fa86c48ac5dd05fb9909917e96c3070217
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seatsio (32.
|
4
|
+
seatsio (32.6.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -32,8 +32,8 @@ GEM
|
|
32
32
|
unf (0.1.4)
|
33
33
|
unf_ext
|
34
34
|
unf_ext (0.0.7.7)
|
35
|
-
webmock (3.
|
36
|
-
addressable (>= 2.
|
35
|
+
webmock (3.14.0)
|
36
|
+
addressable (>= 2.8.0)
|
37
37
|
crack (>= 0.3.2)
|
38
38
|
hashdiff (>= 0.4.0, < 2.0.0)
|
39
39
|
|
data/README.md
CHANGED
@@ -121,4 +121,13 @@ This exception contains a message string describing what went wrong, and also tw
|
|
121
121
|
This library supports [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff).
|
122
122
|
|
123
123
|
When you send too many concurrent requests, the server returns an error `429 - Too Many Requests`. The client reacts to this by waiting for a while, and then retrying the request.
|
124
|
-
If the request still fails with an error `429`, it waits a little longer, and try again.
|
124
|
+
If the request still fails with an error `429`, it waits a little longer, and try again. By default this happens 5 times, before giving up (after approximately 15 seconds).
|
125
|
+
|
126
|
+
To change the maximum number of retries, create the client as follows:
|
127
|
+
|
128
|
+
```ruby
|
129
|
+
require('seatsio')
|
130
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key", max_retries = 3)
|
131
|
+
```
|
132
|
+
|
133
|
+
Passing in 0 disables exponential backoff completely. In that case, the client will never retry a failed request.
|
@@ -6,8 +6,8 @@ require 'cgi'
|
|
6
6
|
|
7
7
|
module Seatsio
|
8
8
|
class ChartReportsClient
|
9
|
-
def initialize(
|
10
|
-
@http_client =
|
9
|
+
def initialize(http_client)
|
10
|
+
@http_client = http_client
|
11
11
|
end
|
12
12
|
|
13
13
|
def by_label(chart_key, book_whole_tables = nil)
|
data/lib/seatsio/charts.rb
CHANGED
@@ -11,8 +11,8 @@ module Seatsio
|
|
11
11
|
class ChartsClient
|
12
12
|
attr_reader :archive
|
13
13
|
|
14
|
-
def initialize(
|
15
|
-
@http_client =
|
14
|
+
def initialize(http_client)
|
15
|
+
@http_client = http_client
|
16
16
|
@archive = Pagination::Cursor.new(Chart, 'charts/archive', @http_client)
|
17
17
|
end
|
18
18
|
|
@@ -7,8 +7,8 @@ require 'cgi'
|
|
7
7
|
module Seatsio
|
8
8
|
# Client for fetching event reports
|
9
9
|
class EventReportsClient
|
10
|
-
def initialize(
|
11
|
-
@http_client =
|
10
|
+
def initialize(http_client)
|
11
|
+
@http_client = http_client
|
12
12
|
end
|
13
13
|
|
14
14
|
def by_status(event_key, status = nil)
|
data/lib/seatsio/events.rb
CHANGED
@@ -11,8 +11,8 @@ require "seatsio/events/change_best_available_object_status_request"
|
|
11
11
|
module Seatsio
|
12
12
|
|
13
13
|
class EventsClient
|
14
|
-
def initialize(
|
15
|
-
@http_client =
|
14
|
+
def initialize(http_client)
|
15
|
+
@http_client = http_client
|
16
16
|
end
|
17
17
|
|
18
18
|
def create(chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil)
|
data/lib/seatsio/hold_tokens.rb
CHANGED
@@ -11,8 +11,8 @@ module Seatsio
|
|
11
11
|
|
12
12
|
class HoldTokensClient
|
13
13
|
# @return [Seatsio::HoldTokensClient]
|
14
|
-
def initialize(
|
15
|
-
@http_client =
|
14
|
+
def initialize(http_client)
|
15
|
+
@http_client = http_client
|
16
16
|
end
|
17
17
|
|
18
18
|
def create(expires_in_minutes: nil)
|
data/lib/seatsio/httpClient.rb
CHANGED
@@ -6,10 +6,11 @@ require "uri"
|
|
6
6
|
|
7
7
|
module Seatsio
|
8
8
|
class HttpClient
|
9
|
-
def initialize(secret_key, workspace_key, base_url)
|
9
|
+
def initialize(secret_key, workspace_key, base_url, max_retries)
|
10
10
|
@secret_key = Base64.encode64(secret_key)
|
11
11
|
@workspace_key = workspace_key
|
12
12
|
@base_url = base_url
|
13
|
+
@max_retries = max_retries
|
13
14
|
end
|
14
15
|
|
15
16
|
def execute(*args)
|
@@ -55,7 +56,7 @@ module Seatsio
|
|
55
56
|
begin
|
56
57
|
return RestClient::Request.execute(request_options)
|
57
58
|
rescue RestClient::ExceptionWithResponse => e
|
58
|
-
if e.response.code != 429 || retry_count >=
|
59
|
+
if e.response.code != 429 || retry_count >= @max_retries
|
59
60
|
raise e
|
60
61
|
else
|
61
62
|
wait_time = (2 ** (retry_count + 2)) / 10.0
|
data/lib/seatsio/subaccounts.rb
CHANGED
@@ -8,8 +8,8 @@ require "seatsio/domain"
|
|
8
8
|
|
9
9
|
module Seatsio
|
10
10
|
class SubaccountsClient
|
11
|
-
def initialize(
|
12
|
-
@http_client =
|
11
|
+
def initialize(http_client)
|
12
|
+
@http_client = http_client
|
13
13
|
end
|
14
14
|
|
15
15
|
def create(name: nil)
|
@@ -6,8 +6,8 @@ require 'cgi'
|
|
6
6
|
|
7
7
|
module Seatsio
|
8
8
|
class UsageReportsClient
|
9
|
-
def initialize(
|
10
|
-
@http_client =
|
9
|
+
def initialize(http_client)
|
10
|
+
@http_client = http_client
|
11
11
|
end
|
12
12
|
|
13
13
|
def summary_for_all_months
|
data/lib/seatsio/version.rb
CHANGED
data/lib/seatsio/workspaces.rb
CHANGED
@@ -9,8 +9,8 @@ require "seatsio/domain"
|
|
9
9
|
module Seatsio
|
10
10
|
class WorkspacesClient
|
11
11
|
|
12
|
-
def initialize(
|
13
|
-
@http_client =
|
12
|
+
def initialize(http_client)
|
13
|
+
@http_client = http_client
|
14
14
|
end
|
15
15
|
|
16
16
|
def create(name:, is_test: nil)
|
data/lib/seatsio.rb
CHANGED
@@ -13,19 +13,22 @@ module Seatsio
|
|
13
13
|
attr_reader :charts, :subaccounts, :workspaces, :events,
|
14
14
|
:hold_tokens, :chart_reports, :event_reports, :usage_reports
|
15
15
|
|
16
|
-
def initialize(region, secret_key, workspace_key = nil)
|
16
|
+
def initialize(region, secret_key, workspace_key = nil, max_retries = 5)
|
17
17
|
base_url = region.url
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
21
|
-
@
|
22
|
-
@
|
23
|
-
@
|
24
|
-
@
|
25
|
-
@
|
18
|
+
@http_client = Seatsio::HttpClient.new(secret_key, workspace_key, base_url, max_retries)
|
19
|
+
@charts = ChartsClient.new(@http_client)
|
20
|
+
@subaccounts = SubaccountsClient.new(@http_client)
|
21
|
+
@workspaces = WorkspacesClient.new(@http_client)
|
22
|
+
@events = EventsClient.new(@http_client)
|
23
|
+
@hold_tokens = HoldTokensClient.new(@http_client)
|
24
|
+
@chart_reports = ChartReportsClient.new(@http_client)
|
25
|
+
@event_reports = EventReportsClient.new(@http_client)
|
26
|
+
@usage_reports = UsageReportsClient.new(@http_client)
|
26
27
|
end
|
28
|
+
|
27
29
|
end
|
28
30
|
|
31
|
+
|
29
32
|
class Region
|
30
33
|
attr_reader :url
|
31
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seatsio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 32.
|
4
|
+
version: 32.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seats.io
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|