seatsio 34.0.0 → 35.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: d8cf426e69e7b398fe7f656998b5918baaadb7366a34d3f69ba6923944e1a5e6
4
- data.tar.gz: 535d5c8073412db116e808ab2ed465ce788e195396d88660ad4c9aaa682c3465
3
+ metadata.gz: 621bb856b807e82315540bb575ea947feb75cb3e7807adbd25cf0a7b74393aeb
4
+ data.tar.gz: 1ea9af6b8e43f3ac4a4cd85fcf7cce0fe03aa46919e5d4d7ca219439b97e33ab
5
5
  SHA512:
6
- metadata.gz: 6c002279fb10b41d5c1c17d4994eb74f6d4e43f5c565475e70abff3bd6944598c004163cd16acda88827e1ea436d909bb181822b20c2900bb7ad2aa4be630997
7
- data.tar.gz: f1216cf4ed428193d8cc3a2450b090fc49cc226b95ca6cd2efd3033ff00de494a365f398cc21d191f1bec3b533cff32d7eb60d35b2018994e8b04369a50cf536
6
+ metadata.gz: a48e05fe8cc84746c3d9cc32e0e4eebf04b17e0654107524a19d384157a43b646ce6b5c3a4698a7461c28574c275c307c3d2d149eebf31827fdcbca7834cdb51
7
+ data.tar.gz: f12a0b1a9deb661e5340b3d1419b4846cbb3b3f835e5a2e084bbd103f76ab8cf1f863e3cbf4daea263ee0837e5a67fc1f2bd1d94a68e442ae79d65f1610c9388
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- ruby-version: ['2.4']
15
+ ruby-version: ['2.4', '3.0']
16
16
 
17
17
  steps:
18
18
  - uses: actions/checkout@v2
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /tmp/
9
9
  /.idea
10
10
  /seatsio-ruby.iml
