seatschart 0.1.0 → 0.2.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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -3
  3. data/lib/seatschart/api/charts_api.rb +9 -9
  4. data/lib/seatschart/api/embed_api.rb +13 -2
  5. data/lib/seatschart/api/event_log_api.rb +2 -2
  6. data/lib/seatschart/api/events_api.rb +186 -20
  7. data/lib/seatschart/api/listings_api.rb +884 -0
  8. data/lib/seatschart/api/object_status_api.rb +2 -2
  9. data/lib/seatschart/api/seasons_api.rb +113 -8
  10. data/lib/seatschart/api/seats_api.rb +3 -22
  11. data/lib/seatschart/api/usage_api.rb +4 -4
  12. data/lib/seatschart/api/webhooks_api.rb +2 -2
  13. data/lib/seatschart/api/workspace_api.rb +4 -4
  14. data/lib/seatschart/models/api_error.rb +307 -0
  15. data/lib/seatschart/models/api_error_params_value.rb +105 -0
  16. data/lib/seatschart/models/get_api_monitoring_requests200_response.rb +17 -1
  17. data/lib/seatschart/models/get_api_monitoring_requests200_response_concurrency.rb +318 -0
  18. data/lib/seatschart/models/get_api_monitoring_requests200_response_concurrency_api_keys_inner.rb +297 -0
  19. data/lib/seatschart/models/get_api_monitoring_requests200_response_points_inner.rb +21 -4
  20. data/lib/seatschart/models/get_api_workspace_settings200_response_effective.rb +20 -4
  21. data/lib/seatschart/models/get_api_workspace_settings200_response_overrides.rb +13 -4
  22. data/lib/seatschart/models/get_api_workspace_settings200_response_sources.rb +32 -4
  23. data/lib/seatschart/models/patch_api_events_by_event_id_listings_by_listing_id_request.rb +379 -0
  24. data/lib/seatschart/models/patch_api_listing_types_by_key_request.rb +376 -0
  25. data/lib/seatschart/models/patch_api_seasons_by_season_id_partial_seasons_by_partial_season_id_request.rb +268 -0
  26. data/lib/seatschart/models/patch_api_seasons_by_season_id_request.rb +27 -1
  27. data/lib/seatschart/models/patch_api_webhooks_by_id_request.rb +1 -1
  28. data/lib/seatschart/models/patch_api_workspace_settings_request.rb +12 -1
  29. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request_seats_inner_accessibility.rb +6 -6
  30. data/lib/seatschart/models/post_api_events_actions_change_object_status_request_status_changes_inner.rb +0 -11
  31. data/lib/seatschart/models/post_api_events_by_event_id_actions_change_object_status_request.rb +13 -26
  32. data/lib/seatschart/models/post_api_events_by_event_id_actions_change_object_status_request_listing.rb +392 -0
  33. data/lib/seatschart/models/post_api_events_by_event_id_actions_mark_everything_as_not_for_sale_request.rb +215 -0
  34. data/lib/seatschart/models/post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request.rb +243 -0
  35. data/lib/seatschart/models/post_api_events_by_event_id_listings_request.rb +435 -0
  36. data/lib/seatschart/models/post_api_events_by_event_id_listings_request_objects_inner.rb +104 -0
  37. data/lib/seatschart/models/post_api_events_by_event_id_listings_request_objects_inner_any_of.rb +325 -0
  38. data/lib/seatschart/models/post_api_ga_confirm_request.rb +0 -44
  39. data/lib/seatschart/models/post_api_ga_release_request.rb +0 -11
  40. data/lib/seatschart/models/post_api_ga_reserve_request.rb +0 -33
  41. data/lib/seatschart/models/post_api_hold_tokens_request.rb +0 -22
  42. data/lib/seatschart/models/post_api_listing_types_request.rb +439 -0
  43. data/lib/seatschart/models/post_api_quotes_request.rb +0 -22
  44. data/lib/seatschart/models/post_api_seasons_by_season_id_partial_seasons_request.rb +27 -1
  45. data/lib/seatschart/models/post_api_seasons_request.rb +27 -1
  46. data/lib/seatschart/models/post_api_seats_best_available_request.rb +0 -11
  47. data/lib/seatschart/models/post_api_seats_confirm_request.rb +0 -44
  48. data/lib/seatschart/models/post_api_seats_release_request.rb +0 -11
  49. data/lib/seatschart/models/post_api_seats_reserve_request.rb +0 -22
  50. data/lib/seatschart/models/post_api_viewer_tokens_request.rb +0 -11
  51. data/lib/seatschart/models/post_api_webhooks_request.rb +1 -1
  52. data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +348 -0
  53. data/lib/seatschart/version.rb +1 -1
  54. data/lib/seatschart.rb +16 -0
  55. metadata +17 -1
