svix 0.83.0 → 0.84.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +247 -181
  4. data/lib/svix/api/authentication_api.rb +82 -82
  5. data/lib/svix/api/background_tasks_api.rb +161 -0
  6. data/lib/svix/api/endpoint_api.rb +561 -485
  7. data/lib/svix/api/environment_api.rb +16 -16
  8. data/lib/svix/api/environment_settings_api.rb +7 -10
  9. data/lib/svix/api/event_type_api.rb +152 -81
  10. data/lib/svix/api/health_api.rb +6 -9
  11. data/lib/svix/api/integration_api.rb +123 -134
  12. data/lib/svix/api/message_api.rb +96 -102
  13. data/lib/svix/api/message_attempt_api.rb +382 -406
  14. data/lib/svix/api/statistics_api.rb +107 -45
  15. data/lib/svix/api_client.rb +0 -1
  16. data/lib/svix/application_api.rb +22 -22
  17. data/lib/svix/authentication_api.rb +3 -3
  18. data/lib/svix/configuration.rb +0 -7
  19. data/lib/svix/endpoint_api.rb +16 -16
  20. data/lib/svix/event_type_api.rb +19 -19
  21. data/lib/svix/integration_api.rb +26 -26
  22. data/lib/svix/message_api.rb +4 -4
  23. data/lib/svix/message_attempt_api.rb +8 -8
  24. data/lib/svix/models/app_portal_access_in.rb +1 -0
  25. data/lib/svix/models/application_in.rb +34 -1
  26. data/lib/svix/models/application_out.rb +20 -2
  27. data/lib/svix/models/application_patch.rb +299 -0
  28. data/lib/svix/models/application_stats.rb +0 -1
  29. data/lib/svix/models/{webhook_types.rb → background_task_out.rb} +40 -69
  30. data/lib/svix/models/background_task_out_common.rb +251 -0
  31. data/lib/svix/models/background_task_status.rb +38 -0
  32. data/lib/svix/models/background_task_type.rb +38 -0
  33. data/lib/svix/models/calculate_app_stats_in.rb +255 -0
  34. data/lib/svix/models/endpoint_created_event.rb +5 -0
  35. data/lib/svix/models/endpoint_created_event_data.rb +0 -2
  36. data/lib/svix/models/endpoint_deleted_event.rb +5 -0
  37. data/lib/svix/models/endpoint_deleted_event_data.rb +0 -2
  38. data/lib/svix/models/endpoint_disabled_event.rb +5 -0
  39. data/lib/svix/models/endpoint_disabled_event_data.rb +1 -2
  40. data/lib/svix/models/endpoint_in.rb +19 -10
  41. data/lib/svix/models/endpoint_message_out.rb +1 -0
  42. data/lib/svix/models/endpoint_out.rb +33 -15
  43. data/lib/svix/models/endpoint_patch.rb +405 -0
  44. data/lib/svix/models/endpoint_secret_rotate_in.rb +2 -0
  45. data/lib/svix/models/endpoint_transformation_in.rb +0 -2
  46. data/lib/svix/models/endpoint_transformation_simulate_in.rb +6 -0
  47. data/lib/svix/models/endpoint_update.rb +19 -10
  48. data/lib/svix/models/endpoint_updated_event.rb +5 -0
  49. data/lib/svix/models/endpoint_updated_event_data.rb +0 -2
  50. data/lib/svix/models/event_type_example_out.rb +4 -2
  51. data/lib/svix/models/event_type_patch.rb +275 -0
  52. data/lib/svix/models/event_type_schema_in.rb +0 -1
  53. data/lib/svix/models/http_validation_error.rb +5 -0
  54. data/lib/svix/models/list_response_application_stats.rb +15 -5
  55. data/lib/svix/models/list_response_background_task_out.rb +259 -0
  56. data/lib/svix/models/list_response_integration_out.rb +15 -5
  57. data/lib/svix/models/list_response_message_endpoint_out.rb +15 -5
  58. data/lib/svix/models/message_attempt_exhausted_event.rb +5 -0
  59. data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -2
  60. data/lib/svix/models/message_attempt_failing_event.rb +5 -0
  61. data/lib/svix/models/message_attempt_failing_event_data.rb +1 -2
  62. data/lib/svix/models/message_attempt_headers_out.rb +27 -1
  63. data/lib/svix/models/message_endpoint_out.rb +45 -29
  64. data/lib/svix/models/message_in.rb +0 -1
  65. data/lib/svix/models/recover_out.rb +251 -0
  66. data/lib/svix/models/replay_out.rb +251 -0
  67. data/lib/svix/models/transformation_http_method.rb +1 -1
  68. data/lib/svix/models/validation_error.rb +4 -0
  69. data/lib/svix/version.rb +1 -1
  70. metadata +14 -3
@@ -19,52 +19,52 @@ module Svix
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Expire All
23
- # Expire all of the tokens associated with a specific Application
22
+ # App Portal Access
23
+ # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
24
24
  # @param app_id [String]
25
- # @param application_token_expire_in [ApplicationTokenExpireIn]
25
+ # @param app_portal_access_in [AppPortalAccessIn]
26
26
  # @param [Hash] opts the optional parameters
27
27
  # @option opts [String] :idempotency_key The request's idempotency key
28
- # @return [nil]
29
- def expire_all_api_v1_auth_app_app_id_expire_all_post(app_id, application_token_expire_in, opts = {})
30
- expire_all_api_v1_auth_app_app_id_expire_all_post_with_http_info(app_id, application_token_expire_in, opts)
31
- nil
28
+ # @return [AppPortalAccessOut]
29
+ def v1_authentication_app_portal_access(app_id, app_portal_access_in, opts = {})
30
+ data, _status_code, _headers = v1_authentication_app_portal_access_with_http_info(app_id, app_portal_access_in, opts)
31
+ data
32
32
  end
33
33
 
34
- # Expire All
35
- # Expire all of the tokens associated with a specific Application
34
+ # App Portal Access
35
+ # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
36
36
  # @param app_id [String]
37
- # @param application_token_expire_in [ApplicationTokenExpireIn]
37
+ # @param app_portal_access_in [AppPortalAccessIn]
38
38
  # @param [Hash] opts the optional parameters
39
39
  # @option opts [String] :idempotency_key The request's idempotency key
40
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
41
- def expire_all_api_v1_auth_app_app_id_expire_all_post_with_http_info(app_id, application_token_expire_in, opts = {})
40
+ # @return [Array<(AppPortalAccessOut, Integer, Hash)>] AppPortalAccessOut data, response status code and response headers
41
+ def v1_authentication_app_portal_access_with_http_info(app_id, app_portal_access_in, opts = {})
42
42
  if @api_client.config.debugging
43
- @api_client.config.logger.debug 'Calling API: AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post ...'
43
+ @api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_app_portal_access ...'
44
44
  end
45
45
  # verify the required parameter 'app_id' is set
46
46
  if @api_client.config.client_side_validation && app_id.nil?
47
- fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post"
47
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.v1_authentication_app_portal_access"
48
48
  end
49
49
  if @api_client.config.client_side_validation && app_id.to_s.length > 256
50
- fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post, the character length must be smaller than or equal to 256.'
50
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_app_portal_access, the character length must be smaller than or equal to 256.'
51
51
  end
52
52
 
53
53
  if @api_client.config.client_side_validation && app_id.to_s.length < 1
54
- fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post, the character length must be great than or equal to 1.'
54
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_app_portal_access, the character length must be great than or equal to 1.'
55
55
  end
56
56
 
57
57
  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
58
58
  if @api_client.config.client_side_validation && app_id !~ pattern
59
- fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post, must conform to the pattern #{pattern}."
59
+ fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.v1_authentication_app_portal_access, must conform to the pattern #{pattern}."
60
60
  end
61
61
 
62
- # verify the required parameter 'application_token_expire_in' is set
63
- if @api_client.config.client_side_validation && application_token_expire_in.nil?
64
- fail ArgumentError, "Missing the required parameter 'application_token_expire_in' when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post"
62
+ # verify the required parameter 'app_portal_access_in' is set
63
+ if @api_client.config.client_side_validation && app_portal_access_in.nil?
64
+ fail ArgumentError, "Missing the required parameter 'app_portal_access_in' when calling AuthenticationApi.v1_authentication_app_portal_access"
65
65
  end
66
66
  # resource path
67
- local_var_path = '/api/v1/auth/app/{app_id}/expire-all/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
67
+ local_var_path = '/api/v1/auth/app-portal-access/{app_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
68
68
 
69
69
  # query parameters
70
70
  query_params = opts[:query_params] || {}
@@ -81,16 +81,16 @@ module Svix
81
81
  form_params = opts[:form_params] || {}
82
82
 
83
83
  # http body (model)
84
- post_body = opts[:debug_body] || @api_client.object_to_http_body(application_token_expire_in)
84
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(app_portal_access_in)
85
85
 
86
86
  # return_type
87
- return_type = opts[:debug_return_type]
87
+ return_type = opts[:debug_return_type] || 'AppPortalAccessOut'
88
88
 
89
89
  # auth_names
90
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
90
+ auth_names = opts[:debug_auth_names] || []
91
91
 
92
92
  new_options = opts.merge(
93
- :operation => :"AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post",
93
+ :operation => :"AuthenticationApi.v1_authentication_app_portal_access",
94
94
  :header_params => header_params,
95
95
  :query_params => query_params,
96
96
  :form_params => form_params,
@@ -101,57 +101,51 @@ module Svix
101
101
 
102
102
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
103
103
  if @api_client.config.debugging
104
- @api_client.config.logger.debug "API called: AuthenticationApi#expire_all_api_v1_auth_app_app_id_expire_all_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
+ @api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_app_portal_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
105
105
  end
106
106
  return data, status_code, headers
107
107
  end
108
108
 
109
- # Get Consumer App Portal Access
110
- # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
109
+ # Dashboard Access
110
+ # DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
111
111
  # @param app_id [String]
112
- # @param app_portal_access_in [AppPortalAccessIn]
113
112
  # @param [Hash] opts the optional parameters
114
113
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
115
- # @return [AppPortalAccessOut]
116
- def get_app_portal_access_api_v1_auth_app_portal_access_app_id_post(app_id, app_portal_access_in, opts = {})
117
- data, _status_code, _headers = get_app_portal_access_api_v1_auth_app_portal_access_app_id_post_with_http_info(app_id, app_portal_access_in, opts)
114
+ # @return [DashboardAccessOut]
115
+ def v1_authentication_dashboard_access(app_id, opts = {})
116
+ data, _status_code, _headers = v1_authentication_dashboard_access_with_http_info(app_id, opts)
118
117
  data
119
118
  end
120
119
 
121
- # Get Consumer App Portal Access
122
- # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
120
+ # Dashboard Access
121
+ # DEPRECATED: Please use &#x60;app-portal-access&#x60; instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
123
122
  # @param app_id [String]
124
- # @param app_portal_access_in [AppPortalAccessIn]
125
123
  # @param [Hash] opts the optional parameters
126
124
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
127
- # @return [Array<(AppPortalAccessOut, Integer, Hash)>] AppPortalAccessOut data, response status code and response headers
128
- def get_app_portal_access_api_v1_auth_app_portal_access_app_id_post_with_http_info(app_id, app_portal_access_in, opts = {})
125
+ # @return [Array<(DashboardAccessOut, Integer, Hash)>] DashboardAccessOut data, response status code and response headers
126
+ def v1_authentication_dashboard_access_with_http_info(app_id, opts = {})
129
127
  if @api_client.config.debugging
130
- @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post ...'
128
+ @api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_dashboard_access ...'
131
129
  end
132
130
  # verify the required parameter 'app_id' is set
133
131
  if @api_client.config.client_side_validation && app_id.nil?
134
- fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post"
132
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.v1_authentication_dashboard_access"
135
133
  end
136
134
  if @api_client.config.client_side_validation && app_id.to_s.length > 256
137
- fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post, the character length must be smaller than or equal to 256.'
135
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_dashboard_access, the character length must be smaller than or equal to 256.'
138
136
  end
139
137
 
140
138
  if @api_client.config.client_side_validation && app_id.to_s.length < 1
141
- fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post, the character length must be great than or equal to 1.'
139
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_dashboard_access, the character length must be great than or equal to 1.'
142
140
  end
143
141
 
144
142
  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
145
143
  if @api_client.config.client_side_validation && app_id !~ pattern
146
- fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post, must conform to the pattern #{pattern}."
144
+ fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.v1_authentication_dashboard_access, must conform to the pattern #{pattern}."
147
145
  end
148
146
 
149
- # verify the required parameter 'app_portal_access_in' is set
150
- if @api_client.config.client_side_validation && app_portal_access_in.nil?
151
- fail ArgumentError, "Missing the required parameter 'app_portal_access_in' when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post"
152
- end
153
147
  # resource path
154
- local_var_path = '/api/v1/auth/app-portal-access/{app_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
148
+ local_var_path = '/api/v1/auth/dashboard-access/{app_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
155
149
 
156
150
  # query parameters
157
151
  query_params = opts[:query_params] || {}
@@ -160,24 +154,22 @@ module Svix
160
154
  header_params = opts[:header_params] || {}
161
155
  # HTTP header 'Accept' (if needed)
162
156
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
163
- # HTTP header 'Content-Type'
164
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
165
157
  header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
166
158
 
167
159
  # form parameters
168
160
  form_params = opts[:form_params] || {}
169
161
 
170
162
  # http body (model)
171
- post_body = opts[:debug_body] || @api_client.object_to_http_body(app_portal_access_in)
163
+ post_body = opts[:debug_body]
172
164
 
173
165
  # return_type
174
- return_type = opts[:debug_return_type] || 'AppPortalAccessOut'
166
+ return_type = opts[:debug_return_type] || 'DashboardAccessOut'
175
167
 
176
168
  # auth_names
177
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
169
+ auth_names = opts[:debug_auth_names] || []
178
170
 
179
171
  new_options = opts.merge(
180
- :operation => :"AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post",
172
+ :operation => :"AuthenticationApi.v1_authentication_dashboard_access",
181
173
  :header_params => header_params,
182
174
  :query_params => query_params,
183
175
  :form_params => form_params,
@@ -188,51 +180,57 @@ module Svix
188
180
 
189
181
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
190
182
  if @api_client.config.debugging
191
- @api_client.config.logger.debug "API called: AuthenticationApi#get_app_portal_access_api_v1_auth_app_portal_access_app_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
183
+ @api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_dashboard_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
184
  end
193
185
  return data, status_code, headers
194
186
  end
195
187
 
196
- # Get Dashboard Access
197
- # DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
188
+ # Expire All
189
+ # Expire all of the tokens associated with a specific Application
198
190
  # @param app_id [String]
191
+ # @param application_token_expire_in [ApplicationTokenExpireIn]
199
192
  # @param [Hash] opts the optional parameters
200
193
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
201
- # @return [DashboardAccessOut]
202
- def get_dashboard_access_api_v1_auth_dashboard_access_app_id_post(app_id, opts = {})
203
- data, _status_code, _headers = get_dashboard_access_api_v1_auth_dashboard_access_app_id_post_with_http_info(app_id, opts)
204
- data
194
+ # @return [nil]
195
+ def v1_authentication_expire_all(app_id, application_token_expire_in, opts = {})
196
+ v1_authentication_expire_all_with_http_info(app_id, application_token_expire_in, opts)
197
+ nil
205
198
  end
206
199
 
207
- # Get Dashboard Access
208
- # DEPRECATED: Please use &#x60;app-portal-access&#x60; instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
200
+ # Expire All
201
+ # Expire all of the tokens associated with a specific Application
209
202
  # @param app_id [String]
203
+ # @param application_token_expire_in [ApplicationTokenExpireIn]
210
204
  # @param [Hash] opts the optional parameters
211
205
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
212
- # @return [Array<(DashboardAccessOut, Integer, Hash)>] DashboardAccessOut data, response status code and response headers
213
- def get_dashboard_access_api_v1_auth_dashboard_access_app_id_post_with_http_info(app_id, opts = {})
206
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
207
+ def v1_authentication_expire_all_with_http_info(app_id, application_token_expire_in, opts = {})
214
208
  if @api_client.config.debugging
215
- @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post ...'
209
+ @api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_expire_all ...'
216
210
  end
217
211
  # verify the required parameter 'app_id' is set
218
212
  if @api_client.config.client_side_validation && app_id.nil?
219
- fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post"
213
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.v1_authentication_expire_all"
220
214
  end
221
215
  if @api_client.config.client_side_validation && app_id.to_s.length > 256
222
- fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post, the character length must be smaller than or equal to 256.'
216
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_expire_all, the character length must be smaller than or equal to 256.'
223
217
  end
224
218
 
225
219
  if @api_client.config.client_side_validation && app_id.to_s.length < 1
226
- fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post, the character length must be great than or equal to 1.'
220
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_expire_all, the character length must be great than or equal to 1.'
227
221
  end
228
222
 
229
223
  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
230
224
  if @api_client.config.client_side_validation && app_id !~ pattern
231
- fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post, must conform to the pattern #{pattern}."
225
+ fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.v1_authentication_expire_all, must conform to the pattern #{pattern}."
232
226
  end
233
227
 
228
+ # verify the required parameter 'application_token_expire_in' is set
229
+ if @api_client.config.client_side_validation && application_token_expire_in.nil?
230
+ fail ArgumentError, "Missing the required parameter 'application_token_expire_in' when calling AuthenticationApi.v1_authentication_expire_all"
231
+ end
234
232
  # resource path
235
- local_var_path = '/api/v1/auth/dashboard-access/{app_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
233
+ local_var_path = '/api/v1/auth/app/{app_id}/expire-all/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
236
234
 
237
235
  # query parameters
238
236
  query_params = opts[:query_params] || {}
@@ -241,22 +239,24 @@ module Svix
241
239
  header_params = opts[:header_params] || {}
242
240
  # HTTP header 'Accept' (if needed)
243
241
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
242
+ # HTTP header 'Content-Type'
243
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
244
244
  header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
245
245
 
246
246
  # form parameters
247
247
  form_params = opts[:form_params] || {}
248
248
 
249
249
  # http body (model)
250
- post_body = opts[:debug_body]
250
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(application_token_expire_in)
251
251
 
252
252
  # return_type
253
- return_type = opts[:debug_return_type] || 'DashboardAccessOut'
253
+ return_type = opts[:debug_return_type]
254
254
 
255
255
  # auth_names
256
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
256
+ auth_names = opts[:debug_auth_names] || []
257
257
 
258
258
  new_options = opts.merge(
259
- :operation => :"AuthenticationApi.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post",
259
+ :operation => :"AuthenticationApi.v1_authentication_expire_all",
260
260
  :header_params => header_params,
261
261
  :query_params => query_params,
262
262
  :form_params => form_params,
@@ -267,7 +267,7 @@ module Svix
267
267
 
268
268
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
269
269
  if @api_client.config.debugging
270
- @api_client.config.logger.debug "API called: AuthenticationApi#get_dashboard_access_api_v1_auth_dashboard_access_app_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
270
+ @api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_expire_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
271
271
  end
272
272
  return data, status_code, headers
273
273
  end
@@ -277,8 +277,8 @@ module Svix
277
277
  # @param [Hash] opts the optional parameters
278
278
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
279
279
  # @return [nil]
280
- def logout_api_v1_auth_logout_post(opts = {})
281
- logout_api_v1_auth_logout_post_with_http_info(opts)
280
+ def v1_authentication_logout(opts = {})
281
+ v1_authentication_logout_with_http_info(opts)
282
282
  nil
283
283
  end
284
284
 
@@ -287,9 +287,9 @@ module Svix
287
287
  # @param [Hash] opts the optional parameters
288
288
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
289
289
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
290
- def logout_api_v1_auth_logout_post_with_http_info(opts = {})
290
+ def v1_authentication_logout_with_http_info(opts = {})
291
291
  if @api_client.config.debugging
292
- @api_client.config.logger.debug 'Calling API: AuthenticationApi.logout_api_v1_auth_logout_post ...'
292
+ @api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_logout ...'
293
293
  end
294
294
  # resource path
295
295
  local_var_path = '/api/v1/auth/logout/'
@@ -313,10 +313,10 @@ module Svix
313
313
  return_type = opts[:debug_return_type]
314
314
 
315
315
  # auth_names
316
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
316
+ auth_names = opts[:debug_auth_names] || []
317
317
 
318
318
  new_options = opts.merge(
319
- :operation => :"AuthenticationApi.logout_api_v1_auth_logout_post",
319
+ :operation => :"AuthenticationApi.v1_authentication_logout",
320
320
  :header_params => header_params,
321
321
  :query_params => query_params,
322
322
  :form_params => form_params,
@@ -327,7 +327,7 @@ module Svix
327
327
 
328
328
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
329
329
  if @api_client.config.debugging
330
- @api_client.config.logger.debug "API called: AuthenticationApi#logout_api_v1_auth_logout_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
330
+ @api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
331
331
  end
332
332
  return data, status_code, headers
333
333
  end
@@ -0,0 +1,161 @@
1
+ =begin
2
+ #Svix API
3
+
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
+
6
+ The version of the OpenAPI document: 1.4
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Svix
16
+ class BackgroundTasksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Background Task
23
+ # Get a background task by ID.
24
+ # @param task_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [BackgroundTaskOut]
27
+ def get_background_task(task_id, opts = {})
28
+ data, _status_code, _headers = get_background_task_with_http_info(task_id, opts)
29
+ data
30
+ end
31
+
32
+ # Get Background Task
33
+ # Get a background task by ID.
34
+ # @param task_id [String]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(BackgroundTaskOut, Integer, Hash)>] BackgroundTaskOut data, response status code and response headers
37
+ def get_background_task_with_http_info(task_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: BackgroundTasksApi.get_background_task ...'
40
+ end
41
+ # verify the required parameter 'task_id' is set
42
+ if @api_client.config.client_side_validation && task_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'task_id' when calling BackgroundTasksApi.get_background_task"
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/v1/background-task/{task_id}/'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'BackgroundTaskOut'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || []
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"BackgroundTasksApi.get_background_task",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: BackgroundTasksApi#get_background_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # List Background Tasks
86
+ # List background tasks executed in the past 90 days.
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [BackgroundTaskStatus] :status
89
+ # @option opts [BackgroundTaskType] :task
90
+ # @option opts [Integer] :limit
91
+ # @option opts [String] :iterator
92
+ # @option opts [Ordering] :order
93
+ # @return [ListResponseBackgroundTaskOut]
94
+ def list_background_tasks(opts = {})
95
+ data, _status_code, _headers = list_background_tasks_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # List Background Tasks
100
+ # List background tasks executed in the past 90 days.
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [BackgroundTaskStatus] :status
103
+ # @option opts [BackgroundTaskType] :task
104
+ # @option opts [Integer] :limit
105
+ # @option opts [String] :iterator
106
+ # @option opts [Ordering] :order
107
+ # @return [Array<(ListResponseBackgroundTaskOut, Integer, Hash)>] ListResponseBackgroundTaskOut data, response status code and response headers
108
+ def list_background_tasks_with_http_info(opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: BackgroundTasksApi.list_background_tasks ...'
111
+ end
112
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
113
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BackgroundTasksApi.list_background_tasks, must be greater than or equal to 0.'
114
+ end
115
+
116
+ # resource path
117
+ local_var_path = '/api/v1/background-task/'
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
122
+ query_params[:'task'] = opts[:'task'] if !opts[:'task'].nil?
123
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
124
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
125
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
126
+
127
+ # header parameters
128
+ header_params = opts[:header_params] || {}
129
+ # HTTP header 'Accept' (if needed)
130
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
131
+
132
+ # form parameters
133
+ form_params = opts[:form_params] || {}
134
+
135
+ # http body (model)
136
+ post_body = opts[:debug_body]
137
+
138
+ # return_type
139
+ return_type = opts[:debug_return_type] || 'ListResponseBackgroundTaskOut'
140
+
141
+ # auth_names
142
+ auth_names = opts[:debug_auth_names] || []
143
+
144
+ new_options = opts.merge(
145
+ :operation => :"BackgroundTasksApi.list_background_tasks",
146
+ :header_params => header_params,
147
+ :query_params => query_params,
148
+ :form_params => form_params,
149
+ :body => post_body,
150
+ :auth_names => auth_names,
151
+ :return_type => return_type
152
+ )
153
+
154
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: BackgroundTasksApi#list_background_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+ end
161
+ end