seatsio 34.0.0 → 35.2.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/workflows/build.yml +1 -1
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/README.md +27 -2
- data/lib/seatsio/chart_reports.rb +25 -0
- data/lib/seatsio/domain.rb +2 -2
- data/lib/seatsio/event_reports.rb +18 -6
- data/lib/seatsio/events/change_object_status_request.rb +3 -1
- data/lib/seatsio/events.rb +3 -3
- data/lib/seatsio/pagination/cursor.rb +2 -2
- data/lib/seatsio/version.rb +1 -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: 621bb856b807e82315540bb575ea947feb75cb3e7807adbd25cf0a7b74393aeb
|
4
|
+
data.tar.gz: 1ea9af6b8e43f3ac4a4cd85fcf7cce0fe03aa46919e5d4d7ca219439b97e33ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a48e05fe8cc84746c3d9cc32e0e4eebf04b17e0654107524a19d384157a43b646ce6b5c3a4698a7461c28574c275c307c3d2d149eebf31827fdcbca7834cdb51
|
7
|
+
data.tar.gz: f12a0b1a9deb661e5340b3d1419b4846cbb3b3f835e5a2e084bbd103f76ab8cf1f863e3cbf4daea263ee0837e5a67fc1f2bd1d94a68e442ae79d65f1610c9388
|
data/.github/workflows/build.yml
CHANGED
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seatsio (
|
4
|
+
seatsio (35.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
mime-types (3.3.1)
|
20
20
|
mime-types-data (~> 3.2015)
|
21
21
|
mime-types-data (3.2021.0225)
|
22
|
-
minitest (5.
|
22
|
+
minitest (5.15.0)
|
23
23
|
netrc (0.11.0)
|
24
24
|
public_suffix (4.0.6)
|
25
25
|
rake (13.0.6)
|
data/README.md
CHANGED
@@ -9,13 +9,38 @@ This is the official Ruby client library for the [Seats.io V2 REST API](https://
|
|
9
9
|
|
10
10
|
seatsio-ruby follows semver since v23.3.0.
|
11
11
|
|
12
|
-
##
|
12
|
+
## API reference
|
13
|
+
|
14
|
+
You can find a full API reference at https://www.rubydoc.info/gems/seatsio/
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
### General instructions
|
19
|
+
|
20
|
+
To use this library, you'll need to create a `Seatsio::Client`:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require('seatsio')
|
24
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key")
|
25
|
+
...
|
26
|
+
```
|
27
|
+
|
28
|
+
You can find your _workspace secret key_ in the [settings section of the workspace](https://app.seats.io/workspace-settings).
|
29
|
+
|
30
|
+
The region should correspond to the region of your account:
|
31
|
+
|
32
|
+
- `Seatsio::Region.EU()`: Europe
|
33
|
+
- `Seatsio::Region.NA()`: North-America
|
34
|
+
- `Seatsio::Region.SA()`: South-America
|
35
|
+
- `Seatsio::Region.OC()`: Oceania
|
36
|
+
|
37
|
+
If you're unsure about your region, have a look at your [company settings page](https://app.seats.io/company-settings).
|
13
38
|
|
14
39
|
### Creating a chart and an event
|
15
40
|
|
16
41
|
```ruby
|
17
42
|
require('seatsio')
|
18
|
-
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key")
|
43
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key")
|
19
44
|
chart = client.charts.create
|
20
45
|
event = client.events.create chart_key: chart.key
|
21
46
|
```
|
@@ -18,14 +18,34 @@ module Seatsio
|
|
18
18
|
get_chart_report('byObjectType', chart_key, book_whole_tables)
|
19
19
|
end
|
20
20
|
|
21
|
+
def summary_by_object_type(chart_key)
|
22
|
+
fetch_summary_report('byObjectType', chart_key)
|
23
|
+
end
|
24
|
+
|
21
25
|
def by_category_key(chart_key, book_whole_tables = nil)
|
22
26
|
get_chart_report('byCategoryKey', chart_key, book_whole_tables)
|
23
27
|
end
|
24
28
|
|
29
|
+
def summary_by_category_key(chart_key)
|
30
|
+
fetch_summary_report('byCategoryKey', chart_key)
|
31
|
+
end
|
32
|
+
|
25
33
|
def by_category_label(chart_key, book_whole_tables = nil)
|
26
34
|
get_chart_report('byCategoryLabel', chart_key, book_whole_tables)
|
27
35
|
end
|
28
36
|
|
37
|
+
def summary_by_category_label(chart_key)
|
38
|
+
fetch_summary_report('byCategoryLabel', chart_key)
|
39
|
+
end
|
40
|
+
|
41
|
+
def by_section(chart_key, book_whole_tables = nil)
|
42
|
+
get_chart_report('bySection', chart_key, book_whole_tables)
|
43
|
+
end
|
44
|
+
|
45
|
+
def summary_by_section(event_key)
|
46
|
+
fetch_summary_report('bySection', event_key)
|
47
|
+
end
|
48
|
+
|
29
49
|
private
|
30
50
|
|
31
51
|
def get_chart_report(report_type, chart_key, book_whole_tables)
|
@@ -34,5 +54,10 @@ module Seatsio
|
|
34
54
|
body = @http_client.get(url, params)
|
35
55
|
ChartReport.new(body)
|
36
56
|
end
|
57
|
+
|
58
|
+
def fetch_summary_report(report_type, event_key)
|
59
|
+
url = "reports/charts/#{event_key}/#{report_type}/summary"
|
60
|
+
@http_client.get(url)
|
61
|
+
end
|
37
62
|
end
|
38
63
|
end
|
data/lib/seatsio/domain.rb
CHANGED
@@ -315,7 +315,7 @@ module Seatsio
|
|
315
315
|
:category_key, :entrance, :object_type, :hold_token, :category_label,
|
316
316
|
:ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
|
317
317
|
:is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
|
318
|
-
:left_neighbour, :right_neighbour, :
|
318
|
+
:left_neighbour, :right_neighbour, :is_available, :is_disabled_by_social_distancing, :channel,
|
319
319
|
:book_as_a_whole, :distance_to_focal_point, :holds
|
320
320
|
|
321
321
|
def initialize(data)
|
@@ -343,7 +343,7 @@ module Seatsio
|
|
343
343
|
@displayed_object_type = data['displayedObjectType']
|
344
344
|
@left_neighbour = data['leftNeighbour']
|
345
345
|
@right_neighbour = data['rightNeighbour']
|
346
|
-
@
|
346
|
+
@is_available = data['isAvailable']
|
347
347
|
@is_disabled_by_social_distancing = data['isDisabledBySocialDistancing']
|
348
348
|
@channel = data['channel']
|
349
349
|
@book_as_a_whole = data['bookAsAWhole']
|
@@ -71,16 +71,28 @@ module Seatsio
|
|
71
71
|
fetch_deep_summary_report('bySection', event_key)
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
75
|
-
fetch_report('
|
74
|
+
def by_availability(event_key, availability = nil)
|
75
|
+
fetch_report('byAvailability', event_key, availability)
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
79
|
-
fetch_summary_report('
|
78
|
+
def summary_by_availability(event_key)
|
79
|
+
fetch_summary_report('byAvailability', event_key)
|
80
80
|
end
|
81
81
|
|
82
|
-
def
|
83
|
-
fetch_deep_summary_report('
|
82
|
+
def deep_summary_by_availability(event_key)
|
83
|
+
fetch_deep_summary_report('byAvailability', event_key)
|
84
|
+
end
|
85
|
+
|
86
|
+
def by_availability_reason(event_key, availability_reason = nil)
|
87
|
+
fetch_report('byAvailabilityReason', event_key, availability_reason)
|
88
|
+
end
|
89
|
+
|
90
|
+
def summary_by_availability_reason(event_key)
|
91
|
+
fetch_summary_report('byAvailabilityReason', event_key)
|
92
|
+
end
|
93
|
+
|
94
|
+
def deep_summary_by_availability_reason(event_key)
|
95
|
+
fetch_deep_summary_report('byAvailabilityReason', event_key)
|
84
96
|
end
|
85
97
|
|
86
98
|
def by_channel(event_key, channelKey = nil)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
def create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing)
|
1
|
+
def create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing, allowed_previous_statuses, rejected_previous_statuses)
|
2
2
|
result = {}
|
3
3
|
result[:objects] = normalize(object_or_objects)
|
4
4
|
result[:status] = status
|
@@ -13,6 +13,8 @@ def create_change_object_status_request(object_or_objects, status, hold_token, o
|
|
13
13
|
result[:ignoreChannels] = ignore_channels if ignore_channels != nil
|
14
14
|
result[:channelKeys] = channel_keys if channel_keys != nil
|
15
15
|
result[:ignoreSocialDistancing] = ignore_social_distancing if ignore_social_distancing != nil
|
16
|
+
result[:allowedPreviousStatuses] = allowed_previous_statuses if allowed_previous_statuses != nil
|
17
|
+
result[:rejectedPreviousStatuses] = rejected_previous_statuses if rejected_previous_statuses != nil
|
16
18
|
result
|
17
19
|
end
|
18
20
|
|
data/lib/seatsio/events.rb
CHANGED
@@ -62,12 +62,12 @@ module Seatsio
|
|
62
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)
|
63
63
|
end
|
64
64
|
|
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)
|
66
|
-
request = create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing)
|
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, allowed_previous_statuses: nil, rejected_previous_statuses: nil)
|
66
|
+
request = create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing, allowed_previous_statuses, rejected_previous_statuses)
|
67
67
|
request[:params] = {
|
68
68
|
:expand => 'objects'
|
69
69
|
}
|
70
|
-
response = @http_client.post("
|
70
|
+
response = @http_client.post("events/groups/actions/change-object-status", request)
|
71
71
|
ChangeObjectStatusResult.new(response)
|
72
72
|
end
|
73
73
|
|
@@ -19,7 +19,7 @@ module Seatsio
|
|
19
19
|
@first_page = false
|
20
20
|
end
|
21
21
|
|
22
|
-
def each(start = 0)
|
22
|
+
def each(start = 0, &block)
|
23
23
|
return to_enum(:each, start) unless block_given?
|
24
24
|
|
25
25
|
Array(@collection[start..-1]).each do |element|
|
@@ -30,7 +30,7 @@ module Seatsio
|
|
30
30
|
|
31
31
|
start = [@collection.size, start].max
|
32
32
|
fetch_next_page
|
33
|
-
each(start, &
|
33
|
+
each(start, &block)
|
34
34
|
end
|
35
35
|
|
36
36
|
def set_query_param(key, value)
|
data/lib/seatsio/version.rb
CHANGED
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: 35.2.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:
|
11
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|