seatsio 19 → 20

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: 7c448a03cd150ad6717cc4e84292ddce1a1b414fcf8a7fc47f85adbfc40da4f6
4
- data.tar.gz: 77ca98873d3e6ac9ba23b7b13315837daee4fe7d37ebc1f1e8892154c2c0db17
3
+ metadata.gz: 053120a25790822d3ce402791d06fbc1ffd3c9125c68c848127e7b27561e3ff8
4
+ data.tar.gz: 5f18fd7ce220d832faddef356bfdf2769c3d7b9f40ac9ecdbe4f3ab63453ed5c
5
5
  SHA512:
6
- metadata.gz: d7e0df3a115dfe0d2112db3873709941a84e1d8b5adbc5538fc7b07148c0757f35d8fb520646c92d87fa54d888e82012f66aec404a1b8a61a0648ae466bcd530
7
- data.tar.gz: 736f061e98d078704713d3e6136e411c4e09448358ea248e771264bfcf66b521ad881b38c3bb42732990e58b8713bb2e321d91730043176e70e245340165164d
6
+ metadata.gz: ed22422f34f21014dca0c72d65030637e447bdc6eaba388444e7ca23f28962b808af651b9c6e81a95ff050ce6f94ec8bb4ea9e9c9f7a16a6c48e9f883be4ed67
7
+ data.tar.gz: d289aa5f212d7f92abcfdde64e052ef565ecd392c1af810a61dbde52e79faa80f25f2ad27b532cc930fb7059f1b1460063d1ea2f538a62f14fafd99ab8c607e9
data/.gitignore CHANGED
@@ -6,4 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- /.idea
9
+ /.idea
10
+ /seatsio-ruby.iml
data/Gemfile.lock ADDED
@@ -0,0 +1,68 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ seatsio (20)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ addressable (2.6.0)
10
+ public_suffix (>= 2.0.2, < 4.0)
11
+ coveralls (0.8.23)
12
+ json (>= 1.8, < 3)
13
+ simplecov (~> 0.16.1)
14
+ term-ansicolor (~> 1.3)
15
+ thor (>= 0.19.4, < 2.0)
16
+ tins (~> 1.6)
17
+ crack (0.4.3)
18
+ safe_yaml (~> 1.0.0)
19
+ docile (1.3.1)
20
+ domain_name (0.5.20180417)
21
+ unf (>= 0.0.5, < 1.0.0)
22
+ hashdiff (0.4.0)
23
+ http-cookie (1.0.3)
24
+ domain_name (~> 0.5)
25
+ json (2.2.0)
26
+ mime-types (3.2.2)
27
+ mime-types-data (~> 3.2015)
28
+ mime-types-data (3.2019.0331)
29
+ minitest (5.11.3)
30
+ netrc (0.11.0)
31
+ public_suffix (3.1.0)
32
+ rake (10.5.0)
33
+ rest-client (2.0.2)
34
+ http-cookie (>= 1.0.2, < 2.0)
35
+ mime-types (>= 1.16, < 4.0)
36
+ netrc (~> 0.8)
37
+ safe_yaml (1.0.5)
38
+ simplecov (0.16.1)
39
+ docile (~> 1.1)
40
+ json (>= 1.8, < 3)
41
+ simplecov-html (~> 0.10.0)
42
+ simplecov-html (0.10.2)
43
+ term-ansicolor (1.7.1)
44
+ tins (~> 1.0)
45
+ thor (0.20.3)
46
+ tins (1.20.3)
47
+ unf (0.1.4)
48
+ unf_ext
49
+ unf_ext (0.0.7.6)
50
+ webmock (3.6.0)
51
+ addressable (>= 2.3.6)
52
+ crack (>= 0.3.2)
53
+ hashdiff (>= 0.4.0, < 2.0.0)
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ bundler (~> 1.16)
60
+ coveralls (~> 0.8.22)
61
+ minitest (~> 5.0)
62
+ rake (~> 10.0)
63
+ rest-client (~> 2.0, >= 2.0.2)
64
+ seatsio!
65
+ webmock (~> 3.4, >= 3.4.2)
66
+
67
+ BUNDLED WITH
68
+ 1.17.3
@@ -118,7 +118,8 @@ module Seatsio
118
118
  end
