svix 0.83.1 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/application_api.rb +247 -181
- data/lib/svix/api/authentication_api.rb +82 -150
- data/lib/svix/api/background_tasks_api.rb +161 -0
- data/lib/svix/api/endpoint_api.rb +561 -485
- data/lib/svix/api/environment_api.rb +16 -16
- data/lib/svix/api/environment_settings_api.rb +7 -10
- data/lib/svix/api/event_type_api.rb +152 -81
- data/lib/svix/api/health_api.rb +6 -9
- data/lib/svix/api/integration_api.rb +123 -134
- data/lib/svix/api/message_api.rb +96 -102
- data/lib/svix/api/message_attempt_api.rb +382 -406
- data/lib/svix/api/statistics_api.rb +107 -45
- data/lib/svix/api_client.rb +0 -1
- data/lib/svix/application_api.rb +22 -22
- data/lib/svix/authentication_api.rb +3 -3
- data/lib/svix/configuration.rb +0 -7
- data/lib/svix/endpoint_api.rb +16 -16
- data/lib/svix/event_type_api.rb +19 -19
- data/lib/svix/integration_api.rb +26 -26
- data/lib/svix/message_api.rb +4 -4
- data/lib/svix/message_attempt_api.rb +8 -8
- data/lib/svix/models/app_portal_access_in.rb +1 -0
- data/lib/svix/models/application_in.rb +34 -1
- data/lib/svix/models/application_out.rb +20 -2
- data/lib/svix/models/application_patch.rb +299 -0
- data/lib/svix/models/application_stats.rb +0 -1
- data/lib/svix/models/{webhook_types.rb → background_task_out.rb} +40 -69
- data/lib/svix/models/background_task_out_common.rb +251 -0
- data/lib/svix/models/background_task_status.rb +38 -0
- data/lib/svix/models/background_task_type.rb +38 -0
- data/lib/svix/models/calculate_app_stats_in.rb +255 -0
- data/lib/svix/models/endpoint_created_event.rb +5 -0
- data/lib/svix/models/endpoint_created_event_data.rb +0 -2
- data/lib/svix/models/endpoint_deleted_event.rb +5 -0
- data/lib/svix/models/endpoint_deleted_event_data.rb +0 -2
- data/lib/svix/models/endpoint_disabled_event.rb +5 -0
- data/lib/svix/models/endpoint_disabled_event_data.rb +1 -2
- data/lib/svix/models/endpoint_in.rb +19 -10
- data/lib/svix/models/endpoint_message_out.rb +1 -0
- data/lib/svix/models/endpoint_out.rb +33 -15
- data/lib/svix/models/endpoint_patch.rb +405 -0
- data/lib/svix/models/endpoint_secret_rotate_in.rb +2 -0
- data/lib/svix/models/endpoint_transformation_in.rb +0 -2
- data/lib/svix/models/endpoint_transformation_simulate_in.rb +6 -0
- data/lib/svix/models/endpoint_update.rb +19 -10
- data/lib/svix/models/endpoint_updated_event.rb +5 -0
- data/lib/svix/models/endpoint_updated_event_data.rb +0 -2
- data/lib/svix/models/event_type_example_out.rb +4 -2
- data/lib/svix/models/event_type_patch.rb +275 -0
- data/lib/svix/models/event_type_schema_in.rb +0 -1
- data/lib/svix/models/http_validation_error.rb +5 -0
- data/lib/svix/models/list_response_application_stats.rb +15 -5
- data/lib/svix/models/list_response_background_task_out.rb +259 -0
- data/lib/svix/models/list_response_integration_out.rb +15 -5
- data/lib/svix/models/list_response_message_endpoint_out.rb +15 -5
- data/lib/svix/models/message_attempt_exhausted_event.rb +5 -0
- data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -2
- data/lib/svix/models/message_attempt_failing_event.rb +5 -0
- data/lib/svix/models/message_attempt_failing_event_data.rb +1 -2
- data/lib/svix/models/message_attempt_headers_out.rb +27 -1
- data/lib/svix/models/message_endpoint_out.rb +45 -29
- data/lib/svix/models/message_in.rb +0 -1
- data/lib/svix/models/{one_time_token_out.rb → recover_out.rb} +41 -13
- data/lib/svix/models/{one_time_token_in.rb → replay_out.rb} +41 -13
- data/lib/svix/models/transformation_http_method.rb +1 -1
- data/lib/svix/models/validation_error.rb +4 -0
- data/lib/svix/version.rb +1 -1
- metadata +14 -5
data/lib/svix/api/message_api.rb
CHANGED
@@ -20,50 +20,50 @@ module Svix
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Create Message
|
23
|
-
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
23
|
+
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
24
24
|
# @param app_id [String]
|
25
25
|
# @param message_in [MessageIn]
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @option opts [Boolean] :with_content (default to true)
|
28
28
|
# @option opts [String] :idempotency_key The request's idempotency key
|
29
29
|
# @return [MessageOut]
|
30
|
-
def
|
31
|
-
data, _status_code, _headers =
|
30
|
+
def v1_message_create(app_id, message_in, opts = {})
|
31
|
+
data, _status_code, _headers = v1_message_create_with_http_info(app_id, message_in, opts)
|
32
32
|
data
|
33
33
|
end
|
34
34
|
|
35
35
|
# Create Message
|
36
|
-
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
36
|
+
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
37
37
|
# @param app_id [String]
|
38
38
|
# @param message_in [MessageIn]
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @option opts [Boolean] :with_content
|
41
41
|
# @option opts [String] :idempotency_key The request's idempotency key
|
42
42
|
# @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
|
43
|
-
def
|
43
|
+
def v1_message_create_with_http_info(app_id, message_in, opts = {})
|
44
44
|
if @api_client.config.debugging
|
45
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.
|
45
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_create ...'
|
46
46
|
end
|
47
47
|
# verify the required parameter 'app_id' is set
|
48
48
|
if @api_client.config.client_side_validation && app_id.nil?
|
49
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.
|
49
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_create"
|
50
50
|
end
|
51
51
|
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
52
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.
|
52
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_create, the character length must be smaller than or equal to 256.'
|
53
53
|
end
|
54
54
|
|
55
55
|
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
56
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.
|
56
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_create, the character length must be great than or equal to 1.'
|
57
57
|
end
|
58
58
|
|
59
59
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
60
60
|
if @api_client.config.client_side_validation && app_id !~ pattern
|
61
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.
|
61
|
+
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_create, must conform to the pattern #{pattern}."
|
62
62
|
end
|
63
63
|
|
64
64
|
# verify the required parameter 'message_in' is set
|
65
65
|
if @api_client.config.client_side_validation && message_in.nil?
|
66
|
-
fail ArgumentError, "Missing the required parameter 'message_in' when calling MessageApi.
|
66
|
+
fail ArgumentError, "Missing the required parameter 'message_in' when calling MessageApi.v1_message_create"
|
67
67
|
end
|
68
68
|
# resource path
|
69
69
|
local_var_path = '/api/v1/app/{app_id}/msg/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
@@ -90,10 +90,10 @@ module Svix
|
|
90
90
|
return_type = opts[:debug_return_type] || 'MessageOut'
|
91
91
|
|
92
92
|
# auth_names
|
93
|
-
auth_names = opts[:debug_auth_names] || [
|
93
|
+
auth_names = opts[:debug_auth_names] || []
|
94
94
|
|
95
95
|
new_options = opts.merge(
|
96
|
-
:operation => :"MessageApi.
|
96
|
+
:operation => :"MessageApi.v1_message_create",
|
97
97
|
:header_params => header_params,
|
98
98
|
:query_params => query_params,
|
99
99
|
:form_params => form_params,
|
@@ -104,70 +104,68 @@ module Svix
|
|
104
104
|
|
105
105
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
106
106
|
if @api_client.config.debugging
|
107
|
-
@api_client.config.logger.debug "API called: MessageApi#
|
107
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
108
108
|
end
|
109
109
|
return data, status_code, headers
|
110
110
|
end
|
111
111
|
|
112
|
-
#
|
112
|
+
# Expunge Message Content
|
113
113
|
# Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. The message can't be replayed or resent once its payload has been deleted or expired.
|
114
|
-
# @param msg_id [String]
|
115
114
|
# @param app_id [String]
|
115
|
+
# @param msg_id [String]
|
116
116
|
# @param [Hash] opts the optional parameters
|
117
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
118
117
|
# @return [nil]
|
119
|
-
def
|
120
|
-
|
118
|
+
def v1_message_expunge_content(app_id, msg_id, opts = {})
|
119
|
+
v1_message_expunge_content_with_http_info(app_id, msg_id, opts)
|
121
120
|
nil
|
122
121
|
end
|
123
122
|
|
124
|
-
#
|
123
|
+
# Expunge Message Content
|
125
124
|
# Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. The message can't be replayed or resent once its payload has been deleted or expired.
|
126
|
-
# @param msg_id [String]
|
127
125
|
# @param app_id [String]
|
126
|
+
# @param msg_id [String]
|
128
127
|
# @param [Hash] opts the optional parameters
|
129
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
130
128
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
131
|
-
def
|
129
|
+
def v1_message_expunge_content_with_http_info(app_id, msg_id, opts = {})
|
132
130
|
if @api_client.config.debugging
|
133
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.
|
131
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_expunge_content ...'
|
134
132
|
end
|
135
|
-
# verify the required parameter '
|
136
|
-
if @api_client.config.client_side_validation &&
|
137
|
-
fail ArgumentError, "Missing the required parameter '
|
133
|
+
# verify the required parameter 'app_id' is set
|
134
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
135
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_expunge_content"
|
138
136
|
end
|
139
|
-
if @api_client.config.client_side_validation &&
|
140
|
-
fail ArgumentError, 'invalid value for "
|
137
|
+
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
138
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_expunge_content, the character length must be smaller than or equal to 256.'
|
141
139
|
end
|
142
140
|
|
143
|
-
if @api_client.config.client_side_validation &&
|
144
|
-
fail ArgumentError, 'invalid value for "
|
141
|
+
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
142
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_expunge_content, the character length must be great than or equal to 1.'
|
145
143
|
end
|
146
144
|
|
147
145
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
148
|
-
if @api_client.config.client_side_validation &&
|
149
|
-
fail ArgumentError, "invalid value for '
|
146
|
+
if @api_client.config.client_side_validation && app_id !~ pattern
|
147
|
+
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_expunge_content, must conform to the pattern #{pattern}."
|
150
148
|
end
|
151
149
|
|
152
|
-
# verify the required parameter '
|
153
|
-
if @api_client.config.client_side_validation &&
|
154
|
-
fail ArgumentError, "Missing the required parameter '
|
150
|
+
# verify the required parameter 'msg_id' is set
|
151
|
+
if @api_client.config.client_side_validation && msg_id.nil?
|
152
|
+
fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageApi.v1_message_expunge_content"
|
155
153
|
end
|
156
|
-
if @api_client.config.client_side_validation &&
|
157
|
-
fail ArgumentError, 'invalid value for "
|
154
|
+
if @api_client.config.client_side_validation && msg_id.to_s.length > 256
|
155
|
+
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_expunge_content, the character length must be smaller than or equal to 256.'
|
158
156
|
end
|
159
157
|
|
160
|
-
if @api_client.config.client_side_validation &&
|
161
|
-
fail ArgumentError, 'invalid value for "
|
158
|
+
if @api_client.config.client_side_validation && msg_id.to_s.length < 1
|
159
|
+
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_expunge_content, the character length must be great than or equal to 1.'
|
162
160
|
end
|
163
161
|
|
164
162
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
165
|
-
if @api_client.config.client_side_validation &&
|
166
|
-
fail ArgumentError, "invalid value for '
|
163
|
+
if @api_client.config.client_side_validation && msg_id !~ pattern
|
164
|
+
fail ArgumentError, "invalid value for 'msg_id' when calling MessageApi.v1_message_expunge_content, must conform to the pattern #{pattern}."
|
167
165
|
end
|
168
166
|
|
169
167
|
# resource path
|
170
|
-
local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/content/'.sub('{' + '
|
168
|
+
local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/content/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s))
|
171
169
|
|
172
170
|
# query parameters
|
173
171
|
query_params = opts[:query_params] || {}
|
@@ -176,7 +174,6 @@ module Svix
|
|
176
174
|
header_params = opts[:header_params] || {}
|
177
175
|
# HTTP header 'Accept' (if needed)
|
178
176
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
179
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
180
177
|
|
181
178
|
# form parameters
|
182
179
|
form_params = opts[:form_params] || {}
|
@@ -188,10 +185,10 @@ module Svix
|
|
188
185
|
return_type = opts[:debug_return_type]
|
189
186
|
|
190
187
|
# auth_names
|
191
|
-
auth_names = opts[:debug_auth_names] || [
|
188
|
+
auth_names = opts[:debug_auth_names] || []
|
192
189
|
|
193
190
|
new_options = opts.merge(
|
194
|
-
:operation => :"MessageApi.
|
191
|
+
:operation => :"MessageApi.v1_message_expunge_content",
|
195
192
|
:header_params => header_params,
|
196
193
|
:query_params => query_params,
|
197
194
|
:form_params => form_params,
|
@@ -202,79 +199,79 @@ module Svix
|
|
202
199
|
|
203
200
|
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
204
201
|
if @api_client.config.debugging
|
205
|
-
@api_client.config.logger.debug "API called: MessageApi#
|
202
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_expunge_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
206
203
|
end
|
207
204
|
return data, status_code, headers
|
208
205
|
end
|
209
206
|
|
210
207
|
# Get Message
|
211
208
|
# Get a message by its ID or eventID.
|
212
|
-
# @param msg_id [String]
|
213
209
|
# @param app_id [String]
|
210
|
+
# @param msg_id [String]
|
214
211
|
# @param [Hash] opts the optional parameters
|
215
|
-
# @option opts [
|
212
|
+
# @option opts [Boolean] :with_content (default to true)
|
216
213
|
# @return [MessageOut]
|
217
|
-
def
|
218
|
-
data, _status_code, _headers =
|
214
|
+
def v1_message_get(app_id, msg_id, opts = {})
|
215
|
+
data, _status_code, _headers = v1_message_get_with_http_info(app_id, msg_id, opts)
|
219
216
|
data
|
220
217
|
end
|
221
218
|
|
222
219
|
# Get Message
|
223
220
|
# Get a message by its ID or eventID.
|
224
|
-
# @param msg_id [String]
|
225
221
|
# @param app_id [String]
|
222
|
+
# @param msg_id [String]
|
226
223
|
# @param [Hash] opts the optional parameters
|
227
|
-
# @option opts [
|
224
|
+
# @option opts [Boolean] :with_content
|
228
225
|
# @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
|
229
|
-
def
|
226
|
+
def v1_message_get_with_http_info(app_id, msg_id, opts = {})
|
230
227
|
if @api_client.config.debugging
|
231
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.
|
228
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_get ...'
|
232
229
|
end
|
233
|
-
# verify the required parameter '
|
234
|
-
if @api_client.config.client_side_validation &&
|
235
|
-
fail ArgumentError, "Missing the required parameter '
|
230
|
+
# verify the required parameter 'app_id' is set
|
231
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
232
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_get"
|
236
233
|
end
|
237
|
-
if @api_client.config.client_side_validation &&
|
238
|
-
fail ArgumentError, 'invalid value for "
|
234
|
+
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
235
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_get, the character length must be smaller than or equal to 256.'
|
239
236
|
end
|
240
237
|
|
241
|
-
if @api_client.config.client_side_validation &&
|
242
|
-
fail ArgumentError, 'invalid value for "
|
238
|
+
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
239
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_get, the character length must be great than or equal to 1.'
|
243
240
|
end
|
244
241
|
|
245
242
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
246
|
-
if @api_client.config.client_side_validation &&
|
247
|
-
fail ArgumentError, "invalid value for '
|
243
|
+
if @api_client.config.client_side_validation && app_id !~ pattern
|
244
|
+
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_get, must conform to the pattern #{pattern}."
|
248
245
|
end
|
249
246
|
|
250
|
-
# verify the required parameter '
|
251
|
-
if @api_client.config.client_side_validation &&
|
252
|
-
fail ArgumentError, "Missing the required parameter '
|
247
|
+
# verify the required parameter 'msg_id' is set
|
248
|
+
if @api_client.config.client_side_validation && msg_id.nil?
|
249
|
+
fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageApi.v1_message_get"
|
253
250
|
end
|
254
|
-
if @api_client.config.client_side_validation &&
|
255
|
-
fail ArgumentError, 'invalid value for "
|
251
|
+
if @api_client.config.client_side_validation && msg_id.to_s.length > 256
|
252
|
+
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_get, the character length must be smaller than or equal to 256.'
|
256
253
|
end
|
257
254
|
|
258
|
-
if @api_client.config.client_side_validation &&
|
259
|
-
fail ArgumentError, 'invalid value for "
|
255
|
+
if @api_client.config.client_side_validation && msg_id.to_s.length < 1
|
256
|
+
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_get, the character length must be great than or equal to 1.'
|
260
257
|
end
|
261
258
|
|
262
259
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
263
|
-
if @api_client.config.client_side_validation &&
|
264
|
-
fail ArgumentError, "invalid value for '
|
260
|
+
if @api_client.config.client_side_validation && msg_id !~ pattern
|
261
|
+
fail ArgumentError, "invalid value for 'msg_id' when calling MessageApi.v1_message_get, must conform to the pattern #{pattern}."
|
265
262
|
end
|
266
263
|
|
267
264
|
# resource path
|
268
|
-
local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/'.sub('{' + '
|
265
|
+
local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s))
|
269
266
|
|
270
267
|
# query parameters
|
271
268
|
query_params = opts[:query_params] || {}
|
269
|
+
query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
|
272
270
|
|
273
271
|
# header parameters
|
274
272
|
header_params = opts[:header_params] || {}
|
275
273
|
# HTTP header 'Accept' (if needed)
|
276
274
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
277
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
278
275
|
|
279
276
|
# form parameters
|
280
277
|
form_params = opts[:form_params] || {}
|
@@ -286,10 +283,10 @@ module Svix
|
|
286
283
|
return_type = opts[:debug_return_type] || 'MessageOut'
|
287
284
|
|
288
285
|
# auth_names
|
289
|
-
auth_names = opts[:debug_auth_names] || [
|
286
|
+
auth_names = opts[:debug_auth_names] || []
|
290
287
|
|
291
288
|
new_options = opts.merge(
|
292
|
-
:operation => :"MessageApi.
|
289
|
+
:operation => :"MessageApi.v1_message_get",
|
293
290
|
:header_params => header_params,
|
294
291
|
:query_params => query_params,
|
295
292
|
:form_params => form_params,
|
@@ -300,7 +297,7 @@ module Svix
|
|
300
297
|
|
301
298
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
302
299
|
if @api_client.config.debugging
|
303
|
-
@api_client.config.logger.debug "API called: MessageApi#
|
300
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
304
301
|
end
|
305
302
|
return data, status_code, headers
|
306
303
|
end
|
@@ -309,16 +306,15 @@ module Svix
|
|
309
306
|
# List all of the application's messages. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. The `after` parameter lets you filter all items created after a certain date and is ignored if an iterator is passed. `before` and `after` cannot be used simultaneously.
|
310
307
|
# @param app_id [String]
|
311
308
|
# @param [Hash] opts the optional parameters
|
309
|
+
# @option opts [Integer] :limit
|
312
310
|
# @option opts [String] :iterator
|
313
|
-
# @option opts [Integer] :limit (default to 50)
|
314
|
-
# @option opts [Array<String>] :event_types
|
315
311
|
# @option opts [String] :channel
|
316
312
|
# @option opts [Time] :before
|
317
313
|
# @option opts [Time] :after
|
318
|
-
# @option opts [String] :
|
314
|
+
# @option opts [Array<String>] :event_types
|
319
315
|
# @return [ListResponseMessageOut]
|
320
|
-
def
|
321
|
-
data, _status_code, _headers =
|
316
|
+
def v1_message_list(app_id, opts = {})
|
317
|
+
data, _status_code, _headers = v1_message_list_with_http_info(app_id, opts)
|
322
318
|
data
|
323
319
|
end
|
324
320
|
|
@@ -326,46 +322,45 @@ module Svix
|
|
326
322
|
# List all of the application's messages. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. The `after` parameter lets you filter all items created after a certain date and is ignored if an iterator is passed. `before` and `after` cannot be used simultaneously.
|
327
323
|
# @param app_id [String]
|
328
324
|
# @param [Hash] opts the optional parameters
|
329
|
-
# @option opts [String] :iterator
|
330
325
|
# @option opts [Integer] :limit
|
331
|
-
# @option opts [
|
326
|
+
# @option opts [String] :iterator
|
332
327
|
# @option opts [String] :channel
|
333
328
|
# @option opts [Time] :before
|
334
329
|
# @option opts [Time] :after
|
335
|
-
# @option opts [String] :
|
330
|
+
# @option opts [Array<String>] :event_types
|
336
331
|
# @return [Array<(ListResponseMessageOut, Integer, Hash)>] ListResponseMessageOut data, response status code and response headers
|
337
|
-
def
|
332
|
+
def v1_message_list_with_http_info(app_id, opts = {})
|
338
333
|
if @api_client.config.debugging
|
339
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.
|
334
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_list ...'
|
340
335
|
end
|
341
336
|
# verify the required parameter 'app_id' is set
|
342
337
|
if @api_client.config.client_side_validation && app_id.nil?
|
343
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.
|
338
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_list"
|
344
339
|
end
|
345
340
|
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
346
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.
|
341
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_list, the character length must be smaller than or equal to 256.'
|
347
342
|
end
|
348
343
|
|
349
344
|
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
350
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.
|
345
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_list, the character length must be great than or equal to 1.'
|
351
346
|
end
|
352
347
|
|
353
348
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
354
349
|
if @api_client.config.client_side_validation && app_id !~ pattern
|
355
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.
|
350
|
+
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
356
351
|
end
|
357
352
|
|
358
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit']
|
359
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.
|
353
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
|
354
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_list, must be greater than or equal to 0.'
|
360
355
|
end
|
361
356
|
|
362
357
|
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
|
363
|
-
fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageApi.
|
358
|
+
fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageApi.v1_message_list, the character length must be smaller than or equal to 128.'
|
364
359
|
end
|
365
360
|
|
366
361
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
367
362
|
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
|
368
|
-
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.
|
363
|
+
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
369
364
|
end
|
370
365
|
|
371
366
|
# resource path
|
@@ -373,18 +368,17 @@ module Svix
|
|
373
368
|
|
374
369
|
# query parameters
|
375
370
|
query_params = opts[:query_params] || {}
|
376
|
-
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
377
371
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
378
|
-
query_params[:'
|
372
|
+
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
379
373
|
query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
|
380
374
|
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
381
375
|
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
376
|
+
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
382
377
|
|
383
378
|
# header parameters
|
384
379
|
header_params = opts[:header_params] || {}
|
385
380
|
# HTTP header 'Accept' (if needed)
|
386
381
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
387
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
388
382
|
|
389
383
|
# form parameters
|
390
384
|
form_params = opts[:form_params] || {}
|
@@ -396,10 +390,10 @@ module Svix
|
|
396
390
|
return_type = opts[:debug_return_type] || 'ListResponseMessageOut'
|
397
391
|
|
398
392
|
# auth_names
|
399
|
-
auth_names = opts[:debug_auth_names] || [
|
393
|
+
auth_names = opts[:debug_auth_names] || []
|
400
394
|
|
401
395
|
new_options = opts.merge(
|
402
|
-
:operation => :"MessageApi.
|
396
|
+
:operation => :"MessageApi.v1_message_list",
|
403
397
|
:header_params => header_params,
|
404
398
|
:query_params => query_params,
|
405
399
|
:form_params => form_params,
|
@@ -410,7 +404,7 @@ module Svix
|
|
410
404
|
|
411
405
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
412
406
|
if @api_client.config.debugging
|
413
|
-
@api_client.config.logger.debug "API called: MessageApi#
|
407
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
414
408
|
end
|
415
409
|
return data, status_code, headers
|
416
410
|
end
|