@@ -0,0 +1,884 @@
1
+ =begin
2
+ #SeatsChart API
3
+
4
+ #Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SeatsChart
16
+ class ListingsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete a listing type
23
+ # Refused while active listings use it (409 `listing_type_in_use`); closed listings keep their history without the type.
24
+ # @param key [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
27
+ # @return [nil]
28
+ def delete_api_listing_types_by_key(key, opts = {})
29
+ delete_api_listing_types_by_key_with_http_info(key, opts)
30
+ nil
31
+ end
32
+
33
+ # Delete a listing type
34
+ # Refused while active listings use it (409 `listing_type_in_use`); closed listings keep their history without the type.
35
+ # @param key [String]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
38
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
+ def delete_api_listing_types_by_key_with_http_info(key, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ListingsApi.delete_api_listing_types_by_key ...'
42
+ end
43
+ # verify the required parameter 'key' is set
44
+ if @api_client.config.client_side_validation && key.nil?
45
+ fail ArgumentError, "Missing the required parameter 'key' when calling ListingsApi.delete_api_listing_types_by_key"
46
+ end
47
+ if @api_client.config.client_side_validation && key.to_s.length > 64
48
+ fail ArgumentError, 'invalid value for "key" when calling ListingsApi.delete_api_listing_types_by_key, the character length must be smaller than or equal to 64.'
49
+ end
50
+
51
+ if @api_client.config.client_side_validation && key.to_s.length < 1
52
+ fail ArgumentError, 'invalid value for "key" when calling ListingsApi.delete_api_listing_types_by_key, the character length must be great than or equal to 1.'
53
+ end
54
+
55
+ pattern = Regexp.new(/^[A-Za-z0-9][A-Za-z0-9_.~:-]{0,63}$/)
56
+ if @api_client.config.client_side_validation && key !~ pattern
57
+ fail ArgumentError, "invalid value for 'key' when calling ListingsApi.delete_api_listing_types_by_key, must conform to the pattern #{pattern}."
58
+ end
59
+
60
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
61
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.delete_api_listing_types_by_key, the character length must be smaller than or equal to 255.'
62
+ end
63
+
64
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
65
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.delete_api_listing_types_by_key, the character length must be great than or equal to 1.'
66
+ end
67
+
68
+ # resource path
69
+ local_var_path = '/api/listing-types/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
70
+
71
+ # query parameters
72
+ query_params = opts[:query_params] || {}
73
+
74
+ # header parameters
75
+ header_params = opts[:header_params] || {}
76
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
77
+
78
+ # form parameters
79
+ form_params = opts[:form_params] || {}
80
+
81
+ # http body (model)
82
+ post_body = opts[:debug_body]
83
+
84
+ # return_type
85
+ return_type = opts[:debug_return_type]
86
+
87
+ # auth_names
88
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
89
+
90
+ new_options = opts.merge(
91
+ :operation => :"ListingsApi.delete_api_listing_types_by_key",
92
+ :header_params => header_params,
93
+ :query_params => query_params,
94
+ :form_params => form_params,
95
+ :body => post_body,
96
+ :auth_names => auth_names,
97
+ :return_type => return_type
98
+ )
99
+
100
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug "API called: ListingsApi#delete_api_listing_types_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
103
+ end
104
+ return data, status_code, headers
105
+ end
106
+
107
+ # List the listings of an event
108
+ # Creation order; page with `cursor` = the previous `nextCursor`. Filter by `status` and `type` (`resale` includes untyped listings). A listing groups objects of one event sold together (`sellAsWhole`, default true) or one by one, with a price per object (`priceCents`, or per object in `objects[].priceCents`) or a `totalPriceCents` (sold as a whole only). An object belongs to at most one active listing (409 `listing_object_conflict`). **Holds:** holding any seat of a sold-as-whole listing holds all of its seats in the same atomic hold (POST /seats/reserve returns every seat); general-admission places of such a listing are held exactly as listed; confirming part of it is refused (409 `listing_incomplete`); best available never picks its seats. A confirmed order that sells every seat of an active listing closes it as `sold` with the order id. **With live holds**, withdrawing, or changing `objects` or `sellAsWhole`, is refused with 409 `listing_has_holds` (`heldObjects`) until the holds end (confirmed, released or expired); price, type and metadata changes apply at once. Viewers receive listings in the compact state (`listings` block) and live over SSE. Changes are written to the event log (`event.listings_updated`) and delivered as the `event.listings_updated` webhook.
109
+ # @param event_id [String]
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [String] :status
112
+ # @option opts [String] :type
113
+ # @option opts [Integer] :limit Page size (1..100, default 20).
114
+ # @option opts [String] :cursor Opaque &#x60;nextCursor&#x60; value from the previous page.
115
+ # @return [nil]
116
+ def get_api_events_by_event_id_listings(event_id, opts = {})
117
+ get_api_events_by_event_id_listings_with_http_info(event_id, opts)
118
+ nil
119
+ end
120
+
121
+ # List the listings of an event
122
+ # Creation order; page with &#x60;cursor&#x60; &#x3D; the previous &#x60;nextCursor&#x60;. Filter by &#x60;status&#x60; and &#x60;type&#x60; (&#x60;resale&#x60; includes untyped listings). A listing groups objects of one event sold together (&#x60;sellAsWhole&#x60;, default true) or one by one, with a price per object (&#x60;priceCents&#x60;, or per object in &#x60;objects[].priceCents&#x60;) or a &#x60;totalPriceCents&#x60; (sold as a whole only). An object belongs to at most one active listing (409 &#x60;listing_object_conflict&#x60;). **Holds:** holding any seat of a sold-as-whole listing holds all of its seats in the same atomic hold (POST /seats/reserve returns every seat); general-admission places of such a listing are held exactly as listed; confirming part of it is refused (409 &#x60;listing_incomplete&#x60;); best available never picks its seats. A confirmed order that sells every seat of an active listing closes it as &#x60;sold&#x60; with the order id. **With live holds**, withdrawing, or changing &#x60;objects&#x60; or &#x60;sellAsWhole&#x60;, is refused with 409 &#x60;listing_has_holds&#x60; (&#x60;heldObjects&#x60;) until the holds end (confirmed, released or expired); price, type and metadata changes apply at once. Viewers receive listings in the compact state (&#x60;listings&#x60; block) and live over SSE. Changes are written to the event log (&#x60;event.listings_updated&#x60;) and delivered as the &#x60;event.listings_updated&#x60; webhook.
123
+ # @param event_id [String]
124
+ # @param [Hash] opts the optional parameters
125
+ # @option opts [String] :status
126
+ # @option opts [String] :type
127
+ # @option opts [Integer] :limit Page size (1..100, default 20).
128
+ # @option opts [String] :cursor Opaque &#x60;nextCursor&#x60; value from the previous page.
129
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
130
+ def get_api_events_by_event_id_listings_with_http_info(event_id, opts = {})
131
+ if @api_client.config.debugging
132
+ @api_client.config.logger.debug 'Calling API: ListingsApi.get_api_events_by_event_id_listings ...'
133
+ end
134
+ # verify the required parameter 'event_id' is set
135
+ if @api_client.config.client_side_validation && event_id.nil?
136
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling ListingsApi.get_api_events_by_event_id_listings"
137
+ end
138
+ allowable_values = ["active", "sold", "withdrawn"]
139
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
140
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
141
+ end
142
+ if @api_client.config.client_side_validation && !opts[:'type'].nil? && opts[:'type'].to_s.length > 64
143
+ fail ArgumentError, 'invalid value for "opts[:"type"]" when calling ListingsApi.get_api_events_by_event_id_listings, the character length must be smaller than or equal to 64.'
144
+ end
145
+
146
+ if @api_client.config.client_side_validation && !opts[:'type'].nil? && opts[:'type'].to_s.length < 1
147
+ fail ArgumentError, 'invalid value for "opts[:"type"]" when calling ListingsApi.get_api_events_by_event_id_listings, the character length must be great than or equal to 1.'
148
+ end
149
+
150
+ pattern = Regexp.new(/^[A-Za-z0-9][A-Za-z0-9_.~:-]{0,63}$/)
151
+ if @api_client.config.client_side_validation && !opts[:'type'].nil? && opts[:'type'] !~ pattern
152
+ fail ArgumentError, "invalid value for 'opts[:\"type\"]' when calling ListingsApi.get_api_events_by_event_id_listings, must conform to the pattern #{pattern}."
153
+ end
154
+
155
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
156
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListingsApi.get_api_events_by_event_id_listings, must be smaller than or equal to 100.'
157
+ end
158
+
159
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
160
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListingsApi.get_api_events_by_event_id_listings, must be greater than or equal to 1.'
161
+ end
162
+
163
+ if @api_client.config.client_side_validation && !opts[:'cursor'].nil? && opts[:'cursor'].to_s.length > 512
164
+ fail ArgumentError, 'invalid value for "opts[:"cursor"]" when calling ListingsApi.get_api_events_by_event_id_listings, the character length must be smaller than or equal to 512.'
165
+ end
166
+
167
+ if @api_client.config.client_side_validation && !opts[:'cursor'].nil? && opts[:'cursor'].to_s.length < 1
168
+ fail ArgumentError, 'invalid value for "opts[:"cursor"]" when calling ListingsApi.get_api_events_by_event_id_listings, the character length must be great than or equal to 1.'
169
+ end
170
+
171
+ pattern = Regexp.new(/^[A-Za-z0-9_-]+$/)
172
+ if @api_client.config.client_side_validation && !opts[:'cursor'].nil? && opts[:'cursor'] !~ pattern
173
+ fail ArgumentError, "invalid value for 'opts[:\"cursor\"]' when calling ListingsApi.get_api_events_by_event_id_listings, must conform to the pattern #{pattern}."
174
+ end
175
+
176
+ # resource path
177
+ local_var_path = '/api/events/{eventId}/listings'.sub('{' + 'eventId' + '}', CGI.escape(event_id.to_s))
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
182
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
183
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
184
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
185
+
186
+ # header parameters
187
+ header_params = opts[:header_params] || {}
188
+
189
+ # form parameters
190
+ form_params = opts[:form_params] || {}
191
+
192
+ # http body (model)
193
+ post_body = opts[:debug_body]
194
+
195
+ # return_type
196
+ return_type = opts[:debug_return_type]
197
+
198
+ # auth_names
199
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
200
+
201
+ new_options = opts.merge(
202
+ :operation => :"ListingsApi.get_api_events_by_event_id_listings",
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => return_type
209
+ )
210
+
211
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug "API called: ListingsApi#get_api_events_by_event_id_listings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
214
+ end
215
+ return data, status_code, headers
216
+ end
217
+
218
+ # Read a listing
219
+ # By id or key.
220
+ # @param event_id [String]
221
+ # @param listing_id [String] Listing id or key.
222
+ # @param [Hash] opts the optional parameters
223
+ # @return [nil]
224
+ def get_api_events_by_event_id_listings_by_listing_id(event_id, listing_id, opts = {})
225
+ get_api_events_by_event_id_listings_by_listing_id_with_http_info(event_id, listing_id, opts)
226
+ nil
227
+ end
228
+
229
+ # Read a listing
230
+ # By id or key.
231
+ # @param event_id [String]
232
+ # @param listing_id [String] Listing id or key.
233
+ # @param [Hash] opts the optional parameters
234
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
235
+ def get_api_events_by_event_id_listings_by_listing_id_with_http_info(event_id, listing_id, opts = {})
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug 'Calling API: ListingsApi.get_api_events_by_event_id_listings_by_listing_id ...'
238
+ end
239
+ # verify the required parameter 'event_id' is set
240
+ if @api_client.config.client_side_validation && event_id.nil?
241
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling ListingsApi.get_api_events_by_event_id_listings_by_listing_id"
242
+ end
243
+ # verify the required parameter 'listing_id' is set
244
+ if @api_client.config.client_side_validation && listing_id.nil?
245
+ fail ArgumentError, "Missing the required parameter 'listing_id' when calling ListingsApi.get_api_events_by_event_id_listings_by_listing_id"
246
+ end
247
+ if @api_client.config.client_side_validation && listing_id.to_s.length > 64
248
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.get_api_events_by_event_id_listings_by_listing_id, the character length must be smaller than or equal to 64.'
249
+ end
250
+
251
+ if @api_client.config.client_side_validation && listing_id.to_s.length < 1
252
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.get_api_events_by_event_id_listings_by_listing_id, the character length must be great than or equal to 1.'
253
+ end
254
+
255
+ # resource path
256
+ local_var_path = '/api/events/{eventId}/listings/{listingId}'.sub('{' + 'eventId' + '}', CGI.escape(event_id.to_s)).sub('{' + 'listingId' + '}', CGI.escape(listing_id.to_s))
257
+
258
+ # query parameters
259
+ query_params = opts[:query_params] || {}
260
+
261
+ # header parameters
262
+ header_params = opts[:header_params] || {}
263
+
264
+ # form parameters
265
+ form_params = opts[:form_params] || {}
266
+
267
+ # http body (model)
268
+ post_body = opts[:debug_body]
269
+
270
+ # return_type
271
+ return_type = opts[:debug_return_type]
272
+
273
+ # auth_names
274
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
275
+
276
+ new_options = opts.merge(
277
+ :operation => :"ListingsApi.get_api_events_by_event_id_listings_by_listing_id",
278
+ :header_params => header_params,
279
+ :query_params => query_params,
280
+ :form_params => form_params,
281
+ :body => post_body,
282
+ :auth_names => auth_names,
283
+ :return_type => return_type
284
+ )
285
+
286
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug "API called: ListingsApi#get_api_events_by_event_id_listings_by_listing_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
+ end
290
+ return data, status_code, headers
291
+ end
292
+
293
+ # List the listing types of the workspace
294
+ # Listing types give listings their look (`backgroundColor`, `iconColor`, `icon`, shown on seats, in the legend and on the listing price) and their semantics (`kind`: primary | resale, used by the viewer listingType filter). The reserved key `resale` styles every listing created without a type (seats.io convention).
295
+ # @param [Hash] opts the optional parameters
296
+ # @return [nil]
297
+ def get_api_listing_types(opts = {})
298
+ get_api_listing_types_with_http_info(opts)
299
+ nil
300
+ end
301
+
302
+ # List the listing types of the workspace
303
+ # Listing types give listings their look (&#x60;backgroundColor&#x60;, &#x60;iconColor&#x60;, &#x60;icon&#x60;, shown on seats, in the legend and on the listing price) and their semantics (&#x60;kind&#x60;: primary | resale, used by the viewer listingType filter). The reserved key &#x60;resale&#x60; styles every listing created without a type (seats.io convention).
304
+ # @param [Hash] opts the optional parameters
305
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
306
+ def get_api_listing_types_with_http_info(opts = {})
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug 'Calling API: ListingsApi.get_api_listing_types ...'
309
+ end
310
+ # resource path
311
+ local_var_path = '/api/listing-types'
312
+
313
+ # query parameters
314
+ query_params = opts[:query_params] || {}
315
+
316
+ # header parameters
317
+ header_params = opts[:header_params] || {}
318
+
319
+ # form parameters
320
+ form_params = opts[:form_params] || {}
321
+
322
+ # http body (model)
323
+ post_body = opts[:debug_body]
324
+
325
+ # return_type
326
+ return_type = opts[:debug_return_type]
327
+
328
+ # auth_names
329
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
330
+
331
+ new_options = opts.merge(
332
+ :operation => :"ListingsApi.get_api_listing_types",
333
+ :header_params => header_params,
334
+ :query_params => query_params,
335
+ :form_params => form_params,
336
+ :body => post_body,
337
+ :auth_names => auth_names,
338
+ :return_type => return_type
339
+ )
340
+
341
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
342
+ if @api_client.config.debugging
343
+ @api_client.config.logger.debug "API called: ListingsApi#get_api_listing_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
344
+ end
345
+ return data, status_code, headers
346
+ end
347
+
348
+ # Update an active listing
349
+ # Closed listings return 409 `listing_closed`. A listing groups objects of one event sold together (`sellAsWhole`, default true) or one by one, with a price per object (`priceCents`, or per object in `objects[].priceCents`) or a `totalPriceCents` (sold as a whole only). An object belongs to at most one active listing (409 `listing_object_conflict`). **Holds:** holding any seat of a sold-as-whole listing holds all of its seats in the same atomic hold (POST /seats/reserve returns every seat); general-admission places of such a listing are held exactly as listed; confirming part of it is refused (409 `listing_incomplete`); best available never picks its seats. A confirmed order that sells every seat of an active listing closes it as `sold` with the order id. **With live holds**, withdrawing, or changing `objects` or `sellAsWhole`, is refused with 409 `listing_has_holds` (`heldObjects`) until the holds end (confirmed, released or expired); price, type and metadata changes apply at once. Viewers receive listings in the compact state (`listings` block) and live over SSE. Changes are written to the event log (`event.listings_updated`) and delivered as the `event.listings_updated` webhook.
350
+ # @param event_id [String]
351
+ # @param listing_id [String] Listing id or key.
352
+ # @param patch_api_events_by_event_id_listings_by_listing_id_request [PatchApiEventsByEventIdListingsByListingIdRequest]
353
+ # @param [Hash] opts the optional parameters
354
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
355
+ # @return [nil]
356
+ def patch_api_events_by_event_id_listings_by_listing_id(event_id, listing_id, patch_api_events_by_event_id_listings_by_listing_id_request, opts = {})
357
+ patch_api_events_by_event_id_listings_by_listing_id_with_http_info(event_id, listing_id, patch_api_events_by_event_id_listings_by_listing_id_request, opts)
358
+ nil
359
+ end
360
+
361
+ # Update an active listing
362
+ # Closed listings return 409 &#x60;listing_closed&#x60;. A listing groups objects of one event sold together (&#x60;sellAsWhole&#x60;, default true) or one by one, with a price per object (&#x60;priceCents&#x60;, or per object in &#x60;objects[].priceCents&#x60;) or a &#x60;totalPriceCents&#x60; (sold as a whole only). An object belongs to at most one active listing (409 &#x60;listing_object_conflict&#x60;). **Holds:** holding any seat of a sold-as-whole listing holds all of its seats in the same atomic hold (POST /seats/reserve returns every seat); general-admission places of such a listing are held exactly as listed; confirming part of it is refused (409 &#x60;listing_incomplete&#x60;); best available never picks its seats. A confirmed order that sells every seat of an active listing closes it as &#x60;sold&#x60; with the order id. **With live holds**, withdrawing, or changing &#x60;objects&#x60; or &#x60;sellAsWhole&#x60;, is refused with 409 &#x60;listing_has_holds&#x60; (&#x60;heldObjects&#x60;) until the holds end (confirmed, released or expired); price, type and metadata changes apply at once. Viewers receive listings in the compact state (&#x60;listings&#x60; block) and live over SSE. Changes are written to the event log (&#x60;event.listings_updated&#x60;) and delivered as the &#x60;event.listings_updated&#x60; webhook.
363
+ # @param event_id [String]
364
+ # @param listing_id [String] Listing id or key.
365
+ # @param patch_api_events_by_event_id_listings_by_listing_id_request [PatchApiEventsByEventIdListingsByListingIdRequest]
366
+ # @param [Hash] opts the optional parameters
367
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
368
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
369
+ def patch_api_events_by_event_id_listings_by_listing_id_with_http_info(event_id, listing_id, patch_api_events_by_event_id_listings_by_listing_id_request, opts = {})
370
+ if @api_client.config.debugging
371
+ @api_client.config.logger.debug 'Calling API: ListingsApi.patch_api_events_by_event_id_listings_by_listing_id ...'
372
+ end
373
+ # verify the required parameter 'event_id' is set
374
+ if @api_client.config.client_side_validation && event_id.nil?
375
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling ListingsApi.patch_api_events_by_event_id_listings_by_listing_id"
376
+ end
377
+ # verify the required parameter 'listing_id' is set
378
+ if @api_client.config.client_side_validation && listing_id.nil?
379
+ fail ArgumentError, "Missing the required parameter 'listing_id' when calling ListingsApi.patch_api_events_by_event_id_listings_by_listing_id"
380
+ end
381
+ if @api_client.config.client_side_validation && listing_id.to_s.length > 64
382
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.patch_api_events_by_event_id_listings_by_listing_id, the character length must be smaller than or equal to 64.'
383
+ end
384
+
385
+ if @api_client.config.client_side_validation && listing_id.to_s.length < 1
386
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.patch_api_events_by_event_id_listings_by_listing_id, the character length must be great than or equal to 1.'
387
+ end
388
+
389
+ # verify the required parameter 'patch_api_events_by_event_id_listings_by_listing_id_request' is set
390
+ if @api_client.config.client_side_validation && patch_api_events_by_event_id_listings_by_listing_id_request.nil?
391
+ fail ArgumentError, "Missing the required parameter 'patch_api_events_by_event_id_listings_by_listing_id_request' when calling ListingsApi.patch_api_events_by_event_id_listings_by_listing_id"
392
+ end
393
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
394
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.patch_api_events_by_event_id_listings_by_listing_id, the character length must be smaller than or equal to 255.'
395
+ end
396
+
397
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
398
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.patch_api_events_by_event_id_listings_by_listing_id, the character length must be great than or equal to 1.'
399
+ end
400
+
401
+ # resource path
402
+ local_var_path = '/api/events/{eventId}/listings/{listingId}'.sub('{' + 'eventId' + '}', CGI.escape(event_id.to_s)).sub('{' + 'listingId' + '}', CGI.escape(listing_id.to_s))
403
+
404
+ # query parameters
405
+ query_params = opts[:query_params] || {}
406
+
407
+ # header parameters
408
+ header_params = opts[:header_params] || {}
409
+ # HTTP header 'Content-Type'
410
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
411
+ if !content_type.nil?
412
+ header_params['Content-Type'] = content_type
413
+ end
414
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
415
+
416
+ # form parameters
417
+ form_params = opts[:form_params] || {}
418
+
419
+ # http body (model)
420
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_api_events_by_event_id_listings_by_listing_id_request)
421
+
422
+ # return_type
423
+ return_type = opts[:debug_return_type]
424
+
425
+ # auth_names
426
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
427
+
428
+ new_options = opts.merge(
429
+ :operation => :"ListingsApi.patch_api_events_by_event_id_listings_by_listing_id",
430
+ :header_params => header_params,
431
+ :query_params => query_params,
432
+ :form_params => form_params,
433
+ :body => post_body,
434
+ :auth_names => auth_names,
435
+ :return_type => return_type
436
+ )
437
+
438
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
439
+ if @api_client.config.debugging
440
+ @api_client.config.logger.debug "API called: ListingsApi#patch_api_events_by_event_id_listings_by_listing_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
441
+ end
442
+ return data, status_code, headers
443
+ end
444
+
445
+ # Update a listing type
446
+ # Viewers of events with active listings of this type receive the new look at once (SSE).
447
+ # @param key [String]
448
+ # @param patch_api_listing_types_by_key_request [PatchApiListingTypesByKeyRequest]
449
+ # @param [Hash] opts the optional parameters
450
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
451
+ # @return [nil]
452
+ def patch_api_listing_types_by_key(key, patch_api_listing_types_by_key_request, opts = {})
453
+ patch_api_listing_types_by_key_with_http_info(key, patch_api_listing_types_by_key_request, opts)
454
+ nil
455
+ end
456
+
457
+ # Update a listing type
458
+ # Viewers of events with active listings of this type receive the new look at once (SSE).
459
+ # @param key [String]
460
+ # @param patch_api_listing_types_by_key_request [PatchApiListingTypesByKeyRequest]
461
+ # @param [Hash] opts the optional parameters
462
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
463
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
464
+ def patch_api_listing_types_by_key_with_http_info(key, patch_api_listing_types_by_key_request, opts = {})
465
+ if @api_client.config.debugging
466
+ @api_client.config.logger.debug 'Calling API: ListingsApi.patch_api_listing_types_by_key ...'
467
+ end
468
+ # verify the required parameter 'key' is set
469
+ if @api_client.config.client_side_validation && key.nil?
470
+ fail ArgumentError, "Missing the required parameter 'key' when calling ListingsApi.patch_api_listing_types_by_key"
471
+ end
472
+ if @api_client.config.client_side_validation && key.to_s.length > 64
473
+ fail ArgumentError, 'invalid value for "key" when calling ListingsApi.patch_api_listing_types_by_key, the character length must be smaller than or equal to 64.'
474
+ end
475
+
476
+ if @api_client.config.client_side_validation && key.to_s.length < 1
477
+ fail ArgumentError, 'invalid value for "key" when calling ListingsApi.patch_api_listing_types_by_key, the character length must be great than or equal to 1.'
478
+ end
479
+
480
+ pattern = Regexp.new(/^[A-Za-z0-9][A-Za-z0-9_.~:-]{0,63}$/)
481
+ if @api_client.config.client_side_validation && key !~ pattern
482
+ fail ArgumentError, "invalid value for 'key' when calling ListingsApi.patch_api_listing_types_by_key, must conform to the pattern #{pattern}."
483
+ end
484
+
485
+ # verify the required parameter 'patch_api_listing_types_by_key_request' is set
486
+ if @api_client.config.client_side_validation && patch_api_listing_types_by_key_request.nil?
487
+ fail ArgumentError, "Missing the required parameter 'patch_api_listing_types_by_key_request' when calling ListingsApi.patch_api_listing_types_by_key"
488
+ end
489
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
490
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.patch_api_listing_types_by_key, the character length must be smaller than or equal to 255.'
491
+ end
492
+
493
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
494
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.patch_api_listing_types_by_key, the character length must be great than or equal to 1.'
495
+ end
496
+
497
+ # resource path
498
+ local_var_path = '/api/listing-types/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
499
+
500
+ # query parameters
501
+ query_params = opts[:query_params] || {}
502
+
503
+ # header parameters
504
+ header_params = opts[:header_params] || {}
505
+ # HTTP header 'Content-Type'
506
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
507
+ if !content_type.nil?
508
+ header_params['Content-Type'] = content_type
509
+ end
510
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
511
+
512
+ # form parameters
513
+ form_params = opts[:form_params] || {}
514
+
515
+ # http body (model)
516
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_api_listing_types_by_key_request)
517
+
518
+ # return_type
519
+ return_type = opts[:debug_return_type]
520
+
521
+ # auth_names
522
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
523
+
524
+ new_options = opts.merge(
525
+ :operation => :"ListingsApi.patch_api_listing_types_by_key",
526
+ :header_params => header_params,
527
+ :query_params => query_params,
528
+ :form_params => form_params,
529
+ :body => post_body,
530
+ :auth_names => auth_names,
531
+ :return_type => return_type
532
+ )
533
+
534
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
535
+ if @api_client.config.debugging
536
+ @api_client.config.logger.debug "API called: ListingsApi#patch_api_listing_types_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
537
+ end
538
+ return data, status_code, headers
539
+ end
540
+
541
+ # Create a listing
542
+ # Objects by id or label (max 50); key unique per event (409 `listing_key_taken`; a UUID is generated when omitted). Partner keys need the `bookings` scope. A listing groups objects of one event sold together (`sellAsWhole`, default true) or one by one, with a price per object (`priceCents`, or per object in `objects[].priceCents`) or a `totalPriceCents` (sold as a whole only). An object belongs to at most one active listing (409 `listing_object_conflict`). **Holds:** holding any seat of a sold-as-whole listing holds all of its seats in the same atomic hold (POST /seats/reserve returns every seat); general-admission places of such a listing are held exactly as listed; confirming part of it is refused (409 `listing_incomplete`); best available never picks its seats. A confirmed order that sells every seat of an active listing closes it as `sold` with the order id. **With live holds**, withdrawing, or changing `objects` or `sellAsWhole`, is refused with 409 `listing_has_holds` (`heldObjects`) until the holds end (confirmed, released or expired); price, type and metadata changes apply at once. Viewers receive listings in the compact state (`listings` block) and live over SSE. Changes are written to the event log (`event.listings_updated`) and delivered as the `event.listings_updated` webhook.
543
+ # @param event_id [String]
544
+ # @param post_api_events_by_event_id_listings_request [PostApiEventsByEventIdListingsRequest]
545
+ # @param [Hash] opts the optional parameters
546
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
547
+ # @return [nil]
548
+ def post_api_events_by_event_id_listings(event_id, post_api_events_by_event_id_listings_request, opts = {})
549
+ post_api_events_by_event_id_listings_with_http_info(event_id, post_api_events_by_event_id_listings_request, opts)
550
+ nil
551
+ end
552
+
553
+ # Create a listing
554
+ # Objects by id or label (max 50); key unique per event (409 &#x60;listing_key_taken&#x60;; a UUID is generated when omitted). Partner keys need the &#x60;bookings&#x60; scope. A listing groups objects of one event sold together (&#x60;sellAsWhole&#x60;, default true) or one by one, with a price per object (&#x60;priceCents&#x60;, or per object in &#x60;objects[].priceCents&#x60;) or a &#x60;totalPriceCents&#x60; (sold as a whole only). An object belongs to at most one active listing (409 &#x60;listing_object_conflict&#x60;). **Holds:** holding any seat of a sold-as-whole listing holds all of its seats in the same atomic hold (POST /seats/reserve returns every seat); general-admission places of such a listing are held exactly as listed; confirming part of it is refused (409 &#x60;listing_incomplete&#x60;); best available never picks its seats. A confirmed order that sells every seat of an active listing closes it as &#x60;sold&#x60; with the order id. **With live holds**, withdrawing, or changing &#x60;objects&#x60; or &#x60;sellAsWhole&#x60;, is refused with 409 &#x60;listing_has_holds&#x60; (&#x60;heldObjects&#x60;) until the holds end (confirmed, released or expired); price, type and metadata changes apply at once. Viewers receive listings in the compact state (&#x60;listings&#x60; block) and live over SSE. Changes are written to the event log (&#x60;event.listings_updated&#x60;) and delivered as the &#x60;event.listings_updated&#x60; webhook.
555
+ # @param event_id [String]
556
+ # @param post_api_events_by_event_id_listings_request [PostApiEventsByEventIdListingsRequest]
557
+ # @param [Hash] opts the optional parameters
558
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
559
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
560
+ def post_api_events_by_event_id_listings_with_http_info(event_id, post_api_events_by_event_id_listings_request, opts = {})
561
+ if @api_client.config.debugging
562
+ @api_client.config.logger.debug 'Calling API: ListingsApi.post_api_events_by_event_id_listings ...'
563
+ end
564
+ # verify the required parameter 'event_id' is set
565
+ if @api_client.config.client_side_validation && event_id.nil?
566
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling ListingsApi.post_api_events_by_event_id_listings"
567
+ end
568
+ # verify the required parameter 'post_api_events_by_event_id_listings_request' is set
569
+ if @api_client.config.client_side_validation && post_api_events_by_event_id_listings_request.nil?
570
+ fail ArgumentError, "Missing the required parameter 'post_api_events_by_event_id_listings_request' when calling ListingsApi.post_api_events_by_event_id_listings"
571
+ end
572
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
573
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_events_by_event_id_listings, the character length must be smaller than or equal to 255.'
574
+ end
575
+
576
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
577
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_events_by_event_id_listings, the character length must be great than or equal to 1.'
578
+ end
579
+
580
+ # resource path
581
+ local_var_path = '/api/events/{eventId}/listings'.sub('{' + 'eventId' + '}', CGI.escape(event_id.to_s))
582
+
583
+ # query parameters
584
+ query_params = opts[:query_params] || {}
585
+
586
+ # header parameters
587
+ header_params = opts[:header_params] || {}
588
+ # HTTP header 'Content-Type'
589
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
590
+ if !content_type.nil?
591
+ header_params['Content-Type'] = content_type
592
+ end
593
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
594
+
595
+ # form parameters
596
+ form_params = opts[:form_params] || {}
597
+
598
+ # http body (model)
599
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_events_by_event_id_listings_request)
600
+
601
+ # return_type
602
+ return_type = opts[:debug_return_type]
603
+
604
+ # auth_names
605
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
606
+
607
+ new_options = opts.merge(
608
+ :operation => :"ListingsApi.post_api_events_by_event_id_listings",
609
+ :header_params => header_params,
610
+ :query_params => query_params,
611
+ :form_params => form_params,
612
+ :body => post_body,
613
+ :auth_names => auth_names,
614
+ :return_type => return_type
615
+ )
616
+
617
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
618
+ if @api_client.config.debugging
619
+ @api_client.config.logger.debug "API called: ListingsApi#post_api_events_by_event_id_listings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
620
+ end
621
+ return data, status_code, headers
622
+ end
623
+
624
+ # Mark a listing as sold
625
+ # For listings sold outside SeatsChart (for example a resale settled by the partner). Listings sold through a confirmed order close by themselves.
626
+ # @param event_id [String]
627
+ # @param listing_id [String] Listing id or key.
628
+ # @param post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request [PostApiEventsByEventIdListingsByListingIdActionsMarkSoldRequest]
629
+ # @param [Hash] opts the optional parameters
630
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
631
+ # @return [nil]
632
+ def post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold(event_id, listing_id, post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request, opts = {})
633
+ post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_with_http_info(event_id, listing_id, post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request, opts)
634
+ nil
635
+ end
636
+
637
+ # Mark a listing as sold
638
+ # For listings sold outside SeatsChart (for example a resale settled by the partner). Listings sold through a confirmed order close by themselves.
639
+ # @param event_id [String]
640
+ # @param listing_id [String] Listing id or key.
641
+ # @param post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request [PostApiEventsByEventIdListingsByListingIdActionsMarkSoldRequest]
642
+ # @param [Hash] opts the optional parameters
643
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
644
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
645
+ def post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_with_http_info(event_id, listing_id, post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request, opts = {})
646
+ if @api_client.config.debugging
647
+ @api_client.config.logger.debug 'Calling API: ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold ...'
648
+ end
649
+ # verify the required parameter 'event_id' is set
650
+ if @api_client.config.client_side_validation && event_id.nil?
651
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold"
652
+ end
653
+ # verify the required parameter 'listing_id' is set
654
+ if @api_client.config.client_side_validation && listing_id.nil?
655
+ fail ArgumentError, "Missing the required parameter 'listing_id' when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold"
656
+ end
657
+ if @api_client.config.client_side_validation && listing_id.to_s.length > 64
658
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold, the character length must be smaller than or equal to 64.'
659
+ end
660
+
661
+ if @api_client.config.client_side_validation && listing_id.to_s.length < 1
662
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold, the character length must be great than or equal to 1.'
663
+ end
664
+
665
+ # verify the required parameter 'post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request' is set
666
+ if @api_client.config.client_side_validation && post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request.nil?
667
+ fail ArgumentError, "Missing the required parameter 'post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request' when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold"
668
+ end
669
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
670
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold, the character length must be smaller than or equal to 255.'
671
+ end
672
+
673
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
674
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold, the character length must be great than or equal to 1.'
675
+ end
676
+
677
+ # resource path
678
+ local_var_path = '/api/events/{eventId}/listings/{listingId}/actions/mark-sold'.sub('{' + 'eventId' + '}', CGI.escape(event_id.to_s)).sub('{' + 'listingId' + '}', CGI.escape(listing_id.to_s))
679
+
680
+ # query parameters
681
+ query_params = opts[:query_params] || {}
682
+
683
+ # header parameters
684
+ header_params = opts[:header_params] || {}
685
+ # HTTP header 'Content-Type'
686
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
687
+ if !content_type.nil?
688
+ header_params['Content-Type'] = content_type
689
+ end
690
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
691
+
692
+ # form parameters
693
+ form_params = opts[:form_params] || {}
694
+
695
+ # http body (model)
696
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request)
697
+
698
+ # return_type
699
+ return_type = opts[:debug_return_type]
700
+
701
+ # auth_names
702
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
703
+
704
+ new_options = opts.merge(
705
+ :operation => :"ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold",
706
+ :header_params => header_params,
707
+ :query_params => query_params,
708
+ :form_params => form_params,
709
+ :body => post_body,
710
+ :auth_names => auth_names,
711
+ :return_type => return_type
712
+ )
713
+
714
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
715
+ if @api_client.config.debugging
716
+ @api_client.config.logger.debug "API called: ListingsApi#post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
717
+ end
718
+ return data, status_code, headers
719
+ end
720
+
721
+ # Withdraw a listing
722
+ # The objects leave the listing (they keep their status; resale objects stay booked). Refused with 409 `listing_has_holds` while any object is held: retry after the holds end. Closed listings return 409 `listing_closed`.
723
+ # @param event_id [String]
724
+ # @param listing_id [String] Listing id or key.
725
+ # @param [Hash] opts the optional parameters
726
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
727
+ # @return [nil]
728
+ def post_api_events_by_event_id_listings_by_listing_id_actions_withdraw(event_id, listing_id, opts = {})
729
+ post_api_events_by_event_id_listings_by_listing_id_actions_withdraw_with_http_info(event_id, listing_id, opts)
730
+ nil
731
+ end
732
+
733
+ # Withdraw a listing
734
+ # The objects leave the listing (they keep their status; resale objects stay booked). Refused with 409 &#x60;listing_has_holds&#x60; while any object is held: retry after the holds end. Closed listings return 409 &#x60;listing_closed&#x60;.
735
+ # @param event_id [String]
736
+ # @param listing_id [String] Listing id or key.
737
+ # @param [Hash] opts the optional parameters
738
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
739
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
740
+ def post_api_events_by_event_id_listings_by_listing_id_actions_withdraw_with_http_info(event_id, listing_id, opts = {})
741
+ if @api_client.config.debugging
742
+ @api_client.config.logger.debug 'Calling API: ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw ...'
743
+ end
744
+ # verify the required parameter 'event_id' is set
745
+ if @api_client.config.client_side_validation && event_id.nil?
746
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw"
747
+ end
748
+ # verify the required parameter 'listing_id' is set
749
+ if @api_client.config.client_side_validation && listing_id.nil?
750
+ fail ArgumentError, "Missing the required parameter 'listing_id' when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw"
751
+ end
752
+ if @api_client.config.client_side_validation && listing_id.to_s.length > 64
753
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw, the character length must be smaller than or equal to 64.'
754
+ end
755
+
756
+ if @api_client.config.client_side_validation && listing_id.to_s.length < 1
757
+ fail ArgumentError, 'invalid value for "listing_id" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw, the character length must be great than or equal to 1.'
758
+ end
759
+
760
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
761
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw, the character length must be smaller than or equal to 255.'
762
+ end
763
+
764
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
765
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw, the character length must be great than or equal to 1.'
766
+ end
767
+
768
+ # resource path
769
+ local_var_path = '/api/events/{eventId}/listings/{listingId}/actions/withdraw'.sub('{' + 'eventId' + '}', CGI.escape(event_id.to_s)).sub('{' + 'listingId' + '}', CGI.escape(listing_id.to_s))
770
+
771
+ # query parameters
772
+ query_params = opts[:query_params] || {}
773
+
774
+ # header parameters
775
+ header_params = opts[:header_params] || {}
776
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
777
+
778
+ # form parameters
779
+ form_params = opts[:form_params] || {}
780
+
781
+ # http body (model)
782
+ post_body = opts[:debug_body]
783
+
784
+ # return_type
785
+ return_type = opts[:debug_return_type]
786
+
787
+ # auth_names
788
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
789
+
790
+ new_options = opts.merge(
791
+ :operation => :"ListingsApi.post_api_events_by_event_id_listings_by_listing_id_actions_withdraw",
792
+ :header_params => header_params,
793
+ :query_params => query_params,
794
+ :form_params => form_params,
795
+ :body => post_body,
796
+ :auth_names => auth_names,
797
+ :return_type => return_type
798
+ )
799
+
800
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
801
+ if @api_client.config.debugging
802
+ @api_client.config.logger.debug "API called: ListingsApi#post_api_events_by_event_id_listings_by_listing_id_actions_withdraw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
803
+ end
804
+ return data, status_code, headers
805
+ end
806
+
807
+ # Create a listing type
808
+ # Key unique per workspace (409 `listing_type_exists`). Partner keys need the `events_write` scope.
809
+ # @param post_api_listing_types_request [PostApiListingTypesRequest]
810
+ # @param [Hash] opts the optional parameters
811
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
812
+ # @return [nil]
813
+ def post_api_listing_types(post_api_listing_types_request, opts = {})
814
+ post_api_listing_types_with_http_info(post_api_listing_types_request, opts)
815
+ nil
816
+ end
817
+
818
+ # Create a listing type
819
+ # Key unique per workspace (409 &#x60;listing_type_exists&#x60;). Partner keys need the &#x60;events_write&#x60; scope.
820
+ # @param post_api_listing_types_request [PostApiListingTypesRequest]
821
+ # @param [Hash] opts the optional parameters
822
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
823
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
824
+ def post_api_listing_types_with_http_info(post_api_listing_types_request, opts = {})
825
+ if @api_client.config.debugging
826
+ @api_client.config.logger.debug 'Calling API: ListingsApi.post_api_listing_types ...'
827
+ end
828
+ # verify the required parameter 'post_api_listing_types_request' is set
829
+ if @api_client.config.client_side_validation && post_api_listing_types_request.nil?
830
+ fail ArgumentError, "Missing the required parameter 'post_api_listing_types_request' when calling ListingsApi.post_api_listing_types"
831
+ end
832
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
833
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_listing_types, the character length must be smaller than or equal to 255.'
834
+ end
835
+
836
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
837
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ListingsApi.post_api_listing_types, the character length must be great than or equal to 1.'
838
+ end
839
+
840
+ # resource path
841
+ local_var_path = '/api/listing-types'
842
+
843
+ # query parameters
844
+ query_params = opts[:query_params] || {}
845
+
846
+ # header parameters
847
+ header_params = opts[:header_params] || {}
848
+ # HTTP header 'Content-Type'
849
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
850
+ if !content_type.nil?
851
+ header_params['Content-Type'] = content_type
852
+ end
853
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
854
+
855
+ # form parameters
856
+ form_params = opts[:form_params] || {}
857
+
858
+ # http body (model)
859
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_listing_types_request)
860
+
861
+ # return_type
862
+ return_type = opts[:debug_return_type]
863
+
864
+ # auth_names
865
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
866
+
867
+ new_options = opts.merge(
868
+ :operation => :"ListingsApi.post_api_listing_types",
869
+ :header_params => header_params,
870
+ :query_params => query_params,
871
+ :form_params => form_params,
872
+ :body => post_body,
873
+ :auth_names => auth_names,
874
+ :return_type => return_type
875
+ )
876
+
877
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
878
+ if @api_client.config.debugging
879
+ @api_client.config.logger.debug "API called: ListingsApi#post_api_listing_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
880
+ end
881
+ return data, status_code, headers
882
+ end
883
+ end
884
+ end