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,272 +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
- require 'date'
14
- require 'time'
15
-
16
- module Svix
17
- # Sent when an endpoint is created.
18
- class EndpointCreatedEvent
19
- attr_accessor :data
20
-
21
- attr_accessor :type
22
-
23
- class EnumAttributeValidator
24
- attr_reader :datatype
25
- attr_reader :allowable_values
26
-
27
- def initialize(datatype, allowable_values)
28
- @allowable_values = allowable_values.map do |value|
29
- case datatype.to_s
30
- when /Integer/i
31
- value.to_i
32
- when /Float/i
33
- value.to_f
34
- else
35
- value
36
- end
37
- end
38
- end
39
-
40
- def valid?(value)
41
- !value || allowable_values.include?(value)
42
- end
43
- end
44
-
45
- # Attribute mapping from ruby-style variable name to JSON key.
46
- def self.attribute_map
47
- {
48
- :'data' => :'data',
49
- :'type' => :'type'
50
- }
51
- end
52
-
53
- # Returns all the JSON keys this model knows about
54
- def self.acceptable_attributes
55
- attribute_map.values
56
- end
57
-
58
- # Attribute type mapping.
59
- def self.openapi_types
60
- {
61
- :'data' => :'EndpointCreatedEventData',
62
- :'type' => :'String'
63
- }
64
- end
65
-
66
- # List of attributes with nullable: true
67
- def self.openapi_nullable
68
- Set.new([
69
- ])
70
- end
71
-
72
- # Initializes the object
73
- # @param [Hash] attributes Model attributes in the form of hash
74
- def initialize(attributes = {})
75
- if (!attributes.is_a?(Hash))
76
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointCreatedEvent` initialize method"
77
- end
78
-
79
- # check to see if the attribute exists and convert string to symbol for hash key
80
- attributes = attributes.each_with_object({}) { |(k, v), h|
81
- if (!self.class.attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointCreatedEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
- end
84
- h[k.to_sym] = v
85
- }
86
-
87
- if attributes.key?(:'data')
88
- self.data = attributes[:'data']
89
- else
90
- self.data = nil
91
- end
92
-
93
- if attributes.key?(:'type')
94
- self.type = attributes[:'type']
95
- else
96
- self.type = 'endpoint.created'
97
- end
98
- end
99
-
100
- # Show invalid properties with the reasons. Usually used together with valid?
101
- # @return Array for valid properties with the reasons
102
- def list_invalid_properties
103
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
- invalid_properties = Array.new
105
- if @data.nil?
106
- invalid_properties.push('invalid value for "data", data cannot be nil.')
107
- end
108
-
109
- if @type.nil?
110
- invalid_properties.push('invalid value for "type", type cannot be nil.')
111
- end
112
-
113
- invalid_properties
114
- end
115
-
116
- # Check to see if the all the properties in the model are valid
117
- # @return true if the model is valid
118
- def valid?
119
- warn '[DEPRECATED] the `valid?` method is obsolete'
120
- return false if @data.nil?
121
- return false if @type.nil?
122
- type_validator = EnumAttributeValidator.new('String', ["endpoint.created"])
123
- return false unless type_validator.valid?(@type)
124
- true
125
- end
126
-
127
- # Custom attribute writer method checking allowed values (enum).
128
- # @param [Object] type Object to be assigned
129
- def type=(type)
130
- validator = EnumAttributeValidator.new('String', ["endpoint.created"])
131
- unless validator.valid?(type)
132
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
133
- end
134
- @type = type
135
- end
136
-
137
- # Checks equality by comparing each attribute.
138
- # @param [Object] Object to be compared
139
- def ==(o)
140
- return true if self.equal?(o)
141
- self.class == o.class &&
142
- data == o.data &&
143
- type == o.type
144
- end
145
-
146
- # @see the `==` method
147
- # @param [Object] Object to be compared
148
- def eql?(o)
149
- self == o
150
- end
151
-
152
- # Calculates hash code according to all attributes.
153
- # @return [Integer] Hash code
154
- def hash
155
- [data, type].hash
156
- end
157
-
158
- # Builds the object from hash
159
- # @param [Hash] attributes Model attributes in the form of hash
160
- # @return [Object] Returns the model itself
161
- def self.build_from_hash(attributes)
162
- return nil unless attributes.is_a?(Hash)
163
- attributes = attributes.transform_keys(&:to_sym)
164
- transformed_hash = {}
165
- openapi_types.each_pair do |key, type|
166
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
- transformed_hash["#{key}"] = nil
168
- elsif type =~ /\AArray<(.*)>/i
169
- # check to ensure the input is an array given that the attribute
170
- # is documented as an array but the input is not
171
- if attributes[attribute_map[key]].is_a?(Array)
172
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
- end
174
- elsif !attributes[attribute_map[key]].nil?
175
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
- end
177
- end
178
- new(transformed_hash)
179
- end
180
-
181
- # Deserializes the data based on type
182
- # @param string type Data type
183
- # @param string value Value to be deserialized
184
- # @return [Object] Deserialized data
185
- def self._deserialize(type, value)
186
- case type.to_sym
187
- when :Time
188
- Time.parse(value)
189
- when :Date
190
- Date.parse(value)
191
- when :String
192
- value.to_s
193
- when :Integer
194
- value.to_i
195
- when :Float
196
- value.to_f
197
- when :Boolean
198
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
- true
200
- else
201
- false
202
- end
203
- when :Object
204
- # generic object (usually a Hash), return directly
205
- value
206
- when /\AArray<(?<inner_type>.+)>\z/
207
- inner_type = Regexp.last_match[:inner_type]
208
- value.map { |v| _deserialize(inner_type, v) }
209
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
- k_type = Regexp.last_match[:k_type]
211
- v_type = Regexp.last_match[:v_type]
212
- {}.tap do |hash|
213
- value.each do |k, v|
214
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
- end
216
- end
217
- else # model
218
- # models (e.g. Pet) or oneOf
219
- klass = Svix.const_get(type)
220
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
- end
222
- end
223
-
224
- # Returns the string representation of the object
225
- # @return [String] String presentation of the object
226
- def to_s
227
- to_hash.to_s
228
- end
229
-
230
- # to_body is an alias to to_hash (backward compatibility)
231
- # @return [Hash] Returns the object in the form of hash
232
- def to_body
233
- to_hash
234
- end
235
-
236
- # Returns the object in the form of hash
237
- # @return [Hash] Returns the object in the form of hash
238
- def to_hash
239
- hash = {}
240
- self.class.attribute_map.each_pair do |attr, param|
241
- value = self.send(attr)
242
- if value.nil?
243
- is_nullable = self.class.openapi_nullable.include?(attr)
244
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
- end
246
-
247
- hash[param] = _to_hash(value)
248
- end
249
- hash
250
- end
251
-
252
- # Outputs non-array value in the form of hash
253
- # For object, use to_hash. Otherwise, just return the value
254
- # @param [Object] value Any valid value
255
- # @return [Hash] Returns the value in the form of hash
256
- def _to_hash(value)
257
- if value.is_a?(Array)
258
- value.compact.map { |v| _to_hash(v) }
259
- elsif value.is_a?(Hash)
260
- {}.tap do |hash|
261
- value.each { |k, v| hash[k] = _to_hash(v) }
262
- end
263
- elsif value.respond_to? :to_hash
264
- value.to_hash
265
- else
266
- value
267
- end
268
- end
269
-
270
- end
271
-
272
- end
@@ -1,410 +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
- require 'date'
14
- require 'time'
15
-
16
- module Svix
17
- # Sent when an endpoint is created, updated, or deleted
18
- class EndpointCreatedEventData
19
- # The Application's ID.
20
- attr_accessor :app_id
21
-
22
- # The Application's UID.
23
- attr_accessor :app_uid
24
-
25
- # The Endpoint's ID.
26
- attr_accessor :endpoint_id
27
-
28
- # The Endpoint's UID.
29
- attr_accessor :endpoint_uid
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'app_id' => :'appId',
35
- :'app_uid' => :'appUid',
36
- :'endpoint_id' => :'endpointId',
37
- :'endpoint_uid' => :'endpointUid'
38
- }
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'app_id' => :'String',
50
- :'app_uid' => :'String',
51
- :'endpoint_id' => :'String',
52
- :'endpoint_uid' => :'String'
53
- }
54
- end
55
-
56
- # List of attributes with nullable: true
57
- def self.openapi_nullable
58
- Set.new([
59
- :'app_uid',
60
- :'endpoint_uid'
61
- ])
62
- end
63
-
64
- # Initializes the object
65
- # @param [Hash] attributes Model attributes in the form of hash
66
- def initialize(attributes = {})
67
- if (!attributes.is_a?(Hash))
68
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointCreatedEventData` initialize method"
69
- end
70
-
71
- # check to see if the attribute exists and convert string to symbol for hash key
72
- attributes = attributes.each_with_object({}) { |(k, v), h|
73
- if (!self.class.attribute_map.key?(k.to_sym))
74
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointCreatedEventData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
- end
76
- h[k.to_sym] = v
77
- }
78
-
79
- if attributes.key?(:'app_id')
80
- self.app_id = attributes[:'app_id']
81
- else
82
- self.app_id = nil
83
- end
84
-
85
- if attributes.key?(:'app_uid')
86
- self.app_uid = attributes[:'app_uid']
87
- end
88
-
89
- if attributes.key?(:'endpoint_id')
90
- self.endpoint_id = attributes[:'endpoint_id']
91
- else
92
- self.endpoint_id = nil
93
- end
94
-
95
- if attributes.key?(:'endpoint_uid')
96
- self.endpoint_uid = attributes[:'endpoint_uid']
97
- end
98
- end
99
-
100
- # Show invalid properties with the reasons. Usually used together with valid?
101
- # @return Array for valid properties with the reasons
102
- def list_invalid_properties
103
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
- invalid_properties = Array.new
105
- if @app_id.nil?
106
- invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
107
- end
108
-
109
- if @app_id.to_s.length > 31
110
- invalid_properties.push('invalid value for "app_id", the character length must be smaller than or equal to 31.')
111
- end
112
-
113
- if @app_id.to_s.length < 31
114
- invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 31.')
115
- end
116
-
117
- pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
118
- if @app_id !~ pattern
119
- invalid_properties.push("invalid value for \"app_id\", must conform to the pattern #{pattern}.")
120
- end
121
-
122
- if !@app_uid.nil? && @app_uid.to_s.length > 256
123
- invalid_properties.push('invalid value for "app_uid", the character length must be smaller than or equal to 256.')
124
- end
125
-
126
- if !@app_uid.nil? && @app_uid.to_s.length < 1
127
- invalid_properties.push('invalid value for "app_uid", the character length must be great than or equal to 1.')
128
- end
129
-
130
- pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
131
- if !@app_uid.nil? && @app_uid !~ pattern
132
- invalid_properties.push("invalid value for \"app_uid\", must conform to the pattern #{pattern}.")
133
- end
134
-
135
- if @endpoint_id.nil?
136
- invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
137
- end
138
-
139
- if @endpoint_id.to_s.length > 30
140
- invalid_properties.push('invalid value for "endpoint_id", the character length must be smaller than or equal to 30.')
141
- end
142
-
143
- if @endpoint_id.to_s.length < 30
144
- invalid_properties.push('invalid value for "endpoint_id", the character length must be great than or equal to 30.')
145
- end
146
-
147
- pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
148
- if @endpoint_id !~ pattern
149
- invalid_properties.push("invalid value for \"endpoint_id\", must conform to the pattern #{pattern}.")
150
- end
151
-
152
- if !@endpoint_uid.nil? && @endpoint_uid.to_s.length > 256
153
- invalid_properties.push('invalid value for "endpoint_uid", the character length must be smaller than or equal to 256.')
154
- end
155
-
156
- if !@endpoint_uid.nil? && @endpoint_uid.to_s.length < 1
157
- invalid_properties.push('invalid value for "endpoint_uid", the character length must be great than or equal to 1.')
158
- end
159
-
160
- pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
161
- if !@endpoint_uid.nil? && @endpoint_uid !~ pattern
162
- invalid_properties.push("invalid value for \"endpoint_uid\", must conform to the pattern #{pattern}.")
163
- end
164
-
165
- invalid_properties
166
- end
167
-
168
- # Check to see if the all the properties in the model are valid
169
- # @return true if the model is valid
170
- def valid?
171
- warn '[DEPRECATED] the `valid?` method is obsolete'
172
- return false if @app_id.nil?
173
- return false if @app_id.to_s.length > 31
174
- return false if @app_id.to_s.length < 31
175
- return false if @app_id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
176
- return false if !@app_uid.nil? && @app_uid.to_s.length > 256
177
- return false if !@app_uid.nil? && @app_uid.to_s.length < 1
178
- return false if !@app_uid.nil? && @app_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
179
- return false if @endpoint_id.nil?
180
- return false if @endpoint_id.to_s.length > 30
181
- return false if @endpoint_id.to_s.length < 30
182
- return false if @endpoint_id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
183
- return false if !@endpoint_uid.nil? && @endpoint_uid.to_s.length > 256
184
- return false if !@endpoint_uid.nil? && @endpoint_uid.to_s.length < 1
185
- return false if !@endpoint_uid.nil? && @endpoint_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
186
- true
187
- end
188
-
189
- # Custom attribute writer method with validation
190
- # @param [Object] app_id Value to be assigned
191
- def app_id=(app_id)
192
- if app_id.nil?
193
- fail ArgumentError, 'app_id cannot be nil'
194
- end
195
-
196
- if app_id.to_s.length > 31
197
- fail ArgumentError, 'invalid value for "app_id", the character length must be smaller than or equal to 31.'
198
- end
199
-
200
- if app_id.to_s.length < 31
201
- fail ArgumentError, 'invalid value for "app_id", the character length must be great than or equal to 31.'
202
- end
203
-
204
- pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
205
- if app_id !~ pattern
206
- fail ArgumentError, "invalid value for \"app_id\", must conform to the pattern #{pattern}."
207
- end
208
-
209
- @app_id = app_id
210
- end
211
-
212
- # Custom attribute writer method with validation
213
- # @param [Object] app_uid Value to be assigned
214
- def app_uid=(app_uid)
215
- if !app_uid.nil? && app_uid.to_s.length > 256
216
- fail ArgumentError, 'invalid value for "app_uid", the character length must be smaller than or equal to 256.'
217
- end
218
-
219
- if !app_uid.nil? && app_uid.to_s.length < 1
220
- fail ArgumentError, 'invalid value for "app_uid", the character length must be great than or equal to 1.'
221
- end
222
-
223
- pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
224
- if !app_uid.nil? && app_uid !~ pattern
225
- fail ArgumentError, "invalid value for \"app_uid\", must conform to the pattern #{pattern}."
226
- end
227
-
228
- @app_uid = app_uid
229
- end
230
-
231
- # Custom attribute writer method with validation
232
- # @param [Object] endpoint_id Value to be assigned
233
- def endpoint_id=(endpoint_id)
234
- if endpoint_id.nil?
235
- fail ArgumentError, 'endpoint_id cannot be nil'
236
- end
237
-
238
- if endpoint_id.to_s.length > 30
239
- fail ArgumentError, 'invalid value for "endpoint_id", the character length must be smaller than or equal to 30.'
240
- end
241
-
242
- if endpoint_id.to_s.length < 30
243
- fail ArgumentError, 'invalid value for "endpoint_id", the character length must be great than or equal to 30.'
244
- end
245
-
246
- pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
247
- if endpoint_id !~ pattern
248
- fail ArgumentError, "invalid value for \"endpoint_id\", must conform to the pattern #{pattern}."
249
- end
250
-
251
- @endpoint_id = endpoint_id
252
- end
253
-
254
- # Custom attribute writer method with validation
255
- # @param [Object] endpoint_uid Value to be assigned
256
- def endpoint_uid=(endpoint_uid)
257
- if !endpoint_uid.nil? && endpoint_uid.to_s.length > 256
258
- fail ArgumentError, 'invalid value for "endpoint_uid", the character length must be smaller than or equal to 256.'
259
- end
260
-
261
- if !endpoint_uid.nil? && endpoint_uid.to_s.length < 1
262
- fail ArgumentError, 'invalid value for "endpoint_uid", the character length must be great than or equal to 1.'
263
- end
264
-
265
- pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
266
- if !endpoint_uid.nil? && endpoint_uid !~ pattern
267
- fail ArgumentError, "invalid value for \"endpoint_uid\", must conform to the pattern #{pattern}."
268
- end
269
-
270
- @endpoint_uid = endpoint_uid
271
- end
272
-
273
- # Checks equality by comparing each attribute.
274
- # @param [Object] Object to be compared
275
- def ==(o)
276
- return true if self.equal?(o)
277
- self.class == o.class &&
278
- app_id == o.app_id &&
279
- app_uid == o.app_uid &&
280
- endpoint_id == o.endpoint_id &&
281
- endpoint_uid == o.endpoint_uid
282
- end
283
-
284
- # @see the `==` method
285
- # @param [Object] Object to be compared
286
- def eql?(o)
287
- self == o
288
- end
289
-
290
- # Calculates hash code according to all attributes.
291
- # @return [Integer] Hash code
292
- def hash
293
- [app_id, app_uid, endpoint_id, endpoint_uid].hash
294
- end
295
-
296
- # Builds the object from hash
297
- # @param [Hash] attributes Model attributes in the form of hash
298
- # @return [Object] Returns the model itself
299
- def self.build_from_hash(attributes)
300
- return nil unless attributes.is_a?(Hash)
301
- attributes = attributes.transform_keys(&:to_sym)
302
- transformed_hash = {}
303
- openapi_types.each_pair do |key, type|
304
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
305
- transformed_hash["#{key}"] = nil
306
- elsif type =~ /\AArray<(.*)>/i
307
- # check to ensure the input is an array given that the attribute
308
- # is documented as an array but the input is not
309
- if attributes[attribute_map[key]].is_a?(Array)
310
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
311
- end
312
- elsif !attributes[attribute_map[key]].nil?
313
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
314
- end
315
- end
316
- new(transformed_hash)
317
- end
318
-
319
- # Deserializes the data based on type
320
- # @param string type Data type
321
- # @param string value Value to be deserialized
322
- # @return [Object] Deserialized data
323
- def self._deserialize(type, value)
324
- case type.to_sym
325
- when :Time
326
- Time.parse(value)
327
- when :Date
328
- Date.parse(value)
329
- when :String
330
- value.to_s
331
- when :Integer
332
- value.to_i
333
- when :Float
334
- value.to_f
335
- when :Boolean
336
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
337
- true
338
- else
339
- false
340
- end
341
- when :Object
342
- # generic object (usually a Hash), return directly
343
- value
344
- when /\AArray<(?<inner_type>.+)>\z/
345
- inner_type = Regexp.last_match[:inner_type]
346
- value.map { |v| _deserialize(inner_type, v) }
347
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
348
- k_type = Regexp.last_match[:k_type]
349
- v_type = Regexp.last_match[:v_type]
350
- {}.tap do |hash|
351
- value.each do |k, v|
352
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
353
- end
354
- end
355
- else # model
356
- # models (e.g. Pet) or oneOf
357
- klass = Svix.const_get(type)
358
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
359
- end
360
- end
361
-
362
- # Returns the string representation of the object
363
- # @return [String] String presentation of the object
364
- def to_s
365
- to_hash.to_s
366
- end
367
-
368
- # to_body is an alias to to_hash (backward compatibility)
369
- # @return [Hash] Returns the object in the form of hash
370
- def to_body
371
- to_hash
372
- end
373
-
374
- # Returns the object in the form of hash
375
- # @return [Hash] Returns the object in the form of hash
376
- def to_hash
377
- hash = {}
378
- self.class.attribute_map.each_pair do |attr, param|
379
- value = self.send(attr)
380
- if value.nil?
381
- is_nullable = self.class.openapi_nullable.include?(attr)
382
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
383
- end
384
-
385
- hash[param] = _to_hash(value)
386
- end
387
- hash
388
- end
389
-
390
- # Outputs non-array value in the form of hash
391
- # For object, use to_hash. Otherwise, just return the value
392
- # @param [Object] value Any valid value
393
- # @return [Hash] Returns the value in the form of hash
394
- def _to_hash(value)
395
- if value.is_a?(Array)
396
- value.compact.map { |v| _to_hash(v) }
397
- elsif value.is_a?(Hash)
398
- {}.tap do |hash|
399
- value.each { |k, v| hash[k] = _to_hash(v) }
400
- end
401
- elsif value.respond_to? :to_hash
402
- value.to_hash
403
- else
404
- value
405
- end
406
- end
407
-
408
- end
409
-
410
- end