seatsio 33.1.0 → 35.1.1

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: 33473b549ec1ccc19d4cd335a986402488cb147e6578a5f02cfb841ef319e3a3
4
- data.tar.gz: e0242b450577e6497845bd29a43435169f5e7c9425912c2097282382d5636bee
3
+ metadata.gz: 05a386fb3a2fc728c96f944afcb47225a5f8ae048838473a84dc08baea2859be
4
+ data.tar.gz: b030fa96fbab3f70f292197857adfcaf1b99c68f13d1093349d651701e9b2c42
5
5
  SHA512:
6
- metadata.gz: d66a102bba053bffd67fe4c99d8f43e57307aa2b4d8c90fd79c19ccea7b5c8f7ab5c58bf84cef2312555ae0c4adab0bb1075546147d0b146582232d7cc06dad3
7
- data.tar.gz: 37904aca59ceb8321f4cf1ffdb75ce4f445222737cf4aab12536064848b8cd23b3824a9130938ac8eeb04d29710870f35d4fe7ce5bdc7852b130b03c4c7cfc16
6
+ metadata.gz: 25a5b5a1672a5daeff609280ef2cdaf6f526c9cbee3b9f0667394a0fcb047c43a0f3fbdbb6764341bc9627ae8ecb6c50670f6a908ae953b091e80e43c6de19b6
7
+ data.tar.gz: d27dcc2cbfc02a02c95ff5f979bf8d4c54ef3f6b999f39644e21aac6de5c600f0454ecc3fb61d74fdacdbc05e42d6bfa686e8355094166ad29a83236f24fab6c
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- ruby-version: ['2.3']
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/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.4.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (33.1.0)
4
+ seatsio (35.1.1)
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)
@@ -49,4 +49,4 @@ DEPENDENCIES
49
49
  webmock (~> 3.4, >= 3.4.2)
50
50
 
51
51
  BUNDLED WITH
52
- 1.17.2
52
+ 2.1.4
data/README.md CHANGED
@@ -3,19 +3,44 @@
3
3
  [![Build](https://github.com/seatsio/seatsio-ruby/workflows/Build/badge.svg)](https://github.com/seatsio/seatsio-ruby/actions/workflows/build.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/seatsio.svg)](https://badge.fury.io/rb/seatsio)
5
5
 
6
- This is the official Ruby client library for the [Seats.io V2 REST API](https://docs.seats.io/docs/api-overview), supporting Ruby 2.2.0+
6
+ This is the official Ruby client library for the [Seats.io V2 REST API](https://docs.seats.io/docs/api-overview), supporting Ruby 2.4.0+
7
7
 
8
8
  ## Versioning
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
  ```
@@ -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 = "33.1.0"
2
+ VERSION = "35.1.1"
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: 33.1.0
4
+ version: 35.1.1
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-10-28 00:00:00.000000000 Z
11
+ date: 2022-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler