seatsio 45.2.0 → 46.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/seatsio/chart_reports.rb +29 -21
- data/lib/seatsio/charts.rb +0 -6
- data/lib/seatsio/domain.rb +0 -13
- data/lib/seatsio/version.rb +1 -1
- data/lib/seatsio.rb +1 -3
- metadata +2 -3
- data/lib/seatsio/subaccounts.rb +0 -81
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6fa31469fa22180caf5a5d80afe5f43c39519cf321eeb1c5ad8b3c47e6bb1ac
|
4
|
+
data.tar.gz: bc07d76adef6e5cbcf6d04ae0ebe077f40ea327b20f90854e26bb0cb72752682
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cccdfc2c0c8dac704f3356df148182c616a54e31965f6dad581ef756da3c2f1a34fdca34413cc3d99ec00fe44e16f9e252fe1edee9cd03accac2f7dc427e2d5
|
7
|
+
data.tar.gz: b0451923c810a7de486c688000538964146d9c7aa5f7f3c5e810c050a5771272c65928d8d3350f2122339dff8f50a1440403b266a93367d88876b3bdcd45d23f
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seatsio (
|
4
|
+
seatsio (46.1.0)
|
5
5
|
rest-client (~> 2.0, >= 2.0.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.8.
|
10
|
+
addressable (2.8.5)
|
11
11
|
public_suffix (>= 2.0.2, < 6.0)
|
12
12
|
crack (0.4.5)
|
13
13
|
rexml
|
@@ -24,18 +24,18 @@ GEM
|
|
24
24
|
minitest-parallel_fork (1.3.0)
|
25
25
|
minitest (>= 5.15.0)
|
26
26
|
netrc (0.11.0)
|
27
|
-
public_suffix (5.0.
|
27
|
+
public_suffix (5.0.3)
|
28
28
|
rake (13.0.6)
|
29
29
|
rest-client (2.1.0)
|
30
30
|
http-accept (>= 1.7.0, < 2.0)
|
31
31
|
http-cookie (>= 1.0.2, < 2.0)
|
32
32
|
mime-types (>= 1.16, < 4.0)
|
33
33
|
netrc (~> 0.8)
|
34
|
-
rexml (3.2.
|
34
|
+
rexml (3.2.6)
|
35
35
|
unf (0.1.4)
|
36
36
|
unf_ext
|
37
37
|
unf_ext (0.0.7.7)
|
38
|
-
webmock (3.
|
38
|
+
webmock (3.19.1)
|
39
39
|
addressable (>= 2.8.0)
|
40
40
|
crack (>= 0.3.2)
|
41
41
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -6,59 +6,67 @@ require 'cgi'
|
|
6
6
|
|
7
7
|
module Seatsio
|
8
8
|
class ChartReportsClient
|
9
|
+
|
9
10
|
def initialize(http_client)
|
10
11
|
@http_client = http_client
|
11
12
|
end
|
12
13
|
|
13
|
-
def by_label(chart_key, book_whole_tables = nil)
|
14
|
-
fetch_chart_report('byLabel', chart_key, book_whole_tables)
|
14
|
+
def by_label(chart_key, book_whole_tables = nil, version = nil)
|
15
|
+
fetch_chart_report('byLabel', chart_key, book_whole_tables, version)
|
15
16
|
end
|
16
17
|
|
17
|
-
def by_object_type(chart_key, book_whole_tables = nil)
|
18
|
-
fetch_chart_report('byObjectType', chart_key, book_whole_tables)
|
18
|
+
def by_object_type(chart_key, book_whole_tables = nil, version = nil)
|
19
|
+
fetch_chart_report('byObjectType', chart_key, book_whole_tables, version)
|
19
20
|
end
|
20
21
|
|
21
|
-
def summary_by_object_type(chart_key, book_whole_tables = nil)
|
22
|
-
fetch_summary_report('byObjectType', chart_key, book_whole_tables)
|
22
|
+
def summary_by_object_type(chart_key, book_whole_tables = nil, version = nil)
|
23
|
+
fetch_summary_report('byObjectType', chart_key, book_whole_tables, version)
|
23
24
|
end
|
24
25
|
|
25
|
-
def by_category_key(chart_key, book_whole_tables = nil)
|
26
|
-
fetch_chart_report('byCategoryKey', chart_key, book_whole_tables)
|
26
|
+
def by_category_key(chart_key, book_whole_tables = nil, version = nil)
|
27
|
+
fetch_chart_report('byCategoryKey', chart_key, book_whole_tables, version)
|
27
28
|
end
|
28
29
|
|
29
|
-
def summary_by_category_key(chart_key, book_whole_tables = nil)
|
30
|
-
fetch_summary_report('byCategoryKey', chart_key, book_whole_tables)
|
30
|
+
def summary_by_category_key(chart_key, book_whole_tables = nil, version = nil)
|
31
|
+
fetch_summary_report('byCategoryKey', chart_key, book_whole_tables, version)
|
31
32
|
end
|
32
33
|
|
33
|
-
def by_category_label(chart_key, book_whole_tables = nil)
|
34
|
-
fetch_chart_report('byCategoryLabel', chart_key, book_whole_tables)
|
34
|
+
def by_category_label(chart_key, book_whole_tables = nil, version = nil)
|
35
|
+
fetch_chart_report('byCategoryLabel', chart_key, book_whole_tables, version)
|
35
36
|
end
|
36
37
|
|
37
|
-
def summary_by_category_label(chart_key, book_whole_tables = nil)
|
38
|
-
fetch_summary_report('byCategoryLabel', chart_key, book_whole_tables)
|
38
|
+
def summary_by_category_label(chart_key, book_whole_tables = nil, version = nil)
|
39
|
+
fetch_summary_report('byCategoryLabel', chart_key, book_whole_tables, version)
|
39
40
|
end
|
40
41
|
|
41
|
-
def by_section(chart_key, book_whole_tables = nil)
|
42
|
-
fetch_chart_report('bySection', chart_key, book_whole_tables)
|
42
|
+
def by_section(chart_key, book_whole_tables = nil, version = nil)
|
43
|
+
fetch_chart_report('bySection', chart_key, book_whole_tables, version)
|
43
44
|
end
|
44
45
|
|
45
|
-
def summary_by_section(event_key, book_whole_tables = nil)
|
46
|
-
fetch_summary_report('bySection', event_key, book_whole_tables)
|
46
|
+
def summary_by_section(event_key, book_whole_tables = nil, version = nil)
|
47
|
+
fetch_summary_report('bySection', event_key, book_whole_tables, version)
|
47
48
|
end
|
48
49
|
|
49
50
|
private
|
50
51
|
|
51
|
-
def fetch_chart_report(report_type, chart_key, book_whole_tables)
|
52
|
+
def fetch_chart_report(report_type, chart_key, book_whole_tables, version)
|
52
53
|
params = book_whole_tables.nil? ? {} : { bookWholeTables: book_whole_tables }
|
54
|
+
unless version.nil?
|
55
|
+
params[:version] = version
|
56
|
+
end
|
53
57
|
url = "reports/charts/#{chart_key}/#{report_type}"
|
54
58
|
body = @http_client.get(url, params)
|
55
59
|
ChartReport.new(body)
|
56
60
|
end
|
57
61
|
|
58
|
-
def fetch_summary_report(report_type,
|
62
|
+
def fetch_summary_report(report_type, chart_key, book_whole_tables, version)
|
59
63
|
params = book_whole_tables.nil? ? {} : { bookWholeTables: book_whole_tables }
|
60
|
-
|
64
|
+
unless version.nil?
|
65
|
+
params[:version] = version
|
66
|
+
end
|
67
|
+
url = "reports/charts/#{chart_key}/#{report_type}/summary"
|
61
68
|
@http_client.get(url, params)
|
62
69
|
end
|
63
70
|
end
|
71
|
+
|
64
72
|
end
|
data/lib/seatsio/charts.rb
CHANGED
@@ -64,12 +64,6 @@ module Seatsio
|
|
64
64
|
Chart.new(response)
|
65
65
|
end
|
66
66
|
|
67
|
-
def copy_to_subaccount(chart_key, subaccount_id)
|
68
|
-
url = "charts/#{chart_key}/version/published/actions/copy-to/#{subaccount_id}"
|
69
|
-
response = @http_client.post url
|
70
|
-
Chart.new(response)
|
71
|
-
end
|
72
|
-
|
73
67
|
def copy_to_workspace(chart_key, to_workspace_key)
|
74
68
|
url = "charts/#{chart_key}/version/published/actions/copy-to-workspace/#{to_workspace_key}"
|
75
69
|
response = @http_client.post url
|
data/lib/seatsio/domain.rb
CHANGED
@@ -231,19 +231,6 @@ module Seatsio
|
|
231
231
|
end
|
232
232
|
end
|
233
233
|
|
234
|
-
class Subaccount
|
235
|
-
attr_reader :id, :secret_key, :designer_key, :public_key, :name, :active
|
236
|
-
|
237
|
-
def initialize(data)
|
238
|
-
@id = data['id']
|
239
|
-
@public_key = data['publicKey']
|
240
|
-
@secret_key = data['secretKey']
|
241
|
-
@designer_key = data['designerKey']
|
242
|
-
@name = data['name']
|
243
|
-
@active = data['active']
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
234
|
class Workspace
|
248
235
|
attr_reader :id, :name, :key, :secret_key, :is_test, :is_active, :is_default
|
249
236
|
|
data/lib/seatsio/version.rb
CHANGED
data/lib/seatsio.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'seatsio/version'
|
2
2
|
require 'seatsio/charts'
|
3
|
-
require 'seatsio/subaccounts'
|
4
3
|
require 'seatsio/workspaces'
|
5
4
|
require 'seatsio/events'
|
6
5
|
require 'seatsio/seasons'
|
@@ -11,14 +10,13 @@ require 'seatsio/usage_reports'
|
|
11
10
|
|
12
11
|
module Seatsio
|
13
12
|
class Client
|
14
|
-
attr_reader :charts, :
|
13
|
+
attr_reader :charts, :workspaces, :events, :seasons,
|
15
14
|
:hold_tokens, :chart_reports, :event_reports, :usage_reports
|
16
15
|
|
17
16
|
def initialize(region, secret_key, workspace_key = nil, max_retries = 5)
|
18
17
|
base_url = region.url
|
19
18
|
@http_client = Seatsio::HttpClient.new(secret_key, workspace_key, base_url, max_retries)
|
20
19
|
@charts = ChartsClient.new(@http_client)
|
21
|
-
@subaccounts = SubaccountsClient.new(@http_client)
|
22
20
|
@workspaces = WorkspacesClient.new(@http_client)
|
23
21
|
@events = EventsClient.new(@http_client)
|
24
22
|
@seasons = SeasonsClient.new(@http_client, self)
|
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: 46.1.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: 2023-
|
11
|
+
date: 2023-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -141,7 +141,6 @@ files:
|
|
141
141
|
- lib/seatsio/httpClient.rb
|
142
142
|
- lib/seatsio/pagination/cursor.rb
|
143
143
|
- lib/seatsio/seasons.rb
|
144
|
-
- lib/seatsio/subaccounts.rb
|
145
144
|
- lib/seatsio/usage_reports.rb
|
146
145
|
- lib/seatsio/util.rb
|
147
146
|
- lib/seatsio/version.rb
|
data/lib/seatsio/subaccounts.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
require "seatsio/exception"
|
2
|
-
require "base64"
|
3
|
-
require "seatsio/httpClient"
|
4
|
-
require "seatsio/domain"
|
5
|
-
require "json"
|
6
|
-
require "cgi"
|
7
|
-
require "seatsio/domain"
|
8
|
-
|
9
|
-
module Seatsio
|
10
|
-
class SubaccountsClient
|
11
|
-
def initialize(http_client)
|
12
|
-
@http_client = http_client
|
13
|
-
end
|
14
|
-
|
15
|
-
def create(name: nil)
|
16
|
-
body = {}
|
17
|
-
body['name'] = name if name
|
18
|
-
|
19
|
-
response = @http_client.post("subaccounts", body)
|
20
|
-
Subaccount.new(response)
|
21
|
-
end
|
22
|
-
|
23
|
-
def update(id:, name: nil)
|
24
|
-
body = {}
|
25
|
-
body['name'] = name if name
|
26
|
-
@http_client.post("subaccounts/#{id}", body)
|
27
|
-
end
|
28
|
-
|
29
|
-
def list(filter: nil)
|
30
|
-
extended_cursor = cursor
|
31
|
-
extended_cursor.set_query_param('filter', filter)
|
32
|
-
extended_cursor
|
33
|
-
end
|
34
|
-
|
35
|
-
def active
|
36
|
-
cursor status: 'active'
|
37
|
-
end
|
38
|
-
|
39
|
-
def inactive
|
40
|
-
cursor status: 'inactive'
|
41
|
-
end
|
42
|
-
|
43
|
-
def activate(id:)
|
44
|
-
@http_client.post("/subaccounts/#{id}/actions/activate")
|
45
|
-
end
|
46
|
-
|
47
|
-
def deactivate(id:)
|
48
|
-
@http_client.post("/subaccounts/#{id}/actions/deactivate")
|
49
|
-
end
|
50
|
-
|
51
|
-
def retrieve(id:)
|
52
|
-
response = @http_client.get("/subaccounts/#{id}")
|
53
|
-
Subaccount.new(response)
|
54
|
-
end
|
55
|
-
|
56
|
-
def copy_chart_to_parent(id: nil, chart_key: nil)
|
57
|
-
response = @http_client.post("/subaccounts/#{id}/charts/#{chart_key}/actions/copy-to/parent")
|
58
|
-
Chart.new(response)
|
59
|
-
end
|
60
|
-
|
61
|
-
def copy_chart_to_subaccount(from_id: nil, to_id: nil, chart_key: nil)
|
62
|
-
response = @http_client.post("/subaccounts/#{from_id}/charts/#{chart_key}/actions/copy-to/#{to_id}")
|
63
|
-
Chart.new(response)
|
64
|
-
end
|
65
|
-
|
66
|
-
def regenerate_secret_key(id:)
|
67
|
-
@http_client.post("/subaccounts/#{id}/secret-key/actions/regenerate")
|
68
|
-
end
|
69
|
-
|
70
|
-
def regenerate_designer_key(id:)
|
71
|
-
@http_client.post("/subaccounts/#{id}/designer-key/actions/regenerate")
|
72
|
-
end
|
73
|
-
|
74
|
-
private
|
75
|
-
|
76
|
-
def cursor(status: nil)
|
77
|
-
endpoint = status ? "subaccounts/#{status}" : 'subaccounts'
|
78
|
-
Pagination::Cursor.new(Subaccount, endpoint, @http_client)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|