svix 0.83.1 → 0.84.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +251 -181
  4. data/lib/svix/api/authentication_api.rb +84 -152
  5. data/lib/svix/api/background_tasks_api.rb +165 -0
  6. data/lib/svix/api/endpoint_api.rb +591 -511
  7. data/lib/svix/api/environment_api.rb +15 -15
  8. data/lib/svix/api/environment_settings_api.rb +7 -10
  9. data/lib/svix/api/event_type_api.rb +160 -85
  10. data/lib/svix/api/health_api.rb +7 -10
  11. data/lib/svix/api/integration_api.rb +136 -143
  12. data/lib/svix/api/message_api.rb +103 -105
  13. data/lib/svix/api/message_attempt_api.rb +419 -419
  14. data/lib/svix/api/statistics_api.rb +110 -48
  15. data/lib/svix/api_client.rb +1 -1
  16. data/lib/svix/api_error.rb +1 -1
  17. data/lib/svix/application_api.rb +22 -22
  18. data/lib/svix/authentication_api.rb +3 -3
  19. data/lib/svix/configuration.rb +2 -1
  20. data/lib/svix/endpoint_api.rb +16 -16
  21. data/lib/svix/event_type_api.rb +19 -19
  22. data/lib/svix/integration_api.rb +26 -26
  23. data/lib/svix/message_api.rb +4 -4
  24. data/lib/svix/message_attempt_api.rb +8 -8
  25. data/lib/svix/models/app_portal_access_in.rb +2 -1
  26. data/lib/svix/models/app_portal_access_out.rb +1 -1
  27. data/lib/svix/models/app_usage_stats_in.rb +255 -0
  28. data/lib/svix/models/app_usage_stats_out.rb +251 -0
  29. data/lib/svix/models/application_in.rb +35 -2
  30. data/lib/svix/models/application_out.rb +23 -3
  31. data/lib/svix/models/application_patch.rb +300 -0
  32. data/lib/svix/models/application_stats.rb +3 -2
  33. data/lib/svix/models/application_token_expire_in.rb +1 -1
  34. data/lib/svix/models/attempt_statistics_data.rb +1 -1
  35. data/lib/svix/models/attempt_statistics_response.rb +1 -1
  36. data/lib/svix/models/{webhook_types.rb → background_task_out.rb} +41 -70
  37. data/lib/svix/models/background_task_status.rb +38 -0
  38. data/lib/svix/models/background_task_type.rb +38 -0
  39. data/lib/svix/models/border_radius_config.rb +1 -1
  40. data/lib/svix/models/border_radius_enum.rb +1 -1
  41. data/lib/svix/models/custom_color_palette.rb +1 -1
  42. data/lib/svix/models/custom_theme_override.rb +1 -1
  43. data/lib/svix/models/dashboard_access_out.rb +1 -1
  44. data/lib/svix/models/endpoint_created_event.rb +6 -1
  45. data/lib/svix/models/endpoint_created_event_data.rb +5 -3
  46. data/lib/svix/models/endpoint_deleted_event.rb +6 -1
  47. data/lib/svix/models/endpoint_deleted_event_data.rb +5 -3
  48. data/lib/svix/models/endpoint_disabled_event.rb +6 -1
  49. data/lib/svix/models/endpoint_disabled_event_data.rb +6 -3
  50. data/lib/svix/models/endpoint_headers_in.rb +1 -1
  51. data/lib/svix/models/endpoint_headers_out.rb +1 -1
  52. data/lib/svix/models/endpoint_headers_patch_in.rb +1 -1
  53. data/lib/svix/models/endpoint_in.rb +20 -11
  54. data/lib/svix/models/endpoint_message_out.rb +4 -1
  55. data/lib/svix/models/endpoint_out.rb +35 -16
  56. data/lib/svix/models/endpoint_patch.rb +406 -0
  57. data/lib/svix/models/endpoint_secret_out.rb +1 -1
  58. data/lib/svix/models/endpoint_secret_rotate_in.rb +3 -1
  59. data/lib/svix/models/endpoint_stats.rb +1 -1
  60. data/lib/svix/models/endpoint_transformation_in.rb +1 -3
  61. data/lib/svix/models/endpoint_transformation_out.rb +1 -1
  62. data/lib/svix/models/endpoint_transformation_simulate_in.rb +8 -1
  63. data/lib/svix/models/endpoint_transformation_simulate_out.rb +1 -1
  64. data/lib/svix/models/endpoint_update.rb +20 -11
  65. data/lib/svix/models/endpoint_updated_event.rb +6 -1
  66. data/lib/svix/models/endpoint_updated_event_data.rb +5 -3
  67. data/lib/svix/models/environment_in.rb +1 -1
  68. data/lib/svix/models/environment_out.rb +1 -1
  69. data/lib/svix/models/environment_settings_out.rb +1 -1
  70. data/lib/svix/models/event_example_in.rb +2 -1
  71. data/lib/svix/models/event_type_example_out.rb +5 -3
  72. data/lib/svix/models/event_type_in.rb +2 -1
  73. data/lib/svix/models/event_type_out.rb +2 -1
  74. data/lib/svix/models/event_type_patch.rb +275 -0
  75. data/lib/svix/models/event_type_schema_in.rb +1 -2
  76. data/lib/svix/models/event_type_update.rb +1 -1
  77. data/lib/svix/models/font_size_config.rb +1 -1
  78. data/lib/svix/models/http_error_out.rb +1 -1
  79. data/lib/svix/models/http_validation_error.rb +6 -1
  80. data/lib/svix/models/integration_in.rb +1 -1
  81. data/lib/svix/models/integration_key_out.rb +1 -1
  82. data/lib/svix/models/integration_out.rb +2 -1
  83. data/lib/svix/models/integration_update.rb +1 -1
  84. data/lib/svix/models/list_response_application_out.rb +1 -1
  85. data/lib/svix/models/list_response_application_stats.rb +16 -6
  86. data/lib/svix/models/list_response_background_task_out.rb +259 -0
  87. data/lib/svix/models/list_response_endpoint_message_out.rb +1 -1
  88. data/lib/svix/models/list_response_endpoint_out.rb +1 -1
  89. data/lib/svix/models/list_response_event_type_out.rb +1 -1
  90. data/lib/svix/models/list_response_integration_out.rb +16 -6
  91. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +1 -1
  92. data/lib/svix/models/list_response_message_attempt_out.rb +1 -1
  93. data/lib/svix/models/list_response_message_endpoint_out.rb +16 -6
  94. data/lib/svix/models/list_response_message_out.rb +1 -1
  95. data/lib/svix/models/message_attempt_endpoint_out.rb +4 -1
  96. data/lib/svix/models/message_attempt_exhausted_event.rb +6 -1
  97. data/lib/svix/models/message_attempt_exhausted_event_data.rb +7 -3
  98. data/lib/svix/models/message_attempt_failed_data.rb +2 -1
  99. data/lib/svix/models/message_attempt_failing_event.rb +6 -1
  100. data/lib/svix/models/message_attempt_failing_event_data.rb +7 -3
  101. data/lib/svix/models/message_attempt_headers_out.rb +28 -2
  102. data/lib/svix/models/message_attempt_out.rb +4 -1
  103. data/lib/svix/models/message_attempt_trigger_type.rb +1 -1
  104. data/lib/svix/models/message_endpoint_out.rb +47 -30
  105. data/lib/svix/models/message_in.rb +2 -2
  106. data/lib/svix/models/message_out.rb +3 -1
  107. data/lib/svix/models/message_status.rb +1 -1
  108. data/lib/svix/models/ordering.rb +1 -1
  109. data/lib/svix/models/recover_in.rb +1 -1
  110. data/lib/svix/models/{one_time_token_out.rb → recover_out.rb} +42 -14
  111. data/lib/svix/models/replay_in.rb +1 -1
  112. data/lib/svix/models/{one_time_token_in.rb → replay_out.rb} +42 -14
  113. data/lib/svix/models/settings_in.rb +1 -1
  114. data/lib/svix/models/settings_out.rb +1 -1
  115. data/lib/svix/models/statistics_period.rb +1 -1
  116. data/lib/svix/models/status_code_class.rb +1 -1
  117. data/lib/svix/models/transformation_http_method.rb +2 -2
  118. data/lib/svix/models/validation_error.rb +5 -1
  119. data/lib/svix/version.rb +1 -1
  120. metadata +14 -5
