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,269 +1,55 @@
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 EndpointStats
18
7
  attr_accessor :fail
19
-
20
8
  attr_accessor :pending
21
-
22
9
  attr_accessor :sending
23
-
24
10
  attr_accessor :success
25
11
 
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'fail' => :'fail',
30
- :'pending' => :'pending',
31
- :'sending' => :'sending',
32
- :'success' => :'success'
33
- }
34
- end
35
-
36
- # Returns all the JSON keys this model knows about
37
- def self.acceptable_attributes
38
- attribute_map.values
39
- end
40
-
41
- # Attribute type mapping.
42
- def self.openapi_types
43
- {
44
- :'fail' => :'Integer',
45
- :'pending' => :'Integer',
46
- :'sending' => :'Integer',
47
- :'success' => :'Integer'
48
- }
49
- end
50
-
51
- # List of attributes with nullable: true
52
- def self.openapi_nullable
53
- Set.new([
54
- ])
55
- end
12
+ ALL_FIELD ||= ["fail", "pending", "sending", "success"].freeze
13
+ private_constant :ALL_FIELD
56
14
 
57
- # Initializes the object
58
- # @param [Hash] attributes Model attributes in the form of hash
59
15
  def initialize(attributes = {})
60
- if (!attributes.is_a?(Hash))
61
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointStats` initialize method"
16
+ unless attributes.is_a?(Hash)
17
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointStats` new method")
62
18
  end
63
19
 
