seatsio 40.1.0 → 42.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +9 -6
- data/README.md +1 -1
- data/lib/seatsio/domain.rb +3 -2
- data/lib/seatsio/events.rb +38 -14
- data/lib/seatsio/version.rb +1 -1
- data/seatsio.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0caea0654fe8f1c56917f0f36f5e24692ccb39b71e1c58082fcdfc05c6b9f3f1
|
4
|
+
data.tar.gz: 0c286cb3da66b467d305c51dcf12bc8417e35d0d8d97391fd5e8eb3a257bf480
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1bd2a4919e3d33a3f4494ca4bf1b94facdb875f8466d330c42fe1f057fcd3e6204bd9d4f8eb183dbf7999202140c4ab09946b04433a95815995e5aae50e5377
|
7
|
+
data.tar.gz: 8f4baa6c8b2814c250d7b318772aacbb846cfe9008805fed7d2416c3bc0bac36849471e02aaeedebefc847a6196ac0ad8c585d963ad77a0c3c3ce12b66a94757
|
data/.github/workflows/build.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.4
|
1
|
+
2.7.4
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seatsio (
|
4
|
+
seatsio (42.0.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
addressable (2.8.
|
10
|
-
public_suffix (>= 2.0.2, <
|
9
|
+
addressable (2.8.1)
|
10
|
+
public_suffix (>= 2.0.2, < 6.0)
|
11
11
|
crack (0.4.5)
|
12
12
|
rexml
|
13
13
|
domain_name (0.5.20190701)
|
@@ -19,9 +19,11 @@ 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.16.3)
|
23
|
+
minitest-parallel_fork (1.3.0)
|
24
|
+
minitest (>= 5.15.0)
|
23
25
|
netrc (0.11.0)
|
24
|
-
public_suffix (
|
26
|
+
public_suffix (5.0.0)
|
25
27
|
rake (13.0.6)
|
26
28
|
rest-client (2.1.0)
|
27
29
|
http-accept (>= 1.7.0, < 2.0)
|
@@ -32,7 +34,7 @@ GEM
|
|
32
34
|
unf (0.1.4)
|
33
35
|
unf_ext
|
34
36
|
unf_ext (0.0.7.7)
|
35
|
-
webmock (3.
|
37
|
+
webmock (3.18.1)
|
36
38
|
addressable (>= 2.8.0)
|
37
39
|
crack (>= 0.3.2)
|
38
40
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -43,6 +45,7 @@ PLATFORMS
|
|
43
45
|
DEPENDENCIES
|
44
46
|
bundler (~> 2.2)
|
45
47
|
minitest (~> 5.0)
|
48
|
+
minitest-parallel_fork (~> 1.3)
|
46
49
|
rake (~> 13.0)
|
47
50
|
rest-client (~> 2.0, >= 2.0.2)
|
48
51
|
seatsio!
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Build](https://github.com/seatsio/seatsio-ruby/workflows/Build/badge.svg)](https://github.com/seatsio/seatsio-ruby/actions/workflows/build.yml)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/seatsio.svg)](https://badge.fury.io/rb/seatsio)
|
5
5
|
|
6
|
-
This is the official Ruby client library for the [Seats.io V2 REST API](https://docs.seats.io/docs/api-overview), supporting Ruby 2.
|
6
|
+
This is the official Ruby client library for the [Seats.io V2 REST API](https://docs.seats.io/docs/api-overview), supporting Ruby 2.7.0+
|
7
7
|
|
8
8
|
## Versioning
|
9
9
|
|
data/lib/seatsio/domain.rb
CHANGED
@@ -59,12 +59,13 @@ module Seatsio
|
|
59
59
|
|
60
60
|
class ForSaleConfig
|
61
61
|
|
62
|
-
attr_reader :for_sale, :objects, :categories
|
62
|
+
attr_reader :for_sale, :objects, :area_places, :categories
|
63
63
|
|
64
64
|
def initialize(data)
|
65
65
|
if data
|
66
66
|
@for_sale = data['forSale']
|
67
67
|
@objects = data['objects']
|
68
|
+
@area_places = data['areaPlaces']
|
68
69
|
@categories = data['categories']
|
69
70
|
end
|
70
71
|
end
|
@@ -74,7 +75,7 @@ module Seatsio
|
|
74
75
|
|
75
76
|
attr_reader :key, :label, :color, :accessible
|
76
77
|
|
77
|
-
def initialize(key, label, color, accessible)
|
78
|
+
def initialize(key, label, color, accessible = false)
|
78
79
|
@key = key
|
79
80
|
@label = label
|
80
81
|
@color = color
|
data/lib/seatsio/events.rb
CHANGED
@@ -18,11 +18,11 @@ module Seatsio
|
|
18
18
|
@channels = ChannelsClient.new(@http_client)
|
19
19
|
end
|
20
20
|
|
21
|
-
def create(chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil)
|
21
|
+
def create(chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil, categories: nil)
|
22
22
|
payload = build_event_request(chart_key: chart_key, event_key: event_key,
|
23
23
|
table_booking_config: table_booking_config,
|
24
24
|
social_distancing_ruleset_key: social_distancing_ruleset_key,
|
25
|
-
object_categories: object_categories)
|
25
|
+
object_categories: object_categories, categories: categories)
|
26
26
|
response = @http_client.post("events", payload)
|
27
27
|
Event.new(response)
|
28
28
|
end
|
@@ -33,8 +33,14 @@ module Seatsio
|
|
33
33
|
Events.new(response).events
|
34
34
|
end
|
35
35
|
|
36
|
-
def update(key:, chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil)
|
37
|
-
payload = build_event_request(
|
36
|
+
def update(key:, chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil, categories: nil)
|
37
|
+
payload = build_event_request(
|
38
|
+
chart_key: chart_key,
|
39
|
+
event_key: event_key,
|
40
|
+
table_booking_config: table_booking_config,
|
41
|
+
social_distancing_ruleset_key: social_distancing_ruleset_key,
|
42
|
+
object_categories: object_categories,
|
43
|
+
categories: categories)
|
38
44
|
@http_client.post("/events/#{key}", payload)
|
39
45
|
end
|
40
46
|
|
@@ -55,7 +61,7 @@ module Seatsio
|
|
55
61
|
|
56
62
|
def retrieve_object_infos(key:, labels:)
|
57
63
|
url = "events/#{key}/objects"
|
58
|
-
query_params = URI.encode_www_form(labels.map { |label| ['label', label]})
|
64
|
+
query_params = URI.encode_www_form(labels.map { |label| ['label', label] })
|
59
65
|
response = @http_client.get(url, query_params)
|
60
66
|
response.each do |key, value|
|
61
67
|
response[key] = EventObjectInfo.new(value)
|
@@ -70,7 +76,7 @@ module Seatsio
|
|
70
76
|
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)
|
71
77
|
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)
|
72
78
|
request[:params] = {
|
73
|
-
|
79
|
+
:expand => 'objects'
|
74
80
|
}
|
75
81
|
response = @http_client.post("events/groups/actions/change-object-status", request)
|
76
82
|
ChangeObjectStatusResult.new(response)
|
@@ -78,8 +84,8 @@ module Seatsio
|
|
78
84
|
|
79
85
|
def change_object_status_in_batch(status_change_requests)
|
80
86
|
request = {
|
81
|
-
|
82
|
-
|
87
|
+
:statusChanges => status_change_requests,
|
88
|
+
:params => { :expand => 'objects' }
|
83
89
|
}
|
84
90
|
response = @http_client.post("events/actions/change-object-status", request)
|
85
91
|
ChangeObjectStatusInBatchResult.new(response).results
|
@@ -132,8 +138,8 @@ module Seatsio
|
|
132
138
|
Pagination::Cursor.new(StatusChange, "/events/#{key}/objects/#{object_id}/status-changes", @http_client)
|
133
139
|
end
|
134
140
|
|
135
|
-
def mark_as_not_for_sale(key:, objects: nil, categories: nil)
|
136
|
-
request = build_parameters_for_mark_as_sale objects
|
141
|
+
def mark_as_not_for_sale(key:, objects: nil, area_places: nil, categories: nil)
|
142
|
+
request = build_parameters_for_mark_as_sale objects, area_places, categories
|
137
143
|
@http_client.post("events/#{key}/actions/mark-as-not-for-sale", request)
|
138
144
|
end
|
139
145
|
|
@@ -141,16 +147,17 @@ module Seatsio
|
|
141
147
|
@http_client.post("events/#{key}/actions/mark-everything-as-for-sale")
|
142
148
|
end
|
143
149
|
|
144
|
-
def mark_as_for_sale(key:, objects: nil, categories: nil)
|
145
|
-
request = build_parameters_for_mark_as_sale objects
|
150
|
+
def mark_as_for_sale(key:, objects: nil, area_places: nil, categories: nil)
|
151
|
+
request = build_parameters_for_mark_as_sale objects, area_places, categories
|
146
152
|
@http_client.post("events/#{key}/actions/mark-as-for-sale", request)
|
147
153
|
end
|
148
154
|
|
149
155
|
private
|
150
156
|
|
151
|
-
def build_parameters_for_mark_as_sale(objects
|
157
|
+
def build_parameters_for_mark_as_sale(objects, area_places, categories)
|
152
158
|
request = {}
|
153
159
|
request[:objects] = objects if objects
|
160
|
+
request[:areaPlaces] = area_places if area_places
|
154
161
|
request[:categories] = categories if categories
|
155
162
|
request
|
156
163
|
end
|
@@ -161,13 +168,14 @@ module Seatsio
|
|
161
168
|
payload
|
162
169
|
end
|
163
170
|
|
164
|
-
def build_event_request(chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil)
|
171
|
+
def build_event_request(chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil, categories: nil)
|
165
172
|
result = {}
|
166
173
|
result["chartKey"] = chart_key if chart_key
|
167
174
|
result["eventKey"] = event_key if event_key
|
168
175
|
result["tableBookingConfig"] = table_booking_config_to_request(table_booking_config) if table_booking_config != nil
|
169
176
|
result["socialDistancingRulesetKey"] = social_distancing_ruleset_key if social_distancing_ruleset_key != nil
|
170
177
|
result["objectCategories"] = object_categories if object_categories != nil
|
178
|
+
result["categories"] = categories_to_request(categories) if categories != nil
|
171
179
|
result
|
172
180
|
end
|
173
181
|
|
@@ -184,6 +192,9 @@ module Seatsio
|
|
184
192
|
r = {}
|
185
193
|
r["eventKey"] = param[:event_key] if param[:event_key] != nil
|
186
194
|
r["tableBookingConfig"] = table_booking_config_to_request(param[:table_booking_config]) if param[:table_booking_config] != nil
|
195
|
+
r["socialDistancingRulesetKey"] = param[:social_distancing_ruleset_key] if param[:social_distancing_ruleset_key] != nil
|
196
|
+
r["objectCategories"] = param[:object_categories] if param[:object_categories] != nil
|
197
|
+
r["categories"] = categories_to_request(param[:categories]) if param[:categories] != nil
|
187
198
|
result.push(r)
|
188
199
|
end
|
189
200
|
result
|
@@ -196,5 +207,18 @@ module Seatsio
|
|
196
207
|
result
|
197
208
|
end
|
198
209
|
|
210
|
+
def categories_to_request(categories)
|
211
|
+
result = []
|
212
|
+
categories.each do |category|
|
213
|
+
r = {}
|
214
|
+
r["key"] = category.key if category.key != nil
|
215
|
+
r["label"] = category.label if category.label != nil
|
216
|
+
r["color"] = category.color if category.color != nil
|
217
|
+
r["accessible"] = category.accessible if category.accessible != nil
|
218
|
+
result.push(r)
|
219
|
+
end
|
220
|
+
result
|
221
|
+
end
|
222
|
+
|
199
223
|
end
|
200
224
|
end
|
data/lib/seatsio/version.rb
CHANGED
data/seatsio.gemspec
CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency "minitest", "~> 5.0"
|
26
26
|
spec.add_development_dependency "rest-client", '~> 2.0', '>= 2.0.2'
|
27
27
|
spec.add_development_dependency 'webmock', '~> 3.4', '>= 3.4.2'
|
28
|
+
spec.add_development_dependency 'minitest-parallel_fork', '~> 1.3'
|
28
29
|
end
|
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: 42.0.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: 2022-
|
11
|
+
date: 2022-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,6 +92,20 @@ dependencies:
|
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 3.4.2
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: minitest-parallel_fork
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '1.3'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - "~>"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '1.3'
|
95
109
|
description: This is the official Ruby client library for the Seats.io V2 REST API
|
96
110
|
email:
|
97
111
|
- nahuel@seats.io
|
@@ -151,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: '0'
|
153
167
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
168
|
+
rubygems_version: 3.3.5
|
155
169
|
signing_key:
|
156
170
|
specification_version: 4
|
157
171
|
summary: the official Seats.io Ruby client library
|