svix 1.60.1 → 1.61.1

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 (297) 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 +90 -0
  6. data/lib/svix/api/authentication.rb +61 -0
  7. data/lib/svix/api/background_task.rb +37 -0
  8. data/lib/svix/api/endpoint.rb +185 -0
  9. data/lib/svix/api/environment.rb +37 -0
  10. data/lib/svix/api/event_type.rb +92 -0
  11. data/lib/svix/api/health.rb +20 -0
  12. data/lib/svix/api/ingest_endpoint.rb +100 -0
  13. data/lib/svix/api/integration.rb +84 -0
  14. data/lib/svix/api/message.rb +107 -0
  15. data/lib/svix/api/message_attempt.rb +116 -0
  16. data/lib/svix/api/operational_webhook_endpoint.rb +100 -0
  17. data/lib/svix/api/statistics.rb +34 -0
  18. data/lib/svix/api_error.rb +7 -17
  19. data/lib/svix/errors.rb +9 -9
  20. data/lib/svix/http_error_out.rb +18 -0
  21. data/lib/svix/http_validation_error.rb +18 -0
  22. data/lib/svix/internal.rb +0 -9
  23. data/lib/svix/models/aggregate_event_types_out.rb +32 -292
  24. data/lib/svix/models/app_portal_access_in.rb +31 -278
  25. data/lib/svix/models/app_portal_access_out.rb +27 -243
  26. data/lib/svix/models/app_usage_stats_in.rb +30 -234
  27. data/lib/svix/models/app_usage_stats_out.rb +31 -320
  28. data/lib/svix/models/application_in.rb +31 -298
  29. data/lib/svix/models/application_out.rb +37 -371
  30. data/lib/svix/models/application_patch.rb +31 -272
  31. data/lib/svix/models/application_token_expire_in.rb +28 -219
  32. data/lib/svix/models/background_task_out.rb +31 -307
  33. data/lib/svix/models/background_task_status.rb +14 -25
  34. data/lib/svix/models/background_task_type.rb +23 -26
  35. data/lib/svix/models/connector_in.rb +58 -385
  36. data/lib/svix/models/connector_kind.rb +28 -26
  37. data/lib/svix/models/dashboard_access_out.rb +27 -243
  38. data/lib/svix/models/endpoint_headers_in.rb +25 -202
  39. data/lib/svix/models/endpoint_headers_out.rb +30 -230
  40. data/lib/svix/models/endpoint_headers_patch_in.rb +28 -202
  41. data/lib/svix/models/endpoint_in.rb +65 -449
  42. data/lib/svix/models/endpoint_message_out.rb +48 -467
  43. data/lib/svix/models/endpoint_out.rb +67 -528
  44. data/lib/svix/models/endpoint_patch.rb +61 -383
  45. data/lib/svix/models/endpoint_secret_out.rb +25 -222
  46. data/lib/svix/models/endpoint_secret_rotate_in.rb +28 -212
  47. data/lib/svix/models/endpoint_stats.rb +31 -245
  48. data/lib/svix/models/endpoint_transformation_in.rb +30 -226
  49. data/lib/svix/models/endpoint_transformation_out.rb +30 -228
  50. data/lib/svix/models/endpoint_update.rb +58 -422
  51. data/lib/svix/models/environment_in.rb +31 -212
  52. data/lib/svix/models/environment_out.rb +35 -255
  53. data/lib/svix/models/event_example_in.rb +27 -261
  54. data/lib/svix/models/event_type_from_open_api.rb +35 -341
  55. data/lib/svix/models/event_type_import_open_api_in.rb +37 -228
  56. data/lib/svix/models/event_type_import_open_api_out.rb +28 -200
  57. data/lib/svix/models/event_type_import_open_api_out_data.rb +31 -211
  58. data/lib/svix/models/event_type_in.rb +37 -347
  59. data/lib/svix/models/event_type_out.rb +58 -389
  60. data/lib/svix/models/event_type_patch.rb +35 -289
  61. data/lib/svix/models/event_type_update.rb +35 -301
  62. data/lib/svix/models/expung_all_contents_out.rb +29 -292
  63. data/lib/svix/models/expunge_all_contents_out.rb +55 -0
  64. data/lib/svix/models/ingest_endpoint_headers_in.rb +49 -0
  65. data/lib/svix/models/ingest_endpoint_headers_out.rb +52 -0
  66. data/lib/svix/models/ingest_endpoint_in.rb +64 -0
  67. data/lib/svix/models/ingest_endpoint_out.rb +70 -0
  68. data/lib/svix/models/ingest_endpoint_secret_in.rb +49 -0
  69. data/lib/svix/models/ingest_endpoint_secret_out.rb +49 -0
  70. data/lib/svix/models/ingest_endpoint_update.rb +61 -0
  71. data/lib/svix/models/integration_in.rb +27 -239
  72. data/lib/svix/models/integration_key_out.rb +25 -200
  73. data/lib/svix/models/integration_out.rb +33 -324
  74. data/lib/svix/models/integration_update.rb +27 -239
  75. data/lib/svix/models/list_response_application_out.rb +34 -237
  76. data/lib/svix/models/list_response_background_task_out.rb +34 -237
  77. data/lib/svix/models/list_response_endpoint_message_out.rb +34 -237
  78. data/lib/svix/models/list_response_endpoint_out.rb +34 -237
  79. data/lib/svix/models/list_response_event_type_out.rb +34 -237
  80. data/lib/svix/models/list_response_ingest_endpoint_out.rb +58 -0
  81. data/lib/svix/models/list_response_integration_out.rb +34 -237
  82. data/lib/svix/models/list_response_message_attempt_out.rb +34 -237
  83. data/lib/svix/models/list_response_message_endpoint_out.rb +34 -237
  84. data/lib/svix/models/list_response_message_out.rb +34 -237
  85. data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +34 -237
  86. data/lib/svix/models/message_attempt_out.rb +64 -521
  87. data/lib/svix/models/message_attempt_trigger_type.rb +20 -28
  88. data/lib/svix/models/message_endpoint_out.rb +70 -557
  89. data/lib/svix/models/message_in.rb +58 -450
  90. data/lib/svix/models/message_out.rb +37 -414
  91. data/lib/svix/models/message_status.rb +24 -30
  92. data/lib/svix/models/operational_webhook_endpoint_headers_in.rb +28 -202
  93. data/lib/svix/models/operational_webhook_endpoint_headers_out.rb +30 -229
  94. data/lib/svix/models/operational_webhook_endpoint_in.rb +42 -380
  95. data/lib/svix/models/operational_webhook_endpoint_out.rb +64 -458
  96. data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +28 -212
  97. data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +28 -222
  98. data/lib/svix/models/operational_webhook_endpoint_update.rb +40 -353
  99. data/lib/svix/models/ordering.rb +15 -25
  100. data/lib/svix/models/recover_in.rb +28 -210
  101. data/lib/svix/models/recover_out.rb +29 -292
  102. data/lib/svix/models/replay_in.rb +28 -210
  103. data/lib/svix/models/replay_out.rb +29 -292
  104. data/lib/svix/models/status_code_class.rb +28 -32
  105. data/lib/svix/models/template_out.rb +70 -514
  106. data/lib/svix/svix.rb +50 -50
  107. data/lib/svix/svix_http_client.rb +110 -0
  108. data/lib/svix/util.rb +44 -25
  109. data/lib/svix/validation_error.rb +28 -0
  110. data/lib/svix/version.rb +1 -1
  111. data/lib/svix/webhook.rb +69 -65
  112. data/lib/svix.rb +60 -37
  113. data/svix.gemspec +1 -10
  114. data/templates/api_extra/application_create.rb +16 -0
  115. data/templates/api_extra/message.rb +26 -0
  116. data/templates/api_resource.rb.jinja +71 -0
  117. data/templates/component_type.rb.jinja +7 -0
  118. data/templates/summary.rb.jinja +41 -0
  119. data/templates/types/integer_enum.rb.jinja +37 -0
  120. data/templates/types/string_enum.rb.jinja +37 -0
  121. data/templates/types/struct.rb.jinja +87 -0
  122. metadata +40 -194
  123. data/lib/svix/api/application_api.rb +0 -772
  124. data/lib/svix/api/authentication_api.rb +0 -791
  125. data/lib/svix/api/background_tasks_api.rb +0 -191
  126. data/lib/svix/api/broadcast_api.rb +0 -93
  127. data/lib/svix/api/endpoint_api.rb +0 -2752
  128. data/lib/svix/api/environment_api.rb +0 -153
  129. data/lib/svix/api/environment_settings_api.rb +0 -79
  130. data/lib/svix/api/event_type_api.rb +0 -852
  131. data/lib/svix/api/events_api.rb +0 -102
  132. data/lib/svix/api/health_api.rb +0 -79
  133. data/lib/svix/api/inbound_api.rb +0 -209
  134. data/lib/svix/api/integration_api.rb +0 -707
  135. data/lib/svix/api/message_api.rb +0 -1192
  136. data/lib/svix/api/message_attempt_api.rb +0 -1245
  137. data/lib/svix/api/statistics_api.rb +0 -333
  138. data/lib/svix/api/stream_api.rb +0 -659
  139. data/lib/svix/api/stream_event_types_api.rb +0 -486
  140. data/lib/svix/api/transformation_template_api.rb +0 -967
  141. data/lib/svix/api/webhook_endpoint_api.rb +0 -748
  142. data/lib/svix/api_client.rb +0 -423
  143. data/lib/svix/application_api.rb +0 -35
  144. data/lib/svix/authentication_api.rb +0 -21
  145. data/lib/svix/background_tasks_api.rb +0 -17
  146. data/lib/svix/configuration.rb +0 -312
  147. data/lib/svix/endpoint_api.rb +0 -80
  148. data/lib/svix/event_type_api.rb +0 -37
  149. data/lib/svix/integration_api.rb +0 -38
  150. data/lib/svix/message_api.rb +0 -54
  151. data/lib/svix/message_attempt_api.rb +0 -51
  152. data/lib/svix/models/active_application_out.rb +0 -373
  153. data/lib/svix/models/active_endpoint_out.rb +0 -355
  154. data/lib/svix/models/aggregated_event_types.rb +0 -305
  155. data/lib/svix/models/application_message_failure.rb +0 -277
  156. data/lib/svix/models/application_message_id_pair.rb +0 -317
  157. data/lib/svix/models/application_stats.rb +0 -323
  158. data/lib/svix/models/application_stats_out.rb +0 -324
  159. data/lib/svix/models/attempt_statistics_data.rb +0 -229
  160. data/lib/svix/models/attempt_statistics_response.rb +0 -291
  161. data/lib/svix/models/auth_token_out.rb +0 -325
  162. data/lib/svix/models/azure_blob_storage_config.rb +0 -253
  163. data/lib/svix/models/background_task_finished_event.rb +0 -272
  164. data/lib/svix/models/background_task_finished_event2.rb +0 -331
  165. data/lib/svix/models/big_query_config.rb +0 -271
  166. data/lib/svix/models/border_radius_config.rb +0 -254
  167. data/lib/svix/models/border_radius_enum.rb +0 -43
  168. data/lib/svix/models/client_secret_jwt_params_in.rb +0 -297
  169. data/lib/svix/models/completion_choice.rb +0 -253
  170. data/lib/svix/models/completion_message.rb +0 -237
  171. data/lib/svix/models/count_out.rb +0 -258
  172. data/lib/svix/models/create_stream_in.rb +0 -232
  173. data/lib/svix/models/create_token_in.rb +0 -248
  174. data/lib/svix/models/custom_color_palette.rb +0 -295
  175. data/lib/svix/models/custom_strings_override.rb +0 -235
  176. data/lib/svix/models/custom_theme_override.rb +0 -223
  177. data/lib/svix/models/data.rb +0 -108
  178. data/lib/svix/models/data_any_of.rb +0 -240
  179. data/lib/svix/models/data_any_of1.rb +0 -223
  180. data/lib/svix/models/data_any_of2.rb +0 -241
  181. data/lib/svix/models/data_any_of3.rb +0 -223
  182. data/lib/svix/models/data_any_of4.rb +0 -240
  183. data/lib/svix/models/duration.rb +0 -275
  184. data/lib/svix/models/endpoint_created_event.rb +0 -272
  185. data/lib/svix/models/endpoint_created_event_data.rb +0 -410
  186. data/lib/svix/models/endpoint_deleted_event.rb +0 -272
  187. data/lib/svix/models/endpoint_deleted_event_data.rb +0 -410
  188. data/lib/svix/models/endpoint_disabled_event.rb +0 -272
  189. data/lib/svix/models/endpoint_disabled_event_data.rb +0 -451
  190. data/lib/svix/models/endpoint_disabled_trigger.rb +0 -40
  191. data/lib/svix/models/endpoint_enabled_event.rb +0 -272
  192. data/lib/svix/models/endpoint_enabled_event_data.rb +0 -410
  193. data/lib/svix/models/endpoint_mtls_config_in.rb +0 -233
  194. data/lib/svix/models/endpoint_mtls_config_out.rb +0 -215
  195. data/lib/svix/models/endpoint_oauth_config_in.rb +0 -350
  196. data/lib/svix/models/endpoint_oauth_config_out.rb +0 -315
  197. data/lib/svix/models/endpoint_transformation_simulate_in.rb +0 -330
  198. data/lib/svix/models/endpoint_transformation_simulate_out.rb +0 -296
  199. data/lib/svix/models/endpoint_updated_event.rb +0 -272
  200. data/lib/svix/models/endpoint_updated_event_data.rb +0 -410
  201. data/lib/svix/models/environment_settings_out.rb +0 -455
  202. data/lib/svix/models/event_in.rb +0 -258
  203. data/lib/svix/models/event_out.rb +0 -274
  204. data/lib/svix/models/event_stream_out.rb +0 -255
  205. data/lib/svix/models/event_type_example_out.rb +0 -221
  206. data/lib/svix/models/event_type_schema_in.rb +0 -221
  207. data/lib/svix/models/export_event_type_out.rb +0 -315
  208. data/lib/svix/models/font_size_config.rb +0 -230
  209. data/lib/svix/models/generate_in.rb +0 -221
  210. data/lib/svix/models/generate_out.rb +0 -287
  211. data/lib/svix/models/google_cloud_storage_config.rb +0 -239
  212. data/lib/svix/models/http_error_out.rb +0 -237
  213. data/lib/svix/models/http_validation_error.rb +0 -223
  214. data/lib/svix/models/hubspot_oauth_config_in.rb +0 -221
  215. data/lib/svix/models/inbound_path_params.rb +0 -277
  216. data/lib/svix/models/incoming_webhook_payload_out.rb +0 -235
  217. data/lib/svix/models/kafka_security_protocol_type.rb +0 -41
  218. data/lib/svix/models/list_response_active_application_out.rb +0 -261
  219. data/lib/svix/models/list_response_application_stats.rb +0 -261
  220. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +0 -261
  221. data/lib/svix/models/list_response_sink_out.rb +0 -261
  222. data/lib/svix/models/list_response_stream_event_type_out.rb +0 -261
  223. data/lib/svix/models/list_response_stream_out.rb +0 -261
  224. data/lib/svix/models/list_response_stream_sink_out.rb +0 -261
  225. data/lib/svix/models/list_response_template_out.rb +0 -261
  226. data/lib/svix/models/message_attempt_endpoint_out.rb +0 -545
  227. data/lib/svix/models/message_attempt_exhausted_event.rb +0 -272
  228. data/lib/svix/models/message_attempt_exhausted_event_data.rb +0 -482
  229. data/lib/svix/models/message_attempt_failed_data.rb +0 -293
  230. data/lib/svix/models/message_attempt_failing_event.rb +0 -272
  231. data/lib/svix/models/message_attempt_failing_event_data.rb +0 -482
  232. data/lib/svix/models/message_attempt_headers_out.rb +0 -263
  233. data/lib/svix/models/message_attempt_recovered_event.rb +0 -272
  234. data/lib/svix/models/message_attempt_recovered_event_data.rb +0 -482
  235. data/lib/svix/models/message_broadcast_in.rb +0 -423
  236. data/lib/svix/models/message_broadcast_out.rb +0 -315
  237. data/lib/svix/models/message_events_out.rb +0 -255
  238. data/lib/svix/models/message_precheck_in.rb +0 -288
  239. data/lib/svix/models/message_precheck_out.rb +0 -221
  240. data/lib/svix/models/message_raw_payload_out.rb +0 -221
  241. data/lib/svix/models/message_subscriber_auth_token_out.rb +0 -237
  242. data/lib/svix/models/o_auth_payload_in.rb +0 -237
  243. data/lib/svix/models/o_auth_payload_out.rb +0 -235
  244. data/lib/svix/models/oauth2_auth_method_in_out.rb +0 -41
  245. data/lib/svix/models/oauth2_grant_type_in_out.rb +0 -40
  246. data/lib/svix/models/oauth_jws_signing_algorithm.rb +0 -39
  247. data/lib/svix/models/one_time_token_in.rb +0 -221
  248. data/lib/svix/models/one_time_token_out.rb +0 -221
  249. data/lib/svix/models/polling_endpoint_message_out.rb +0 -454
  250. data/lib/svix/models/polling_endpoint_out.rb +0 -255
  251. data/lib/svix/models/redshift_config.rb +0 -317
  252. data/lib/svix/models/retry_schedule_in_out.rb +0 -216
  253. data/lib/svix/models/rotate_poller_token_in.rb +0 -280
  254. data/lib/svix/models/rotated_url_out.rb +0 -221
  255. data/lib/svix/models/s3_config.rb +0 -269
  256. data/lib/svix/models/sink_http_config.rb +0 -242
  257. data/lib/svix/models/sink_in.rb +0 -108
  258. data/lib/svix/models/sink_in_one_of.rb +0 -287
  259. data/lib/svix/models/sink_in_one_of1.rb +0 -319
  260. data/lib/svix/models/sink_in_one_of2.rb +0 -325
  261. data/lib/svix/models/sink_in_one_of3.rb +0 -271
  262. data/lib/svix/models/sink_in_one_of4.rb +0 -255
  263. data/lib/svix/models/sink_otel_v1_config.rb +0 -221
  264. data/lib/svix/models/sink_out.rb +0 -108
  265. data/lib/svix/models/sink_payload_format.rb +0 -39
  266. data/lib/svix/models/sink_secret_out.rb +0 -233
  267. data/lib/svix/models/sink_status.rb +0 -41
  268. data/lib/svix/models/sink_status_in.rb +0 -40
  269. data/lib/svix/models/sink_transform_in.rb +0 -248
  270. data/lib/svix/models/sink_transformation_out.rb +0 -226
  271. data/lib/svix/models/snowflake_config.rb +0 -287
  272. data/lib/svix/models/statistics_period.rb +0 -40
  273. data/lib/svix/models/stream_event_type_in.rb +0 -262
  274. data/lib/svix/models/stream_event_type_out.rb +0 -294
  275. data/lib/svix/models/stream_event_type_patch.rb +0 -254
  276. data/lib/svix/models/stream_in.rb +0 -287
  277. data/lib/svix/models/stream_out.rb +0 -350
  278. data/lib/svix/models/stream_patch.rb +0 -261
  279. data/lib/svix/models/stream_portal_access_in.rb +0 -293
  280. data/lib/svix/models/stream_sink_in.rb +0 -111
  281. data/lib/svix/models/stream_sink_in_one_of.rb +0 -271
  282. data/lib/svix/models/stream_sink_in_one_of1.rb +0 -271
  283. data/lib/svix/models/stream_sink_in_one_of2.rb +0 -271
  284. data/lib/svix/models/stream_sink_in_one_of3.rb +0 -271
  285. data/lib/svix/models/stream_sink_in_one_of4.rb +0 -271
  286. data/lib/svix/models/stream_sink_in_one_of5.rb +0 -271
  287. data/lib/svix/models/stream_sink_in_one_of6.rb +0 -271
  288. data/lib/svix/models/stream_sink_in_one_of7.rb +0 -271
  289. data/lib/svix/models/stream_sink_out.rb +0 -111
  290. data/lib/svix/models/stream_sink_patch.rb +0 -111
  291. data/lib/svix/models/template_patch.rb +0 -382
  292. data/lib/svix/models/template_update.rb +0 -402
  293. data/lib/svix/models/transformation_http_method.rb +0 -41
  294. data/lib/svix/models/transformation_simulate_in.rb +0 -330
  295. data/lib/svix/models/transformation_simulate_out.rb +0 -296
  296. data/lib/svix/models/validation_error.rb +0 -259
  297. data/lib/svix/statistics_api.rb +0 -17
