seatsio 30.2.0 → 31.0.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: 6897bc523384fb90e5668bdb6941a4b6677a4f01e68b8630235231ad2f58ed97
4
- data.tar.gz: faaa58fd76d8fb1fd5b5dc4ef9e3defb65ce11bb51ad8de3f748b3c3a9ef9e72
3
+ metadata.gz: bf1124000be835fc50c85b57259d3cc53d0efbb3625bff185329e412f0fd9b33
4
+ data.tar.gz: 4f85fb99913ddb488705092c483c88ada2da298a0f9b7dbcee90df3cae558a4d
5
5
  SHA512:
6
- metadata.gz: 608a83c243161ef3feb9031209485c452a69c13dc16e8561676c156782500a2fd4a584b3158e6339207cc9b43a340a8bc3df5e5511691bfa18c73519489935f3
7
- data.tar.gz: ea041bae68b966b8b61ef4378cdfab06839b4f3773b9e37390f1b75d52ef4eeee232da70cc2abab14cbf5d67753be2862b7dc32637322262eb0a4493243b55fd
6
+ metadata.gz: fd5ed35d871c54d7101e78eaacb2fd9925ef0894e69d56150eecd671b04b8a01cafaabe57b51b94c02326c4a9acbdfe27fe1dbed1a680e3700c6d80ebef5723e
7
+ data.tar.gz: 933fe7bb11ebcc7e9c15f8efbe8dafbfb5c9b584f351f5cef9c949a51a0dd243eda159077d8be2b79b042e9eaab44947b1c1b1feaabddb8ca554bc487e11e3b9
@@ -1,3 +1,5 @@
1
+ name: 'Build'
2
+
1
3
  on:
2
4
  push:
3
5
  branches: [ master ]
@@ -18,4 +20,7 @@ jobs:
18
20
  with:
19
21
  ruby-version: ${{ matrix.ruby-version }}
20
22
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
23
+ - uses: zcong1993/setup-timezone@master
24
+ with:
25
+ timezone: Europe/Brussels
21
26
  - run: bundle exec rake
@@ -1,4 +1,4 @@
1
- name: Ruby Gem
1
+ name: 'Publish'
2
2
 
3
3
  on:
4
4
  release:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (30.2.0)
4
+ seatsio (31.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # seatsio-ruby, the official Seats.io Ruby client library
2
2
 
3
- [![Build Status](https://travis-ci.org/seatsio/seatsio-ruby.svg?branch=master)](https://travis-ci.org/seatsio/seatsio-ruby)
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, base_url = 'https://api.seatsio.net')
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
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "30.2.0"
2
+ VERSION = "31.0.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: 30.2.0
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: 2021-01-29 00:00:00.000000000 Z
11
+ date: 2021-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -101,7 +101,7 @@ extra_rdoc_files: []
101
101
  files:
102
102
  - ".editorconfig"
103
103
  - ".github/workflows/build.yml"
104
- - ".github/workflows/release.yml"
104
+ - ".github/workflows/publish.yml"
105
105
  - ".gitignore"
106
106
  - ".ruby-version"
107
107
  - Gemfile
@@ -133,7 +133,7 @@ files:
133
133
  homepage: http://seats.io
134
134
  licenses: []
135
135
  metadata: {}
136
- post_install_message:
136
+ post_install_message:
137
137
  rdoc_options: []
138
138
  require_paths:
139
139
  - lib
@@ -148,9 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  requirements: []
151
- rubyforge_project:
152
- rubygems_version: 2.7.6
153
- signing_key:
151
+ rubygems_version: 3.1.2
152
+ signing_key:
154
153
  specification_version: 4
155
154
  summary: the official Seats.io Ruby client library
156
155
  test_files: []