119
119
 
120
120
  def validate_draft_version(chart_key)
121
- @http_client.post("charts/#{chart_key}/version/draft/actions/validate")
121
+ response = @http_client.post("charts/#{chart_key}/version/draft/actions/validate")
122
+ Seatsio::Domain::ChartValidationResult.new(response)
122
123
  end
123
124
 
124
125
  private
@@ -140,27 +140,26 @@ module Seatsio::Domain
140
140
  end
141
141
 
142
142
  class Account
143
- attr_reader :id, :secret_key, :designer_key, :public_key, :name,
144
- :email, :active, :settings, :is_subaccount
143
+ attr_reader :id, :secret_key, :designer_key, :name,
144
+ :email, :active, :settings
145
145
 
146
146
  def initialize(data)
147
147
  @id = data['id']
148
148
  @secret_key = data['secretKey']
149
149
  @designer_key = data['designerKey']
150
- @public_key = data['publicKey']
151
150
  @name = data['name']
152
151
  @email = data['email']
153
- @is_subaccount = data['isSubaccount']
154
152
  @active = data['active']
155
153
  @settings = AccountSettings.new(data['settings']) if data['settings'] != nil
156
154
  end
157
155
  end
158
156
 
159
157
  class Subaccount < Account
160
- attr_reader :workspace
158
+ attr_reader :public_key, :workspace
161
159
 
162
160
  def initialize(data)
163
161
  super
162
+ @public_key = data['publicKey']
164
163
  @workspace = Workspace.new(data['workspace']) if data['workspace'] != nil
165
164
  end
166
165
  end
@@ -12,19 +12,17 @@ module Seatsio
12
12
  @http_client = ::Seatsio::HttpClient.new(secret_key, workspace_key, base_url)
13
13
  end
14
14
 
15
- def create(name: nil, email: nil)
15
+ def create(name: nil)
16
16
  body = {}
17
17
  body['name'] = name if name
18
- body['email'] = email if email
19
18
 
20
19
  response = @http_client.post("subaccounts", body)
21
20
  Domain::Subaccount.new(response)
22
21
  end
23
22
 
24
- def update(id:, name: nil, email: nil)
23
+ def update(id:, name: nil)
25
24
  body = {}
26
25
  body['name'] = name if name
27
- body['email'] = email if email
28
26
  @http_client.post("subaccounts/#{id}", body)
29
27
  end
30
28
 
@@ -65,10 +63,6 @@ module Seatsio
65
63
  Domain::Chart.new(response)
66
64
  end
67
65
 
68
- def create_with_email(email: nil, name: nil)
69
- do_create name: name, email: email
70
- end
71
-
72
66
  def regenerate_secret_key(id:)
73
67
  @http_client.post("/subaccounts/#{id}/secret-key/actions/regenerate")
74
68
  end
@@ -79,14 +73,6 @@ module Seatsio
79
73
 
80
74
  private
81
75
 
82
- def do_create(name: nil, email: nil)
83
- body = {}
84
- body['name'] = name if name
85
- body['email'] = email if email
86
- response = @http_client.post('subaccounts', body)
87
- Domain::Subaccount.new(response)
88
- end
89
-
90
76
  def cursor(status: nil)
91
77
  endpoint = status ? "subaccounts/#{status}" : 'subaccounts'
92
78
  Pagination::Cursor.new(Domain::Subaccount, endpoint, @http_client)
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "19"
2
+ VERSION = "20"
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: '19'
4
+ version: '20'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seats.io
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-21 00:00:00.000000000 Z
11
+ date: 2020-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,6 +117,7 @@ files:
117
117
  - ".gitignore"
118
118
  - ".travis.yml"
119
119
  - Gemfile
120
+ - Gemfile.lock
120
121
  - README.md
121
122
  - Rakefile
122
123
  - bin/console