@@ -1,545 +1,88 @@
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
- require 'date'
14
- require 'time'
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
15
4
 
16
5
  module Svix
17
6
  class MessageAttemptOut
18
- # The Endpoint's ID.
19
7
  attr_accessor :endpoint_id
20
-
21
- # The MessageAttempt's ID.
22
8
  attr_accessor :id
23
-
24
9
  attr_accessor :msg
25
-
26
- # The Message's ID.
27
10
  attr_accessor :msg_id
28
-
29
11
  attr_accessor :response
30
-
31
- # Response duration in milliseconds.
32
12
  attr_accessor :response_duration_ms
33
-
34
13
  attr_accessor :response_status_code
35
-
36
14
  attr_accessor :status
37
-
38
15
  attr_accessor :timestamp
39
-
40
16
  attr_accessor :trigger_type
41
-
42
17
  attr_accessor :url
43
18
 
44
- class EnumAttributeValidator
45
- attr_reader :datatype
46
- attr_reader :allowable_values
47
-
48
- def initialize(datatype, allowable_values)
49
- @allowable_values = allowable_values.map do |value|
50
- case datatype.to_s
51
- when /Integer/i
52
- value.to_i
53
- when /Float/i
54
- value.to_f
55
- else
56
- value
57
- end
58
- end
59
- end
60
-
61
- def valid?(value)
62
- !value || allowable_values.include?(value)
63
- end
64
- end
19
+ ALL_FIELD ||= [
20
+ "endpoint_id",
21
+ "id",
22
+ "msg",
23
+ "msg_id",
24
+ "response",
25
+ "response_duration_ms",
26
+ "response_status_code",
27
+ "status",
28
+ "timestamp",
29
+ "trigger_type",
30
+ "url"
31
+ ].freeze
32
+ private_constant :ALL_FIELD
65
33
 
