seatsio 46.2.0 → 46.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea140138380fddec62446cd0d4acb5b00280989d842960218e6431e08d8f94e4
4
- data.tar.gz: e939d665188ff00e46e2916185a4b92d6735b5afa5d9b3026716f5180f903490
3
+ metadata.gz: 6f6fa92abd664442b48a8e1285facba65545f36ef713e2b41882e24bd5abfbe7
4
+ data.tar.gz: 3c22e0d584aea9f01382a0c453e84a988c7739057c8c6ecaa731f6b00ec30490
5
5
  SHA512:
6
- metadata.gz: 84b277d911fd0103184538b61cf6e3f67c8b1b31425a0ab0ddde812c387706ebdec98408dede52f3c5f2f2018199ebbabeb6e744a8084bb9a2466e01bdbc05c6
7
- data.tar.gz: c4e63427269b2f81402a3a7929659eba7c34ea779e6adc710abace361c7d139c564aca4c2e2054c40da6f4017c070eff82b241da79fe8dc643a1bf6b1516654b
6
+ metadata.gz: 262525f75f50deab1e8d170734dd2232b82a3399637cf2db93b576c62a8b67755828f2998defc40c9b678e3399ffca9f979cf571cc1c209118f2036735fe6f4b
7
+ data.tar.gz: 4d1e8e4ec37ec95741deed0855625d7833df394315e2896dc592ec54e4af4a19674273e7dbaabea5b1dd035c1561182fed1b3a8b12812574558aca815df679ae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (46.2.0)
4
+ seatsio (46.3.0)
5
5
  rest-client (~> 2.0, >= 2.0.2)
6
6
 
7
7
  GEM
@@ -46,14 +46,26 @@ module Seatsio
46
46
 
47
47
  attr_reader :for_sale, :objects, :area_places, :categories
48
48
 
49
- def initialize(data)
49
+ def initialize(for_sale, objects = nil, area_places = nil, categories = nil)
50
+ @for_sale = for_sale
51
+ @objects = objects
52
+ @area_places = area_places
53
+ @categories = categories
54
+ end
55
+
56
+ def self.from_json(data)
50
57
  if data
51
- @for_sale = data['forSale']
52
- @objects = data['objects']
53
- @area_places = data['areaPlaces']
54
- @categories = data['categories']
58
+ ForSaleConfig.new(data['forSale'], data['objects'], data['areaPlaces'], data['categories'])
55
59
  end
56
60
  end
61
+
62
+ def == (other)
63
+ other != nil &&
64
+ for_sale == other.for_sale &&
65
+ objects == other.objects &&
66
+ area_places == other.area_places &&
67
+ categories == other.categories
68
+ end
57
69
  end
58
70
 
59
71
  class Category
@@ -160,7 +172,7 @@ module Seatsio
160
172
  @date = Date.iso8601(data['date']) if data['date']
161
173
  @supports_best_available = data['supportsBestAvailable']
162
174
  @table_booking_config = TableBookingConfig::from_json(data['tableBookingConfig'])
163
- @for_sale_config = ForSaleConfig.new(data['forSaleConfig']) if data['forSaleConfig']
175
+ @for_sale_config = ForSaleConfig::from_json(data['forSaleConfig']) if data['forSaleConfig']
164
176
  @created_on = parse_date(data['createdOn'])
165
177
  @updated_on = parse_date(data['updatedOn'])
166
178
  @channels = data['channels'].map {
@@ -18,8 +18,8 @@ module Seatsio
18
18
  @channels = ChannelsClient.new(@http_client)
19
19
  end
20
20
 
21
- def create(chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil, channels: nil)
22
- payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: channels, is_in_the_past: nil)
21
+ def create(chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil, channels: nil, for_sale_config: nil)
22
+ payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: channels, is_in_the_past: nil, for_sale_config: for_sale_config)
23
23
  response = @http_client.post("events", payload)
24
24
  Event.new(response)
25
25
  end
@@ -159,7 +159,7 @@ module Seatsio
159
159
  payload