@@ -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. The optional `application` property will be used to create an application if the application referenced in the path does not exist. If it does then this property is ignored.
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&#39;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&#39;s idempotency key
29
29
  # @return [MessageOut]
30
- def create_message_api_v1_app_app_id_msg_post(app_id, message_in, opts = {})
31
- data, _status_code, _headers = create_message_api_v1_app_app_id_msg_post_with_http_info(app_id, message_in, opts)
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&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. It&#39;s verified to be unique only up to a day, after that no verification will be made. If a message with the same &#x60;eventId&#x60; already exists for any application in your environment, a 409 conflict error will be returned. The &#x60;eventType&#x60; indicates the type and schema of the event. All messages of a certain &#x60;eventType&#x60; are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have &#x60;channels&#x60;, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don&#39;t imply a specific message content or schema. The &#x60;payload&#x60; property is the webhook&#39;s body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it&#39;s generally a good idea to keep webhook payloads small, probably no larger than 40kb. The optional &#x60;application&#x60; property will be used to create an application if the application referenced in the path does not exist. If it does then this property is ignored.
37
- # @param app_id [String]
36
+ # Creates a new message and dispatches it to all of the application&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. It&#39;s verified to be unique only up to a day, after that no verification will be made. If a message with the same &#x60;eventId&#x60; already exists for any application in your environment, a 409 conflict error will be returned. The &#x60;eventType&#x60; indicates the type and schema of the event. All messages of a certain &#x60;eventType&#x60; are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have &#x60;channels&#x60;, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don&#39;t imply a specific message content or schema. The &#x60;payload&#x60; property is the webhook&#39;s body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it&#39;s generally a good idea to keep webhook payloads small, probably no larger than 40kb.
37
+ # @param app_id [String] The app&#39;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&#39;s idempotency key
42
42
  # @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
43
- def create_message_api_v1_app_app_id_msg_post_with_http_info(app_id, message_in, opts = {})
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.create_message_api_v1_app_app_id_msg_post ...'
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.create_message_api_v1_app_app_id_msg_post"
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.create_message_api_v1_app_app_id_msg_post, the character length must be smaller than or equal to 256.'
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.create_message_api_v1_app_app_id_msg_post, the character length must be great than or equal to 1.'
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.create_message_api_v1_app_app_id_msg_post, must conform to the pattern #{pattern}."
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.create_message_api_v1_app_app_id_msg_post"
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.create_message_api_v1_app_app_id_msg_post",
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#create_message_api_v1_app_app_id_msg_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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 msg_id [String]
115
- # @param app_id [String]
114
+ # @param app_id [String] The app&#39;s ID or UID
115
+ # @param msg_id [String] The msg&#39;s ID or UID
116
116
  # @param [Hash] opts the optional parameters
117
- # @option opts [String] :idempotency_key The request&#39;s idempotency key
118
117
  # @return [nil]
119
- def expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete(msg_id, app_id, opts = {})
120
- expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete_with_http_info(msg_id, app_id, opts)
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&#39;s payload. Useful in cases when a message was accidentally sent with sensitive content. The message can&#39;t be replayed or resent once its payload has been deleted or expired.
126
- # @param msg_id [String]
127
- # @param app_id [String]
125
+ # @param app_id [String] The app&#39;s ID or UID
126
+ # @param msg_id [String] The msg&#39;s ID or UID
128
127
  # @param [Hash] opts the optional parameters
129
- # @option opts [String] :idempotency_key The request&#39;s idempotency key
130
128
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
131
- def expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete_with_http_info(msg_id, app_id, opts = {})
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.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete ...'
131
+ @api_client.config.logger.debug 'Calling API: MessageApi.v1_message_expunge_content ...'
134
132
  end
135
- # verify the required parameter 'msg_id' is set
136
- if @api_client.config.client_side_validation && msg_id.nil?
137
- fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete"
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 && msg_id.to_s.length > 256
140
- fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete, the character length must be smaller than or equal to 256.'
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 && msg_id.to_s.length < 1
144
- fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete, the character length must be great than or equal to 1.'
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 && msg_id !~ pattern
149
- fail ArgumentError, "invalid value for 'msg_id' when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete, must conform to the pattern #{pattern}."
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 'app_id' is set
153
- if @api_client.config.client_side_validation && app_id.nil?
154
- fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete"
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 && app_id.to_s.length > 256
157
- fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete, the character length must be smaller than or equal to 256.'
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 && app_id.to_s.length < 1
161
- fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete, the character length must be great than or equal to 1.'
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 && app_id !~ pattern
166
- fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete, must conform to the pattern #{pattern}."
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('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
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.expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete",
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#expunge_message_payload_api_v1_app_app_id_msg_msg_id_content_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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
- # @param app_id [String]
209
+ # @param app_id [String] The app&#39;s ID or UID
210
+ # @param msg_id [String] The msg&#39;s ID or UID
214
211
  # @param [Hash] opts the optional parameters
215
- # @option opts [String] :idempotency_key The request&#39;s idempotency key
212
+ # @option opts [Boolean] :with_content (default to true)
216
213
  # @return [MessageOut]
217
- def get_message_api_v1_app_app_id_msg_msg_id_get(msg_id, app_id, opts = {})
218
- data, _status_code, _headers = get_message_api_v1_app_app_id_msg_msg_id_get_with_http_info(msg_id, app_id, opts)
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
- # @param app_id [String]
221
+ # @param app_id [String] The app&#39;s ID or UID
222
+ # @param msg_id [String] The msg&#39;s ID or UID
226
223
  # @param [Hash] opts the optional parameters
227
- # @option opts [String] :idempotency_key The request&#39;s idempotency key
224
+ # @option opts [Boolean] :with_content
228
225
  # @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
229
- def get_message_api_v1_app_app_id_msg_msg_id_get_with_http_info(msg_id, app_id, opts = {})
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.get_message_api_v1_app_app_id_msg_msg_id_get ...'
228
+ @api_client.config.logger.debug 'Calling API: MessageApi.v1_message_get ...'
232
229
  end
233
- # verify the required parameter 'msg_id' is set
234
- if @api_client.config.client_side_validation && msg_id.nil?
235
- fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get"
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 && msg_id.to_s.length > 256
238
- fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get, the character length must be smaller than or equal to 256.'
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 && msg_id.to_s.length < 1
242
- fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get, the character length must be great than or equal to 1.'
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 && msg_id !~ pattern
247
- fail ArgumentError, "invalid value for 'msg_id' when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get, must conform to the pattern #{pattern}."
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 'app_id' is set
251
- if @api_client.config.client_side_validation && app_id.nil?
252
- fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get"
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 && app_id.to_s.length > 256
255
- fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get, the character length must be smaller than or equal to 256.'
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 && app_id.to_s.length < 1
259
- fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get, the character length must be great than or equal to 1.'
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 && app_id !~ pattern
264
- fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.get_message_api_v1_app_app_id_msg_msg_id_get, must conform to the pattern #{pattern}."
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('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
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.get_message_api_v1_app_app_id_msg_msg_id_get",
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#get_message_api_v1_app_app_id_msg_msg_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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&#39;s ID or UID
311
308
  # @param [Hash] opts the optional parameters
312
- # @option opts [String] :iterator
313
- # @option opts [Integer] :limit (default to 50)
314
- # @option opts [Array<String>] :event_types
309
+ # @option opts [Integer] :limit
310
+ # @option opts [String] :iterator The msg&#39;s ID
315
311
  # @option opts [String] :channel
316
312
  # @option opts [Time] :before
317
313
  # @option opts [Time] :after
318
- # @option opts [String] :idempotency_key The request&#39;s idempotency key
314
+ # @option opts [Array<String>] :event_types
319
315
  # @return [ListResponseMessageOut]
320
- def list_messages_api_v1_app_app_id_msg_get(app_id, opts = {})
321
- data, _status_code, _headers = list_messages_api_v1_app_app_id_msg_get_with_http_info(app_id, opts)
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&#39;s messages. The &#x60;before&#x60; parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. The &#x60;after&#x60; parameter lets you filter all items created after a certain date and is ignored if an iterator is passed. &#x60;before&#x60; and &#x60;after&#x60; cannot be used simultaneously.
327
- # @param app_id [String]
323
+ # @param app_id [String] The app&#39;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 [Array<String>] :event_types
326
+ # @option opts [String] :iterator The msg&#39;s ID
332
327
  # @option opts [String] :channel
333
328
  # @option opts [Time] :before
334
329
  # @option opts [Time] :after
335
- # @option opts [String] :idempotency_key The request&#39;s idempotency key
330
+ # @option opts [Array<String>] :event_types
336
331
  # @return [Array<(ListResponseMessageOut, Integer, Hash)>] ListResponseMessageOut data, response status code and response headers
337
- def list_messages_api_v1_app_app_id_msg_get_with_http_info(app_id, opts = {})
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.list_messages_api_v1_app_app_id_msg_get ...'
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.list_messages_api_v1_app_app_id_msg_get"
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.list_messages_api_v1_app_app_id_msg_get, the character length must be smaller than or equal to 256.'
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.list_messages_api_v1_app_app_id_msg_get, the character length must be great than or equal to 1.'
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.list_messages_api_v1_app_app_id_msg_get, must conform to the pattern #{pattern}."
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.list_messages_api_v1_app_app_id_msg_get, must be smaller than or equal to 250.'
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.list_messages_api_v1_app_app_id_msg_get, the character length must be smaller than or equal to 128.'
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.list_messages_api_v1_app_app_id_msg_get, must conform to the pattern #{pattern}."
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[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
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.list_messages_api_v1_app_app_id_msg_get",
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#list_messages_api_v1_app_app_id_msg_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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