64
- # check to see if the attribute exists and convert string to symbol for hash key
65
- attributes = attributes.each_with_object({}) { |(k, v), h|
66
- if (!self.class.attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
20
+ attributes.each do |k, v|
21
+ unless ALL_FIELD.include?(k.to_s)
22
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointStats")
68
23
  end
69
- h[k.to_sym] = v
70
- }
71
24
 
72
- if attributes.key?(:'fail')
73
- self.fail = attributes[:'fail']
74
- else
75
- self.fail = nil
76
- end
77
-
78
- if attributes.key?(:'pending')
79
- self.pending = attributes[:'pending']
80
- else
81
- self.pending = nil
82
- end
83
-
84
- if attributes.key?(:'sending')
85
- self.sending = attributes[:'sending']
86
- else
87
- self.sending = nil
88
- end
89
-
90
- if attributes.key?(:'success')
91
- self.success = attributes[:'success']
92
- else
93
- self.success = nil
25
+ instance_variable_set("@#{k}", v)
26
+ instance_variable_set("@__#{k}_is_defined", true)
94
27
  end
95
28
  end
96
29
 
97
- # Show invalid properties with the reasons. Usually used together with valid?
98
- # @return Array for valid properties with the reasons
99
- def list_invalid_properties
100
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
- invalid_properties = Array.new
102
- if @fail.nil?
103
- invalid_properties.push('invalid value for "fail", fail cannot be nil.')
104
- end
105
-
106
- if @pending.nil?
107
- invalid_properties.push('invalid value for "pending", pending cannot be nil.')
108
- end
109
-
110
- if @sending.nil?
111
- invalid_properties.push('invalid value for "sending", sending cannot be nil.')
112
- end
113
-
114
- if @success.nil?
115
- invalid_properties.push('invalid value for "success", success cannot be nil.')
116
- end
117
-
118
- invalid_properties
30
+ def self.deserialize(attributes = {})
31
+ attributes = attributes.transform_keys(&:to_s)
32
+ attrs = Hash.new
33
+ attrs["fail"] = attributes["fail"]
34
+ attrs["pending"] = attributes["pending"]
35
+ attrs["sending"] = attributes["sending"]
36
+ attrs["success"] = attributes["success"]
37
+ new(attrs)
119
38
  end
120
39
 
121
- # Check to see if the all the properties in the model are valid
122
- # @return true if the model is valid
123
- def valid?
124
- warn '[DEPRECATED] the `valid?` method is obsolete'
125
- return false if @fail.nil?
126
- return false if @pending.nil?
127
- return false if @sending.nil?
128
- return false if @success.nil?
129
- true
40
+ def serialize
41
+ out = Hash.new
42
+ out["fail"] = Svix::serialize_primitive(@fail) if @fail
43
+ out["pending"] = Svix::serialize_primitive(@pending) if @pending
44
+ out["sending"] = Svix::serialize_primitive(@sending) if @sending
45
+ out["success"] = Svix::serialize_primitive(@success) if @success
46
+ out
130
47
  end
131
48
 
132
- # Checks equality by comparing each attribute.
133
- # @param [Object] Object to be compared
134
- def ==(o)
135
- return true if self.equal?(o)
136
- self.class == o.class &&
137
- fail == o.fail &&
138
- pending == o.pending &&
139
- sending == o.sending &&
140
- success == o.success
49
+ # Serializes the object to a json string
50
+ # @return String
51
+ def to_json
52
+ JSON.dump(serialize)
141
53
  end
142
-
143
- # @see the `==` method
144
- # @param [Object] Object to be compared
145
- def eql?(o)
146
- self == o
147
- end
148
-
149
- # Calculates hash code according to all attributes.
150
- # @return [Integer] Hash code
151
- def hash
152
- [fail, pending, sending, success].hash
153
- end
154
-
155
- # Builds the object from hash
156
- # @param [Hash] attributes Model attributes in the form of hash
157
- # @return [Object] Returns the model itself
158
- def self.build_from_hash(attributes)
159
- return nil unless attributes.is_a?(Hash)
160
- attributes = attributes.transform_keys(&:to_sym)
161
- transformed_hash = {}
162
- openapi_types.each_pair do |key, type|
163
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
164
- transformed_hash["#{key}"] = nil
165
- elsif type =~ /\AArray<(.*)>/i
166
- # check to ensure the input is an array given that the attribute
167
- # is documented as an array but the input is not
168
- if attributes[attribute_map[key]].is_a?(Array)
169
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
170
- end
171
- elsif !attributes[attribute_map[key]].nil?
172
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
173
- end
174
- end
175
- new(transformed_hash)
176
- end
177
-
178
- # Deserializes the data based on type
179
- # @param string type Data type
180
- # @param string value Value to be deserialized
181
- # @return [Object] Deserialized data
182
- def self._deserialize(type, value)
183
- case type.to_sym
184
- when :Time
185
- Time.parse(value)
186
- when :Date
187
- Date.parse(value)
188
- when :String
189
- value.to_s
190
- when :Integer
191
- value.to_i
192
- when :Float
193
- value.to_f
194
- when :Boolean
195
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
- true
197
- else
198
- false
199
- end
200
- when :Object
201
- # generic object (usually a Hash), return directly
202
- value
203
- when /\AArray<(?<inner_type>.+)>\z/
204
- inner_type = Regexp.last_match[:inner_type]
205
- value.map { |v| _deserialize(inner_type, v) }
206
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
- k_type = Regexp.last_match[:k_type]
208
- v_type = Regexp.last_match[:v_type]
209
- {}.tap do |hash|
210
- value.each do |k, v|
211
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
- end
213
- end
214
- else # model
215
- # models (e.g. Pet) or oneOf
216
- klass = Svix.const_get(type)
217
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
- end
219
- end
220
-
221
- # Returns the string representation of the object
222
- # @return [String] String presentation of the object
223
- def to_s
224
- to_hash.to_s
225
- end
226
-
227
- # to_body is an alias to to_hash (backward compatibility)
228
- # @return [Hash] Returns the object in the form of hash
229
- def to_body
230
- to_hash
231
- end
232
-
233
- # Returns the object in the form of hash
234
- # @return [Hash] Returns the object in the form of hash
235
- def to_hash
236
- hash = {}
237
- self.class.attribute_map.each_pair do |attr, param|
238
- value = self.send(attr)
239
- if value.nil?
240
- is_nullable = self.class.openapi_nullable.include?(attr)
241
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
- end
243
-
244
- hash[param] = _to_hash(value)
245
- end
246
- hash
247
- end
248
-
249
- # Outputs non-array value in the form of hash
250
- # For object, use to_hash. Otherwise, just return the value
251
- # @param [Object] value Any valid value
252
- # @return [Hash] Returns the value in the form of hash
253
- def _to_hash(value)
254
- if value.is_a?(Array)
255
- value.compact.map { |v| _to_hash(v) }
256
- elsif value.is_a?(Hash)
257
- {}.tap do |hash|
258
- value.each { |k, v| hash[k] = _to_hash(v) }
259
- end
260
- elsif value.respond_to? :to_hash
261
- value.to_hash
262
- else
263
- value
264
- end
265
- end
266
-
267
54
  end
268
-
269
55
  end
@@ -1,248 +1,52 @@
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 EndpointTransformationIn
18
7
  attr_accessor :code
19
-
20
8
  attr_accessor :enabled
21
9
 
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'code' => :'code',
26
- :'enabled' => :'enabled'
27
- }
28
- end
29
-
30
- # Returns all the JSON keys this model knows about
31
- def self.acceptable_attributes
32
- attribute_map.values
33
- end
34
-
35
- # Attribute type mapping.
36
- def self.openapi_types
37
- {
38
- :'code' => :'String',
39
- :'enabled' => :'Boolean'
40
- }
41
- end
10
+ ALL_FIELD ||= ["code", "enabled"].freeze
11
+ private_constant :ALL_FIELD
42
12
 
