seatsio 38.0.0 → 40.1.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: f3e4409411cb73aa535359e45d2fd273be5f22ea573700504083760d9f62367f
4
- data.tar.gz: c72a6ab7a5dc1ef2c5a036077f8ac7d4a9bcdeba9eb1ed2c541010358c68b214
3
+ metadata.gz: 4b8822f5a0c8488e65a7291c414a1425fbb3d499bf77a4621c43dc46a11afd8b
4
+ data.tar.gz: a79e55c7a602c061cdc39ac05bcc3c73e5e6497d4c3af76327c98b55ae041905
5
5
  SHA512:
6
- metadata.gz: '049fda47eb204dabf25624ed3695d955f824d3463d9e43fbbc82b5ff7fe2919167885d9eb373fd0af82c8ce9aba65afbdb2248cc504e18411ae0a757000bbf3b'
7
- data.tar.gz: 40b02cba281f9a763da24c3d505cb42cd094a0a488e13889523556cb0e21e581e3bac860285a2149049712201a56b4aa8e145107427d28b121621874f3f86bc8
6
+ metadata.gz: 3db73b2ababeefb303f173e20fcabf96e97b025c6a6d773229a1e194ab7c5885a27aeef84fa667b9dafc1d7b3a0f438f0b0b03091eb2b55dccc22b468066792e
7
+ data.tar.gz: b98d89bea756c377f98ec4857a1a980359a19bdb6d65cfd99fdf534006090588814a4eb35e5ee8690342e929ab2875a8cf55173eb8958db6606e9cf27ca98e10
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (38.0.0)
4
+ seatsio (40.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,48 @@
1
+ module Seatsio
2
+
3
+ class ChannelsClient
4
+ def initialize(http_client)
5
+ @http_client = http_client
6
+ end
7
+
8
+ def add(event_key:, channel_key:, channel_name:, channel_color:, index: nil, objects: nil)
9
+ payload = {
10
+ key: channel_key,
11
+ name: channel_name,
12
+ color: channel_color
13
+ }
14
+ payload['index'] = index if index != nil
15
+ payload['objects'] = objects if objects != nil
16
+ @http_client.post("events/#{event_key}/channels", payload)
17
+ end
18
+
19
+ def remove(event_key:, channel_key:)
20
+ @http_client.delete("events/#{event_key}/channels/#{channel_key}")
21
+ end
22
+
23
+ def update(event_key:, channel_key:, channel_name: nil, channel_color: nil, objects: nil)
24
+ payload = {}
25
+ payload['name'] = channel_name if channel_name != nil
26
+ payload['color'] = channel_color if channel_color != nil
27
+ payload['objects'] = objects if objects != nil
28
+ @http_client.post("events/#{event_key}/channels/#{channel_key}", payload)
29
+ end
30
+
31
+ def add_objects(event_key:, channel_key:, objects:)
32
+ @http_client.post("events/#{event_key}/channels/#{channel_key}/objects", { objects: objects })
33
+ end
34
+
35
+ def remove_objects(event_key:, channel_key:, objects:)
36
+ @http_client.delete("events/#{event_key}/channels/#{channel_key}/objects", { objects: objects })
37
+ end
38
+
39
+ def replace(key:, channels:)
40
+ @http_client.post("events/#{key}/channels/update", channels: channels)
41
+ end
42
+
43
+ def set_objects(key:, channelConfig:)
44
+ @http_client.post("events/#{key}/channels/assign-objects", channelConfig: channelConfig)
45
+ end
46
+
47
+ end
48
+ end
@@ -315,7 +315,7 @@ module Seatsio
315
315
  class ChartObjectInfo
316
316
 
317
317
  attr_reader :label, :labels, :ids, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
318
- :left_neighbour, :right_neighbour, :book_as_a_whole, :distance_to_focal_point
318
+ :left_neighbour, :right_neighbour, :book_as_a_whole, :distance_to_focal_point, :num_seats
319
319
 
320
320
  def initialize(data)
321
321
  @label = data['label']
@@ -331,6 +331,7 @@ module Seatsio
331
331
  @right_neighbour = data['rightNeighbour']
332
332
  @book_as_a_whole = data['bookAsAWhole']
333
333
  @distance_to_focal_point = data['distanceToFocalPoint']
334
+ @num_seats = data['numSeats']
334
335
  end
335
336
  end
336
337
 
@@ -386,7 +387,7 @@ module Seatsio
386
387
  :ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
387
388
  :is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
388
389
  :left_neighbour, :right_neighbour, :is_available, :is_disabled_by_social_distancing, :channel,
389
- :book_as_a_whole, :distance_to_focal_point, :holds
390
+ :book_as_a_whole, :distance_to_focal_point, :holds, :num_seats
390
391
 
391
392
  def initialize(data)
392
393
  @status = data['status']
@@ -419,6 +420,7 @@ module Seatsio
419
420
  @book_as_a_whole = data['bookAsAWhole']
420
421
  @distance_to_focal_point = data['distanceToFocalPoint']
421
422
  @holds = data['holds']
423
+ @num_seats = data['numSeats']
422
424
  end
423
425
  end
424
426
 
@@ -476,16 +478,12 @@ module Seatsio
476
478
 
477
479
  class UsageByEvent
478
480
 
479
- attr_reader :event, :num_used_objects, :num_first_bookings, :num_first_bookings_or_selections,
480
- :num_ga_selections_without_booking, :num_non_ga_selections_without_booking, :num_object_selections
481
+ attr_reader :event, :num_used_objects, :num_first_bookings, :num_object_selections
481
482
 
482
483
  def initialize(data)
483
484
  @event = UsageEvent.new(data['event'])
484
485
  @num_used_objects = data['numUsedObjects']
485
486
  @num_first_bookings = data['numFirstBookings']
486
- @num_first_bookings_or_selections = data['numFirstBookingsOrSelections']
487
- @num_ga_selections_without_booking = data['numGASelectionsWithoutBooking']
488
- @num_non_ga_selections_without_booking = data['numNonGASelectionsWithoutBooking']
489
487
  @num_object_selections = data['numObjectSelections']
490
488
  end
491
489
  end
@@ -6,12 +6,16 @@ require "json"
6
6
  require "cgi"
7
7
  require "seatsio/events/change_object_status_request"
8
8
  require "seatsio/events/change_best_available_object_status_request"
9
+ require 'seatsio/channels'
9
10
 
10
11
  module Seatsio
11
12
 
12
13
  class EventsClient
14
+ attr_reader :channels
15
+
13
16
  def initialize(http_client)
14
17
  @http_client = http_client
18
+ @channels = ChannelsClient.new(@http_client)
15
19
  end
16
20
 
17
21
  def create(chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil)
@@ -142,14 +146,6 @@ module Seatsio
142
146
  @http_client.post("events/#{key}/actions/mark-as-for-sale", request)
143
147
  end
144
148
 
145
- def update_channels(key:, channels:)
146
- @http_client.post("events/#{key}/channels/update", channels: channels)
147
- end
148
-
149
- def assign_objects_to_channels(key:, channelConfig:)
150
- @http_client.post("events/#{key}/channels/assign-objects", channelConfig: channelConfig)
151
- end
152
-
153
149
  private
154
150
 
155
151
  def build_parameters_for_mark_as_sale(objects: nil, categories: nil)
@@ -33,7 +33,7 @@ module Seatsio
33
33
 
34
34
  request_options = { method: args[0], url: url, headers: headers }
35
35
 
36
- if args[0] == :post
36
+ if args[0] == :post || args[0] == :delete
37
37
  args[2].delete :params
38
38
  request_options[:payload] = args[2].to_json
39
39
  end
@@ -90,8 +90,8 @@ module Seatsio
90
90
  execute(:post, endpoint, payload)
91
91
  end
92
92
 
93
- def delete(endpoint)
94
- execute(:delete, endpoint, {})
93
+ def delete(endpoint, payload = {})
94
+ execute(:delete, endpoint, payload)
95
95
  end
96
96
  end
97
97
  end
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "38.0.0"
2
+ VERSION = "40.1.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: 38.0.0
4
+ version: 40.1.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-05-19 00:00:00.000000000 Z
11
+ date: 2022-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,6 +112,7 @@ files:
112
112
  - bin/console
113
113
  - bin/setup
114
114
  - lib/seatsio.rb
115
+ - lib/seatsio/channels.rb
115
116
  - lib/seatsio/chart_reports.rb
116
117
  - lib/seatsio/charts.rb
117
118
  - lib/seatsio/domain.rb