66
- # Attribute mapping from ruby-style variable name to JSON key.
67
- def self.attribute_map
68
- {
69
- :'endpoint_id' => :'endpointId',
70
- :'id' => :'id',
71
- :'msg' => :'msg',
72
- :'msg_id' => :'msgId',
73
- :'response' => :'response',
74
- :'response_duration_ms' => :'responseDurationMs',
75
- :'response_status_code' => :'responseStatusCode',
76
- :'status' => :'status',
77
- :'timestamp' => :'timestamp',
78
- :'trigger_type' => :'triggerType',
79
- :'url' => :'url'
80
- }
81
- end
82
-
83
- # Returns all the JSON keys this model knows about
84
- def self.acceptable_attributes
85
- attribute_map.values
86
- end
87
-
88
- # Attribute type mapping.
89
- def self.openapi_types
90
- {
91
- :'endpoint_id' => :'String',
92
- :'id' => :'String',
93
- :'msg' => :'MessageOut',
94
- :'msg_id' => :'String',
95
- :'response' => :'String',
96
- :'response_duration_ms' => :'Integer',
97
- :'response_status_code' => :'Integer',
98
- :'status' => :'MessageStatus',
99
- :'timestamp' => :'Time',
100
- :'trigger_type' => :'MessageAttemptTriggerType',
101
- :'url' => :'String'
102
- }
103
- end
104
-
105
- # List of attributes with nullable: true
106
- def self.openapi_nullable
107
- Set.new([
108
- ])
109
- end
110
-
111
- # Initializes the object
112
- # @param [Hash] attributes Model attributes in the form of hash
113
34
  def initialize(attributes = {})