11
+ /out
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (34.0.0)
4
+ seatsio (35.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -19,7 +19,7 @@ GEM
19
19
  mime-types (3.3.1)
20
20
  mime-types-data (~> 3.2015)
21
21
  mime-types-data (3.2021.0225)
22
- minitest (5.14.4)
22
+ minitest (5.15.0)
23
23
  netrc (0.11.0)
24
24
  public_suffix (4.0.6)
25
25
  rake (13.0.6)
data/README.md CHANGED
@@ -9,13 +9,38 @@ This is the official Ruby client library for the [Seats.io V2 REST API](https://
9
9
 
10
10
  seatsio-ruby follows semver since v23.3.0.
11
11
 
12
- ## Examples
12
+ ## API reference
13
+
14
+ You can find a full API reference at https://www.rubydoc.info/gems/seatsio/
15
+
16
+ ## Usage
17
+
18
+ ### General instructions
19
+
20
+ To use this library, you'll need to create a `Seatsio::Client`:
21
+
22
+ ```ruby
23
+ require('seatsio')
24
+ client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key")
25
+ ...
26
+ ```
27
+
28
+ You can find your _workspace secret key_ in the [settings section of the workspace](https://app.seats.io/workspace-settings).
29
+
30
+ The region should correspond to the region of your account:
31
+
32
+ - `Seatsio::Region.EU()`: Europe
33
+ - `Seatsio::Region.NA()`: North-America
34
+ - `Seatsio::Region.SA()`: South-America
35
+ - `Seatsio::Region.OC()`: Oceania
36
+
37
+ If you're unsure about your region, have a look at your [company settings page](https://app.seats.io/company-settings).
13
38
 
14
39
  ### Creating a chart and an event
15
40
 
16
41
  ```ruby
17
42
  require('seatsio')
18
- client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key") # can be found on https://app.seats.io/workspace-settings
43
+ client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key")
19
44
  chart = client.charts.create
20
45
  event = client.events.create chart_key: chart.key
21
46
  ```
@@ -18,14 +18,34 @@ module Seatsio
18
18
  get_chart_report('byObjectType', chart_key, book_whole_tables)
19
19
  end
20
20
 
21
+ def summary_by_object_type(chart_key)
22
+ fetch_summary_report('byObjectType', chart_key)
23
+ end
24
+
21
25
  def by_category_key(chart_key, book_whole_tables = nil)
22
26
  get_chart_report('byCategoryKey', chart_key, book_whole_tables)
23
27
  end
24
28
 
29
+ def summary_by_category_key(chart_key)
30
+ fetch_summary_report('byCategoryKey', chart_key)
31
+ end
32
+
25
33
  def by_category_label(chart_key, book_whole_tables = nil)
26
34
  get_chart_report('byCategoryLabel', chart_key, book_whole_tables)
27
35
  end
28
36
 
37
+ def summary_by_category_label(chart_key)
38
+ fetch_summary_report('byCategoryLabel', chart_key)
39
+ end
40
+
41
+ def by_section(chart_key, book_whole_tables = nil)
42
+ get_chart_report('bySection', chart_key, book_whole_tables)
43
+ end
44
+
45
+ def summary_by_section(event_key)
46
+ fetch_summary_report('bySection', event_key)
47
+ end
48
+
29
49
  private
30
50
 
31
51
  def get_chart_report(report_type, chart_key, book_whole_tables)
@@ -34,5 +54,10 @@ module Seatsio
34
54
  body = @http_client.get(url, params)
35
55
  ChartReport.new(body)
36
56
  end
57
+
58
+ def fetch_summary_report(report_type, event_key)
59
+ url = "reports/charts/#{event_key}/#{report_type}/summary"
60
+ @http_client.get(url)
61
+ end
37
62
  end
38
63
  end
@@ -315,7 +315,7 @@ module Seatsio
315
315
  :category_key, :entrance, :object_type, :hold_token, :category_label,
316
316
  :ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
317
317
  :is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
318
- :left_neighbour, :right_neighbour, :is_selectable, :is_disabled_by_social_distancing, :channel,
318
+ :left_neighbour, :right_neighbour, :is_available, :is_disabled_by_social_distancing, :channel,
319
319
  :book_as_a_whole, :distance_to_focal_point, :holds
320
320
 
321
321
  def initialize(data)
@@ -343,7 +343,7 @@ module Seatsio
343
343
  @displayed_object_type = data['displayedObjectType']
344
344
  @left_neighbour = data['leftNeighbour']
345
345
  @right_neighbour = data['rightNeighbour']
346
- @is_selectable = data['isSelectable']
346
+ @is_available = data['isAvailable']
347
347
  @is_disabled_by_social_distancing = data['isDisabledBySocialDistancing']
348
348
  @channel = data['channel']
349
349
  @book_as_a_whole = data['bookAsAWhole']
@@ -71,16 +71,28 @@ module Seatsio
71
71
  fetch_deep_summary_report('bySection', event_key)
72
72
  end
73
73
 
74
- def by_selectability(event_key, selectability = nil)
75
- fetch_report('bySelectability', event_key, selectability)
74
+ def by_availability(event_key, availability = nil)
75
+ fetch_report('byAvailability', event_key, availability)
76
76
  end
77
77
 
78
- def summary_by_selectability(event_key)
79
- fetch_summary_report('bySelectability', event_key)
78
+ def summary_by_availability(event_key)
79
+ fetch_summary_report('byAvailability', event_key)
80
80
  end
81
81
 
82
- def deep_summary_by_selectability(event_key)
83
- fetch_deep_summary_report('bySelectability', event_key)
82
+ def deep_summary_by_availability(event_key)
83
+ fetch_deep_summary_report('byAvailability', event_key)
84
+ end
85
+
86
+ def by_availability_reason(event_key, availability_reason = nil)
87
+ fetch_report('byAvailabilityReason', event_key, availability_reason)
88
+ end
89
+
90
+ def summary_by_availability_reason(event_key)
91
+ fetch_summary_report('byAvailabilityReason', event_key)
92
+ end
93
+
94
+ def deep_summary_by_availability_reason(event_key)
95
+ fetch_deep_summary_report('byAvailabilityReason', event_key)
84
96
  end
85
97
 
86
98
  def by_channel(event_key, channelKey = nil)
@@ -1,4 +1,4 @@
1
- def create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing)
1
+ def create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing, allowed_previous_statuses, rejected_previous_statuses)
2
2
  result = {}
3
3
  result[:objects] = normalize(object_or_objects)
4
4
  result[:status] = status
@@ -13,6 +13,8 @@ def create_change_object_status_request(object_or_objects, status, hold_token, o
13
13
  result[:ignoreChannels] = ignore_channels if ignore_channels != nil
14
14
  result[:channelKeys] = channel_keys if channel_keys != nil
15
15
  result[:ignoreSocialDistancing] = ignore_social_distancing if ignore_social_distancing != nil
16
+ result[:allowedPreviousStatuses] = allowed_previous_statuses if allowed_previous_statuses != nil
17
+ result[:rejectedPreviousStatuses] = rejected_previous_statuses if rejected_previous_statuses != nil
16
18
  result
17
19
  end
18
20
 
@@ -62,12 +62,12 @@ module Seatsio
62
62
  self.change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::BOOKED, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys, ignore_social_distancing: ignore_social_distancing)
63
63
  end
64
64
 
65
- def change_object_status(event_key_or_keys, object_or_objects, status, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, ignore_social_distancing: nil)
66
- request = create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing)
65
+ def change_object_status(event_key_or_keys, object_or_objects, status, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, ignore_social_distancing: nil, allowed_previous_statuses: nil, rejected_previous_statuses: nil)
66
+ request = create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, ignore_social_distancing, allowed_previous_statuses, rejected_previous_statuses)
67
67
  request[:params] = {
68
68
  :expand => 'objects'
69
69
  }
70
- response = @http_client.post("seasons/actions/change-object-status", request)
70
+ response = @http_client.post("events/groups/actions/change-object-status", request)
71
71
  ChangeObjectStatusResult.new(response)
72
72
  end
73
73
 
@@ -19,7 +19,7 @@ module Seatsio
19
19
  @first_page = false
20
20
  end
21
21
 
22
- def each(start = 0)
22
+ def each(start = 0, &block)
23
23
  return to_enum(:each, start) unless block_given?
24
24
 
25
25
  Array(@collection[start..-1]).each do |element|
@@ -30,7 +30,7 @@ module Seatsio
30
30
 
31
31
  start = [@collection.size, start].max
32
32
  fetch_next_page
33
- each(start, &Proc.new)
33
+ each(start, &block)
34
34
  end
35
35
 
36
36
  def set_query_param(key, value)
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "34.0.0"
2
+ VERSION = "35.2.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: 34.0.0
4
+ version: 35.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: 2021-11-19 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler