svix 0.83.1 → 0.84.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/application_api.rb +251 -181
- data/lib/svix/api/authentication_api.rb +84 -152
- data/lib/svix/api/background_tasks_api.rb +165 -0
- data/lib/svix/api/endpoint_api.rb +591 -511
- data/lib/svix/api/environment_api.rb +15 -15
- data/lib/svix/api/environment_settings_api.rb +7 -10
- data/lib/svix/api/event_type_api.rb +160 -85
- data/lib/svix/api/health_api.rb +7 -10
- data/lib/svix/api/integration_api.rb +136 -143
- data/lib/svix/api/message_api.rb +103 -105
- data/lib/svix/api/message_attempt_api.rb +419 -419
- data/lib/svix/api/statistics_api.rb +110 -48
- data/lib/svix/api_client.rb +1 -1
- data/lib/svix/api_error.rb +1 -1
- data/lib/svix/application_api.rb +22 -22
- data/lib/svix/authentication_api.rb +3 -3
- data/lib/svix/configuration.rb +2 -1
- 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 +2 -1
- data/lib/svix/models/app_portal_access_out.rb +1 -1
- data/lib/svix/models/app_usage_stats_in.rb +255 -0
- data/lib/svix/models/app_usage_stats_out.rb +251 -0
- data/lib/svix/models/application_in.rb +35 -2
- data/lib/svix/models/application_out.rb +23 -3
- data/lib/svix/models/application_patch.rb +300 -0
- data/lib/svix/models/application_stats.rb +3 -2
- data/lib/svix/models/application_token_expire_in.rb +1 -1
- data/lib/svix/models/attempt_statistics_data.rb +1 -1
- data/lib/svix/models/attempt_statistics_response.rb +1 -1
- data/lib/svix/models/{webhook_types.rb → background_task_out.rb} +41 -70
- data/lib/svix/models/background_task_status.rb +38 -0
- data/lib/svix/models/background_task_type.rb +38 -0
- data/lib/svix/models/border_radius_config.rb +1 -1
- data/lib/svix/models/border_radius_enum.rb +1 -1
- data/lib/svix/models/custom_color_palette.rb +1 -1
- data/lib/svix/models/custom_theme_override.rb +1 -1
- data/lib/svix/models/dashboard_access_out.rb +1 -1
- data/lib/svix/models/endpoint_created_event.rb +6 -1
- data/lib/svix/models/endpoint_created_event_data.rb +5 -3
- data/lib/svix/models/endpoint_deleted_event.rb +6 -1
- data/lib/svix/models/endpoint_deleted_event_data.rb +5 -3
- data/lib/svix/models/endpoint_disabled_event.rb +6 -1
- data/lib/svix/models/endpoint_disabled_event_data.rb +6 -3
- data/lib/svix/models/endpoint_headers_in.rb +1 -1
- data/lib/svix/models/endpoint_headers_out.rb +1 -1
- data/lib/svix/models/endpoint_headers_patch_in.rb +1 -1
- data/lib/svix/models/endpoint_in.rb +20 -11
- data/lib/svix/models/endpoint_message_out.rb +4 -1
- data/lib/svix/models/endpoint_out.rb +35 -16
- data/lib/svix/models/endpoint_patch.rb +406 -0
- data/lib/svix/models/endpoint_secret_out.rb +1 -1
- data/lib/svix/models/endpoint_secret_rotate_in.rb +3 -1
- data/lib/svix/models/endpoint_stats.rb +1 -1
- data/lib/svix/models/endpoint_transformation_in.rb +1 -3
- data/lib/svix/models/endpoint_transformation_out.rb +1 -1
- data/lib/svix/models/endpoint_transformation_simulate_in.rb +8 -1
- data/lib/svix/models/endpoint_transformation_simulate_out.rb +1 -1
- data/lib/svix/models/endpoint_update.rb +20 -11
- data/lib/svix/models/endpoint_updated_event.rb +6 -1
- data/lib/svix/models/endpoint_updated_event_data.rb +5 -3
- data/lib/svix/models/environment_in.rb +1 -1
- data/lib/svix/models/environment_out.rb +1 -1
- data/lib/svix/models/environment_settings_out.rb +1 -1
- data/lib/svix/models/event_example_in.rb +2 -1
- data/lib/svix/models/event_type_example_out.rb +5 -3
- data/lib/svix/models/event_type_in.rb +2 -1
- data/lib/svix/models/event_type_out.rb +2 -1
- data/lib/svix/models/event_type_patch.rb +275 -0
- data/lib/svix/models/event_type_schema_in.rb +1 -2
- data/lib/svix/models/event_type_update.rb +1 -1
- data/lib/svix/models/font_size_config.rb +1 -1
- data/lib/svix/models/http_error_out.rb +1 -1
- data/lib/svix/models/http_validation_error.rb +6 -1
- data/lib/svix/models/integration_in.rb +1 -1
- data/lib/svix/models/integration_key_out.rb +1 -1
- data/lib/svix/models/integration_out.rb +2 -1
- data/lib/svix/models/integration_update.rb +1 -1
- data/lib/svix/models/list_response_application_out.rb +1 -1
- data/lib/svix/models/list_response_application_stats.rb +16 -6
- data/lib/svix/models/list_response_background_task_out.rb +259 -0
- data/lib/svix/models/list_response_endpoint_message_out.rb +1 -1
- data/lib/svix/models/list_response_endpoint_out.rb +1 -1
- data/lib/svix/models/list_response_event_type_out.rb +1 -1
- data/lib/svix/models/list_response_integration_out.rb +16 -6
- data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +1 -1
- data/lib/svix/models/list_response_message_attempt_out.rb +1 -1
- data/lib/svix/models/list_response_message_endpoint_out.rb +16 -6
- data/lib/svix/models/list_response_message_out.rb +1 -1
- data/lib/svix/models/message_attempt_endpoint_out.rb +4 -1
- data/lib/svix/models/message_attempt_exhausted_event.rb +6 -1
- data/lib/svix/models/message_attempt_exhausted_event_data.rb +7 -3
- data/lib/svix/models/message_attempt_failed_data.rb +2 -1
- data/lib/svix/models/message_attempt_failing_event.rb +6 -1
- data/lib/svix/models/message_attempt_failing_event_data.rb +7 -3
- data/lib/svix/models/message_attempt_headers_out.rb +28 -2
- data/lib/svix/models/message_attempt_out.rb +4 -1
- data/lib/svix/models/message_attempt_trigger_type.rb +1 -1
- data/lib/svix/models/message_endpoint_out.rb +47 -30
- data/lib/svix/models/message_in.rb +2 -2
- data/lib/svix/models/message_out.rb +3 -1
- data/lib/svix/models/message_status.rb +1 -1
- data/lib/svix/models/ordering.rb +1 -1
- data/lib/svix/models/recover_in.rb +1 -1
- data/lib/svix/models/{one_time_token_out.rb → recover_out.rb} +42 -14
- data/lib/svix/models/replay_in.rb +1 -1
- data/lib/svix/models/{one_time_token_in.rb → replay_out.rb} +42 -14
- data/lib/svix/models/settings_in.rb +1 -1
- data/lib/svix/models/settings_out.rb +1 -1
- data/lib/svix/models/statistics_period.rb +1 -1
- data/lib/svix/models/status_code_class.rb +1 -1
- data/lib/svix/models/transformation_http_method.rb +2 -2
- data/lib/svix/models/validation_error.rb +5 -1
- data/lib/svix/version.rb +1 -1
- metadata +14 -5
data/lib/svix/api/message_api.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.4
|
6
|
+
The version of the OpenAPI document: 1.4.1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
OpenAPI Generator version: 5.2.0
|
@@ -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.
|
24
|
-
# @param app_id [String]
|
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
|
+
# @param app_id [String] The app's ID or UID
|
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.
|
37
|
-
# @param app_id [String]
|
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
|
+
# @param app_id [String] The app's ID or UID
|
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))
|
@@ -93,7 +93,7 @@ module Svix
|
|
93
93
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
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
|
# Delete message payload
|
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
|
115
|
-
# @param
|
114
|
+
# @param app_id [String] The app's ID or UID
|
115
|
+
# @param msg_id [String] The msg's ID or UID
|
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
|
# Delete message payload
|
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
|
127
|
-
# @param
|
125
|
+
# @param app_id [String] The app's ID or UID
|
126
|
+
# @param msg_id [String] The msg's ID or UID
|
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] || {}
|
@@ -191,7 +188,7 @@ module Svix
|
|
191
188
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
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
|
213
|
-
# @param
|
209
|
+
# @param app_id [String] The app's ID or UID
|
210
|
+
# @param msg_id [String] The msg's ID or UID
|
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
|
225
|
-
# @param
|
221
|
+
# @param app_id [String] The app's ID or UID
|
222
|
+
# @param msg_id [String] The msg's ID or UID
|
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] || {}
|
@@ -289,7 +286,7 @@ module Svix
|
|
289
286
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
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,72 +297,74 @@ 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
|
307
304
|
|
308
305
|
# List Messages
|
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
|
-
# @param app_id [String]
|
307
|
+
# @param app_id [String] The app's ID or UID
|
311
308
|
# @param [Hash] opts the optional parameters
|
312
|
-
# @option opts [
|
313
|
-
# @option opts [
|
314
|
-
# @option opts [Array<String>] :event_types
|
309
|
+
# @option opts [Integer] :limit
|
310
|
+
# @option opts [String] :iterator The msg's ID
|
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
|
|
325
321
|
# List Messages
|
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
|
-
# @param app_id [String]
|
323
|
+
# @param app_id [String] The app's ID or UID
|
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 The msg's ID
|
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
353
|
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
359
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.
|
354
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_list, must be smaller than or equal to 250.'
|
355
|
+
end
|
356
|
+
|
357
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
358
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_list, must be greater than or equal to 1.'
|
360
359
|
end
|
361
360
|
|
362
361
|
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.
|
362
|
+
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
363
|
end
|
365
364
|
|
366
365
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
367
366
|
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
|
368
|
-
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.
|
367
|
+
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
369
368
|
end
|
370
369
|
|
371
370
|
# resource path
|
@@ -373,18 +372,17 @@ module Svix
|
|
373
372
|
|
374
373
|
# query parameters
|
375
374
|
query_params = opts[:query_params] || {}
|
376
|
-
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
377
375
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
378
|
-
query_params[:'
|
376
|
+
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
379
377
|
query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
|
380
378
|
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
381
379
|
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
380
|
+
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
382
381
|
|
383
382
|
# header parameters
|
384
383
|
header_params = opts[:header_params] || {}
|
385
384
|
# HTTP header 'Accept' (if needed)
|
386
385
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
387
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
388
386
|
|
389
387
|
# form parameters
|
390
388
|
form_params = opts[:form_params] || {}
|
@@ -399,7 +397,7 @@ module Svix
|
|
399
397
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
400
398
|
|
401
399
|
new_options = opts.merge(
|
402
|
-
:operation => :"MessageApi.
|
400
|
+
:operation => :"MessageApi.v1_message_list",
|
403
401
|
:header_params => header_params,
|
404
402
|
:query_params => query_params,
|
405
403
|
:form_params => form_params,
|
@@ -410,7 +408,7 @@ module Svix
|
|
410
408
|
|
411
409
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
412
410
|
if @api_client.config.debugging
|
413
|
-
@api_client.config.logger.debug "API called: MessageApi#
|
411
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
414
412
|
end
|
415
413
|
return data, status_code, headers
|
416
414
|
end
|