seatsio 39.0.0 → 40.0.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seatsio/channels.rb +48 -0
- data/lib/seatsio/events.rb +4 -8
- data/lib/seatsio/httpClient.rb +3 -3
- data/lib/seatsio/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 318b95da4bc9436f82da06e2ba06af0e9ed25054e8328603496bca8e43e71758
|
4
|
+
data.tar.gz: 6efaef3cce86f803f1e8ed65346065181e565f2459fc303dc6ce0f2156ff48be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea50b19a573dfa2403d7e4f66fc6d64ae0396af968cf3469d112ef54c1b0611646fc9b03802f654c0ee96f0d670c6b2e1f1efdfad503c0b37b867889ce0998e
|
7
|
+
data.tar.gz: a4f17bd2c0b680ed75dec260e66b02715a0c8897713eb34ee6e74e738bef0e1bb7737a4a9682a3a3f243eac72c501d80078d401b406e713c3db32bd010ae0c3d
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
module Seatsio
|
2
|
+
|
3
|
+
class ChannelsClient
|
4
|
+
def initialize(http_client)
|
5
|
+
@http_client = http_client
|
6
|
+
end
|
7
|
+
|
8
|
+
def add(event_key:, channel_key:, channel_name:, channel_color:, index: nil, objects: nil)
|
9
|
+
payload = {
|
10
|
+
key: channel_key,
|
11
|
+
name: channel_name,
|
12
|
+
color: channel_color
|
13
|
+
}
|
14
|
+
payload['index'] = index if index != nil
|
15
|
+
payload['objects'] = objects if objects != nil
|
16
|
+
@http_client.post("events/#{event_key}/channels", payload)
|
17
|
+
end
|
18
|
+
|
19
|
+
def remove(event_key:, channel_key:)
|
20
|
+
@http_client.delete("events/#{event_key}/channels/#{channel_key}")
|
21
|
+
end
|
22
|
+
|
23
|
+
def update(event_key:, channel_key:, channel_name: nil, channel_color: nil, objects: nil)
|
24
|
+
payload = {}
|
25
|
+
payload['name'] = channel_name if channel_name != nil
|
26
|
+
payload['color'] = channel_color if channel_color != nil
|
27
|
+
payload['objects'] = objects if objects != nil
|
28
|
+
@http_client.post("events/#{event_key}/channels/#{channel_key}", payload)
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_objects(event_key:, channel_key:, objects:)
|
32
|
+
@http_client.post("events/#{event_key}/channels/#{channel_key}/objects", { objects: objects })
|
33
|
+
end
|
34
|
+
|
35
|
+
def remove_objects(event_key:, channel_key:, objects:)
|
36
|
+
@http_client.delete("events/#{event_key}/channels/#{channel_key}/objects", { objects: objects })
|
37
|
+
end
|
38
|
+
|
39
|
+
def replace(key:, channels:)
|
40
|
+
@http_client.post("events/#{key}/channels/update", channels: channels)
|
41
|
+
end
|
42
|
+
|
43
|
+
def set_objects(key:, channelConfig:)
|
44
|
+
@http_client.post("events/#{key}/channels/assign-objects", channelConfig: channelConfig)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
data/lib/seatsio/events.rb
CHANGED
@@ -6,12 +6,16 @@ require "json"
|
|
6
6
|
require "cgi"
|
7
7
|
require "seatsio/events/change_object_status_request"
|
8
8
|
require "seatsio/events/change_best_available_object_status_request"
|
9
|
+
require 'seatsio/channels'
|
9
10
|
|
10
11
|
module Seatsio
|
11
12
|
|
12
13
|
class EventsClient
|
14
|
+
attr_reader :channels
|
15
|
+
|
13
16
|
def initialize(http_client)
|
14
17
|
@http_client = http_client
|
18
|
+
@channels = ChannelsClient.new(@http_client)
|
15
19
|
end
|
16
20
|
|
17
21
|
def create(chart_key: nil, event_key: nil, table_booking_config: nil, social_distancing_ruleset_key: nil, object_categories: nil)
|
@@ -142,14 +146,6 @@ module Seatsio
|
|
142
146
|
@http_client.post("events/#{key}/actions/mark-as-for-sale", request)
|
143
147
|
end
|
144
148
|
|
145
|
-
def update_channels(key:, channels:)
|
146
|
-
@http_client.post("events/#{key}/channels/update", channels: channels)
|
147
|
-
end
|
148
|
-
|
149
|
-
def assign_objects_to_channels(key:, channelConfig:)
|
150
|
-
@http_client.post("events/#{key}/channels/assign-objects", channelConfig: channelConfig)
|
151
|
-
end
|
152
|
-
|
153
149
|
private
|
154
150
|
|
155
151
|
def build_parameters_for_mark_as_sale(objects: nil, categories: nil)
|
data/lib/seatsio/httpClient.rb
CHANGED
@@ -33,7 +33,7 @@ module Seatsio
|
|
33
33
|
|
34
34
|
request_options = { method: args[0], url: url, headers: headers }
|
35
35
|
|
36
|
-
if args[0] == :post
|
36
|
+
if args[0] == :post || args[0] == :delete
|
37
37
|
args[2].delete :params
|
38
38
|
request_options[:payload] = args[2].to_json
|
39
39
|
end
|
@@ -90,8 +90,8 @@ module Seatsio
|
|
90
90
|
execute(:post, endpoint, payload)
|
91
91
|
end
|
92
92
|
|
93
|
-
def delete(endpoint)
|
94
|
-
execute(:delete, endpoint,
|
93
|
+
def delete(endpoint, payload = {})
|
94
|
+
execute(:delete, endpoint, payload)
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
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: 40.0.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: 2022-06-
|
11
|
+
date: 2022-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- bin/console
|
113
113
|
- bin/setup
|
114
114
|
- lib/seatsio.rb
|
115
|
+
- lib/seatsio/channels.rb
|
115
116
|
- lib/seatsio/chart_reports.rb
|
116
117
|
- lib/seatsio/charts.rb
|
117
118
|
- lib/seatsio/domain.rb
|