seatsio 23.5.0 → 24.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2254dd4abeb112be5744f19d3f8d1a875e7098fdecf501b262f023bdaa39fb5
4
- data.tar.gz: b5341306eb8839e3624daeb575538c72daf6290dac722b21b316d4775b70d013
3
+ metadata.gz: 53c3ee30f3c5a645448e922e9fcfb56b90041dc48464a1b5de45db98812f7bfd
4
+ data.tar.gz: 71ca858c39aa10fb370719cda29983ed4b0101f07bca4528e2e75c3568576d37
5
5
  SHA512:
6
- metadata.gz: 4fc8fb88495ce2847ab7a9bd9de49f5019da150610686169df63815c8d4c0dc8e8fa78acdcea6c253c8e29d798909d14de2fd0c7c684ccd7b909090deca0839b
7
- data.tar.gz: e6df23762ef7a88016f716258c197d4702dfb9a24c365ce784bf5cb8e5457fa40c2a8d6c215da8f01ce884ddd2c08bb65fc7c180c63f6c4a9caece126c79903d
6
+ metadata.gz: 9ca3ccfbcbc3290655b480754e35160be6544b30afee311b6e1bfd03ebc7197d566b7c69cc0c5b288fe3796eaa77bc4f20994d92c457fb5b5f0a6871f1bb6c48
7
+ data.tar.gz: 646d64536ed75b69b0bd48a345e9d7f742891dca0b452e114919c704d0eb0460162c3adbc0e86010f92a633f79a6a04c862810d71b414822f22309acc8f249ee
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (23.5.0)
4
+ seatsio (24.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -47,4 +47,4 @@ DEPENDENCIES
47
47
  webmock (~> 3.4, >= 3.4.2)
48
48
 
49
49
  BUNDLED WITH
50
- 1.16.1
50
+ 1.17.2
data/README.md CHANGED
@@ -14,7 +14,7 @@ seatsio-ruby follows semver since v23.3.0.
14
14
 
15
15
  ```ruby
16
16
  require('seatsio')
17
- client = Seatsio::Client.new("my-secret-key") # can be found on https://app.seats.io/settings
17
+ client = Seatsio::Client.new("my-workspace-secret-key") # can be found on https://app.seats.io/workspace-settings
18
18
  chart = client.charts.create
19
19
  event = client.events.create key: chart.key
20
20
  ```
@@ -23,7 +23,7 @@ event = client.events.create key: chart.key
23
23
 
24
24
  ```ruby
25
25
  require('seatsio')
26
- client = Seatsio::Client.new("my-secret-key")
26
+ client = Seatsio::Client.new("my-workspace-secret-key")
27
27
  client.events.book(event.key, ["A-1", "A-2"])
28
28
  ```
29
29
 
@@ -31,7 +31,7 @@ client.events.book(event.key, ["A-1", "A-2"])
31
31
 
32
32
  ```ruby
33
33
  require('seatsio')
34
- client = Seatsio::Client.new("my-secret-key")
34
+ client = Seatsio::Client.new("my-workspace-secret-key")
35
35
  client.events.release(event.key, ["A-1", "A-2"])
36
36
  ```
37
37
 
@@ -39,7 +39,7 @@ client.events.release(event.key, ["A-1", "A-2"])
39
39
 
40
40
  ```ruby
41
41
  require('seatsio')
42
- client = Seatsio::Client.new("my-secret-key")
42
+ client = Seatsio::Client.new("my-workspace-secret-key")
43
43
  client.events.book(event.key, ["A-1", "A-2"], "a-hold-token")
44
44
  ```
45
45
 
@@ -47,7 +47,7 @@ client.events.book(event.key, ["A-1", "A-2"], "a-hold-token")
47
47
 
48
48
  ```ruby
49
49
  require('seatsio')
50
- client = Seatsio::Client.new("my-secret-key")
50
+ client = Seatsio::Client.new("my-workspace-secret-key")
51
51
  client.events.change_object_status("<EVENT KEY>", ["A-1", "A-2"], "my-custom-status")
52
52
  ```
53
53
 
@@ -55,7 +55,7 @@ client.events.change_object_status("", ["A-1", "A-2"], "my-custom-sta
55
55
 
56
56
  ```ruby
57
57
  require('seatsio')
58
- client = Seatsio::Client.new("my-secret-key")
58
+ client = Seatsio::Client.new("my-workspace-secret-key")
59
59
  charts = client.charts.list
60
60
  charts.each do |chart|
61
61
  puts chart.key
data/Rakefile CHANGED
@@ -8,4 +8,11 @@ Rake::TestTask.new(:test) do |t|
8
8
  t.warning = false
9
9
  end
10
10
 
11
+ Rake::TestTask.new(:singletest) do |t|
12
+ t.libs << "test"
13
+ t.libs << "lib"
14
+ t.test_files = FileList["test/**/update_channels_test.rb", "test/**/assign_objects_to_channels_test.rb"]
15
+ t.warning = false
16
+ end
17
+
11
18
  task :default => :test
@@ -69,13 +69,11 @@ module Seatsio
69
69
  end
70
70
 
71
71
  def retrieve_published_version(key)
72
- response = @http_client.get("charts/#{key}/version/published")
73
- Domain::Chart.new(response)
72
+ @http_client.get("charts/#{key}/version/published")
74
73
  end
75
74
 
76
75
  def retrieve_draft_version(key)
77
- response = @http_client.get("charts/#{key}/version/draft")
78
- Domain::ChartDraft.new(response)
76
+ @http_client.get("charts/#{key}/version/draft")
79
77
  end
80
78
 
81
79
  def retrieve_draft_version_thumbnail(key)
@@ -94,6 +92,11 @@ module Seatsio
94
92
  @http_client.post("charts/#{chart_key}/version/draft/actions/publish")
95
93
  end
96
94
 
95
+ def save_social_distancing_rulesets(chart_key, rulesets)
96
+ payload = {"socialDistancingRulesets": rulesets}
97
+ @http_client.post("charts/#{chart_key}/social-distancing-rulesets", payload)
98
+ end
99
+
97
100
  def list(chart_filter: nil, tag: nil, expand_events: nil, with_validation: false)
98
101
  cursor = Pagination::Cursor.new(Domain::Chart, 'charts', @http_client)
99
102
  cursor.set_query_param('filter', chart_filter)
@@ -4,25 +4,11 @@ module Seatsio::Domain
4
4
 
5
5
  module_function
6
6
 
7
- class ChartCategories
8
- attr_accessor :list, :max_category_key
9
-
10
- def initialize(data)
11
- if data
12
- @list = data['list']
13
- @max_category_key = data['maxCategoryKey']
14
- else
15
- @list = []
16
- @max_category_key = ''
17
- end
18
- end
19
- end
20
-
21
7
  class Chart
22
8
 
23
9
  attr_reader :id, :key, :status, :name, :published_version_thumbnail_url,
24
- :draft_version_thumbnail_url, :events, :tags, :archived, :venue_type,
25
- :categories, :validation
10
+ :draft_version_thumbnail_url, :events, :tags, :archived,
11
+ :categories, :validation, :social_distancing_rulesets
26
12
 
27
13
  def initialize(data)
28
14
  @id = data['id']
@@ -34,9 +20,12 @@ module Seatsio::Domain
34
20
  @events = Event.create_list(data['events']) if data['events']
35
21
  @tags = data['tags']
36
22
  @archived = data['archived']
37
- @venue_type = data['venueType']
38
- @categories = ChartCategories.new(data['categories'])
39
23
  @validation = data['validation']
24
+ @social_distancing_rulesets = data['socialDistancingRulesets'].map {
25
+ |key, r| [key, SocialDistancingRuleset.new(r['name'], r['numberOfDisabledSeatsToTheSides'], r['disableSeatsInFrontAndBehind'],
26
+ r['numberOfDisabledAisleSeats'], r['maxGroupSize'],
27
+ r['disabledSeats'], r['enabledSeats'], r['index'])]
28
+ }.to_h
40
29
  end
41
30
  end
42
31
 
@@ -71,10 +60,32 @@ module Seatsio::Domain
71
60
  end
72
61
  end
73
62
 
63
+ class Channel
64
+ attr_reader :key, :name, :color, :index, :objects
65
+
66
+ def initialize(key, name, color, index, objects)
67
+ @key = key
68
+ @name = name
69
+ @color = color
70
+ @index = index
71
+ @objects = objects
72
+ end
73
+
74
+ def == (other)
75
+ self.key == other.key &&
76
+ self.name == other.name &&
77
+ self.color == other.color &&
78
+ self.index == other.index &&
79
+ self.objects == other.objects
80
+ end
81
+
82
+ end
83
+
74
84
  class Event
75
85
 
76
86
  attr_accessor :id, :key, :chart_key, :book_whole_tables, :supports_best_available,
77
- :table_booking_modes, :for_sale_config, :created_on, :updated_on
87
+ :table_booking_modes, :for_sale_config, :created_on, :updated_on, :channels,
88
+ :social_distancing_ruleset_key
78
89
 
79
90
  def initialize(data)
80
91
  @id = data['id']
@@ -86,6 +97,10 @@ module Seatsio::Domain
86
97
  @for_sale_config = ForSaleConfig.new(data['forSaleConfig']) if data['forSaleConfig']
87
98
  @created_on = parse_date(data['createdOn'])
88
99
  @updated_on = parse_date(data['updatedOn'])
100
+ @channels = data['channels'].map {
101
+ |d| Channel.new(d['key'], d['name'], d['color'], d['index'], d['objects'])
102
+ } if data['channels']
103
+ @social_distancing_ruleset_key = data['socialDistancingRulesetKey']
89
104
  end
90
105
 
91
106
  def self.create_list(list = [])
@@ -132,7 +147,7 @@ module Seatsio::Domain
132
147
  end
133
148
 
134
149
  class Workspace
135
- attr_reader :id, :name, :key, :secret_key, :is_test
150
+ attr_reader :id, :name, :key, :secret_key, :is_test, :is_active
136
151
 
137
152
  def initialize(data)
138
153
  @id = data['id']
@@ -140,6 +155,7 @@ module Seatsio::Domain
140
155
  @key = data['key']
141
156
  @secret_key = data['secretKey']
142
157
  @is_test = data['isTest']
158
+ @is_active = data['isActive']
143
159
  end
144
160
  end
145
161
 
@@ -205,7 +221,8 @@ module Seatsio::Domain
205
221
 
206
222
  class ChartReportItem
207
223
 
208
- attr_reader :label, :labels, :category_key, :category_label, :section, :entrance, :capacity, :object_type
224
+ attr_reader :label, :labels, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
225
+ :left_neighbour, :right_neighbour
209
226
 
210
227
  def initialize(data)
211
228
  @label = data['label']
@@ -216,6 +233,8 @@ module Seatsio::Domain
216
233
  @entrance = data['entrance']
217
234
  @capacity = data['capacity']
218
235
  @object_type = data['objectType']
236
+ @left_neighbour = data['leftNeighbour']
237
+ @right_neighbour = data['rightNeighbour']
219
238
  end
220
239
  end
221
240
 
@@ -265,7 +284,8 @@ module Seatsio::Domain
265
284
  attr_reader :labels, :label, :order_id, :extra_data, :capacity, :status,
266
285
  :category_key, :entrance, :object_type, :hold_token, :category_label,
267
286
  :ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
268
- :is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type
287
+ :is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
288
+ :left_neighbour, :right_neighbour, :is_selectable, :is_disabled_by_social_distancing
269
289
 
270
290
  def initialize(data)
271
291
  @status = data['status']
@@ -289,6 +309,10 @@ module Seatsio::Domain
289
309
  @is_companion_seat = data['isCompanionSeat']
290
310
  @has_restricted_view = data['hasRestrictedView']
291
311
  @displayed_object_type = data['displayedObjectType']
312
+ @left_neighbour = data['leftNeighbour']
313
+ @right_neighbour = data['rightNeighbour']
314
+ @is_selectable = data['isSelectable']
315
+ @is_disabled_by_social_distancing = data['isDisabledBySocialDistancing']
292
316
  end
293
317
  end
294
318
 
@@ -446,4 +470,33 @@ module Seatsio::Domain
446
470
  object_details
447
471
  end
448
472
 
473
+ class SocialDistancingRuleset
474
+ attr_reader :name, :number_of_disabled_seats_to_the_sides, :disable_seats_in_front_and_behind,
475
+ :number_of_disabled_aisle_seats, :max_group_size, :disabled_seats, :enabled_seats, :index
476
+
477
+ def initialize(name, number_of_disabled_seats_to_the_sides = 0, disable_seats_in_front_and_behind = false, number_of_disabled_aisle_seats = 0,
478
+ max_group_size = 0, disabled_seats = [], enabled_seats = [], index = 0)
479
+ @name = name
480
+ @number_of_disabled_seats_to_the_sides = number_of_disabled_seats_to_the_sides
481
+ @disable_seats_in_front_and_behind = disable_seats_in_front_and_behind
482
+ @number_of_disabled_aisle_seats = number_of_disabled_aisle_seats
483
+ @max_group_size = max_group_size
484
+ @disabled_seats = disabled_seats
485
+ @enabled_seats = enabled_seats
486
+ @index = index
487
+ end
488
+
489
+ def == (other)
490
+ self.name == other.name &&
491
+ self.number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
492
+ self.disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
493
+ self.number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
494
+ self.max_group_size == other.max_group_size &&
495
+ self.disabled_seats == other.disabled_seats &&
496
+ self.enabled_seats == other.enabled_seats &&
497
+ self.index == other.index
498
+ end
499
+
500
+ end
501
+
449
502
  end
@@ -27,6 +27,10 @@ module Seatsio
27
27
  fetch_summary_report('bySection', event_key)
28
28
  end
29
29
 
30
+ def summary_by_selectability(event_key)
31
+ fetch_summary_report('bySelectability', event_key)
32
+ end
33
+
30
34
  def by_label(event_key, label = nil)
31
35
  fetch_report('byLabel', event_key, label)
32
36
  end
@@ -51,6 +55,10 @@ module Seatsio
51
55
  fetch_report('bySection', event_key, section)
52
56
  end
53
57
 
58
+ def by_selectability(event_key, selectability = nil)
59
+ fetch_report('bySelectability', event_key, selectability)
60
+ end
61
+
54
62
  private
55
63
 
56
64
  def fetch_summary_report(report_type, event_key)
@@ -15,8 +15,9 @@ module Seatsio
15
15
  @http_client = ::Seatsio::HttpClient.new(secret_key, workspace_key, base_url)
16
16
  end
17
17
 
18
- def create(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil)
19
- payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables, table_booking_modes: table_booking_modes)
18
+ def create(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil, social_distancing_ruleset_key: nil)
19
+ payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables,
20
+ table_booking_modes: table_booking_modes, social_distancing_ruleset_key: social_distancing_ruleset_key)
20
21
  response = @http_client.post("events", payload)
21
22
  Domain::Event.new(response)
22
23
  end
@@ -27,8 +28,9 @@ module Seatsio
27
28
  Domain::Events.new(response).events
28
29
  end
29
30
 
30
- def update(key:, chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil)
31
- payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables, table_booking_modes: table_booking_modes)
31
+ def update(key:, chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil, social_distancing_ruleset_key: nil)
32
+ payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables,
33
+ table_booking_modes: table_booking_modes, social_distancing_ruleset_key: social_distancing_ruleset_key)
32
34
  @http_client.post("/events/#{key}", payload)
33
35
  end
34
36
 
@@ -136,6 +138,14 @@ module Seatsio
136
138
  @http_client.post("events/#{key}/actions/mark-as-for-sale", request)
137
139
  end
138
140
 
141
+ def update_channels(key:, channels:)
142
+ @http_client.post("events/#{key}/channels/update", channels: channels)
143
+ end
144
+
145
+ def assign_objects_to_channels(key:, channelConfig:)
146
+ @http_client.post("events/#{key}/channels/assign-objects", channelConfig: channelConfig)
147
+ end
148
+
139
149
  private
140
150
 
141
151
  def build_parameters_for_mark_as_sale(objects: nil, categories: nil)
@@ -151,12 +161,13 @@ module Seatsio
151
161
  payload
152
162
  end
153
163
 
154
- def build_event_request(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil)
164
+ def build_event_request(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil, social_distancing_ruleset_key: nil)
155
165
  result = {}
156
166
  result["chartKey"] = chart_key if chart_key
157
167
  result["eventKey"] = event_key if event_key
158
168
  result["bookWholeTables"] = book_whole_tables if book_whole_tables != nil
159
169
  result["tableBookingModes"] = table_booking_modes if table_booking_modes != nil
170
+ result["socialDistancingRulesetKey"] = social_distancing_ruleset_key if social_distancing_ruleset_key != nil
160
171
  result
161
172
  end
162
173
 
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "23.5.0"
2
+ VERSION = "24.2.0"
3
3
  end
@@ -32,6 +32,14 @@ module Seatsio
32
32
  response['secretKey']
33
33
  end
34
34
 
35
+ def activate(key:)
36
+ @http_client.post("workspaces/#{key}/actions/activate")
37
+ end
38
+
39
+ def deactivate(key:)
40
+ @http_client.post("workspaces/#{key}/actions/deactivate")
41
+ end
42
+
35
43
  def list(filter: nil)
36
44
  extended_cursor = cursor
37
45
  extended_cursor.set_query_param('filter', filter)
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: 23.5.0
4
+ version: 24.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: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2020-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler