seatsio 48.6.0 → 48.7.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: 2ad6744eebd12843ba7e3f5788e336b553a7dc0162bd2b25df1d1846fbc46301
4
- data.tar.gz: 074a220d42dd764b2e133d3094a2b7de85655500096f309695a75840b4040bcb
3
+ metadata.gz: 44c226c772bca0a0c6087ad8860cec799ecdb45103259352d70748b75527d985
4
+ data.tar.gz: 865f4fd84a6bd9981ce0115db2d0680ae5e0cdaa72a845c9c0fb5d862dc9e7f4
5
5
  SHA512:
6
- metadata.gz: ed90ab7bfe4874e03dbe0cdb2033912f2b370d3a35ec7ed6b0aa8fd3f1c9b4dbd6cf1ad7b21e159eb2e384cc3745b052990208c509e4ed380b9b4fe9c8cdb2b6
7
- data.tar.gz: 8a0cc2f188c343a34f16e9ff3d6c52359f993c1786615823dacd8270f7a2667b85f1c8979d00e80bfd8322c58661b8806ce8950b339f60b6303eda1a1f4f2475
6
+ metadata.gz: 7d4266b4a4267f1101e77dc780be168bf7cb353ac8f681292540b0926382c69b3f3370939cd7f11e08754e61be57c49549ed5dc1d7d1e8e72d1159a134b84825
7
+ data.tar.gz: ae7e73608e0ad48ba6235667fc72173554e91835eb35323895720085d5573027a79353f0aa8abbe0ed9c71b05e6f01d7b47e98ad3c3073101e194066d7a77fbc
@@ -23,6 +23,6 @@ jobs:
23
23
  - uses: zcong1993/setup-timezone@master
24
24
  with:
25
25
  timezone: Europe/Brussels
26
- - run: bundle exec rake
26
+ - run: bundle exec parallel_test
27
27
  env:
28
28
  DEMO_COMPANY_SECRET_KEY: ${{ secrets.DEMO_COMPANY_SECRET_KEY }}
data/Gemfile.lock CHANGED
@@ -1,44 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (48.6.0)
4
+ seatsio (48.7.0)
5
5
  rest-client (~> 2.0, >= 2.0.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.8.6)
11
- public_suffix (>= 2.0.2, < 6.0)
10
+ addressable (2.8.7)
11
+ public_suffix (>= 2.0.2, < 7.0)
12
12
  bigdecimal (3.1.8)
13
13
  crack (1.0.0)
14
14
  bigdecimal
15
15
  rexml
16
- domain_name (0.5.20190701)
17
- unf (>= 0.0.5, < 1.0.0)
16
+ domain_name (0.6.20240107)
18
17
  hashdiff (1.1.0)
19
18
  http-accept (1.7.0)
20
- http-cookie (1.0.3)
19
+ http-cookie (1.0.6)
21
20
  domain_name (~> 0.5)
22
- mime-types (3.3.1)
21
+ mime-types (3.5.2)
23
22
  mime-types-data (~> 3.2015)
24
- mime-types-data (3.2021.0225)
25
- minitest (5.23.1)
26
- minitest-parallel_fork (2.0.0)
27
- minitest (>= 5.15.0)
23
+ mime-types-data (3.2024.0702)
24
+ minitest (5.24.1)
28
25
  netrc (0.11.0)
29
- public_suffix (5.0.5)
26
+ parallel (1.25.1)
27
+ parallel_tests (4.7.1)
28
+ parallel
29
+ public_suffix (6.0.0)
30
30
  rake (13.2.1)
31
31
  rest-client (2.1.0)
32
32
  http-accept (>= 1.7.0, < 2.0)
33
33
  http-cookie (>= 1.0.2, < 2.0)
34
34
  mime-types (>= 1.16, < 4.0)
35
35
  netrc (~> 0.8)
36
- rexml (3.2.8)
37
- strscan (>= 3.0.9)
36
+ rexml (3.3.1)
37
+ strscan
38
38
  strscan (3.1.0)
39
- unf (0.1.4)
40
- unf_ext
41
- unf_ext (0.0.7.7)
42
39
  webmock (3.23.1)
43
40
  addressable (>= 2.8.0)
44
41
  crack (>= 0.3.2)
@@ -50,10 +47,10 @@ PLATFORMS
50
47
  DEPENDENCIES
51
48
  bundler (~> 2.2)
52
49
  minitest (~> 5.0)
53
- minitest-parallel_fork (~> 2.0)
50
+ parallel_tests (~> 4.7.1)
54
51
  rake (~> 13.0)
55
52
  seatsio!
56
53
  webmock (~> 3.4, >= 3.4.2)
57
54
 
58
55
  BUNDLED WITH
59
- 2.1.4
56
+ 2.5.3
@@ -47,6 +47,14 @@ module Seatsio
47
47
  fetch_summary_report('bySection', event_key, book_whole_tables, version)
48
48
  end
49
49
 
50
+ def by_zone(chart_key, book_whole_tables = nil, version = nil)
51
+ fetch_chart_report('byZone', chart_key, book_whole_tables, version)
52
+ end
53
+
54
+ def summary_by_zone(event_key, book_whole_tables = nil, version = nil)
55
+ fetch_summary_report('byZone', event_key, book_whole_tables, version)
56
+ end
57
+
50
58
  private
51
59
 
52
60
  def fetch_chart_report(report_type, chart_key, book_whole_tables, version)
@@ -113,17 +113,38 @@ module Seatsio
113
113
  @http_client.post("charts/#{chart_key}/version/draft/actions/publish")
114
114
  end
115
115
 
116
- def list(chart_filter: nil, tag: nil, expand_events: nil, with_validation: false)
116
+ def list(chart_filter: nil, tag: nil, expand_events: false, expand_validation: false, expand_venue_type: false, expand_zones: false)
117
117
  cursor = Pagination::Cursor.new(Chart, 'charts', @http_client)
118
118
  cursor.set_query_param('filter', chart_filter)
119
119
  cursor.set_query_param('tag', tag)
120
120
 
121
- cursor.set_query_param('expand', 'events') if expand_events
122
- cursor.set_query_param('validation', with_validation) if with_validation
123
-
121
+ expand_params = list_expand_params(expand_events, expand_validation, expand_venue_type, expand_zones)
122
+ cursor.set_query_param('expand', expand_params) unless expand_params.empty?
124
123
  cursor
125
124
  end
126
125
 
126
+ def list_expand_params(expand_events, expand_validation, expand_venue_type, expand_zones)
127
+ result = []
128
+
129
+ if expand_events
130
+ result.push('events')
131
+ end
132
+
133
+ if expand_validation
134
+ result.push('validation')
135
+ end
136
+
137
+ if expand_venue_type
138
+ result.push('venueType')
139
+ end
140
+
141
+ if expand_zones
142
+ result.push('zones')
143
+ end
144
+
145
+ result
146
+ end
147
+
127
148
  def list_all_tags
128
149
  response = @http_client.get('charts/tags')
129
150
  response['tags']
@@ -8,7 +8,7 @@ module Seatsio
8
8
 
9
9
  attr_reader :id, :key, :status, :name, :published_version_thumbnail_url,
10
10
  :draft_version_thumbnail_url, :events, :tags, :archived,
11
- :categories, :validation, :venue_type
11
+ :categories, :validation, :venue_type, :zones
12
12
 
13
13
  def initialize(data)
14
14
  @id = data['id']
@@ -22,6 +22,38 @@ module Seatsio
22
22
  @archived = data['archived']
23
23
  @validation = data['validation']
24
24
  @venue_type = data['venueType']
25
+ @zones = Zone.create_list(data['zones']) if data['zones']
26
+ end
27
+ end
28
+
29
+ class Zone
30
+
31
+ attr_reader :key, :label
32
+
33
+ def initialize(key, label)
34
+ @key = key
35
+ @label = label
36
+ end
37
+
38
+ def self.from_json(data)
39
+ if data
40
+ Zone.new(data['key'], data['label'])
41
+ end
42
+ end
43
+
44
+ def == (other)
45
+ key == other.key &&
46
+ label == other.label
47
+ end
48
+
49
+ def self.create_list(list = [])
50
+ result = []
51
+
52
+ list.each do |item|
53
+ result << Zone.from_json(item)
54
+ end
55
+
56
+ result
25
57
  end
26
58
  end
27
59
 
@@ -316,7 +348,7 @@ module Seatsio
316
348
 
317
349
  attr_reader :label, :labels, :ids, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
318
350
  :left_neighbour, :right_neighbour, :book_as_a_whole, :distance_to_focal_point, :num_seats, :is_accessible,
319
- :is_companion_seat, :has_restricted_view
351
+ :is_companion_seat, :has_restricted_view, :zone
320
352
 
321
353
  def initialize(data)
322
354
  @label = data['label']
@@ -336,6 +368,7 @@ module Seatsio
336
368
  @is_accessible = data['isAccessible']
337
369
  @is_companion_seat = data['isCompanionSeat']
338
370
  @has_restricted_view = data['hasRestrictedView']
371
+ @zone = data['zone']
339
372
  end
340
373
  end
341
374
 
@@ -392,7 +425,8 @@ module Seatsio
392
425
  :is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
393
426
  :left_neighbour, :right_neighbour, :is_available, :channel,
394
427
  :book_as_a_whole, :distance_to_focal_point, :holds, :num_seats, :variable_occupancy,
395
- :min_occupancy, :max_occupancy, :season_status_overridden_quantity, :num_not_for_sale
428
+ :min_occupancy, :max_occupancy, :season_status_overridden_quantity, :num_not_for_sale,
429
+ :zone
396
430
 
397
431
  def initialize(data)
398
432
  @status = data['status']
@@ -430,6 +464,7 @@ module Seatsio
430
464
  @max_occupancy = data['maxOccupancy']
431
465
  @season_status_overridden_quantity = data['seasonStatusOverriddenQuantity']
432
466
  @num_not_for_sale = data['numNotForSale']