160
160
  end
161
161
 
162
- def build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: nil, is_in_the_past: nil)
162
+ def build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: nil, is_in_the_past: nil, for_sale_config: nil)
163
163
  result = {}
164
164
  result["chartKey"] = chart_key if chart_key
165
165
  result["eventKey"] = event_key if event_key
@@ -170,6 +170,7 @@ module Seatsio
170
170
  result["categories"] = categories_to_request(categories) if categories != nil
171
171
  result["channels"] = ChannelsClient::channels_to_request(channels) if channels != nil
172
172
  result["isInThePast"] = is_in_the_past if is_in_the_past != nil
173
+ result["forSaleConfig"] = for_sale_config_to_request(for_sale_config) if for_sale_config != nil
173
174
  result
174
175
  end
175
176
 
@@ -191,6 +192,7 @@ module Seatsio
191
192
  r["objectCategories"] = param[:object_categories] if param[:object_categories] != nil
192
193
  r["categories"] = categories_to_request(param[:categories]) if param[:categories] != nil
193
194
  r["channels"] = ChannelsClient::channels_to_request(param[:channels]) if param[:channels] != nil
195
+ r["forSaleConfig"] = for_sale_config_to_request(param[:for_sale_config]) if param[:for_sale_config] != nil
194
196
  result.push(r)
195
197
  end
196
198
  result
@@ -216,5 +218,14 @@ module Seatsio
216
218
  result
217
219
  end
218
220
 
221
+ def for_sale_config_to_request(for_sale_config)
222
+ result = {}
223
+ result["forSale"] = for_sale_config.for_sale
224
+ result["objects"] = for_sale_config.objects if for_sale_config.objects != nil
225
+ result["areaPlaces"] = for_sale_config.area_places if for_sale_config.area_places != nil
226
+ result["categories"] = for_sale_config.categories if for_sale_config.categories != nil
227
+ result
228
+ end
229
+
219
230
  end
220
231
  end
@@ -14,8 +14,8 @@ module Seatsio
14
14
  end
15
15
 
16
16
  def create(chart_key:, key: nil, number_of_events: nil, event_keys: nil,
17
- table_booking_config: nil, channels: nil)
18
- request = build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels)
17
+ table_booking_config: nil, channels: nil, for_sale_config: nil)
18
+ request = build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels, for_sale_config)
19
19
  response = @http_client.post('seasons', request)
20
20
  Season.new(response)
21
21
  end
@@ -54,7 +54,7 @@ module Seatsio
54
54
 
55
55
  private
56
56
 
57
- def build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels)
57
+ def build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels, for_sale_config)
58
58
  request = {}
59
59
  request['chartKey'] = chart_key if chart_key
60
60
  request['key'] = key if key
@@ -62,6 +62,7 @@ module Seatsio
62
62
  request['eventKeys'] = event_keys if event_keys
63
63
  request['tableBookingConfig'] = table_booking_config_to_request(table_booking_config) if table_booking_config != nil
64
64
  request['channels'] = ChannelsClient::channels_to_request(channels) if channels != nil
65
+ request['forSaleConfig'] = for_sale_config_to_request(for_sale_config) if for_sale_config != nil
65
66
  request
66
67
  end
67
68
 
@@ -72,5 +73,14 @@ module Seatsio
72
73
  request
73
74
  end
74
75
 
76
+ def for_sale_config_to_request(for_sale_config)
77
+ result = {}
78
+ result["forSale"] = for_sale_config.for_sale
79
+ result["objects"] = for_sale_config.objects if for_sale_config.objects != nil
80
+ result["areaPlaces"] = for_sale_config.area_places if for_sale_config.area_places != nil
81
+ result["categories"] = for_sale_config.categories if for_sale_config.categories != nil
82
+ result
83
+ end
84
+
75
85
  end
76
86
  end
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "46.2.0"
2
+ VERSION = "46.3.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: 46.2.0
4
+ version: 46.3.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: 2023-10-05 00:00:00.000000000 Z
11
+ date: 2023-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client