seatsio 41.1.0 → 42.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e26c4f5acaa14ec57d48cdf21d7f5485cccef99d6b5ee8870217af893ff880f
4
- data.tar.gz: eb282ada76ca8e0c7ebd1efc1f3a24117148e76174b9f92284dc2bcc60433038
3
+ metadata.gz: 0caea0654fe8f1c56917f0f36f5e24692ccb39b71e1c58082fcdfc05c6b9f3f1
4
+ data.tar.gz: 0c286cb3da66b467d305c51dcf12bc8417e35d0d8d97391fd5e8eb3a257bf480
5
5
  SHA512:
6
- metadata.gz: 5c91b99a9e83e3c5ff84021f4a564d4da5ccd37eaf6a29bc9e8e106d20a1543bc3d5789987861bb48eaa0483847783354d8dfe6632f3d235e842745fb7641f9a
7
- data.tar.gz: 9d500c05e2df1619ef5177ca6e7308fa707ecab377c4950b24cdb6ac5c1aacaff6632af7fb3695bf086b399dab0bdc53e886b593dc9a68a142e1e2eccef86d81
6
+ metadata.gz: e1bd2a4919e3d33a3f4494ca4bf1b94facdb875f8466d330c42fe1f057fcd3e6204bd9d4f8eb183dbf7999202140c4ab09946b04433a95815995e5aae50e5377
7
+ data.tar.gz: 8f4baa6c8b2814c250d7b318772aacbb846cfe9008805fed7d2416c3bc0bac36849471e02aaeedebefc847a6196ac0ad8c585d963ad77a0c3c3ce12b66a94757
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (41.1.0)
4
+ seatsio (42.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -75,7 +75,7 @@ module Seatsio
75
75
 
76
76
  attr_reader :key, :label, :color, :accessible
77
77
 
78
- def initialize(key, label, color, accessible)
78
+ def initialize(key, label, color, accessible = false)
79
79
  @key = key
80
80
  @label = label
81
81
  @color = color
@@ -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(chart_key: chart_key, event_key: event_key, table_booking_config: table_booking_config, social_distancing_ruleset_key: social_distancing_ruleset_key, object_categories: object_categories)
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
 
@@ -162,13 +168,14 @@ module Seatsio
162
168
  payload
163
169
  end
164
170
 
165
- 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)
166
172
  result = {}
167
173
  result["chartKey"] = chart_key if chart_key
168
174
  result["eventKey"] = event_key if event_key
169
175
  result["tableBookingConfig"] = table_booking_config_to_request(table_booking_config) if table_booking_config != nil
170
176
  result["socialDistancingRulesetKey"] = social_distancing_ruleset_key if social_distancing_ruleset_key != nil
171
177
  result["objectCategories"] = object_categories if object_categories != nil
178
+ result["categories"] = categories_to_request(categories) if categories != nil
172
179
  result
173
180
  end
174
181
 
@@ -185,6 +192,9 @@ module Seatsio
185
192
  r = {}
186
193
  r["eventKey"] = param[:event_key] if param[:event_key] != nil
187
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
188
198
  result.push(r)
189
199
  end
190
200
  result
@@ -197,5 +207,18 @@ module Seatsio
197
207
  result
198
208
  end
199
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
+
200
223
  end
201
224
  end
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "41.1.0"
2
+ VERSION = "42.0.0"
3
3
  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: 41.1.0
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-10-25 00:00:00.000000000 Z
11
+ date: 2022-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubygems_version: 3.1.2
168
+ rubygems_version: 3.3.5
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: the official Seats.io Ruby client library