43
- # List of attributes with nullable: true
44
- def self.openapi_nullable
45
- Set.new([
46
- :'code',
47
- ])
48
- end
49
-
50
- # Initializes the object
51
- # @param [Hash] attributes Model attributes in the form of hash
52
13
  def initialize(attributes = {})
53
- if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointTransformationIn` initialize method"
14
+ unless attributes.is_a?(Hash)
15
+ fail(
16
+ ArgumentError,
17
+ "The input argument (attributes) must be a hash in `Svix::EndpointTransformationIn` new method"
18
+ )
55
19
  end
56
20
 
57
- # check to see if the attribute exists and convert string to symbol for hash key
58
- attributes = attributes.each_with_object({}) { |(k, v), h|
59
- if (!self.class.attribute_map.key?(k.to_sym))
60
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointTransformationIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
21
+ attributes.each do |k, v|
22
+ unless ALL_FIELD.include?(k.to_s)
23
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointTransformationIn")
61
24
  end
62
- h[k.to_sym] = v
63
- }
64
25
 
65
- if attributes.key?(:'code')
66
- self.code = attributes[:'code']
26
+ instance_variable_set("@#{k}", v)
27
+ instance_variable_set("@__#{k}_is_defined", true)
67
28
  end
68
-
69
- if attributes.key?(:'enabled')
70
- self.enabled = attributes[:'enabled']
71
- end
72
- end
73
-
74
- # Show invalid properties with the reasons. Usually used together with valid?
75
- # @return Array for valid properties with the reasons
76
- def list_invalid_properties
77
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
- invalid_properties = Array.new
79
- if !@code.nil? && @code.to_s.length > 51200
80
- invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 51200.')
81
- end
82
-
83
- if !@code.nil? && @code.to_s.length < 10
84
- invalid_properties.push('invalid value for "code", the character length must be great than or equal to 10.')
85
- end
86
-
87
- invalid_properties
88
29
  end
89
30
 
90
- # Check to see if the all the properties in the model are valid
91
- # @return true if the model is valid
92
- def valid?
93
- warn '[DEPRECATED] the `valid?` method is obsolete'
94
- return false if !@code.nil? && @code.to_s.length > 51200
95
- return false if !@code.nil? && @code.to_s.length < 10
96
- true
97
- end
98
-
99
- # Custom attribute writer method with validation
100
- # @param [Object] code Value to be assigned
101
- def code=(code)
102
- if !code.nil? && code.to_s.length > 51200
103
- fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 51200.'
104
- end
105
-
106
- if !code.nil? && code.to_s.length < 10
107
- fail ArgumentError, 'invalid value for "code", the character length must be great than or equal to 10.'
108
- end
109
-
110
- @code = code
31
+ def self.deserialize(attributes = {})
32
+ attributes = attributes.transform_keys(&:to_s)
33
+ attrs = Hash.new
34
+ attrs["code"] = attributes["code"]
35
+ attrs["enabled"] = attributes["enabled"]
36
+ new(attrs)
111
37
  end
112
38
 
113
- # Checks equality by comparing each attribute.
114
- # @param [Object] Object to be compared
115
- def ==(o)
116
- return true if self.equal?(o)
117
- self.class == o.class &&
118
- code == o.code &&
119
- enabled == o.enabled
39
+ def serialize
40
+ out = Hash.new
41
+ out["code"] = Svix::serialize_primitive(@code) if @code
42
+ out["enabled"] = Svix::serialize_primitive(@enabled) if @enabled
43
+ out
120
44
  end
121
45
 
122
- # @see the `==` method
123
- # @param [Object] Object to be compared
124
- def eql?(o)
125
- self == o
46
+ # Serializes the object to a json string
47
+ # @return String
48
+ def to_json
49
+ JSON.dump(serialize)
126
50
  end
127
-
128
- # Calculates hash code according to all attributes.
129
- # @return [Integer] Hash code
130
- def hash
131
- [code, enabled].hash
132
- end
133
-
134
- # Builds the object from hash
135
- # @param [Hash] attributes Model attributes in the form of hash
136
- # @return [Object] Returns the model itself
137
- def self.build_from_hash(attributes)
138
- return nil unless attributes.is_a?(Hash)
139
- attributes = attributes.transform_keys(&:to_sym)
140
- transformed_hash = {}
141
- openapi_types.each_pair do |key, type|
142
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
- transformed_hash["#{key}"] = nil
144
- elsif type =~ /\AArray<(.*)>/i
145
- # check to ensure the input is an array given that the attribute
146
- # is documented as an array but the input is not
147
- if attributes[attribute_map[key]].is_a?(Array)
148
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
- end
150
- elsif !attributes[attribute_map[key]].nil?
151
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
- end
153
- end
154
- new(transformed_hash)
155
- end
156
-
157
- # Deserializes the data based on type
158
- # @param string type Data type
159
- # @param string value Value to be deserialized
160
- # @return [Object] Deserialized data
161
- def self._deserialize(type, value)
162
- case type.to_sym
163
- when :Time
164
- Time.parse(value)
165
- when :Date
166
- Date.parse(value)
167
- when :String
168
- value.to_s
169
- when :Integer
170
- value.to_i
171
- when :Float
172
- value.to_f
173
- when :Boolean
174
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
- true
176
- else
177
- false
178
- end
179
- when :Object
180
- # generic object (usually a Hash), return directly
181
- value
182
- when /\AArray<(?<inner_type>.+)>\z/
183
- inner_type = Regexp.last_match[:inner_type]
184
- value.map { |v| _deserialize(inner_type, v) }
185
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
- k_type = Regexp.last_match[:k_type]
187
- v_type = Regexp.last_match[:v_type]
188
- {}.tap do |hash|
189
- value.each do |k, v|
190
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
- end
192
- end
193
- else # model
194
- # models (e.g. Pet) or oneOf
195
- klass = Svix.const_get(type)
196
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
197
- end
198
- end
199
-
200
- # Returns the string representation of the object
201
- # @return [String] String presentation of the object
202
- def to_s
203
- to_hash.to_s
204
- end
205
-
206
- # to_body is an alias to to_hash (backward compatibility)
207
- # @return [Hash] Returns the object in the form of hash
208
- def to_body
209
- to_hash
210
- end
211
-
212
- # Returns the object in the form of hash
213
- # @return [Hash] Returns the object in the form of hash
214
- def to_hash
215
- hash = {}
216
- self.class.attribute_map.each_pair do |attr, param|
217
- value = self.send(attr)
218
- if value.nil?
219
- is_nullable = self.class.openapi_nullable.include?(attr)
220
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
- end
222
-
223
- hash[param] = _to_hash(value)
224
- end
225
- hash
226
- end
227
-
228
- # Outputs non-array value in the form of hash
229
- # For object, use to_hash. Otherwise, just return the value
230
- # @param [Object] value Any valid value
231
- # @return [Hash] Returns the value in the form of hash
232
- def _to_hash(value)
233
- if value.is_a?(Array)
234
- value.compact.map { |v| _to_hash(v) }
235
- elsif value.is_a?(Hash)
236
- {}.tap do |hash|
237
- value.each { |k, v| hash[k] = _to_hash(v) }
238
- end
239
- elsif value.respond_to? :to_hash
240
- value.to_hash
241
- else
242
- value
243
- end
244
- end
245
-
246
51
  end
247
-
248
52
  end