seatsio 32.1.0 → 33.0.0
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 +4 -4
- data/.github/dependabot.yml +11 -0
- data/Gemfile.lock +5 -5
- data/README.md +11 -2
- data/lib/seatsio/chart_reports.rb +2 -2
- data/lib/seatsio/charts.rb +2 -2
- data/lib/seatsio/domain.rb +19 -29
- data/lib/seatsio/event_reports.rb +2 -2
- data/lib/seatsio/events.rb +20 -11
- data/lib/seatsio/hold_tokens.rb +2 -2
- data/lib/seatsio/httpClient.rb +12 -4
- 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 +15 -2
- data/lib/seatsio.rb +12 -9
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb9b9ede155afb77e4c55fac2ac7a9da697e5cf7f4f80e9a772002879718166d
|
|
4
|
+
data.tar.gz: ed80c3e21eca4567f4e613bfe1ed7e4dba90e62f4605dc2b4b47d1aface142aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4e792dcbdc73e9967de1c377b3a092dc4ba0f00615e8b57724580aa3cd93e29dcad82086f1ec1e9cd6ffc494ed6be4b85addcc01f422c4dd5462e286df836db
|
|
7
|
+
data.tar.gz: 31648860929a47b3b368504c32d573dda0f3bfa2b6f679d645c8c7577a0764aedf27660061f81800c2852769386e238b2644b892fc728bb2e55785631738fa13
|
data/Gemfile.lock
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
seatsio (
|
|
4
|
+
seatsio (33.0.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
addressable (2.
|
|
9
|
+
addressable (2.8.0)
|
|
10
10
|
public_suffix (>= 2.0.2, < 5.0)
|
|
11
11
|
crack (0.4.5)
|
|
12
12
|
rexml
|
|
@@ -22,7 +22,7 @@ GEM
|
|
|
22
22
|
minitest (5.14.4)
|
|
23
23
|
netrc (0.11.0)
|
|
24
24
|
public_suffix (4.0.6)
|
|
25
|
-
rake (13.0.
|
|
25
|
+
rake (13.0.6)
|
|
26
26
|
rest-client (2.1.0)
|
|
27
27
|
http-accept (>= 1.7.0, < 2.0)
|
|
28
28
|
http-cookie (>= 1.0.2, < 2.0)
|
|
@@ -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
|
@@ -17,7 +17,7 @@ seatsio-ruby follows semver since v23.3.0.
|
|
|
17
17
|
require('seatsio')
|
|
18
18
|
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key") # can be found on https://app.seats.io/workspace-settings
|
|
19
19
|
chart = client.charts.create
|
|
20
|
-
event = client.events.create
|
|
20
|
+
event = client.events.create chart_key: chart.key
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### Booking objects
|
|
@@ -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
|
|
data/lib/seatsio/domain.rb
CHANGED
|
@@ -201,25 +201,6 @@ module Seatsio
|
|
|
201
201
|
end
|
|
202
202
|
end
|
|
203
203
|
|
|
204
|
-
class ObjectStatus
|
|
205
|
-
FREE = 'free'
|
|
206
|
-
BOOKED = 'booked'
|
|
207
|
-
HELD = 'reservedByToken'
|
|
208
|
-
|
|
209
|
-
attr_reader :status, :hold_token, :order_id, :ticket_type,
|
|
210
|
-
:quantity, :extra_data, :for_sale
|
|
211
|
-
|
|
212
|
-
def initialize(data)
|
|
213
|
-
@status = data['status']
|
|
214
|
-
@hold_token = data['holdToken']
|
|
215
|
-
@order_id = data['orderId']
|
|
216
|
-
@ticket_type = data['ticketType']
|
|
217
|
-
@quantity = data['quantity']
|
|
218
|
-
@extra_data = data['extraData']
|
|
219
|
-
@for_sale = data['forSale']
|
|
220
|
-
end
|
|
221
|
-
end
|
|
222
|
-
|
|
223
204
|
class ChangeObjectStatusResult
|
|
224
205
|
|
|
225
206
|
attr_reader :objects
|
|
@@ -261,14 +242,15 @@ module Seatsio
|
|
|
261
242
|
end
|
|
262
243
|
end
|
|
263
244
|
|
|
264
|
-
class
|
|
245
|
+
class ChartObjectInfo
|
|
265
246
|
|
|
266
|
-
attr_reader :label, :labels, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
|
|
267
|
-
:left_neighbour, :right_neighbour, :book_as_a_whole
|
|
247
|
+
attr_reader :label, :labels, :ids, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
|
|
248
|
+
:left_neighbour, :right_neighbour, :book_as_a_whole, :distance_to_focal_point
|
|
268
249
|
|
|
269
250
|
def initialize(data)
|
|
270
251
|
@label = data['label']
|
|
271
252
|
@labels = data['labels']
|
|
253
|
+
@ids = data['ids']
|
|
272
254
|
@category_label = data['categoryLabel']
|
|
273
255
|
@category_key = data['categoryKey']
|
|
274
256
|
@section = data['section']
|
|
@@ -278,6 +260,7 @@ module Seatsio
|
|
|
278
260
|
@left_neighbour = data['leftNeighbour']
|
|
279
261
|
@right_neighbour = data['rightNeighbour']
|
|
280
262
|
@book_as_a_whole = data['bookAsAWhole']
|
|
263
|
+
@distance_to_focal_point = data['distanceToFocalPoint']
|
|
281
264
|
end
|
|
282
265
|
end
|
|
283
266
|
|
|
@@ -290,7 +273,7 @@ module Seatsio
|
|
|
290
273
|
data.each do |key, values|
|
|
291
274
|
items[key] = []
|
|
292
275
|
values.each do |value|
|
|
293
|
-
items[key] <<
|
|
276
|
+
items[key] << ChartObjectInfo.new(value)
|
|
294
277
|
end
|
|
295
278
|
end
|
|
296
279
|
@items = items
|
|
@@ -305,7 +288,7 @@ module Seatsio
|
|
|
305
288
|
if data.is_a? Array
|
|
306
289
|
items = []
|
|
307
290
|
data.each do |item|
|
|
308
|
-
items <<
|
|
291
|
+
items << EventObjectInfo.new(item)
|
|
309
292
|
end
|
|
310
293
|
@items = items
|
|
311
294
|
elsif data.nil?
|
|
@@ -315,7 +298,7 @@ module Seatsio
|
|
|
315
298
|
data.each do |key, values|
|
|
316
299
|
items[key] = []
|
|
317
300
|
values.each do |value|
|
|
318
|
-
items[key] <<
|
|
301
|
+
items[key] << EventObjectInfo.new(value)
|
|
319
302
|
end
|
|
320
303
|
end
|
|
321
304
|
@items = items
|
|
@@ -323,18 +306,23 @@ module Seatsio
|
|
|
323
306
|
end
|
|
324
307
|
end
|
|
325
308
|
|
|
326
|
-
class
|
|
327
|
-
|
|
309
|
+
class EventObjectInfo
|
|
310
|
+
FREE = 'free'
|
|
311
|
+
BOOKED = 'booked'
|
|
312
|
+
HELD = 'reservedByToken'
|
|
313
|
+
|
|
314
|
+
attr_reader :labels, :ids, :label, :order_id, :extra_data, :capacity, :status,
|
|
328
315
|
:category_key, :entrance, :object_type, :hold_token, :category_label,
|
|
329
316
|
:ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
|
|
330
317
|
:is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
|
|
331
318
|
:left_neighbour, :right_neighbour, :is_selectable, :is_disabled_by_social_distancing, :channel,
|
|
332
|
-
:book_as_a_whole
|
|
319
|
+
:book_as_a_whole, :distance_to_focal_point, :holds
|
|
333
320
|
|
|
334
321
|
def initialize(data)
|
|
335
322
|
@status = data['status']
|
|
336
323
|
@label = data['label']
|
|
337
324
|
@labels = data['labels']
|
|
325
|
+
@ids = data['ids']
|
|
338
326
|
@category_label = data['categoryLabel']
|
|
339
327
|
@category_key = data['categoryKey']
|
|
340
328
|
@ticket_type = data['ticketType']
|
|
@@ -359,6 +347,8 @@ module Seatsio
|
|
|
359
347
|
@is_disabled_by_social_distancing = data['isDisabledBySocialDistancing']
|
|
360
348
|
@channel = data['channel']
|
|
361
349
|
@book_as_a_whole = data['bookAsAWhole']
|
|
350
|
+
@distance_to_focal_point = data['distanceToFocalPoint']
|
|
351
|
+
@holds = data['holds']
|
|
362
352
|
end
|
|
363
353
|
end
|
|
364
354
|
|
|
@@ -502,7 +492,7 @@ module Seatsio
|
|
|
502
492
|
def to_object_details(data)
|
|
503
493
|
object_details = {}
|
|
504
494
|
data.each do |key, value|
|
|
505
|
-
object_details[key] =
|
|
495
|
+
object_details[key] = EventObjectInfo.new(value)
|
|
506
496
|
end
|
|
507
497
|
object_details
|
|
508
498
|
end
|
|
@@ -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)
|
|
@@ -43,14 +43,23 @@ module Seatsio
|
|
|
43
43
|
@http_client.post("events/#{key}/actions/update-extra-data", payload)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
def
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
def retrieve_object_info(key:, label:)
|
|
47
|
+
result = retrieve_object_infos key: key, labels: [label]
|
|
48
|
+
result[label]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def retrieve_object_infos(key:, labels:)
|
|
52
|
+
url = "events/#{key}/objects"
|
|
53
|
+
query_params = URI.encode_www_form(labels.map { |label| ['label', label]})
|
|
54
|
+
response = @http_client.get(url, query_params)
|
|
55
|
+
response.each do |key, value|
|
|
56
|
+
response[key] = EventObjectInfo.new(value)
|
|
57
|
+
end
|
|
58
|
+
response
|
|
50
59
|
end
|
|
51
60
|
|
|
52
61
|
def book(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, ignore_social_distancing: nil)
|
|
53
|
-
self.change_object_status(event_key_or_keys, object_or_objects,
|
|
62
|
+
self.change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::BOOKED, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys, ignore_social_distancing: ignore_social_distancing)
|
|
54
63
|
end
|
|
55
64
|
|
|
56
65
|
def change_object_status(event_key_or_keys, object_or_objects, status, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, ignore_social_distancing: nil)
|
|
@@ -72,7 +81,7 @@ module Seatsio
|
|
|
72
81
|
end
|
|
73
82
|
|
|
74
83
|
def hold(event_key_or_keys, object_or_objects, hold_token, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, ignore_social_distancing: nil)
|
|
75
|
-
change_object_status(event_key_or_keys, object_or_objects,
|
|
84
|
+
change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::HELD, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys, ignore_social_distancing: ignore_social_distancing)
|
|
76
85
|
end
|
|
77
86
|
|
|
78
87
|
def change_best_available_object_status(key, number, status, categories: nil, hold_token: nil, extra_data: nil, ticket_types: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
|
@@ -82,15 +91,15 @@ module Seatsio
|
|
|
82
91
|
end
|
|
83
92
|
|
|
84
93
|
def book_best_available(key, number, categories: nil, hold_token: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil)
|
|
85
|
-
change_best_available_object_status(key, number,
|
|
94
|
+
change_best_available_object_status(key, number, Seatsio::EventObjectInfo::BOOKED, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
|
86
95
|
end
|
|
87
96
|
|
|
88
97
|
def hold_best_available(key, number, hold_token, categories: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil)
|
|
89
|
-
change_best_available_object_status(key, number,
|
|
98
|
+
change_best_available_object_status(key, number, Seatsio::EventObjectInfo::HELD, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
|
90
99
|
end
|
|
91
100
|
|
|
92
101
|
def release(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
|
93
|
-
change_object_status(event_key_or_keys, object_or_objects,
|
|
102
|
+
change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::FREE, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
|
94
103
|
end
|
|
95
104
|
|
|
96
105
|
def delete(key:)
|
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)
|
|
@@ -18,11 +19,18 @@ module Seatsio
|
|
|
18
19
|
unless @workspace_key.nil?
|
|
19
20
|
headers[:'X-Workspace-Key'] = @workspace_key
|
|
20
21
|
end
|
|
22
|
+
|
|
23
|
+
url = "#{@base_url}/#{args[1]}"
|
|
24
|
+
|
|
21
25
|
if args[2].include? :params
|
|
22
|
-
|
|
26
|
+
params = args[2][:params]
|
|
27
|
+
if params.is_a? Hash
|
|
28
|
+
headers[:params] = params
|
|
29
|
+
else
|
|
30
|
+
url += "?" + params
|
|
31
|
+
end
|
|
23
32
|
end
|
|
24
33
|
|
|
25
|
-
url = "#{@base_url}/#{args[1]}"
|
|
26
34
|
|
|
27
35
|
request_options = { method: args[0], url: url, headers: headers }
|
|
28
36
|
|
|
@@ -55,7 +63,7 @@ module Seatsio
|
|
|
55
63
|
begin
|
|
56
64
|
return RestClient::Request.execute(request_options)
|
|
57
65
|
rescue RestClient::ExceptionWithResponse => e
|
|
58
|
-
if e.response.code != 429 || retry_count >=
|
|
66
|
+
if e.response.code != 429 || retry_count >= @max_retries
|
|
59
67
|
raise e
|
|
60
68
|
else
|
|
61
69
|
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
|
@@ -8,8 +8,9 @@ require "seatsio/domain"
|
|
|
8
8
|
|
|
9
9
|
module Seatsio
|
|
10
10
|
class WorkspacesClient
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
def initialize(http_client)
|
|
13
|
+
@http_client = http_client
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
def create(name:, is_test: nil)
|
|
@@ -50,6 +51,18 @@ module Seatsio
|
|
|
50
51
|
extended_cursor
|
|
51
52
|
end
|
|
52
53
|
|
|
54
|
+
def active(filter: nil)
|
|
55
|
+
extended_cursor = Pagination::Cursor.new(Workspace, 'workspaces/active', @http_client)
|
|
56
|
+
extended_cursor.set_query_param('filter', filter)
|
|
57
|
+
extended_cursor
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def inactive(filter: nil)
|
|
61
|
+
extended_cursor = Pagination::Cursor.new(Workspace, 'workspaces/inactive', @http_client)
|
|
62
|
+
extended_cursor.set_query_param('filter', filter)
|
|
63
|
+
extended_cursor
|
|
64
|
+
end
|
|
65
|
+
|
|
53
66
|
def retrieve(key:)
|
|
54
67
|
response = @http_client.get("/workspaces/#{key}")
|
|
55
68
|
Workspace.new(response)
|
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:
|
|
4
|
+
version: 33.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Seats.io
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-09-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -100,6 +100,7 @@ extensions: []
|
|
|
100
100
|
extra_rdoc_files: []
|
|
101
101
|
files:
|
|
102
102
|
- ".editorconfig"
|
|
103
|
+
- ".github/dependabot.yml"
|
|
103
104
|
- ".github/workflows/build.yml"
|
|
104
105
|
- ".github/workflows/publish.yml"
|
|
105
106
|
- ".gitignore"
|
|
@@ -133,7 +134,7 @@ files:
|
|
|
133
134
|
homepage: http://seats.io
|
|
134
135
|
licenses: []
|
|
135
136
|
metadata: {}
|
|
136
|
-
post_install_message:
|
|
137
|
+
post_install_message:
|
|
137
138
|
rdoc_options: []
|
|
138
139
|
require_paths:
|
|
139
140
|
- lib
|
|
@@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
149
150
|
version: '0'
|
|
150
151
|
requirements: []
|
|
151
152
|
rubygems_version: 3.1.2
|
|
152
|
-
signing_key:
|
|
153
|
+
signing_key:
|
|
153
154
|
specification_version: 4
|
|
154
155
|
summary: the official Seats.io Ruby client library
|
|
155
156
|
test_files: []
|