svix 1.60.1 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -1
  3. data/Gemfile.lock +35 -21
  4. data/README.md +0 -7
  5. data/lib/svix/api/application.rb +96 -0
  6. data/lib/svix/api/authentication.rb +65 -0
  7. data/lib/svix/api/background_task.rb +39 -0
  8. data/lib/svix/api/endpoint.rb +202 -0
  9. data/lib/svix/api/environment.rb +39 -0
  10. data/lib/svix/api/event_type.rb +99 -0
  11. data/lib/svix/api/health.rb +21 -0
  12. data/lib/svix/api/integration.rb +91 -0
  13. data/lib/svix/api/message.rb +112 -0
  14. data/lib/svix/api/message_attempt.rb +123 -0
  15. data/lib/svix/api/operational_webhook_endpoint.rb +109 -0
  16. data/lib/svix/api/statistics.rb +36 -0
  17. data/lib/svix/api_error.rb +7 -17
  18. data/lib/svix/errors.rb +9 -9
  19. data/lib/svix/http_error_out.rb +18 -0
  20. data/lib/svix/http_validation_error.rb +18 -0
  21. data/lib/svix/internal.rb +0 -9
  22. data/lib/svix/models/aggregate_event_types_out.rb +32 -292
  23. data/lib/svix/models/app_portal_access_in.rb +31 -278
  24. data/lib/svix/models/app_portal_access_out.rb +27 -243
  25. data/lib/svix/models/app_usage_stats_in.rb +30 -234
  26. data/lib/svix/models/app_usage_stats_out.rb +31 -320
  27. data/lib/svix/models/application_in.rb +31 -298
  28. data/lib/svix/models/application_out.rb +37 -371
  29. data/lib/svix/models/application_patch.rb +31 -272
  30. data/lib/svix/models/application_token_expire_in.rb +28 -219
  31. data/lib/svix/models/background_task_out.rb +31 -307
  32. data/lib/svix/models/background_task_status.rb +14 -25
  33. data/lib/svix/models/background_task_type.rb +23 -26
  34. data/lib/svix/models/connector_in.rb +58 -385
  35. data/lib/svix/models/connector_kind.rb +28 -26
  36. data/lib/svix/models/dashboard_access_out.rb +27 -243
  37. data/lib/svix/models/endpoint_headers_in.rb +25 -202
  38. data/lib/svix/models/endpoint_headers_out.rb +30 -230
  39. data/lib/svix/models/endpoint_headers_patch_in.rb +28 -202
  40. data/lib/svix/models/endpoint_in.rb +61 -449
  41. data/lib/svix/models/endpoint_message_out.rb +48 -467
  42. data/lib/svix/models/endpoint_out.rb +67 -528
  43. data/lib/svix/models/endpoint_patch.rb +61 -383
  44. data/lib/svix/models/endpoint_secret_out.rb +25 -222
  45. data/lib/svix/models/endpoint_secret_rotate_in.rb +28 -212
  46. data/lib/svix/models/endpoint_stats.rb +31 -245
  47. data/lib/svix/models/endpoint_transformation_in.rb +30 -226
  48. data/lib/svix/models/endpoint_transformation_out.rb +30 -228
  49. data/lib/svix/models/endpoint_update.rb +58 -422
  50. data/lib/svix/models/environment_in.rb +31 -212
  51. data/lib/svix/models/environment_out.rb +35 -255
  52. data/lib/svix/models/event_example_in.rb +27 -261
  53. data/lib/svix/models/event_type_from_open_api.rb +35 -341
  54. data/lib/svix/models/event_type_import_open_api_in.rb +37 -228
  55. data/lib/svix/models/event_type_import_open_api_out.rb +28 -200
  56. data/lib/svix/models/event_type_import_open_api_out_data.rb +31 -211
  57. data/lib/svix/models/event_type_in.rb +37 -347
  58. data/lib/svix/models/event_type_out.rb +58 -389
  59. data/lib/svix/models/event_type_patch.rb +35 -289
  60. data/lib/svix/models/event_type_update.rb +35 -301
  61. data/lib/svix/models/expung_all_contents_out.rb +29 -292
  62. data/lib/svix/models/integration_in.rb +27 -239
  63. data/lib/svix/models/integration_key_out.rb +25 -200
  64. data/lib/svix/models/integration_out.rb +33 -324
  65. data/lib/svix/models/integration_update.rb +27 -239
  66. data/lib/svix/models/list_response_application_out.rb +34 -237
  67. data/lib/svix/models/list_response_background_task_out.rb +34 -237
  68. data/lib/svix/models/list_response_endpoint_message_out.rb +34 -237
  69. data/lib/svix/models/list_response_endpoint_out.rb +34 -237
  70. data/lib/svix/models/list_response_event_type_out.rb +34 -237
  71. data/lib/svix/models/list_response_integration_out.rb +34 -237
  72. data/lib/svix/models/list_response_message_attempt_out.rb +34 -237
  73. data/lib/svix/models/list_response_message_endpoint_out.rb +34 -237
  74. data/lib/svix/models/list_response_message_out.rb +34 -237
  75. data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +34 -237
  76. data/lib/svix/models/message_attempt_out.rb +64 -521
  77. data/lib/svix/models/message_attempt_trigger_type.rb +20 -28
  78. data/lib/svix/models/message_endpoint_out.rb +70 -557
  79. data/lib/svix/models/message_in.rb +58 -450
  80. data/lib/svix/models/message_out.rb +37 -414
  81. data/lib/svix/models/message_status.rb +24 -30
  82. data/lib/svix/models/operational_webhook_endpoint_headers_in.rb +28 -202
  83. data/lib/svix/models/operational_webhook_endpoint_headers_out.rb +30 -229
  84. data/lib/svix/models/operational_webhook_endpoint_in.rb +42 -380
  85. data/lib/svix/models/operational_webhook_endpoint_out.rb +64 -458
  86. data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +28 -212
  87. data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +28 -222
  88. data/lib/svix/models/operational_webhook_endpoint_update.rb +40 -353
  89. data/lib/svix/models/ordering.rb +15 -25
  90. data/lib/svix/models/recover_in.rb +28 -210
  91. data/lib/svix/models/recover_out.rb +29 -292
  92. data/lib/svix/models/replay_in.rb +28 -210
  93. data/lib/svix/models/replay_out.rb +29 -292
  94. data/lib/svix/models/status_code_class.rb +28 -32
  95. data/lib/svix/models/template_out.rb +70 -514
  96. data/lib/svix/svix.rb +50 -50
  97. data/lib/svix/svix_http_client.rb +110 -0
  98. data/lib/svix/util.rb +44 -25
  99. data/lib/svix/validation_error.rb +28 -0
  100. data/lib/svix/version.rb +1 -1
  101. data/lib/svix/webhook.rb +69 -65
  102. data/lib/svix.rb +51 -37
  103. data/svix.gemspec +1 -10
  104. metadata +22 -194
  105. data/lib/svix/api/application_api.rb +0 -772
  106. data/lib/svix/api/authentication_api.rb +0 -791
  107. data/lib/svix/api/background_tasks_api.rb +0 -191
  108. data/lib/svix/api/broadcast_api.rb +0 -93
  109. data/lib/svix/api/endpoint_api.rb +0 -2752
  110. data/lib/svix/api/environment_api.rb +0 -153
  111. data/lib/svix/api/environment_settings_api.rb +0 -79
  112. data/lib/svix/api/event_type_api.rb +0 -852
  113. data/lib/svix/api/events_api.rb +0 -102
  114. data/lib/svix/api/health_api.rb +0 -79
  115. data/lib/svix/api/inbound_api.rb +0 -209
  116. data/lib/svix/api/integration_api.rb +0 -707
  117. data/lib/svix/api/message_api.rb +0 -1192
  118. data/lib/svix/api/message_attempt_api.rb +0 -1245
  119. data/lib/svix/api/statistics_api.rb +0 -333
  120. data/lib/svix/api/stream_api.rb +0 -659
  121. data/lib/svix/api/stream_event_types_api.rb +0 -486
  122. data/lib/svix/api/transformation_template_api.rb +0 -967
  123. data/lib/svix/api/webhook_endpoint_api.rb +0 -748
  124. data/lib/svix/api_client.rb +0 -423
  125. data/lib/svix/application_api.rb +0 -35
  126. data/lib/svix/authentication_api.rb +0 -21
  127. data/lib/svix/background_tasks_api.rb +0 -17
  128. data/lib/svix/configuration.rb +0 -312
  129. data/lib/svix/endpoint_api.rb +0 -80
  130. data/lib/svix/event_type_api.rb +0 -37
  131. data/lib/svix/integration_api.rb +0 -38
  132. data/lib/svix/message_api.rb +0 -54
  133. data/lib/svix/message_attempt_api.rb +0 -51
  134. data/lib/svix/models/active_application_out.rb +0 -373
  135. data/lib/svix/models/active_endpoint_out.rb +0 -355
  136. data/lib/svix/models/aggregated_event_types.rb +0 -305
  137. data/lib/svix/models/application_message_failure.rb +0 -277
  138. data/lib/svix/models/application_message_id_pair.rb +0 -317
  139. data/lib/svix/models/application_stats.rb +0 -323
  140. data/lib/svix/models/application_stats_out.rb +0 -324
  141. data/lib/svix/models/attempt_statistics_data.rb +0 -229
  142. data/lib/svix/models/attempt_statistics_response.rb +0 -291
  143. data/lib/svix/models/auth_token_out.rb +0 -325
  144. data/lib/svix/models/azure_blob_storage_config.rb +0 -253
  145. data/lib/svix/models/background_task_finished_event.rb +0 -272
  146. data/lib/svix/models/background_task_finished_event2.rb +0 -331
  147. data/lib/svix/models/big_query_config.rb +0 -271
  148. data/lib/svix/models/border_radius_config.rb +0 -254
  149. data/lib/svix/models/border_radius_enum.rb +0 -43
  150. data/lib/svix/models/client_secret_jwt_params_in.rb +0 -297
  151. data/lib/svix/models/completion_choice.rb +0 -253
  152. data/lib/svix/models/completion_message.rb +0 -237
  153. data/lib/svix/models/count_out.rb +0 -258
  154. data/lib/svix/models/create_stream_in.rb +0 -232
  155. data/lib/svix/models/create_token_in.rb +0 -248
  156. data/lib/svix/models/custom_color_palette.rb +0 -295
  157. data/lib/svix/models/custom_strings_override.rb +0 -235
  158. data/lib/svix/models/custom_theme_override.rb +0 -223
  159. data/lib/svix/models/data.rb +0 -108
  160. data/lib/svix/models/data_any_of.rb +0 -240
  161. data/lib/svix/models/data_any_of1.rb +0 -223
  162. data/lib/svix/models/data_any_of2.rb +0 -241
  163. data/lib/svix/models/data_any_of3.rb +0 -223
  164. data/lib/svix/models/data_any_of4.rb +0 -240
  165. data/lib/svix/models/duration.rb +0 -275
  166. data/lib/svix/models/endpoint_created_event.rb +0 -272
  167. data/lib/svix/models/endpoint_created_event_data.rb +0 -410
  168. data/lib/svix/models/endpoint_deleted_event.rb +0 -272
  169. data/lib/svix/models/endpoint_deleted_event_data.rb +0 -410
  170. data/lib/svix/models/endpoint_disabled_event.rb +0 -272
  171. data/lib/svix/models/endpoint_disabled_event_data.rb +0 -451
  172. data/lib/svix/models/endpoint_disabled_trigger.rb +0 -40
  173. data/lib/svix/models/endpoint_enabled_event.rb +0 -272
  174. data/lib/svix/models/endpoint_enabled_event_data.rb +0 -410
  175. data/lib/svix/models/endpoint_mtls_config_in.rb +0 -233
  176. data/lib/svix/models/endpoint_mtls_config_out.rb +0 -215
  177. data/lib/svix/models/endpoint_oauth_config_in.rb +0 -350
  178. data/lib/svix/models/endpoint_oauth_config_out.rb +0 -315
  179. data/lib/svix/models/endpoint_transformation_simulate_in.rb +0 -330
  180. data/lib/svix/models/endpoint_transformation_simulate_out.rb +0 -296
  181. data/lib/svix/models/endpoint_updated_event.rb +0 -272
  182. data/lib/svix/models/endpoint_updated_event_data.rb +0 -410
  183. data/lib/svix/models/environment_settings_out.rb +0 -455
  184. data/lib/svix/models/event_in.rb +0 -258
  185. data/lib/svix/models/event_out.rb +0 -274
  186. data/lib/svix/models/event_stream_out.rb +0 -255
  187. data/lib/svix/models/event_type_example_out.rb +0 -221
  188. data/lib/svix/models/event_type_schema_in.rb +0 -221
  189. data/lib/svix/models/export_event_type_out.rb +0 -315
  190. data/lib/svix/models/font_size_config.rb +0 -230
  191. data/lib/svix/models/generate_in.rb +0 -221
  192. data/lib/svix/models/generate_out.rb +0 -287
  193. data/lib/svix/models/google_cloud_storage_config.rb +0 -239
  194. data/lib/svix/models/http_error_out.rb +0 -237
  195. data/lib/svix/models/http_validation_error.rb +0 -223
  196. data/lib/svix/models/hubspot_oauth_config_in.rb +0 -221
  197. data/lib/svix/models/inbound_path_params.rb +0 -277
  198. data/lib/svix/models/incoming_webhook_payload_out.rb +0 -235
  199. data/lib/svix/models/kafka_security_protocol_type.rb +0 -41
  200. data/lib/svix/models/list_response_active_application_out.rb +0 -261
  201. data/lib/svix/models/list_response_application_stats.rb +0 -261
  202. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +0 -261
  203. data/lib/svix/models/list_response_sink_out.rb +0 -261
  204. data/lib/svix/models/list_response_stream_event_type_out.rb +0 -261
  205. data/lib/svix/models/list_response_stream_out.rb +0 -261
  206. data/lib/svix/models/list_response_stream_sink_out.rb +0 -261
  207. data/lib/svix/models/list_response_template_out.rb +0 -261
  208. data/lib/svix/models/message_attempt_endpoint_out.rb +0 -545
  209. data/lib/svix/models/message_attempt_exhausted_event.rb +0 -272
  210. data/lib/svix/models/message_attempt_exhausted_event_data.rb +0 -482
  211. data/lib/svix/models/message_attempt_failed_data.rb +0 -293
  212. data/lib/svix/models/message_attempt_failing_event.rb +0 -272
  213. data/lib/svix/models/message_attempt_failing_event_data.rb +0 -482
  214. data/lib/svix/models/message_attempt_headers_out.rb +0 -263
  215. data/lib/svix/models/message_attempt_recovered_event.rb +0 -272
  216. data/lib/svix/models/message_attempt_recovered_event_data.rb +0 -482
  217. data/lib/svix/models/message_broadcast_in.rb +0 -423
  218. data/lib/svix/models/message_broadcast_out.rb +0 -315
  219. data/lib/svix/models/message_events_out.rb +0 -255
  220. data/lib/svix/models/message_precheck_in.rb +0 -288
  221. data/lib/svix/models/message_precheck_out.rb +0 -221
  222. data/lib/svix/models/message_raw_payload_out.rb +0 -221
  223. data/lib/svix/models/message_subscriber_auth_token_out.rb +0 -237
  224. data/lib/svix/models/o_auth_payload_in.rb +0 -237
  225. data/lib/svix/models/o_auth_payload_out.rb +0 -235
  226. data/lib/svix/models/oauth2_auth_method_in_out.rb +0 -41
  227. data/lib/svix/models/oauth2_grant_type_in_out.rb +0 -40
  228. data/lib/svix/models/oauth_jws_signing_algorithm.rb +0 -39
  229. data/lib/svix/models/one_time_token_in.rb +0 -221
  230. data/lib/svix/models/one_time_token_out.rb +0 -221
  231. data/lib/svix/models/polling_endpoint_message_out.rb +0 -454
  232. data/lib/svix/models/polling_endpoint_out.rb +0 -255
  233. data/lib/svix/models/redshift_config.rb +0 -317
  234. data/lib/svix/models/retry_schedule_in_out.rb +0 -216
  235. data/lib/svix/models/rotate_poller_token_in.rb +0 -280
  236. data/lib/svix/models/rotated_url_out.rb +0 -221
  237. data/lib/svix/models/s3_config.rb +0 -269
  238. data/lib/svix/models/sink_http_config.rb +0 -242
  239. data/lib/svix/models/sink_in.rb +0 -108
  240. data/lib/svix/models/sink_in_one_of.rb +0 -287
  241. data/lib/svix/models/sink_in_one_of1.rb +0 -319
  242. data/lib/svix/models/sink_in_one_of2.rb +0 -325
  243. data/lib/svix/models/sink_in_one_of3.rb +0 -271
  244. data/lib/svix/models/sink_in_one_of4.rb +0 -255
  245. data/lib/svix/models/sink_otel_v1_config.rb +0 -221
  246. data/lib/svix/models/sink_out.rb +0 -108
  247. data/lib/svix/models/sink_payload_format.rb +0 -39
  248. data/lib/svix/models/sink_secret_out.rb +0 -233
  249. data/lib/svix/models/sink_status.rb +0 -41
  250. data/lib/svix/models/sink_status_in.rb +0 -40
  251. data/lib/svix/models/sink_transform_in.rb +0 -248
  252. data/lib/svix/models/sink_transformation_out.rb +0 -226
  253. data/lib/svix/models/snowflake_config.rb +0 -287
  254. data/lib/svix/models/statistics_period.rb +0 -40
  255. data/lib/svix/models/stream_event_type_in.rb +0 -262
  256. data/lib/svix/models/stream_event_type_out.rb +0 -294
  257. data/lib/svix/models/stream_event_type_patch.rb +0 -254
  258. data/lib/svix/models/stream_in.rb +0 -287
  259. data/lib/svix/models/stream_out.rb +0 -350
  260. data/lib/svix/models/stream_patch.rb +0 -261
  261. data/lib/svix/models/stream_portal_access_in.rb +0 -293
  262. data/lib/svix/models/stream_sink_in.rb +0 -111
  263. data/lib/svix/models/stream_sink_in_one_of.rb +0 -271
  264. data/lib/svix/models/stream_sink_in_one_of1.rb +0 -271
  265. data/lib/svix/models/stream_sink_in_one_of2.rb +0 -271
  266. data/lib/svix/models/stream_sink_in_one_of3.rb +0 -271
  267. data/lib/svix/models/stream_sink_in_one_of4.rb +0 -271
  268. data/lib/svix/models/stream_sink_in_one_of5.rb +0 -271
  269. data/lib/svix/models/stream_sink_in_one_of6.rb +0 -271
  270. data/lib/svix/models/stream_sink_in_one_of7.rb +0 -271
  271. data/lib/svix/models/stream_sink_out.rb +0 -111
  272. data/lib/svix/models/stream_sink_patch.rb +0 -111
  273. data/lib/svix/models/template_patch.rb +0 -382
  274. data/lib/svix/models/template_update.rb +0 -402
  275. data/lib/svix/models/transformation_http_method.rb +0 -41
  276. data/lib/svix/models/transformation_simulate_in.rb +0 -330
  277. data/lib/svix/models/transformation_simulate_out.rb +0 -296
  278. data/lib/svix/models/validation_error.rb +0 -259
  279. data/lib/svix/statistics_api.rb +0 -17
