seatsio 28.2.0 → 31.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +26 -0
- data/.github/workflows/publish.yml +21 -0
- data/Gemfile.lock +1 -1
- data/README.md +8 -8
- data/lib/seatsio.rb +30 -2
- data/lib/seatsio/domain.rb +7 -13
- data/lib/seatsio/version.rb +1 -1
- metadata +8 -7
- data/.travis.yml +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf1124000be835fc50c85b57259d3cc53d0efbb3625bff185329e412f0fd9b33
|
4
|
+
data.tar.gz: 4f85fb99913ddb488705092c483c88ada2da298a0f9b7dbcee90df3cae558a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd5ed35d871c54d7101e78eaacb2fd9925ef0894e69d56150eecd671b04b8a01cafaabe57b51b94c02326c4a9acbdfe27fe1dbed1a680e3700c6d80ebef5723e
|
7
|
+
data.tar.gz: 933fe7bb11ebcc7e9c15f8efbe8dafbfb5c9b584f351f5cef9c949a51a0dd243eda159077d8be2b79b042e9eaab44947b1c1b1feaabddb8ca554bc487e11e3b9
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: 'Build'
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version: ['2.3']
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby-version }}
|
22
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
23
|
+
- uses: zcong1993/setup-timezone@master
|
24
|
+
with:
|
25
|
+
timezone: Europe/Brussels
|
26
|
+
- run: bundle exec rake
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: 'Publish'
|
2
|
+
|
3
|
+
on:
|
4
|
+
release:
|
5
|
+
types: [created]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- run: |
|
14
|
+
mkdir -p $HOME/.gem
|
15
|
+
touch $HOME/.gem/credentials
|
16
|
+
chmod 0600 $HOME/.gem/credentials
|
17
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
18
|
+
gem build *.gemspec
|
19
|
+
gem push *.gem
|
20
|
+
env:
|
21
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# seatsio-ruby, the official Seats.io Ruby client library
|
2
2
|
|
3
|
-
|
3
|
+
![Build](https://github.com/seatsio/seatsio-ruby/workflows/Build/badge.svg)
|
4
4
|
|
5
5
|
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
6
|
|
@@ -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-workspace-secret-key") # can be found on https://app.seats.io/workspace-settings
|
17
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "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-workspace-secret-key")
|
26
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "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-workspace-secret-key")
|
34
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "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-workspace-secret-key")
|
42
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key")
|
43
43
|
client.events.book(event.key, ["A-1", "A-2"], hold_token: "a-hold-token")
|
44
44
|
```
|
45
45
|
|
@@ -47,7 +47,7 @@ client.events.book(event.key, ["A-1", "A-2"], hold_token: "a-hold-token")
|
|
47
47
|
|
48
48
|
```ruby
|
49
49
|
require('seatsio')
|
50
|
-
client = Seatsio::Client.new("my-workspace-secret-key")
|
50
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "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("<EVENT KEY>", ["A-1", "A-2"], "my-custom-sta
|
|
55
55
|
|
56
56
|
```ruby
|
57
57
|
require('seatsio')
|
58
|
-
client = Seatsio::Client.new("my-workspace-secret-key")
|
58
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-workspace-secret-key")
|
59
59
|
charts = client.charts.list
|
60
60
|
charts.each do |chart|
|
61
61
|
puts chart.key
|
@@ -101,7 +101,7 @@ end
|
|
101
101
|
|
102
102
|
```ruby
|
103
103
|
require('seatsio')
|
104
|
-
client = Seatsio::Client.new("my-company-admin-key")
|
104
|
+
client = Seatsio::Client.new(Seatsio::Region.EU(), "my-company-admin-key")
|
105
105
|
client.workspaces.create name: "a workspace"
|
106
106
|
```
|
107
107
|
|
data/lib/seatsio.rb
CHANGED
@@ -9,12 +9,12 @@ require 'seatsio/event_reports'
|
|
9
9
|
require 'seatsio/usage_reports'
|
10
10
|
|
11
11
|
module Seatsio
|
12
|
-
# Main Seatsio Class
|
13
12
|
class Client
|
14
13
|
attr_reader :charts, :subaccounts, :workspaces, :events,
|
15
14
|
:hold_tokens, :chart_reports, :event_reports, :usage_reports
|
16
15
|
|
17
|
-
def initialize(secret_key, workspace_key = nil
|
16
|
+
def initialize(region, secret_key, workspace_key = nil)
|
17
|
+
base_url = region.url
|
18
18
|
@charts = ChartsClient.new(secret_key, workspace_key, base_url)
|
19
19
|
@subaccounts = SubaccountsClient.new(secret_key, workspace_key, base_url)
|
20
20
|
@workspaces = WorkspacesClient.new(secret_key, base_url)
|
@@ -25,4 +25,32 @@ module Seatsio
|
|
25
25
|
@usage_reports = UsageReportsClient.new(secret_key, workspace_key, base_url)
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
class Region
|
30
|
+
attr_reader :url
|
31
|
+
|
32
|
+
def initialize(url)
|
33
|
+
@url = url
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.EU()
|
37
|
+
return Region.new(Region.url_for_id("eu"))
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.NA()
|
41
|
+
return Region.new(Region.url_for_id("na"))
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.SA()
|
45
|
+
return Region.new(Region.url_for_id("sa"))
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.OC()
|
49
|
+
return Region.new(Region.url_for_id("oc"))
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.url_for_id(id)
|
53
|
+
return "https://api-" + id + ".seatsio.net"
|
54
|
+
end
|
55
|
+
end
|
28
56
|
end
|
data/lib/seatsio/domain.rb
CHANGED
@@ -264,7 +264,7 @@ module Seatsio
|
|
264
264
|
class ChartReportItem
|
265
265
|
|
266
266
|
attr_reader :label, :labels, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
|
267
|
-
:left_neighbour, :right_neighbour
|
267
|
+
:left_neighbour, :right_neighbour, :book_as_a_whole
|
268
268
|
|
269
269
|
def initialize(data)
|
270
270
|
@label = data['label']
|
@@ -277,6 +277,7 @@ module Seatsio
|
|
277
277
|
@object_type = data['objectType']
|
278
278
|
@left_neighbour = data['leftNeighbour']
|
279
279
|
@right_neighbour = data['rightNeighbour']
|
280
|
+
@book_as_a_whole = data['bookAsAWhole']
|
280
281
|
end
|
281
282
|
end
|
282
283
|
|
@@ -327,7 +328,8 @@ module Seatsio
|
|
327
328
|
:category_key, :entrance, :object_type, :hold_token, :category_label,
|
328
329
|
:ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
|
329
330
|
:is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
|
330
|
-
:left_neighbour, :right_neighbour, :is_selectable, :is_disabled_by_social_distancing, :channel
|
331
|
+
:left_neighbour, :right_neighbour, :is_selectable, :is_disabled_by_social_distancing, :channel,
|
332
|
+
:book_as_a_whole
|
331
333
|
|
332
334
|
def initialize(data)
|
333
335
|
@status = data['status']
|
@@ -356,6 +358,7 @@ module Seatsio
|
|
356
358
|
@is_selectable = data['isSelectable']
|
357
359
|
@is_disabled_by_social_distancing = data['isDisabledBySocialDistancing']
|
358
360
|
@channel = data['channel']
|
361
|
+
@book_as_a_whole = data['bookAsAWhole']
|
359
362
|
end
|
360
363
|
end
|
361
364
|
|
@@ -383,23 +386,14 @@ module Seatsio
|
|
383
386
|
|
384
387
|
class UsageDetails
|
385
388
|
|
386
|
-
attr_reader :
|
389
|
+
attr_reader :workspace, :usage_by_chart
|
387
390
|
|
388
391
|
def initialize(data)
|
389
|
-
@
|
392
|
+
@workspace = data['workspace']
|
390
393
|
@usage_by_chart = data['usageByChart'].map { |usage| UsageByChart.new(usage) }
|
391
394
|
end
|
392
395
|
end
|
393
396
|
|
394
|
-
class UsageSubaccount
|
395
|
-
|
396
|
-
attr_reader :id
|
397
|
-
|
398
|
-
def initialize(data)
|
399
|
-
@id = data['id']
|
400
|
-
end
|
401
|
-
end
|
402
|
-
|
403
397
|
class UsageByChart
|
404
398
|
|
405
399
|
attr_reader :chart, :usage_by_event
|
data/lib/seatsio/version.rb
CHANGED
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:
|
4
|
+
version: 31.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seats.io
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,9 +100,10 @@ extensions: []
|
|
100
100
|
extra_rdoc_files: []
|
101
101
|
files:
|
102
102
|
- ".editorconfig"
|
103
|
+
- ".github/workflows/build.yml"
|
104
|
+
- ".github/workflows/publish.yml"
|
103
105
|
- ".gitignore"
|
104
106
|
- ".ruby-version"
|
105
|
-
- ".travis.yml"
|
106
107
|
- Gemfile
|
107
108
|
- Gemfile.lock
|
108
109
|
- README.md
|
@@ -132,7 +133,7 @@ files:
|
|
132
133
|
homepage: http://seats.io
|
133
134
|
licenses: []
|
134
135
|
metadata: {}
|
135
|
-
post_install_message:
|
136
|
+
post_install_message:
|
136
137
|
rdoc_options: []
|
137
138
|
require_paths:
|
138
139
|
- lib
|
@@ -147,8 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
148
|
- !ruby/object:Gem::Version
|
148
149
|
version: '0'
|
149
150
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
151
|
-
signing_key:
|
151
|
+
rubygems_version: 3.1.2
|
152
|
+
signing_key:
|
152
153
|
specification_version: 4
|
153
154
|
summary: the official Seats.io Ruby client library
|
154
155
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.3.0
|
5
|
-
before_install: gem install bundler -v 1.16.1
|
6
|
-
notifications:
|
7
|
-
slack:
|
8
|
-
rooms:
|
9
|
-
- seatsio:AGaZISx4HlvoEx6WTbVaX50V
|
10
|
-
on_pull_requests: false
|
11
|
-
on_failure: always
|
12
|
-
on_success: change
|
13
|
-
deploy:
|
14
|
-
provider: rubygems
|
15
|
-
gem: seatsio
|
16
|
-
on:
|
17
|
-
tags: true
|
18
|
-
api_key:
|
19
|
-
secure: mQmsVgbIYF16i0rzDYQoOzcXwG8ppJl/czjTWf/KaEtSCWG5tQKBzflXFIkrfoP7EyjC+2TvT4Z5tWIBUVR4gG2KjcV2lGgq2vV/sVYrmUIXO2LZHBu5n35QHBF//0IOvbZMufm7W8PIVM6do1tMxdRE+qMZVtb5M9YIQpDHc6jXru/PKxOffwTNEWMVX1Xjfz4wtuJCpvhR+BHuBoi9uE4dyWrF5WgkL2aELUvHpUmc2wn0gGypqJ9Whrcxq8n3EREvO0kiSMww+MMdWd57ACo4q5J8Za+h4tXvVd49EyEdevjWMvT0wYx+nSz+/vk4B9vOmd5Un9/gzoLbq8qEpAgEHXKw/J6l9KHlJDMNy2dVsMzqSOceEtBx5LA0fizWD4U2XfI0GaiM5Rdt96iNtVlU9lQuiXPhcz7igEFVRSZAkzTNHlh0cAr2FJIBBh27fffrblF/xRw1ziLwDnjutTg8lZsxmdjTrnMkAAuNWMIXKzWvh7n2bZ+jqwzp5bSqp1ckOCae7ozsG1Kx1eS8pMepsvMtmb5w6dsuWGVAI8ASd8XmYFHKisKmi6xHYOGw7uy7yE7rXHa0Ypx/K4xKCoqhv+5Y7RdTvT2tkqC0mwMOh/Io2eslgjTA0vy87sVKyLTCU/ElKRTd2165cRL2JRNH3l/X0gxglT4WpXQEEXs=
|