467
+ @zone = data['zone']
433
468
  end
434
469
  end
435
470
 
@@ -71,6 +71,18 @@ module Seatsio
71
71
  fetch_deep_summary_report('bySection', event_key)
72
72
  end
73
73
 
74
+ def by_zone(event_key, zone = nil)
75
+ fetch_report('byZone', event_key, zone)
76
+ end
77
+
78
+ def summary_by_zone(event_key)
79
+ fetch_summary_report('byZone', event_key)
80
+ end
81
+
82
+ def deep_summary_by_zone(event_key)
83
+ fetch_deep_summary_report('byZone', event_key)
84
+ end
85
+
74
86
  def by_availability(event_key, availability = nil)
75
87
  fetch_report('byAvailability', event_key, availability)
76
88
  end
@@ -1,7 +1,8 @@
1
- def create_change_best_available_object_status_request(number, status, categories, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats)
1
+ def create_change_best_available_object_status_request(number, status, categories, zone, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats)
2
2
  result = {}
3
3
  best_available = {'number': number}
4
4
  best_available[:categories] = categories if categories != nil
5
+ best_available[:zone] = zone if zone != nil
5
6
  best_available[:extraData] = extra_data if extra_data != nil
6
7
  best_available[:ticketTypes] = ticket_types if ticket_types != nil
7
8
  best_available[:tryToPreventOrphanSeats] = try_to_prevent_orphan_seats if try_to_prevent_orphan_seats != nil
@@ -64,7 +64,7 @@ module Seatsio
64
64
 
65
65
  def retrieve_object_infos(key:, labels:)
66
66
  url = "events/#{key}/objects"
67
- query_params = URI.encode_www_form(labels.map { |label| ['label', label] })
67
+ query_params = URI.encode_www_form({ label: labels })
68
68
  response = @http_client.get(url, query_params)
69
69
  response.each do |key, value|
70
70
  response[key] = EventObjectInfo.new(value)
@@ -98,18 +98,18 @@ module Seatsio
98
98
  change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::HELD, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
99
99
  end
100
100
 
101
- def change_best_available_object_status(key, number, status, categories: nil, hold_token: nil, extra_data: nil, ticket_types: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil)
102
- request = create_change_best_available_object_status_request(number, status, categories, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats)
101
+ def change_best_available_object_status(key, number, status, categories: nil, hold_token: nil, extra_data: nil, ticket_types: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil, zone: nil)
102
+ request = create_change_best_available_object_status_request(number, status, categories, zone, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats)
103
103
  response = @http_client.post("events/#{key}/actions/change-object-status", request)
104
104
  BestAvailableObjects.new(response)
105
105
  end
106
106
 
107
- def book_best_available(key, number, categories: nil, hold_token: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil)
108
- change_best_available_object_status(key, number, Seatsio::EventObjectInfo::BOOKED, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats)
107
+ def book_best_available(key, number, categories: nil, hold_token: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil, zone: nil)
108
+ change_best_available_object_status(key, number, Seatsio::EventObjectInfo::BOOKED, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats, zone: zone)
109
109
  end
110
110
 
111
- def hold_best_available(key, number, hold_token, categories: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil)
112
- change_best_available_object_status(key, number, Seatsio::EventObjectInfo::HELD, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats)
111
+ def hold_best_available(key, number, hold_token, categories: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil, zone: nil)
112
+ change_best_available_object_status(key, number, Seatsio::EventObjectInfo::HELD, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats, zone: zone)
113
113
  end
114
114
 
115
115
  def release(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
@@ -73,7 +73,7 @@ module Seatsio
73
73
  end
74
74
 
75
75
  def fetch_next_page
76
- response = @http_client.get(@endpoint, @params)
76
+ response = @http_client.get(@endpoint, URI.encode_www_form(@params))
77
77
 
78
78
  if response.nil? || response['items'].empty?
79
79
  @last_response_empty = true
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "48.6.0"
2
+ VERSION = "48.7.0"
3
3
  end
data/seatsio.gemspec CHANGED
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "rake", "~> 13.0"
27
27
  spec.add_development_dependency "minitest", "~> 5.0"
28
28
  spec.add_development_dependency 'webmock', '~> 3.4', '>= 3.4.2'
29
- spec.add_development_dependency 'minitest-parallel_fork', '~> 2.0'
29
+ spec.add_development_dependency 'parallel_tests', '~> 4.7.1'
30
30
  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: 48.6.0
4
+ version: 48.7.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: 2024-06-10 00:00:00.000000000 Z
11
+ date: 2024-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -93,19 +93,19 @@ dependencies:
93
93
  - !ruby/object:Gem::Version
94
94
  version: 3.4.2
95
95
  - !ruby/object:Gem::Dependency
96
- name: minitest-parallel_fork
96
+ name: parallel_tests
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '2.0'
101
+ version: 4.7.1
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '2.0'
108
+ version: 4.7.1
109
109
  description: This is the official Ruby client library for the Seats.io V2 REST API
110
110
  email:
111
111
  - nahuel@seats.io