@@ -1,312 +0,0 @@
1
- =begin
2
- #Svix API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 1.1.1
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
10
-
11
- =end
12
-
13
- module Svix
14
- class Configuration
15
- # Defines url scheme
16
- attr_accessor :scheme
17
-
18
- # Defines url host
19
- attr_accessor :host
20
-
21
- # Defines url base path
22
- attr_accessor :base_path
23
-
24
- # Define server configuration index
25
- attr_accessor :server_index
26
-
27
- # Define server operation configuration index
28
- attr_accessor :server_operation_index
29
-
30
- # Default server variables
31
- attr_accessor :server_variables
32
-
33
- # Default server operation variables
34
- attr_accessor :server_operation_variables
35
-
36
- # Defines API keys used with API Key authentications.
37
- #
38
- # @return [Hash] key: parameter name, value: parameter value (API key)
39
- #
40
- # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
- # config.api_key['api_key'] = 'xxx'
42
- attr_accessor :api_key
43
-
44
- # Defines API key prefixes used with API Key authentications.
45
- #
46
- # @return [Hash] key: parameter name, value: API key prefix
47
- #
48
- # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
- # config.api_key_prefix['api_key'] = 'Token'
50
- attr_accessor :api_key_prefix
51
-
52
- # Defines the username used with HTTP basic authentication.
53
- #
54
- # @return [String]
55
- attr_accessor :username
56
-
57
- # Defines the password used with HTTP basic authentication.
58
- #
59
- # @return [String]
60
- attr_accessor :password
61
-
62
- # Defines the access token (Bearer) used with OAuth2.
63
- attr_accessor :access_token
64
-
65
- # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
66
- # Overrides the access_token if set
67
- # @return [Proc]
68
- attr_accessor :access_token_getter
69
-
70
- # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
71
- # HTTP responses with return type `File` will be returned as a stream of binary data.
72
- # Default to false.
73
- attr_accessor :return_binary_data
74
-
75
- # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
76
- # details will be logged with `logger.debug` (see the `logger` attribute).
77
- # Default to false.
78
- #
79
- # @return [true, false]
80
- attr_accessor :debugging
81
-
82
- # Set this to ignore operation servers for the API client. This is useful when you need to
83
- # send requests to a different server than the one specified in the OpenAPI document.
84
- # Will default to the base url defined in the spec but can be overridden by setting
85
- # `scheme`, `host`, `base_path` directly.
86
- # Default to false.
87
- # @return [true, false]
88
- attr_accessor :ignore_operation_servers
89
-
90
- # Defines the logger used for debugging.
91
- # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
92
- #
93
- # @return [#debug]
94
- attr_accessor :logger
95
-
96
- # Defines the temporary folder to store downloaded files
97
- # (for API endpoints that have file response).
98
- # Default to use `Tempfile`.
99
- #
100
- # @return [String]
101
- attr_accessor :temp_folder_path
102
-
103
- # The time limit for HTTP request in seconds.
104
- # Default to 0 (never times out).
105
- attr_accessor :timeout
106
-
107
- # Set this to false to skip client side validation in the operation.
108
- # Default to true.
109
- # @return [true, false]
110
- attr_accessor :client_side_validation
111
-
112
- ### TLS/SSL setting
113
- # Set this to false to skip verifying SSL certificate when calling API from https server.
114
- # Default to true.
115
- #
116
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
117
- #
118
- # @return [true, false]
119
- attr_accessor :verify_ssl
120
-
121
- ### TLS/SSL setting
122
- # Set this to false to skip verifying SSL host name
123
- # Default to true.
124
- #
125
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
126
- #
127
- # @return [true, false]
128
- attr_accessor :verify_ssl_host
129
-
130
- ### TLS/SSL setting
131
- # Set this to customize the certificate file to verify the peer.
132
- #
133
- # @return [String] the path to the certificate file
134
- #
135
- # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
136
- # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
137
- attr_accessor :ssl_ca_cert
138
-
139
- ### TLS/SSL setting
140
- # Client certificate file (for client certificate)
141
- attr_accessor :cert_file
142
-
143
- ### TLS/SSL setting
144
- # Client private key file (for client certificate)
145
- attr_accessor :key_file
146
-
147
- # Set this to customize parameters encoding of array parameter with multi collectionFormat.
148
- # Default to nil.
149
- #
150
- # @see The params_encoding option of Ethon. Related source code:
151
- # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
152
- attr_accessor :params_encoding
153
-
154
-
155
- attr_accessor :inject_format
156
-
157
- attr_accessor :force_ending_format
158
-
159
- def initialize
160
- @scheme = 'https'
161
- @host = 'api.eu.svix.com'
162
- @base_path = ''
163
- @server_index = nil
164
- @server_operation_index = {}
165
- @server_variables = {}
166
- @server_operation_variables = {}
167
- @api_key = {}
168
- @api_key_prefix = {}
169
- @client_side_validation = true
170
- @verify_ssl = true
171
- @verify_ssl_host = true
172
- @cert_file = nil
173
- @key_file = nil
174
- @timeout = 0
175
- @params_encoding = nil
176
- @debugging = false
177
- @ignore_operation_servers = false
178
- @inject_format = false
179
- @force_ending_format = false
180
- @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
181
-
182
- yield(self) if block_given?
183
- end
184
-
185
- # The default Configuration object.
186
- def self.default
187
- @@default ||= Configuration.new
188
- end
189
-
190
- def configure
191
- yield(self) if block_given?
192
- end
193
-
194
- def scheme=(scheme)
195
- # remove :// from scheme
196
- @scheme = scheme.sub(/:\/\//, '')
197
- end
198
-
199
- def host=(host)
200
- # remove http(s):// and anything after a slash
201
- @host = host.sub(/https?:\/\//, '').split('/').first
202
- end
203
-
204
- def base_path=(base_path)
205
- # Add leading and trailing slashes to base_path
206
- @base_path = "/#{base_path}".gsub(/\/+/, '/')
207
- @base_path = '' if @base_path == '/'
208
- end
209
-
210
- # Returns base URL for specified operation based on server settings
211
- def base_url(operation = nil)
212
- return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
213
- if operation_server_settings.key?(operation) then
214
- index = server_operation_index.fetch(operation, server_index)
215
- server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
216
- else
217
- server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
218
- end
219
- end
220
-
221
- # Gets API key (with prefix if set).
222
- # @param [String] param_name the parameter name of API key auth
223
- def api_key_with_prefix(param_name, param_alias = nil)
224
- key = @api_key[param_name]
225
- key = @api_key.fetch(param_alias, key) unless param_alias.nil?
226
- if @api_key_prefix[param_name]
227
- "#{@api_key_prefix[param_name]} #{key}"
228
- else
229
- key
230
- end
231
- end
232
-
233
- # Gets access_token using access_token_getter or uses the static access_token
234
- def access_token_with_refresh
235
- return access_token if access_token_getter.nil?
236
- access_token_getter.call
237
- end
238
-
239
- # Gets Basic Auth token string
240
- def basic_auth_token
241
- 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
242
- end
243
-
244
- # Returns Auth Settings hash for api client.
245
- def auth_settings
246
- {
247
- 'HTTPBearer' =>
248
- {
249
- type: 'bearer',
250
- in: 'header',
251
- key: 'Authorization',
252
- value: "Bearer #{access_token_with_refresh}"
253
- },
254
- }
255
- end
256
-
257
- # Returns an array of Server setting
258
- def server_settings
259
- [
260
- {
261
- url: "https://api.eu.svix.com",
262
- description: "The Svix EU region",
263
- },
264
- {
265
- url: "https://api.us.svix.com",
266
- description: "The Svix US region",
267
- }
268
- ]
269
- end
270
-
271
- def operation_server_settings
272
- {
273
- }
274
- end
275
-
276
- # Returns URL based on server settings
277
- #
278
- # @param index array index of the server settings
279
- # @param variables hash of variable and the corresponding value
280
- def server_url(index, variables = {}, servers = nil)
281
- servers = server_settings if servers == nil
282
-
283
- # check array index out of bound
284
- if (index.nil? || index < 0 || index >= servers.size)
285
- fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
286
- end
287
-
288
- server = servers[index]
289
- url = server[:url]
290
-
291
- return url unless server.key? :variables
292
-
293
- # go through variable and assign a value
294
- server[:variables].each do |name, variable|
295
- if variables.key?(name)
296
- if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
297
- url.gsub! "{" + name.to_s + "}", variables[name]
298
- else
299
- fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
300
- end
301
- else
302
- # use default value
303
- url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
304
- end
305
- end
306
-
307
- url
308
- end
309
-
310
-
311
- end
312
- end
@@ -1,80 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Svix
4
- class EndpointAPI
5
- def initialize(api_client)
6
- @api = EndpointApi.new(api_client)
7
- end
8
-
9
- def list(app_id, options = {})
10
- return @api.v1_endpoint_list(app_id, options)
11
- end
12
-
13
- def create(app_id, endpoint_in, options = {})
14
- return @api.v1_endpoint_create(app_id, endpoint_in, options)
15
- end
16
-
17
- def get(app_id, endpoint_id)
18
- return @api.v1_endpoint_get(app_id, endpoint_id)
19
- end
20
-
21
- def update(app_id, endpoint_id, endpoint_update)
22
- return @api.v1_endpoint_update(app_id, endpoint_id, endpoint_update)
23
- end
24
-
25
- def patch(app_id, endpoint_id, endpoint_patch)
26
- return @api.v1_endpoint_patch(app_id, endpoint_id, endpoint_patch)
27
- end
28
-
29
- def delete(app_id, endpoint_id)
30
- return @api.v1_endpoint_delete(app_id, endpoint_id)
31
- end
32
-
33
- def get_secret(app_id, endpoint_id)
34
- return @api.v1_endpoint_get_secret(app_id, endpoint_id)
35
- end
36
-
37
- def rotate_secret(app_id, endpoint_id, endpoint_secret_rotate_in, options = {})
38
- return @api.v1_endpoint_rotate_secret(app_id, endpoint_id, endpoint_secret_rotate_in, options)
39
- end
40
-
41
- def recover(app_id, endpoint_id, recover_in, options = {})
42
- @api.v1_endpoint_recover(app_id, endpoint_id, recover_in, options)
43
- nil
44
- end
45
-
46
- def get_headers(app_id, endpoint_id)
47
- return @api.v1_endpoint_get_headers(app_id, endpoint_id)
48
- end
49
-
50
- def update_headers(app_id, endpoint_id, endpoint_headers_in)
51
- return @api.v1_endpoint_update_headers(app_id, endpoint_id, endpoint_headers_in)
52
- end
53
-
54
- def patch_headers(app_id, endpoint_id, endpoint_headers_in)
55
- return @api.v1_endpoint_patch_headers(app_id, endpoint_id, endpoint_headers_in)
56
- end
57
-
58
- def get_stats(app_id, endpoint_id, options = {})
59
- return @api.v1_endpoint_get_stats(app_id, endpoint_id, options)
60
- end
61
-
62
- def replay_missing(app_id, endpoint_id, replay_in, options = {})
63
- @api.v1_endpoint_replay_missing(app_id, endpoint_id, replay_in, options)
64
- nil
65
- end
66
-
67
- def transformation_get(app_id, endpoint_id, options = {})
68
- return @api.v1_endpoint_transformation_get(app_id, endpoint_id, options)
69
- end
70
-
71
- def transformation_partial_update(app_id, endpoint_id, endpoint_transformation_in, options = {})
72
- @api.v1_endpoint_transformation_partial_update(app_id, endpoint_id, endpoint_transformation_in, options)
73
- nil
74
- end
75
-
76
- def send_example(app_id, endpoint_id, event_example_in, options = {})
77
- @api.v1_endpoint_send_example(app_id, endpoint_id, event_example_in, options)
78
- end
79
- end
80
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Svix
4
- class EventTypeAPI
5
- def initialize(api_client)
6
- @api = EventTypeApi.new(api_client)
7
- end
8
-
9
- def list(options = {})
10
- return @api.v1_event_type_list(options)
11
- end
12
-
13
- def create(event_type_in, options = {})
14
- return @api.v1_event_type_create(event_type_in, options)
15
- end
16
-
17
- def get(event_type_name)
18
- return @api.v1_event_type_get(event_type_name)
19
- end
20
-
21
- def update(event_type_name, event_type_update)
22
- return @api.v1_event_type_update(event_type_name, event_type_update)
23
- end
24
-
25
- def patch(event_type_name, event_type_patch)
26
- return @api.v1_event_type_patch(event_type_name, event_type_patch)
27
- end
28
-
29
- def delete(event_type_name)
30
- return @api.v1_event_type_delete(event_type_name)
31
- end
32
-
33
- def import_openapi(event_type_import_open_api_in, options = {})
34
- return @api.v1_event_type_import_openapi(event_type_import_open_api_in, options)
35
- end
36
- end
37
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Svix
4
- class IntegrationAPI
5
- def initialize(api_client)
6
- @api = IntegrationApi.new(api_client)
7
- end
8
-
9
- def list(app_id, options = {})
10
- return @api.v1_integration_list(app_id, options)
11
- end
12
-
13
- def create(app_id, integ_in, options = {})
14
- return @api.v1_integration_create(app_id, integ_in, options)
15
- end
16
-
17
- def get(app_id, integ_id)
18
- return @api.v1_integration_get(app_id, integ_id)
19
- end
20
-
21
- def update(app_id, integ_id, integ_update)
22
- return @api.v1_integration_update(app_id, integ_id, integ_update)
23
- end
24
-
25
- def delete(app_id, integ_id)
26
- return @api.v1_integration_delete(app_id, integ_id)
27
- end
28
-
29
- def get_key(app_id, integ_id)
30
- return @api.v1_integration_get_key(app_id, integ_id)
31
- end
32
-
33
- def rotate_key(app_id, integ_id, options = {})
34
- return @api.v1_integration_rotate_key(app_id, integ_id, options)
35
- end
36
-
37
- end
38
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Svix
4
- module_function
5
-
6
- class MessageAPI
7
- def initialize(api_client)
8
- @api = MessageApi.new(api_client)
9
- end
10
-
11
- def list(app_id, options = {})
12
- return @api.v1_message_list(app_id, options)
13
- end
14
-
15
- def create(app_id, message_in, options = {})
16
- return @api.v1_message_create(app_id, message_in, options)
17
- end
18
-
19
- def get(app_id, msg_id, options = {})
20
- return @api.v1_message_get(app_id, msg_id, options)
21
- end
22
-
23
- def expunge_content(app_id, msg_id)
24
- return @api.v1_message_expunge_content(app_id, msg_id)
25
- end
26
- end
27
-
28
- # Creates a [`MessageIn`] with a raw string payload.
29
- #
30
- # The payload is not normalized on the server. Normally, payloads are required
31
- # to be JSON, and Svix will minify the payload before sending the webhook
32
- # (for example, by removing extraneous whitespace or unnecessarily escaped
33
- # characters in strings). With this function, the payload will be sent
34
- # "as is", without any minification or other processing.
35
- #
36
- # `attributes[:payload]` must be a string. An extra attribute `content_type`
37
- # is accepted that sets the `content-type` header of the webhook sent by Svix,
38
- # overwriting the default of `application/json` if specified. Other than that,
39
- # the attributes are forwarded [`MessageIn.new`], so all the same ones are
40
- # accepted.
41
- def message_in_raw(attributes = {})
42
- attributes[:transformations_params] ||= {}
43
- attributes[:transformations_params][:rawPayload] = attributes[:payload]
44
- attributes[:payload] = {}
45
-
46
- content_type = attributes.delete(:content_type)
47
- if content_type != nil
48
- attributes[:transformations_params][:headers] ||= {}
49
- attributes[:transformations_params][:headers][:'content-type'] = content_type
50
- end
51
-
52
- return MessageIn.new(attributes)
53
- end
54
- end
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Svix
4
- class MessageAttemptAPI
5
- def initialize(api_client)
6
- @api = MessageAttemptApi.new(api_client)
7
- end
8
-
9
- # <b>DEPRECATED:</b> Please use <tt>list_by_msg</tt> instead.
10
- def list(app_id, msg_id, options = {})
11
- warn "[DEPRECATION] `list` is deprecated. Please use `list_by_msg` instead."
12
- return self.list_by_msg(app_id, msg_id, options)
13
- end
14
-
15
- def list_by_msg(app_id, msg_id, options = {})
16
- return @api.v1_message_attempt_list_by_msg(app_id, msg_id, options)
17
- end
18
-
19
- def list_by_endpoint(app_id, endpoint_id, options = {})
20
- return @api.v1_message_attempt_list_by_endpoint(app_id, endpoint_id, options)
21
- end
22
-
23
- def get(app_id, msg_id, attempt_id)
24
- return @api.v1_message_attempt_get(app_id, msg_id, attempt_id)
25
- end
26
-
27
- def resend(app_id, msg_id, endpoint_id, options = {})
28
- return @api.v1_message_attempt_resend(app_id, msg_id, endpoint_id, options)
29
- end
30
-
31
- def list_attempted_messages(app_id, endpoint_id, options = {})
32
- return @api.v1_message_attempt_list_attempted_messages(app_id, endpoint_id, options)
33
- end
34
-
35
- def list_attempted_destinations(app_id, msg_id, options = {})
36
- return @api.v1_message_attempt_list_attempted_destinations(app_id, msg_id, options)
37
- end
38
-
39
- # <b>DEPRECATED:</b> Please use <tt>list_by_msg</tt> instead.
40
- def list_attempts_for_endpoint(app_id, endpoint_id, msg_id, options = {})
41
- warn "[DEPRECATION] `list` is deprecated. Please use `list_by_msg` instead, passing the endpoint ID through options."
42
-
43
- options[:'endpoint_id'] = endpoint_id
44
- return self.list_by_msg(app_id, msg_id, options)
45
- end
46
-
47
- def expunge_content(app_id, msg_id, attempt_id)
48
- return @api.v1_message_attempt_expunge_content(app_id, msg_id, attempt_id)
49
- end
50
- end
51
- end