114
- if (!attributes.is_a?(Hash))
115
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::MessageAttemptOut` initialize method"
116
- end
117
-
118
- # check to see if the attribute exists and convert string to symbol for hash key
119
- attributes = attributes.each_with_object({}) { |(k, v), h|
120
- if (!self.class.attribute_map.key?(k.to_sym))
121
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::MessageAttemptOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
122
- end
123
- h[k.to_sym] = v
124
- }
125
-
126
- if attributes.key?(:'endpoint_id')
127
- self.endpoint_id = attributes[:'endpoint_id']
128
- else
129
- self.endpoint_id = nil
130
- end
131
-
132
- if attributes.key?(:'id')
133
- self.id = attributes[:'id']
134
- else
135
- self.id = nil
136
- end
137
-
138
- if attributes.key?(:'msg')
139
- self.msg = attributes[:'msg']
140
- end
141
-
142
- if attributes.key?(:'msg_id')
143
- self.msg_id = attributes[:'msg_id']
144
- else
145
- self.msg_id = nil
146
- end
147
-
148
- if attributes.key?(:'response')
149
- self.response = attributes[:'response']
150
- else
151
- self.response = nil
152
- end
153
-
154
- if attributes.key?(:'response_duration_ms')
155
- self.response_duration_ms = attributes[:'response_duration_ms']
156
- else
157
- self.response_duration_ms = nil
158
- end
159
-
160
- if attributes.key?(:'response_status_code')
161
- self.response_status_code = attributes[:'response_status_code']
162
- else
163
- self.response_status_code = nil
164
- end
165
-
166
- if attributes.key?(:'status')
167
- self.status = attributes[:'status']
168
- else
169
- self.status = nil
170
- end
171
-
172
- if attributes.key?(:'timestamp')
173
- self.timestamp = attributes[:'timestamp']
174
- else
175
- self.timestamp = nil
176
- end
177
-
178
- if attributes.key?(:'trigger_type')
179
- self.trigger_type = attributes[:'trigger_type']
180
- else
181
- self.trigger_type = nil
182
- end
183
-
184
- if attributes.key?(:'url')
185
- self.url = attributes[:'url']
186
- else
187
- self.url = nil
188
- end
189
- end
190
-
191
- # Show invalid properties with the reasons. Usually used together with valid?
192
- # @return Array for valid properties with the reasons
193
- def list_invalid_properties
194
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
195
- invalid_properties = Array.new
196
- if @endpoint_id.nil?
197
- invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
198
- end
199
-
200
- if @endpoint_id.to_s.length > 30
201
- invalid_properties.push('invalid value for "endpoint_id", the character length must be smaller than or equal to 30.')
202
- end
203
-
204
- if @endpoint_id.to_s.length < 30
205
- invalid_properties.push('invalid value for "endpoint_id", the character length must be great than or equal to 30.')
206
- end
207
-
208
- pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
209
- if @endpoint_id !~ pattern
210
- invalid_properties.push("invalid value for \"endpoint_id\", must conform to the pattern #{pattern}.")
211
- end
212
-
213
- if @id.nil?
214
- invalid_properties.push('invalid value for "id", id cannot be nil.')
215
- end
216
-
217
- if @id.to_s.length > 33
218
- invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
219
- end
220
-
221
- if @id.to_s.length < 33
222
- invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
223
- end
224
-
225
- pattern = Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
226
- if @id !~ pattern
227
- invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
228
- end
229
-
230
- if @msg_id.nil?
231
- invalid_properties.push('invalid value for "msg_id", msg_id cannot be nil.')
232
- end
233
-
234
- if @msg_id.to_s.length > 31
235
- invalid_properties.push('invalid value for "msg_id", the character length must be smaller than or equal to 31.')
236
- end
237
-
238
- if @msg_id.to_s.length < 31
239
- invalid_properties.push('invalid value for "msg_id", the character length must be great than or equal to 31.')
240
- end
241
-
242
- pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
243
- if @msg_id !~ pattern
244
- invalid_properties.push("invalid value for \"msg_id\", must conform to the pattern #{pattern}.")
245
- end
246
-
247
- if @response.nil?
248
- invalid_properties.push('invalid value for "response", response cannot be nil.')
249
- end
250
-
251
- if @response_duration_ms.nil?
252
- invalid_properties.push('invalid value for "response_duration_ms", response_duration_ms cannot be nil.')
35
+ unless attributes.is_a?(Hash)
36
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::MessageAttemptOut` new method")
253
37
  end
