svix 1.39.0 → 1.41.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/stream_api.rb +157 -0
  4. data/lib/svix/api/stream_event_types_api.rb +486 -0
  5. data/lib/svix/models/app_usage_stats_in.rb +1 -0
  6. data/lib/svix/models/app_usage_stats_out.rb +33 -4
  7. data/lib/svix/models/event_example_in.rb +35 -4
  8. data/lib/svix/models/event_in.rb +38 -1
  9. data/lib/svix/models/event_out.rb +38 -1
  10. data/lib/svix/models/list_response_application_out.rb +2 -0
  11. data/lib/svix/models/list_response_application_stats.rb +2 -0
  12. data/lib/svix/models/list_response_background_task_out.rb +2 -0
  13. data/lib/svix/models/list_response_endpoint_message_out.rb +2 -0
  14. data/lib/svix/models/list_response_endpoint_out.rb +2 -0
  15. data/lib/svix/models/list_response_event_type_out.rb +2 -0
  16. data/lib/svix/models/list_response_integration_out.rb +2 -0
  17. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +2 -0
  18. data/lib/svix/models/list_response_message_attempt_out.rb +2 -0
  19. data/lib/svix/models/list_response_message_endpoint_out.rb +2 -0
  20. data/lib/svix/models/list_response_message_out.rb +2 -0
  21. data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +2 -0
  22. data/lib/svix/models/list_response_sink_out.rb +2 -0
  23. data/lib/svix/models/list_response_stream_event_type_out.rb +261 -0
  24. data/lib/svix/models/list_response_stream_out.rb +2 -0
  25. data/lib/svix/models/list_response_stream_sink_out.rb +2 -0
  26. data/lib/svix/models/list_response_template_out.rb +2 -0
  27. data/lib/svix/models/sink_http_config.rb +11 -1
  28. data/lib/svix/models/stream_event_type_in.rb +262 -0
  29. data/lib/svix/models/stream_event_type_out.rb +294 -0
  30. data/lib/svix/models/stream_event_type_patch.rb +254 -0
  31. data/lib/svix/version.rb +1 -1
  32. metadata +7 -3
  33. data/lib/svix/api/sink_api.rb +0 -179
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c229027d9aedab25fa2dd95f163a8577c5937465482509f0b0779c7aaa1b68cc
4
- data.tar.gz: daecea54482ffc42f450c95f2cfe99712d62a40656def92c385ddc5e027d5b68
3
+ metadata.gz: 1c03e03208f22008f503a1190ee012447474c99f5343f93b133cc991934b2d71
4
+ data.tar.gz: f091fad8d9de7707bd6e60193dc82a9eeaddce4173ba71e8ba284e58ce29e50d
5
5
  SHA512:
6
- metadata.gz: bff9479dabeb60c362646f6ee4b5f44ef38109691dc251b1d1fa831961371cccc01b810a6cce0eed46a2730be168d510355c1f935ba50f113a0ff5cfb9ca0dd6
7
- data.tar.gz: 8b0335fee43b8a2743403032e1cbc0af0b5baeaa860412477fbfcc9c23619b59e80da420e1fd2cba0764814ac0c2258a1ab5f383bd77b36c725700e27e78cc5b
6
+ metadata.gz: ac4e6e56524f4d52e2e3992755e22adaab6c1c6293e4ddb452f02bbd64cd682fe41df8d82f566e2c422a7b57c32eeb1037aa96e8713ed2bb82d9618d82a3cc49
7
+ data.tar.gz: fef4d0656e9390b93d9c574c1ed0441c7a907987ccff447277b424ec0022f2a7e4dac25d7ff161a2ad2bca030ae4d12f11fdd477f9f2f970312606d1f401080c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (1.39.0)
4
+ svix (1.41.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -90,6 +90,83 @@ module Svix
90
90
  return data, status_code, headers
91
91
  end
92
92
 
93
+ # Create Events
94
+ # Creates events on the Stream.
95
+ # @param stream_id [String]
96
+ # @param create_stream_in [CreateStreamIn]
97
+ # @param [Hash] opts the optional parameters
98
+ # @option opts [String] :idempotency_key The request's idempotency key
99
+ # @return [Object]
100
+ def v1_stream_create_events(stream_id, create_stream_in, opts = {})
101
+ data, _status_code, _headers = v1_stream_create_events_with_http_info(stream_id, create_stream_in, opts)
102
+ data
103
+ end
104
+
105
+ # Create Events
106
+ # Creates events on the Stream.
107
+ # @param stream_id [String]
108
+ # @param create_stream_in [CreateStreamIn]
109
+ # @param [Hash] opts the optional parameters
110
+ # @option opts [String] :idempotency_key The request's idempotency key
111
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
112
+ def v1_stream_create_events_with_http_info(stream_id, create_stream_in, opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug 'Calling API: StreamApi.v1_stream_create_events ...'
115
+ end
116
+ # verify the required parameter 'stream_id' is set
117
+ if @api_client.config.client_side_validation && stream_id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'stream_id' when calling StreamApi.v1_stream_create_events"
119
+ end
120
+ # verify the required parameter 'create_stream_in' is set
121
+ if @api_client.config.client_side_validation && create_stream_in.nil?
122
+ fail ArgumentError, "Missing the required parameter 'create_stream_in' when calling StreamApi.v1_stream_create_events"
123
+ end
124
+ # resource path
125
+ local_var_path = '/api/v1/stream/{stream_id}/events'.sub('{' + 'stream_id' + '}', CGI.escape(stream_id.to_s))
126
+
127
+ # query parameters
128
+ query_params = opts[:query_params] || {}
129
+
130
+ # header parameters
131
+ header_params = opts[:header_params] || {}
132
+ # HTTP header 'Accept' (if needed)
133
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
134
+ # HTTP header 'Content-Type'
135
+ content_type = @api_client.select_header_content_type(['application/json'])
136
+ if !content_type.nil?
137
+ header_params['Content-Type'] = content_type
138
+ end
139
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+
144
+ # http body (model)
145
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_stream_in)
146
+
147
+ # return_type
148
+ return_type = opts[:debug_return_type] || 'Object'
149
+
150
+ # auth_names
151
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
152
+
153
+ new_options = opts.merge(
154
+ :operation => :"StreamApi.v1_stream_create_events",
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => return_type
161
+ )
162
+
163
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug "API called: StreamApi#v1_stream_create_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
166
+ end
167
+ return data, status_code, headers
168
+ end
169
+
93
170
  # Delete Stream
94
171
  # Delete a stream.
95
172
  # @param stream_id [String]
@@ -153,6 +230,86 @@ module Svix
153
230
  return data, status_code, headers
154
231
  end
155
232
 
233
+ # Stream Events
234
+ # Iterate over a stream of events.
235
+ # @param stream_id [String]
236
+ # @param [Hash] opts the optional parameters
237
+ # @option opts [Integer] :limit Limit the number of returned items
238
+ # @option opts [String] :iterator The iterator returned from a prior invocation
239
+ # @option opts [Time] :after
240
+ # @return [EventStreamOut]
241
+ def v1_stream_events_get(stream_id, opts = {})
242
+ data, _status_code, _headers = v1_stream_events_get_with_http_info(stream_id, opts)
243
+ data
244
+ end
245
+
246
+ # Stream Events
247
+ # Iterate over a stream of events.
248
+ # @param stream_id [String]
249
+ # @param [Hash] opts the optional parameters
250
+ # @option opts [Integer] :limit Limit the number of returned items
251
+ # @option opts [String] :iterator The iterator returned from a prior invocation
252
+ # @option opts [Time] :after
253
+ # @return [Array<(EventStreamOut, Integer, Hash)>] EventStreamOut data, response status code and response headers
254
+ def v1_stream_events_get_with_http_info(stream_id, opts = {})
255
+ if @api_client.config.debugging
256
+ @api_client.config.logger.debug 'Calling API: StreamApi.v1_stream_events_get ...'
257
+ end
258
+ # verify the required parameter 'stream_id' is set
259
+ if @api_client.config.client_side_validation && stream_id.nil?
260
+ fail ArgumentError, "Missing the required parameter 'stream_id' when calling StreamApi.v1_stream_events_get"
261
+ end
262
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
263
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling StreamApi.v1_stream_events_get, must be smaller than or equal to 250.'
264
+ end
265
+
266
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
267
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling StreamApi.v1_stream_events_get, must be greater than or equal to 1.'
268
+ end
269
+
270
+ # resource path
271
+ local_var_path = '/api/v1/stream/{stream_id}/events'.sub('{' + 'stream_id' + '}', CGI.escape(stream_id.to_s))
272
+
273
+ # query parameters
274
+ query_params = opts[:query_params] || {}
275
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
276
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
277
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
278
+
279
+ # header parameters
280
+ header_params = opts[:header_params] || {}
281
+ # HTTP header 'Accept' (if needed)
282
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
283
+
284
+ # form parameters
285
+ form_params = opts[:form_params] || {}
286
+
287
+ # http body (model)
288
+ post_body = opts[:debug_body]
289
+
290
+ # return_type
291
+ return_type = opts[:debug_return_type] || 'EventStreamOut'
292
+
293
+ # auth_names
294
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
295
+
296
+ new_options = opts.merge(
297
+ :operation => :"StreamApi.v1_stream_events_get",
298
+ :header_params => header_params,
299
+ :query_params => query_params,
300
+ :form_params => form_params,
301
+ :body => post_body,
302
+ :auth_names => auth_names,
303
+ :return_type => return_type
304
+ )
305
+
306
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug "API called: StreamApi#v1_stream_events_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
309
+ end
310
+ return data, status_code, headers
311
+ end
312
+
156
313
  # Get Stream
157
314
  # Get a stream by id or uid.
158
315
  # @param stream_id [String]
@@ -0,0 +1,486 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Svix
16
+ class StreamEventTypesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Stream Event Type
23
+ # Create an event type for Streams.
24
+ # @param stream_event_type_in [StreamEventTypeIn]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
27
+ # @return [StreamEventTypeOut]
28
+ def v1_stream_event_type_create(stream_event_type_in, opts = {})
29
+ data, _status_code, _headers = v1_stream_event_type_create_with_http_info(stream_event_type_in, opts)
30
+ data
31
+ end
32
+
33
+ # Create Stream Event Type
34
+ # Create an event type for Streams.
35
+ # @param stream_event_type_in [StreamEventTypeIn]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
38
+ # @return [Array<(StreamEventTypeOut, Integer, Hash)>] StreamEventTypeOut data, response status code and response headers
39
+ def v1_stream_event_type_create_with_http_info(stream_event_type_in, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: StreamEventTypesApi.v1_stream_event_type_create ...'
42
+ end
43
+ # verify the required parameter 'stream_event_type_in' is set
44
+ if @api_client.config.client_side_validation && stream_event_type_in.nil?
45
+ fail ArgumentError, "Missing the required parameter 'stream_event_type_in' when calling StreamEventTypesApi.v1_stream_event_type_create"
46
+ end
47
+ # resource path
48
+ local_var_path = '/api/v1/stream/event-type'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(stream_event_type_in)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'StreamEventTypeOut'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"StreamEventTypesApi.v1_stream_event_type_create",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: StreamEventTypesApi#v1_stream_event_type_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Delete Stream Event Type
94
+ # Delete an event type.
95
+ # @param name [String] The event type&#39;s name
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [nil]
98
+ def v1_stream_event_type_delete(name, opts = {})
99
+ v1_stream_event_type_delete_with_http_info(name, opts)
100
+ nil
101
+ end
102
+
103
+ # Delete Stream Event Type
104
+ # Delete an event type.
105
+ # @param name [String] The event type&#39;s name
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
108
+ def v1_stream_event_type_delete_with_http_info(name, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: StreamEventTypesApi.v1_stream_event_type_delete ...'
111
+ end
112
+ # verify the required parameter 'name' is set
113
+ if @api_client.config.client_side_validation && name.nil?
114
+ fail ArgumentError, "Missing the required parameter 'name' when calling StreamEventTypesApi.v1_stream_event_type_delete"
115
+ end
116
+ if @api_client.config.client_side_validation && name.to_s.length > 256
117
+ fail ArgumentError, 'invalid value for "name" when calling StreamEventTypesApi.v1_stream_event_type_delete, the character length must be smaller than or equal to 256.'
118
+ end
119
+
120
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
121
+ if @api_client.config.client_side_validation && name !~ pattern
122
+ fail ArgumentError, "invalid value for 'name' when calling StreamEventTypesApi.v1_stream_event_type_delete, must conform to the pattern #{pattern}."
123
+ end
124
+
125
+ # resource path
126
+ local_var_path = '/api/v1/stream/event-type/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
127
+
128
+ # query parameters
129
+ query_params = opts[:query_params] || {}
130
+
131
+ # header parameters
132
+ header_params = opts[:header_params] || {}
133
+ # HTTP header 'Accept' (if needed)
134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
135
+
136
+ # form parameters
137
+ form_params = opts[:form_params] || {}
138
+
139
+ # http body (model)
140
+ post_body = opts[:debug_body]
141
+
142
+ # return_type
143
+ return_type = opts[:debug_return_type]
144
+
145
+ # auth_names
146
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
147
+
148
+ new_options = opts.merge(
149
+ :operation => :"StreamEventTypesApi.v1_stream_event_type_delete",
150
+ :header_params => header_params,
151
+ :query_params => query_params,
152
+ :form_params => form_params,
153
+ :body => post_body,
154
+ :auth_names => auth_names,
155
+ :return_type => return_type
156
+ )
157
+
158
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
159
+ if @api_client.config.debugging
160
+ @api_client.config.logger.debug "API called: StreamEventTypesApi#v1_stream_event_type_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
161
+ end
162
+ return data, status_code, headers
163
+ end
164
+
165
+ # Get Stream Event Type
166
+ # Get an event type.
167
+ # @param name [String] The event type&#39;s name
168
+ # @param [Hash] opts the optional parameters
169
+ # @return [StreamEventTypeOut]
170
+ def v1_stream_event_type_get(name, opts = {})
171
+ data, _status_code, _headers = v1_stream_event_type_get_with_http_info(name, opts)
172
+ data
173
+ end
174
+
175
+ # Get Stream Event Type
176
+ # Get an event type.
177
+ # @param name [String] The event type&#39;s name
178
+ # @param [Hash] opts the optional parameters
179
+ # @return [Array<(StreamEventTypeOut, Integer, Hash)>] StreamEventTypeOut data, response status code and response headers
180
+ def v1_stream_event_type_get_with_http_info(name, opts = {})
181
+ if @api_client.config.debugging
182
+ @api_client.config.logger.debug 'Calling API: StreamEventTypesApi.v1_stream_event_type_get ...'
183
+ end
184
+ # verify the required parameter 'name' is set
185
+ if @api_client.config.client_side_validation && name.nil?
186
+ fail ArgumentError, "Missing the required parameter 'name' when calling StreamEventTypesApi.v1_stream_event_type_get"
187
+ end
188
+ if @api_client.config.client_side_validation && name.to_s.length > 256
189
+ fail ArgumentError, 'invalid value for "name" when calling StreamEventTypesApi.v1_stream_event_type_get, the character length must be smaller than or equal to 256.'
190
+ end
191
+
192
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
193
+ if @api_client.config.client_side_validation && name !~ pattern
194
+ fail ArgumentError, "invalid value for 'name' when calling StreamEventTypesApi.v1_stream_event_type_get, must conform to the pattern #{pattern}."
195
+ end
196
+
197
+ # resource path
198
+ local_var_path = '/api/v1/stream/event-type/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
199
+
200
+ # query parameters
201
+ query_params = opts[:query_params] || {}
202
+
203
+ # header parameters
204
+ header_params = opts[:header_params] || {}
205
+ # HTTP header 'Accept' (if needed)
206
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
207
+
208
+ # form parameters
209
+ form_params = opts[:form_params] || {}
210
+
211
+ # http body (model)
212
+ post_body = opts[:debug_body]
213
+
214
+ # return_type
215
+ return_type = opts[:debug_return_type] || 'StreamEventTypeOut'
216
+
217
+ # auth_names
218
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
219
+
220
+ new_options = opts.merge(
221
+ :operation => :"StreamEventTypesApi.v1_stream_event_type_get",
222
+ :header_params => header_params,
223
+ :query_params => query_params,
224
+ :form_params => form_params,
225
+ :body => post_body,
226
+ :auth_names => auth_names,
227
+ :return_type => return_type
228
+ )
229
+
230
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
231
+ if @api_client.config.debugging
232
+ @api_client.config.logger.debug "API called: StreamEventTypesApi#v1_stream_event_type_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
233
+ end
234
+ return data, status_code, headers
235
+ end
236
+
237
+ # List Stream Event Types
238
+ # List of all the organization's event types for streaming.
239
+ # @param [Hash] opts the optional parameters
240
+ # @option opts [Integer] :limit Limit the number of returned items
241
+ # @option opts [String] :iterator The iterator returned from a prior invocation
242
+ # @option opts [Ordering] :order The sorting order of the returned items
243
+ # @return [ListResponseStreamEventTypeOut]
244
+ def v1_stream_event_type_list(opts = {})
245
+ data, _status_code, _headers = v1_stream_event_type_list_with_http_info(opts)
246
+ data
247
+ end
248
+
249
+ # List Stream Event Types
250
+ # List of all the organization&#39;s event types for streaming.
251
+ # @param [Hash] opts the optional parameters
252
+ # @option opts [Integer] :limit Limit the number of returned items
253
+ # @option opts [String] :iterator The iterator returned from a prior invocation
254
+ # @option opts [Ordering] :order The sorting order of the returned items
255
+ # @return [Array<(ListResponseStreamEventTypeOut, Integer, Hash)>] ListResponseStreamEventTypeOut data, response status code and response headers
256
+ def v1_stream_event_type_list_with_http_info(opts = {})
257
+ if @api_client.config.debugging
258
+ @api_client.config.logger.debug 'Calling API: StreamEventTypesApi.v1_stream_event_type_list ...'
259
+ end
260
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
261
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling StreamEventTypesApi.v1_stream_event_type_list, must be smaller than or equal to 250.'
262
+ end
263
+
264
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
265
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling StreamEventTypesApi.v1_stream_event_type_list, must be greater than or equal to 1.'
266
+ end
267
+
268
+ if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'].to_s.length > 256
269
+ fail ArgumentError, 'invalid value for "opts[:"iterator"]" when calling StreamEventTypesApi.v1_stream_event_type_list, the character length must be smaller than or equal to 256.'
270
+ end
271
+
272
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
273
+ if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'] !~ pattern
274
+ fail ArgumentError, "invalid value for 'opts[:\"iterator\"]' when calling StreamEventTypesApi.v1_stream_event_type_list, must conform to the pattern #{pattern}."
275
+ end
276
+
277
+ # resource path
278
+ local_var_path = '/api/v1/stream/event-type'
279
+
280
+ # query parameters
281
+ query_params = opts[:query_params] || {}
282
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
283
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
284
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
285
+
286
+ # header parameters
287
+ header_params = opts[:header_params] || {}
288
+ # HTTP header 'Accept' (if needed)
289
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
290
+
291
+ # form parameters
292
+ form_params = opts[:form_params] || {}
293
+
294
+ # http body (model)
295
+ post_body = opts[:debug_body]
296
+
297
+ # return_type
298
+ return_type = opts[:debug_return_type] || 'ListResponseStreamEventTypeOut'
299
+
300
+ # auth_names
301
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
302
+
303
+ new_options = opts.merge(
304
+ :operation => :"StreamEventTypesApi.v1_stream_event_type_list",
305
+ :header_params => header_params,
306
+ :query_params => query_params,
307
+ :form_params => form_params,
308
+ :body => post_body,
309
+ :auth_names => auth_names,
310
+ :return_type => return_type
311
+ )
312
+
313
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
314
+ if @api_client.config.debugging
315
+ @api_client.config.logger.debug "API called: StreamEventTypesApi#v1_stream_event_type_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
316
+ end
317
+ return data, status_code, headers
318
+ end
319
+
320
+ # Patch Stream Event Type
321
+ # Patch an event type for Streams.
322
+ # @param name [String] The event type&#39;s name
323
+ # @param stream_event_type_patch [StreamEventTypePatch]
324
+ # @param [Hash] opts the optional parameters
325
+ # @return [StreamEventTypeOut]
326
+ def v1_stream_event_type_patch(name, stream_event_type_patch, opts = {})
327
+ data, _status_code, _headers = v1_stream_event_type_patch_with_http_info(name, stream_event_type_patch, opts)
328
+ data
329
+ end
330
+
331
+ # Patch Stream Event Type
332
+ # Patch an event type for Streams.
333
+ # @param name [String] The event type&#39;s name
334
+ # @param stream_event_type_patch [StreamEventTypePatch]
335
+ # @param [Hash] opts the optional parameters
336
+ # @return [Array<(StreamEventTypeOut, Integer, Hash)>] StreamEventTypeOut data, response status code and response headers
337
+ def v1_stream_event_type_patch_with_http_info(name, stream_event_type_patch, opts = {})
338
+ if @api_client.config.debugging
339
+ @api_client.config.logger.debug 'Calling API: StreamEventTypesApi.v1_stream_event_type_patch ...'
340
+ end
341
+ # verify the required parameter 'name' is set
342
+ if @api_client.config.client_side_validation && name.nil?
343
+ fail ArgumentError, "Missing the required parameter 'name' when calling StreamEventTypesApi.v1_stream_event_type_patch"
344
+ end
345
+ if @api_client.config.client_side_validation && name.to_s.length > 256
346
+ fail ArgumentError, 'invalid value for "name" when calling StreamEventTypesApi.v1_stream_event_type_patch, the character length must be smaller than or equal to 256.'
347
+ end
348
+
349
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
350
+ if @api_client.config.client_side_validation && name !~ pattern
351
+ fail ArgumentError, "invalid value for 'name' when calling StreamEventTypesApi.v1_stream_event_type_patch, must conform to the pattern #{pattern}."
352
+ end
353
+
354
+ # verify the required parameter 'stream_event_type_patch' is set
355
+ if @api_client.config.client_side_validation && stream_event_type_patch.nil?
356
+ fail ArgumentError, "Missing the required parameter 'stream_event_type_patch' when calling StreamEventTypesApi.v1_stream_event_type_patch"
357
+ end
358
+ # resource path
359
+ local_var_path = '/api/v1/stream/event-type/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
360
+
361
+ # query parameters
362
+ query_params = opts[:query_params] || {}
363
+
364
+ # header parameters
365
+ header_params = opts[:header_params] || {}
366
+ # HTTP header 'Accept' (if needed)
367
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
368
+ # HTTP header 'Content-Type'
369
+ content_type = @api_client.select_header_content_type(['application/json'])
370
+ if !content_type.nil?
371
+ header_params['Content-Type'] = content_type
372
+ end
373
+
374
+ # form parameters
375
+ form_params = opts[:form_params] || {}
376
+
377
+ # http body (model)
378
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(stream_event_type_patch)
379
+
380
+ # return_type
381
+ return_type = opts[:debug_return_type] || 'StreamEventTypeOut'
382
+
383
+ # auth_names
384
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
385
+
386
+ new_options = opts.merge(
387
+ :operation => :"StreamEventTypesApi.v1_stream_event_type_patch",
388
+ :header_params => header_params,
389
+ :query_params => query_params,
390
+ :form_params => form_params,
391
+ :body => post_body,
392
+ :auth_names => auth_names,
393
+ :return_type => return_type
394
+ )
395
+
396
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
397
+ if @api_client.config.debugging
398
+ @api_client.config.logger.debug "API called: StreamEventTypesApi#v1_stream_event_type_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
399
+ end
400
+ return data, status_code, headers
401
+ end
402
+
403
+ # Update Stream Event Type
404
+ # Update or create a event type for Streams.
405
+ # @param name [String] The event type&#39;s name
406
+ # @param stream_event_type_in [StreamEventTypeIn]
407
+ # @param [Hash] opts the optional parameters
408
+ # @return [StreamEventTypeOut]
409
+ def v1_stream_event_type_update(name, stream_event_type_in, opts = {})
410
+ data, _status_code, _headers = v1_stream_event_type_update_with_http_info(name, stream_event_type_in, opts)
411
+ data
412
+ end
413
+
414
+ # Update Stream Event Type
415
+ # Update or create a event type for Streams.
416
+ # @param name [String] The event type&#39;s name
417
+ # @param stream_event_type_in [StreamEventTypeIn]
418
+ # @param [Hash] opts the optional parameters
419
+ # @return [Array<(StreamEventTypeOut, Integer, Hash)>] StreamEventTypeOut data, response status code and response headers
420
+ def v1_stream_event_type_update_with_http_info(name, stream_event_type_in, opts = {})
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug 'Calling API: StreamEventTypesApi.v1_stream_event_type_update ...'
423
+ end
424
+ # verify the required parameter 'name' is set
425
+ if @api_client.config.client_side_validation && name.nil?
426
+ fail ArgumentError, "Missing the required parameter 'name' when calling StreamEventTypesApi.v1_stream_event_type_update"
427
+ end
428
+ if @api_client.config.client_side_validation && name.to_s.length > 256
429
+ fail ArgumentError, 'invalid value for "name" when calling StreamEventTypesApi.v1_stream_event_type_update, the character length must be smaller than or equal to 256.'
430
+ end
431
+
432
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
433
+ if @api_client.config.client_side_validation && name !~ pattern
434
+ fail ArgumentError, "invalid value for 'name' when calling StreamEventTypesApi.v1_stream_event_type_update, must conform to the pattern #{pattern}."
435
+ end
436
+
437
+ # verify the required parameter 'stream_event_type_in' is set
438
+ if @api_client.config.client_side_validation && stream_event_type_in.nil?
439
+ fail ArgumentError, "Missing the required parameter 'stream_event_type_in' when calling StreamEventTypesApi.v1_stream_event_type_update"
440
+ end
441
+ # resource path
442
+ local_var_path = '/api/v1/stream/event-type/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
443
+
444
+ # query parameters
445
+ query_params = opts[:query_params] || {}
446
+
447
+ # header parameters
448
+ header_params = opts[:header_params] || {}
449
+ # HTTP header 'Accept' (if needed)
450
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
451
+ # HTTP header 'Content-Type'
452
+ content_type = @api_client.select_header_content_type(['application/json'])
453
+ if !content_type.nil?
454
+ header_params['Content-Type'] = content_type
455
+ end
456
+
457
+ # form parameters
458
+ form_params = opts[:form_params] || {}
459
+
460
+ # http body (model)
461
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(stream_event_type_in)
462
+
463
+ # return_type
464
+ return_type = opts[:debug_return_type] || 'StreamEventTypeOut'
465
+
466
+ # auth_names
467
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
468
+
469
+ new_options = opts.merge(
470
+ :operation => :"StreamEventTypesApi.v1_stream_event_type_update",
471
+ :header_params => header_params,
472
+ :query_params => query_params,
473
+ :form_params => form_params,
474
+ :body => post_body,
475
+ :auth_names => auth_names,
476
+ :return_type => return_type
477
+ )
478
+
479
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
480
+ if @api_client.config.debugging
481
+ @api_client.config.logger.debug "API called: StreamEventTypesApi#v1_stream_event_type_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
482
+ end
483
+ return data, status_code, headers
484
+ end
485
+ end
486
+ end