254
38
 
255
- if @response_status_code.nil?
256
- invalid_properties.push('invalid value for "response_status_code", response_status_code cannot be nil.')
257
- end
258
-
259
- if @status.nil?
260
- invalid_properties.push('invalid value for "status", status cannot be nil.')
261
- end
262
-
263
- if @timestamp.nil?
264
- invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
265
- end
266
-
267
- if @trigger_type.nil?
268
- invalid_properties.push('invalid value for "trigger_type", trigger_type cannot be nil.')
269
- end
270
-
271
- if @url.nil?
272
- invalid_properties.push('invalid value for "url", url cannot be nil.')
273
- end
274
-
275
- if @url.to_s.length > 65536
276
- invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 65536.')
277
- end
278
-
279
- if @url.to_s.length < 1
280
- invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
281
- end
282
-
283
- invalid_properties
284
- end
285
-
286
- # Check to see if the all the properties in the model are valid
287
- # @return true if the model is valid
288
- def valid?
289
- warn '[DEPRECATED] the `valid?` method is obsolete'
290
- return false if @endpoint_id.nil?
291
- return false if @endpoint_id.to_s.length > 30
292
- return false if @endpoint_id.to_s.length < 30
293
- return false if @endpoint_id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
294
- return false if @id.nil?
295
- return false if @id.to_s.length > 33
296
- return false if @id.to_s.length < 33
297
- return false if @id !~ Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
298
- return false if @msg_id.nil?
299
- return false if @msg_id.to_s.length > 31
300
- return false if @msg_id.to_s.length < 31
301
- return false if @msg_id !~ Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
302
- return false if @response.nil?
303
- return false if @response_duration_ms.nil?
304
- return false if @response_status_code.nil?
305
- return false if @status.nil?
306
- return false if @timestamp.nil?
307
- return false if @trigger_type.nil?
308
- return false if @url.nil?
309
- return false if @url.to_s.length > 65536
310
- return false if @url.to_s.length < 1
311
- true
312
- end
313
-
314
- # Custom attribute writer method with validation
315
- # @param [Object] endpoint_id Value to be assigned
316
- def endpoint_id=(endpoint_id)
317
- if endpoint_id.nil?
318
- fail ArgumentError, 'endpoint_id cannot be nil'
319
- end
320
-
321
- if endpoint_id.to_s.length > 30
322
- fail ArgumentError, 'invalid value for "endpoint_id", the character length must be smaller than or equal to 30.'
323
- end
324
-
325
- if endpoint_id.to_s.length < 30
326
- fail ArgumentError, 'invalid value for "endpoint_id", the character length must be great than or equal to 30.'
327
- end
328
-
329
- pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
330
- if endpoint_id !~ pattern
331
- fail ArgumentError, "invalid value for \"endpoint_id\", must conform to the pattern #{pattern}."
332
- end
333
-
334
- @endpoint_id = endpoint_id
335
- end
336
-
337
- # Custom attribute writer method with validation
338
- # @param [Object] id Value to be assigned
339
- def id=(id)
340
- if id.nil?
341
- fail ArgumentError, 'id cannot be nil'
342
- end
343
-
344
- if id.to_s.length > 33
345
- fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
346
- end
347
-
348
- if id.to_s.length < 33
349
- fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
350
- end
351
-
352
- pattern = Regexp.new(/^atmpt_[A-Za-z0-9]{27}$/)
353
- if id !~ pattern
354
- fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
355
- end
356
-
357
- @id = id
358
- end
359
-
360
- # Custom attribute writer method with validation
361
- # @param [Object] msg_id Value to be assigned
362
- def msg_id=(msg_id)
363
- if msg_id.nil?
364
- fail ArgumentError, 'msg_id cannot be nil'
365
- end
366
-
367
- if msg_id.to_s.length > 31
368
- fail ArgumentError, 'invalid value for "msg_id", the character length must be smaller than or equal to 31.'
369
- end
370
-
371
- if msg_id.to_s.length < 31
372
- fail ArgumentError, 'invalid value for "msg_id", the character length must be great than or equal to 31.'
373
- end
374
-
375
- pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
376
- if msg_id !~ pattern
377
- fail ArgumentError, "invalid value for \"msg_id\", must conform to the pattern #{pattern}."
378
- end
379
-
380
- @msg_id = msg_id
381
- end
382
-
383
- # Custom attribute writer method with validation
384
- # @param [Object] url Value to be assigned
385
- def url=(url)
386
- if url.nil?
387
- fail ArgumentError, 'url cannot be nil'
388
- end
389
-
390
- if url.to_s.length > 65536
391
- fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 65536.'
392
- end
393
-
394
- if url.to_s.length < 1
395
- fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
396
- end
397
-
398
- @url = url
399
- end
400
-
401
- # Checks equality by comparing each attribute.
402
- # @param [Object] Object to be compared
403
- def ==(o)
404
- return true if self.equal?(o)
405
- self.class == o.class &&
406
- endpoint_id == o.endpoint_id &&
407
- id == o.id &&
408
- msg == o.msg &&
409
- msg_id == o.msg_id &&
410
- response == o.response &&
411
- response_duration_ms == o.response_duration_ms &&
412
- response_status_code == o.response_status_code &&
413
- status == o.status &&
414
- timestamp == o.timestamp &&
415
- trigger_type == o.trigger_type &&
416
- url == o.url
417
- end
418
-
419
- # @see the `==` method
420
- # @param [Object] Object to be compared
421
- def eql?(o)
422
- self == o
423
- end
424
-
425
- # Calculates hash code according to all attributes.
426
- # @return [Integer] Hash code
427
- def hash
428
- [endpoint_id, id, msg, msg_id, response, response_duration_ms, response_status_code, status, timestamp, trigger_type, url].hash
429
- end
430
-
431
- # Builds the object from hash
432
- # @param [Hash] attributes Model attributes in the form of hash
433
- # @return [Object] Returns the model itself
434
- def self.build_from_hash(attributes)
435
- return nil unless attributes.is_a?(Hash)
436
- attributes = attributes.transform_keys(&:to_sym)
437
- transformed_hash = {}
438
- openapi_types.each_pair do |key, type|
439
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
440
- transformed_hash["#{key}"] = nil
441
- elsif type =~ /\AArray<(.*)>/i
442
- # check to ensure the input is an array given that the attribute
443
- # is documented as an array but the input is not
444
- if attributes[attribute_map[key]].is_a?(Array)
445
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
446
- end
447
- elsif !attributes[attribute_map[key]].nil?
448
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
39
+ attributes.each do |k, v|
40
+ unless ALL_FIELD.include?(k.to_s)
41
+ fail(ArgumentError, "The field #{k} is not part of Svix::MessageAttemptOut")
449
42
  end
450
- end
451
- new(transformed_hash)
452
- end
453
-
454
- # Deserializes the data based on type
455
- # @param string type Data type
456
- # @param string value Value to be deserialized
457
- # @return [Object] Deserialized data
458
- def self._deserialize(type, value)
459
- case type.to_sym
460
- when :Time
461
- Time.parse(value)
462
- when :Date
463
- Date.parse(value)
464
- when :String
465
- value.to_s
466
- when :Integer
467
- value.to_i
468
- when :Float
469
- value.to_f
470
- when :Boolean
471
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
472
- true
473
- else
474
- false
475
- end
476
- when :Object
477
- # generic object (usually a Hash), return directly
478
- value
479
- when /\AArray<(?<inner_type>.+)>\z/
480
- inner_type = Regexp.last_match[:inner_type]
481
- value.map { |v| _deserialize(inner_type, v) }
482
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
483
- k_type = Regexp.last_match[:k_type]
484
- v_type = Regexp.last_match[:v_type]
485
- {}.tap do |hash|
486
- value.each do |k, v|
487
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
488
- end
489
- end
490
- else # model
491
- # models (e.g. Pet) or oneOf
492
- klass = Svix.const_get(type)
493
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
494
- end
495
- end
496
-
497
- # Returns the string representation of the object
498
- # @return [String] String presentation of the object
499
- def to_s
500
- to_hash.to_s
501
- end
502
-
503
- # to_body is an alias to to_hash (backward compatibility)
504
- # @return [Hash] Returns the object in the form of hash
505
- def to_body
506
- to_hash
507
- end
508
-
509
- # Returns the object in the form of hash
510
- # @return [Hash] Returns the object in the form of hash
511
- def to_hash
512
- hash = {}
513
- self.class.attribute_map.each_pair do |attr, param|
514
- value = self.send(attr)
515
- if value.nil?
516
- is_nullable = self.class.openapi_nullable.include?(attr)
517
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
518
- end
519
-
520
- hash[param] = _to_hash(value)
521
- end
522
- hash
523
- end
524
43
 
525
- # Outputs non-array value in the form of hash
526
- # For object, use to_hash. Otherwise, just return the value
527
- # @param [Object] value Any valid value
528
- # @return [Hash] Returns the value in the form of hash
529
- def _to_hash(value)
530
- if value.is_a?(Array)
531
- value.compact.map { |v| _to_hash(v) }
532
- elsif value.is_a?(Hash)
533
- {}.tap do |hash|
534
- value.each { |k, v| hash[k] = _to_hash(v) }
535
- end
536
- elsif value.respond_to? :to_hash
537
- value.to_hash
538
- else
539
- value
540
- end
44
+ instance_variable_set("@#{k}", v)
45
+ instance_variable_set("@__#{k}_is_defined", true)
46
+ end
47
+ end
48
+
49
+ def self.deserialize(attributes = {})
50
+ attributes = attributes.transform_keys(&:to_s)
51
+ attrs = Hash.new
52
+ attrs["endpoint_id"] = attributes["endpointId"]
53
+ attrs["id"] = attributes["id"]
54
+ attrs["msg"] = Svix::MessageOut.deserialize(attributes["msg"]) if attributes["msg"]
55
+ attrs["msg_id"] = attributes["msgId"]
56
+ attrs["response"] = attributes["response"]
57
+ attrs["response_duration_ms"] = attributes["responseDurationMs"]
58
+ attrs["response_status_code"] = attributes["responseStatusCode"]
59
+ attrs["status"] = Svix::MessageStatus.deserialize(attributes["status"])
60
+ attrs["timestamp"] = DateTime.rfc3339(attributes["timestamp"]).to_time
61
+ attrs["trigger_type"] = Svix::MessageAttemptTriggerType.deserialize(attributes["triggerType"])
62
+ attrs["url"] = attributes["url"]
63
+ new(attrs)
64
+ end
65
+
66
+ def serialize
67
+ out = Hash.new
68
+ out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id
69
+ out["id"] = Svix::serialize_primitive(@id) if @id
70
+ out["msg"] = @msg.serialize if @msg
71
+ out["msgId"] = Svix::serialize_primitive(@msg_id) if @msg_id
72
+ out["response"] = Svix::serialize_primitive(@response) if @response
73
+ out["responseDurationMs"] = Svix::serialize_primitive(@response_duration_ms) if @response_duration_ms
74
+ out["responseStatusCode"] = Svix::serialize_primitive(@response_status_code) if @response_status_code
75
+ out["status"] = @status.serialize if @status
76
+ out["timestamp"] = Svix::serialize_primitive(@timestamp) if @timestamp
77
+ out["triggerType"] = @trigger_type.serialize if @trigger_type
78
+ out["url"] = Svix::serialize_primitive(@url) if @url
79
+ out
80
+ end
81
+
82
+ # Serializes the object to a json string
83
+ # @return String
84
+ def to_json
85
+ JSON.dump(serialize)
541
86
  end
542
-
543
87
  end
544
-
545
88
  end
@@ -1,40 +1,32 @@
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
- require 'date'
14
- require 'time'
15
-
1
+ # frozen_string_literal: true
2
+ # This file is @generated
16
3
  module Svix
4
+ # The reason an attempt was made:
5
+ # - Scheduled = 0
6
+ # - Manual = 1
17
7
  class MessageAttemptTriggerType
18
- Scheduled = 0.freeze
19
- Manual = 1.freeze
8
+ SCHEDULED = 0.freeze
9
+ MANUAL = 1.freeze
20
10
 
21
11
  def self.all_vars
22
- @all_vars ||= [Scheduled, Manual].freeze
12
+ @all_vars ||= [SCHEDULED, MANUAL].freeze
23
13
  end
24
14
 
25
- # Builds the enum from string
26
- # @param [String] The enum value in the form of the string
27
- # @return [String] The enum value
28
- def self.build_from_hash(value)
29
- new.build_from_hash(value)
15
+ def initialize(value)
16
+ unless MessageAttemptTriggerType.all_vars.include?(value)
17
+ raise "Invalid ENUM value '#{value}' for class #MessageAttemptTriggerType"
18
+ end
19
+
20
+ @value = value
30
21
  end
31
22
 
32
- # Builds the enum from string
33
- # @param [String] The enum value in the form of the string
34
- # @return [String] The enum value
35
- def build_from_hash(value)
23
+ def self.deserialize(value)
36
24
  return value if MessageAttemptTriggerType.all_vars.include?(value)
37
- raise "Invalid ENUM value #{value} for class #MessageAttemptTriggerType"
25
+ raise "Invalid ENUM value '#{value}' for class #MessageAttemptTriggerType"
26
+ end
27
+
28
+ def serialize
29
+ @value
38
30
  end
39
31
  end
40
32
  end