svix 1.60.1 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -1
  3. data/Gemfile.lock +35 -21
  4. data/README.md +0 -7
  5. data/lib/svix/api/application.rb +96 -0
  6. data/lib/svix/api/authentication.rb +65 -0
  7. data/lib/svix/api/background_task.rb +39 -0
  8. data/lib/svix/api/endpoint.rb +202 -0
  9. data/lib/svix/api/environment.rb +39 -0
  10. data/lib/svix/api/event_type.rb +99 -0
  11. data/lib/svix/api/health.rb +21 -0
  12. data/lib/svix/api/integration.rb +91 -0
  13. data/lib/svix/api/message.rb +112 -0
  14. data/lib/svix/api/message_attempt.rb +123 -0
  15. data/lib/svix/api/operational_webhook_endpoint.rb +109 -0
  16. data/lib/svix/api/statistics.rb +36 -0
  17. data/lib/svix/api_error.rb +7 -17
  18. data/lib/svix/errors.rb +9 -9
  19. data/lib/svix/http_error_out.rb +18 -0
  20. data/lib/svix/http_validation_error.rb +18 -0
  21. data/lib/svix/internal.rb +0 -9
  22. data/lib/svix/models/aggregate_event_types_out.rb +32 -292
  23. data/lib/svix/models/app_portal_access_in.rb +31 -278
  24. data/lib/svix/models/app_portal_access_out.rb +27 -243
  25. data/lib/svix/models/app_usage_stats_in.rb +30 -234
  26. data/lib/svix/models/app_usage_stats_out.rb +31 -320
  27. data/lib/svix/models/application_in.rb +31 -298
  28. data/lib/svix/models/application_out.rb +37 -371
  29. data/lib/svix/models/application_patch.rb +31 -272
  30. data/lib/svix/models/application_token_expire_in.rb +28 -219
  31. data/lib/svix/models/background_task_out.rb +31 -307
  32. data/lib/svix/models/background_task_status.rb +14 -25
  33. data/lib/svix/models/background_task_type.rb +23 -26
  34. data/lib/svix/models/connector_in.rb +58 -385
  35. data/lib/svix/models/connector_kind.rb +28 -26
  36. data/lib/svix/models/dashboard_access_out.rb +27 -243
  37. data/lib/svix/models/endpoint_headers_in.rb +25 -202
  38. data/lib/svix/models/endpoint_headers_out.rb +30 -230
  39. data/lib/svix/models/endpoint_headers_patch_in.rb +28 -202
  40. data/lib/svix/models/endpoint_in.rb +61 -449
  41. data/lib/svix/models/endpoint_message_out.rb +48 -467
  42. data/lib/svix/models/endpoint_out.rb +67 -528
  43. data/lib/svix/models/endpoint_patch.rb +61 -383
  44. data/lib/svix/models/endpoint_secret_out.rb +25 -222
  45. data/lib/svix/models/endpoint_secret_rotate_in.rb +28 -212
  46. data/lib/svix/models/endpoint_stats.rb +31 -245
  47. data/lib/svix/models/endpoint_transformation_in.rb +30 -226
  48. data/lib/svix/models/endpoint_transformation_out.rb +30 -228
  49. data/lib/svix/models/endpoint_update.rb +58 -422
  50. data/lib/svix/models/environment_in.rb +31 -212
  51. data/lib/svix/models/environment_out.rb +35 -255
  52. data/lib/svix/models/event_example_in.rb +27 -261
  53. data/lib/svix/models/event_type_from_open_api.rb +35 -341
  54. data/lib/svix/models/event_type_import_open_api_in.rb +37 -228
  55. data/lib/svix/models/event_type_import_open_api_out.rb +28 -200
  56. data/lib/svix/models/event_type_import_open_api_out_data.rb +31 -211
  57. data/lib/svix/models/event_type_in.rb +37 -347
  58. data/lib/svix/models/event_type_out.rb +58 -389
  59. data/lib/svix/models/event_type_patch.rb +35 -289
  60. data/lib/svix/models/event_type_update.rb +35 -301
  61. data/lib/svix/models/expung_all_contents_out.rb +29 -292
  62. data/lib/svix/models/integration_in.rb +27 -239
  63. data/lib/svix/models/integration_key_out.rb +25 -200
  64. data/lib/svix/models/integration_out.rb +33 -324
  65. data/lib/svix/models/integration_update.rb +27 -239
  66. data/lib/svix/models/list_response_application_out.rb +34 -237
  67. data/lib/svix/models/list_response_background_task_out.rb +34 -237
  68. data/lib/svix/models/list_response_endpoint_message_out.rb +34 -237
  69. data/lib/svix/models/list_response_endpoint_out.rb +34 -237
  70. data/lib/svix/models/list_response_event_type_out.rb +34 -237
  71. data/lib/svix/models/list_response_integration_out.rb +34 -237
  72. data/lib/svix/models/list_response_message_attempt_out.rb +34 -237
  73. data/lib/svix/models/list_response_message_endpoint_out.rb +34 -237
  74. data/lib/svix/models/list_response_message_out.rb +34 -237
  75. data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +34 -237
  76. data/lib/svix/models/message_attempt_out.rb +64 -521
  77. data/lib/svix/models/message_attempt_trigger_type.rb +20 -28
  78. data/lib/svix/models/message_endpoint_out.rb +70 -557
  79. data/lib/svix/models/message_in.rb +58 -450
  80. data/lib/svix/models/message_out.rb +37 -414
  81. data/lib/svix/models/message_status.rb +24 -30
  82. data/lib/svix/models/operational_webhook_endpoint_headers_in.rb +28 -202
  83. data/lib/svix/models/operational_webhook_endpoint_headers_out.rb +30 -229
  84. data/lib/svix/models/operational_webhook_endpoint_in.rb +42 -380
  85. data/lib/svix/models/operational_webhook_endpoint_out.rb +64 -458
  86. data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +28 -212
  87. data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +28 -222
  88. data/lib/svix/models/operational_webhook_endpoint_update.rb +40 -353
  89. data/lib/svix/models/ordering.rb +15 -25
  90. data/lib/svix/models/recover_in.rb +28 -210
  91. data/lib/svix/models/recover_out.rb +29 -292
  92. data/lib/svix/models/replay_in.rb +28 -210
  93. data/lib/svix/models/replay_out.rb +29 -292
  94. data/lib/svix/models/status_code_class.rb +28 -32
  95. data/lib/svix/models/template_out.rb +70 -514
  96. data/lib/svix/svix.rb +50 -50
  97. data/lib/svix/svix_http_client.rb +110 -0
  98. data/lib/svix/util.rb +44 -25
  99. data/lib/svix/validation_error.rb +28 -0
  100. data/lib/svix/version.rb +1 -1
  101. data/lib/svix/webhook.rb +69 -65
  102. data/lib/svix.rb +51 -37
  103. data/svix.gemspec +1 -10
  104. metadata +22 -194
  105. data/lib/svix/api/application_api.rb +0 -772
  106. data/lib/svix/api/authentication_api.rb +0 -791
  107. data/lib/svix/api/background_tasks_api.rb +0 -191
  108. data/lib/svix/api/broadcast_api.rb +0 -93
  109. data/lib/svix/api/endpoint_api.rb +0 -2752
  110. data/lib/svix/api/environment_api.rb +0 -153
  111. data/lib/svix/api/environment_settings_api.rb +0 -79
  112. data/lib/svix/api/event_type_api.rb +0 -852
  113. data/lib/svix/api/events_api.rb +0 -102
  114. data/lib/svix/api/health_api.rb +0 -79
  115. data/lib/svix/api/inbound_api.rb +0 -209
  116. data/lib/svix/api/integration_api.rb +0 -707
  117. data/lib/svix/api/message_api.rb +0 -1192
  118. data/lib/svix/api/message_attempt_api.rb +0 -1245
  119. data/lib/svix/api/statistics_api.rb +0 -333
  120. data/lib/svix/api/stream_api.rb +0 -659
  121. data/lib/svix/api/stream_event_types_api.rb +0 -486
  122. data/lib/svix/api/transformation_template_api.rb +0 -967
  123. data/lib/svix/api/webhook_endpoint_api.rb +0 -748
  124. data/lib/svix/api_client.rb +0 -423
  125. data/lib/svix/application_api.rb +0 -35
  126. data/lib/svix/authentication_api.rb +0 -21
  127. data/lib/svix/background_tasks_api.rb +0 -17
  128. data/lib/svix/configuration.rb +0 -312
  129. data/lib/svix/endpoint_api.rb +0 -80
  130. data/lib/svix/event_type_api.rb +0 -37
  131. data/lib/svix/integration_api.rb +0 -38
  132. data/lib/svix/message_api.rb +0 -54
  133. data/lib/svix/message_attempt_api.rb +0 -51
  134. data/lib/svix/models/active_application_out.rb +0 -373
  135. data/lib/svix/models/active_endpoint_out.rb +0 -355
  136. data/lib/svix/models/aggregated_event_types.rb +0 -305
  137. data/lib/svix/models/application_message_failure.rb +0 -277
  138. data/lib/svix/models/application_message_id_pair.rb +0 -317
  139. data/lib/svix/models/application_stats.rb +0 -323
  140. data/lib/svix/models/application_stats_out.rb +0 -324
  141. data/lib/svix/models/attempt_statistics_data.rb +0 -229
  142. data/lib/svix/models/attempt_statistics_response.rb +0 -291
  143. data/lib/svix/models/auth_token_out.rb +0 -325
  144. data/lib/svix/models/azure_blob_storage_config.rb +0 -253
  145. data/lib/svix/models/background_task_finished_event.rb +0 -272
  146. data/lib/svix/models/background_task_finished_event2.rb +0 -331
  147. data/lib/svix/models/big_query_config.rb +0 -271
  148. data/lib/svix/models/border_radius_config.rb +0 -254
  149. data/lib/svix/models/border_radius_enum.rb +0 -43
  150. data/lib/svix/models/client_secret_jwt_params_in.rb +0 -297
  151. data/lib/svix/models/completion_choice.rb +0 -253
  152. data/lib/svix/models/completion_message.rb +0 -237
  153. data/lib/svix/models/count_out.rb +0 -258
  154. data/lib/svix/models/create_stream_in.rb +0 -232
  155. data/lib/svix/models/create_token_in.rb +0 -248
  156. data/lib/svix/models/custom_color_palette.rb +0 -295
  157. data/lib/svix/models/custom_strings_override.rb +0 -235
  158. data/lib/svix/models/custom_theme_override.rb +0 -223
  159. data/lib/svix/models/data.rb +0 -108
  160. data/lib/svix/models/data_any_of.rb +0 -240
  161. data/lib/svix/models/data_any_of1.rb +0 -223
  162. data/lib/svix/models/data_any_of2.rb +0 -241
  163. data/lib/svix/models/data_any_of3.rb +0 -223
  164. data/lib/svix/models/data_any_of4.rb +0 -240
  165. data/lib/svix/models/duration.rb +0 -275
  166. data/lib/svix/models/endpoint_created_event.rb +0 -272
  167. data/lib/svix/models/endpoint_created_event_data.rb +0 -410
  168. data/lib/svix/models/endpoint_deleted_event.rb +0 -272
  169. data/lib/svix/models/endpoint_deleted_event_data.rb +0 -410
  170. data/lib/svix/models/endpoint_disabled_event.rb +0 -272
  171. data/lib/svix/models/endpoint_disabled_event_data.rb +0 -451
  172. data/lib/svix/models/endpoint_disabled_trigger.rb +0 -40
  173. data/lib/svix/models/endpoint_enabled_event.rb +0 -272
  174. data/lib/svix/models/endpoint_enabled_event_data.rb +0 -410
  175. data/lib/svix/models/endpoint_mtls_config_in.rb +0 -233
  176. data/lib/svix/models/endpoint_mtls_config_out.rb +0 -215
  177. data/lib/svix/models/endpoint_oauth_config_in.rb +0 -350
  178. data/lib/svix/models/endpoint_oauth_config_out.rb +0 -315
  179. data/lib/svix/models/endpoint_transformation_simulate_in.rb +0 -330
  180. data/lib/svix/models/endpoint_transformation_simulate_out.rb +0 -296
  181. data/lib/svix/models/endpoint_updated_event.rb +0 -272
  182. data/lib/svix/models/endpoint_updated_event_data.rb +0 -410
  183. data/lib/svix/models/environment_settings_out.rb +0 -455
  184. data/lib/svix/models/event_in.rb +0 -258
  185. data/lib/svix/models/event_out.rb +0 -274
  186. data/lib/svix/models/event_stream_out.rb +0 -255
  187. data/lib/svix/models/event_type_example_out.rb +0 -221
  188. data/lib/svix/models/event_type_schema_in.rb +0 -221
  189. data/lib/svix/models/export_event_type_out.rb +0 -315
  190. data/lib/svix/models/font_size_config.rb +0 -230
  191. data/lib/svix/models/generate_in.rb +0 -221
  192. data/lib/svix/models/generate_out.rb +0 -287
  193. data/lib/svix/models/google_cloud_storage_config.rb +0 -239
  194. data/lib/svix/models/http_error_out.rb +0 -237
  195. data/lib/svix/models/http_validation_error.rb +0 -223
  196. data/lib/svix/models/hubspot_oauth_config_in.rb +0 -221
  197. data/lib/svix/models/inbound_path_params.rb +0 -277
  198. data/lib/svix/models/incoming_webhook_payload_out.rb +0 -235
  199. data/lib/svix/models/kafka_security_protocol_type.rb +0 -41
  200. data/lib/svix/models/list_response_active_application_out.rb +0 -261
  201. data/lib/svix/models/list_response_application_stats.rb +0 -261
  202. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +0 -261
  203. data/lib/svix/models/list_response_sink_out.rb +0 -261
  204. data/lib/svix/models/list_response_stream_event_type_out.rb +0 -261
  205. data/lib/svix/models/list_response_stream_out.rb +0 -261
  206. data/lib/svix/models/list_response_stream_sink_out.rb +0 -261
  207. data/lib/svix/models/list_response_template_out.rb +0 -261
  208. data/lib/svix/models/message_attempt_endpoint_out.rb +0 -545
  209. data/lib/svix/models/message_attempt_exhausted_event.rb +0 -272
  210. data/lib/svix/models/message_attempt_exhausted_event_data.rb +0 -482
  211. data/lib/svix/models/message_attempt_failed_data.rb +0 -293
  212. data/lib/svix/models/message_attempt_failing_event.rb +0 -272
  213. data/lib/svix/models/message_attempt_failing_event_data.rb +0 -482
  214. data/lib/svix/models/message_attempt_headers_out.rb +0 -263
  215. data/lib/svix/models/message_attempt_recovered_event.rb +0 -272
  216. data/lib/svix/models/message_attempt_recovered_event_data.rb +0 -482
  217. data/lib/svix/models/message_broadcast_in.rb +0 -423
  218. data/lib/svix/models/message_broadcast_out.rb +0 -315
  219. data/lib/svix/models/message_events_out.rb +0 -255
  220. data/lib/svix/models/message_precheck_in.rb +0 -288
  221. data/lib/svix/models/message_precheck_out.rb +0 -221
  222. data/lib/svix/models/message_raw_payload_out.rb +0 -221
  223. data/lib/svix/models/message_subscriber_auth_token_out.rb +0 -237
  224. data/lib/svix/models/o_auth_payload_in.rb +0 -237
  225. data/lib/svix/models/o_auth_payload_out.rb +0 -235
  226. data/lib/svix/models/oauth2_auth_method_in_out.rb +0 -41
  227. data/lib/svix/models/oauth2_grant_type_in_out.rb +0 -40
  228. data/lib/svix/models/oauth_jws_signing_algorithm.rb +0 -39
  229. data/lib/svix/models/one_time_token_in.rb +0 -221
  230. data/lib/svix/models/one_time_token_out.rb +0 -221
  231. data/lib/svix/models/polling_endpoint_message_out.rb +0 -454
  232. data/lib/svix/models/polling_endpoint_out.rb +0 -255
  233. data/lib/svix/models/redshift_config.rb +0 -317
  234. data/lib/svix/models/retry_schedule_in_out.rb +0 -216
  235. data/lib/svix/models/rotate_poller_token_in.rb +0 -280
  236. data/lib/svix/models/rotated_url_out.rb +0 -221
  237. data/lib/svix/models/s3_config.rb +0 -269
  238. data/lib/svix/models/sink_http_config.rb +0 -242
  239. data/lib/svix/models/sink_in.rb +0 -108
  240. data/lib/svix/models/sink_in_one_of.rb +0 -287
  241. data/lib/svix/models/sink_in_one_of1.rb +0 -319
  242. data/lib/svix/models/sink_in_one_of2.rb +0 -325
  243. data/lib/svix/models/sink_in_one_of3.rb +0 -271
  244. data/lib/svix/models/sink_in_one_of4.rb +0 -255
  245. data/lib/svix/models/sink_otel_v1_config.rb +0 -221
  246. data/lib/svix/models/sink_out.rb +0 -108
  247. data/lib/svix/models/sink_payload_format.rb +0 -39
  248. data/lib/svix/models/sink_secret_out.rb +0 -233
  249. data/lib/svix/models/sink_status.rb +0 -41
  250. data/lib/svix/models/sink_status_in.rb +0 -40
  251. data/lib/svix/models/sink_transform_in.rb +0 -248
  252. data/lib/svix/models/sink_transformation_out.rb +0 -226
  253. data/lib/svix/models/snowflake_config.rb +0 -287
  254. data/lib/svix/models/statistics_period.rb +0 -40
  255. data/lib/svix/models/stream_event_type_in.rb +0 -262
  256. data/lib/svix/models/stream_event_type_out.rb +0 -294
  257. data/lib/svix/models/stream_event_type_patch.rb +0 -254
  258. data/lib/svix/models/stream_in.rb +0 -287
  259. data/lib/svix/models/stream_out.rb +0 -350
  260. data/lib/svix/models/stream_patch.rb +0 -261
  261. data/lib/svix/models/stream_portal_access_in.rb +0 -293
  262. data/lib/svix/models/stream_sink_in.rb +0 -111
  263. data/lib/svix/models/stream_sink_in_one_of.rb +0 -271
  264. data/lib/svix/models/stream_sink_in_one_of1.rb +0 -271
  265. data/lib/svix/models/stream_sink_in_one_of2.rb +0 -271
  266. data/lib/svix/models/stream_sink_in_one_of3.rb +0 -271
  267. data/lib/svix/models/stream_sink_in_one_of4.rb +0 -271
  268. data/lib/svix/models/stream_sink_in_one_of5.rb +0 -271
  269. data/lib/svix/models/stream_sink_in_one_of6.rb +0 -271
  270. data/lib/svix/models/stream_sink_in_one_of7.rb +0 -271
  271. data/lib/svix/models/stream_sink_out.rb +0 -111
  272. data/lib/svix/models/stream_sink_patch.rb +0 -111
  273. data/lib/svix/models/template_patch.rb +0 -382
  274. data/lib/svix/models/template_update.rb +0 -402
  275. data/lib/svix/models/transformation_http_method.rb +0 -41
  276. data/lib/svix/models/transformation_simulate_in.rb +0 -330
  277. data/lib/svix/models/transformation_simulate_out.rb +0 -296
  278. data/lib/svix/models/validation_error.rb +0 -259
  279. data/lib/svix/statistics_api.rb +0 -17
@@ -1,407 +1,80 @@
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 ConnectorIn
18
7
  attr_accessor :description
19
-
20
8
  attr_accessor :feature_flag
21
-
22
9
  attr_accessor :filter_types
23
-
24
10
  attr_accessor :instructions
25
-
26
11
  attr_accessor :instructions_link
27
-
28
12
  attr_accessor :kind
29
-
30
13
  attr_accessor :logo
31
-
32
14
  attr_accessor :name
33
-
34
15
  attr_accessor :transformation
35
16
 
36
- class EnumAttributeValidator
37
- attr_reader :datatype
38
- attr_reader :allowable_values
17
+ ALL_FIELD ||= [
18
+ "description",
19
+ "feature_flag",
20
+ "filter_types",
21
+ "instructions",
22
+ "instructions_link",
23
+ "kind",
24
+ "logo",
25
+ "name",
26
+ "transformation"
27
+ ].freeze
28
+ private_constant :ALL_FIELD
39
29
 
40
- def initialize(datatype, allowable_values)
41
- @allowable_values = allowable_values.map do |value|
42
- case datatype.to_s
43
- when /Integer/i
44
- value.to_i
45
- when /Float/i
46
- value.to_f
47
- else
48
- value
49
- end
50
- end
51
- end
52
-
53
- def valid?(value)
54
- !value || allowable_values.include?(value)
55
- end
56
- end
57
-
58
- # Attribute mapping from ruby-style variable name to JSON key.
59
- def self.attribute_map
60
- {
61
- :'description' => :'description',
62
- :'feature_flag' => :'featureFlag',
63
- :'filter_types' => :'filterTypes',
64
- :'instructions' => :'instructions',
65
- :'instructions_link' => :'instructionsLink',
66
- :'kind' => :'kind',
67
- :'logo' => :'logo',
68
- :'name' => :'name',
69
- :'transformation' => :'transformation'
70
- }
71
- end
72
-
73
- # Returns all the JSON keys this model knows about
74
- def self.acceptable_attributes
75
- attribute_map.values
76
- end
77
-
78
- # Attribute type mapping.
79
- def self.openapi_types
80
- {
81
- :'description' => :'String',
82
- :'feature_flag' => :'String',
83
- :'filter_types' => :'Array<String>',
84
- :'instructions' => :'String',
85
- :'instructions_link' => :'String',
86
- :'kind' => :'ConnectorKind',
87
- :'logo' => :'String',
88
- :'name' => :'String',
89
- :'transformation' => :'String'
90
- }
91
- end
92
-
93
- # List of attributes with nullable: true
94
- def self.openapi_nullable
95
- Set.new([
96
- :'feature_flag',
97
- :'filter_types',
98
- :'instructions_link',
99
- ])
100
- end
101
-
102
- # Initializes the object
103
- # @param [Hash] attributes Model attributes in the form of hash
104
30
  def initialize(attributes = {})
105
- if (!attributes.is_a?(Hash))
106
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ConnectorIn` initialize method"
31
+ unless attributes.is_a?(Hash)
32
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::ConnectorIn` new method")
107
33
  end
108
34
 
109
- # check to see if the attribute exists and convert string to symbol for hash key
110
- attributes = attributes.each_with_object({}) { |(k, v), h|
111
- if (!self.class.attribute_map.key?(k.to_sym))
112
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ConnectorIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
35
+ attributes.each do |k, v|
36
+ unless ALL_FIELD.include?(k.to_s)
37
+ fail(ArgumentError, "The field #{k} is not part of Svix::ConnectorIn")
113
38
  end
114
- h[k.to_sym] = v
115
- }
116
-
117
- if attributes.key?(:'description')
118
- self.description = attributes[:'description']
119
- else
120
- self.description = ''
121
- end
122
39
 
123
- if attributes.key?(:'feature_flag')
124
- self.feature_flag = attributes[:'feature_flag']
125
- end
126
-
127
- if attributes.key?(:'filter_types')
128
- if (value = attributes[:'filter_types']).is_a?(Array)
129
- self.filter_types = value
130
- end
131
- end
132
-
133
- if attributes.key?(:'instructions')
134
- self.instructions = attributes[:'instructions']
135
- else
136
- self.instructions = ''
137
- end
138
-
139
- if attributes.key?(:'instructions_link')
140
- self.instructions_link = attributes[:'instructions_link']
141
- end
142
-
143
- if attributes.key?(:'kind')
144
- self.kind = attributes[:'kind']
145
- end
146
-
147
- if attributes.key?(:'logo')
148
- self.logo = attributes[:'logo']
149
- else
150
- self.logo = nil
151
- end
152
-
153
- if attributes.key?(:'name')
154
- self.name = attributes[:'name']
155
- else
156
- self.name = nil
157
- end
158
-
159
- if attributes.key?(:'transformation')
160
- self.transformation = attributes[:'transformation']
161
- else
162
- self.transformation = nil
163
- end
40
+ instance_variable_set("@#{k}", v)
41
+ instance_variable_set("@__#{k}_is_defined", true)
42
+ end
43
+ end
44
+
45
+ def self.deserialize(attributes = {})
46
+ attributes = attributes.transform_keys(&:to_s)
47
+ attrs = Hash.new
48
+ attrs["description"] = attributes["description"]
49
+ attrs["feature_flag"] = attributes["featureFlag"]
50
+ attrs["filter_types"] = attributes["filterTypes"]
51
+ attrs["instructions"] = attributes["instructions"]
52
+ attrs["instructions_link"] = attributes["instructionsLink"]
53
+ attrs["kind"] = Svix::ConnectorKind.deserialize(attributes["kind"]) if attributes["kind"]
54
+ attrs["logo"] = attributes["logo"]
55
+ attrs["name"] = attributes["name"]
56
+ attrs["transformation"] = attributes["transformation"]
57
+ new(attrs)
58
+ end
59
+
60
+ def serialize
61
+ out = Hash.new
62
+ out["description"] = Svix::serialize_primitive(@description) if @description
63
+ out["featureFlag"] = Svix::serialize_primitive(@feature_flag) if @feature_flag
64
+ out["filterTypes"] = Svix::serialize_primitive(@filter_types) if @filter_types
65
+ out["instructions"] = Svix::serialize_primitive(@instructions) if @instructions
66
+ out["instructionsLink"] = Svix::serialize_primitive(@instructions_link) if @instructions_link
67
+ out["kind"] = @kind.serialize if @kind
68
+ out["logo"] = Svix::serialize_primitive(@logo) if @logo
69
+ out["name"] = Svix::serialize_primitive(@name) if @name
70
+ out["transformation"] = Svix::serialize_primitive(@transformation) if @transformation
71
+ out
72
+ end
73
+
74
+ # Serializes the object to a json string
75
+ # @return String
76
+ def to_json
77
+ JSON.dump(serialize)
164
78
  end
165
-
166
- # Show invalid properties with the reasons. Usually used together with valid?
167
- # @return Array for valid properties with the reasons
168
- def list_invalid_properties
169
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
170
- invalid_properties = Array.new
171
- if !@feature_flag.nil? && @feature_flag.to_s.length > 256
172
- invalid_properties.push('invalid value for "feature_flag", the character length must be smaller than or equal to 256.')
173
- end
174
-
175
- pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
176
- if !@feature_flag.nil? && @feature_flag !~ pattern
177
- invalid_properties.push("invalid value for \"feature_flag\", must conform to the pattern #{pattern}.")
178
- end
179
-
180
- if !@filter_types.nil? && @filter_types.length < 1
181
- invalid_properties.push('invalid value for "filter_types", number of items must be greater than or equal to 1.')
182
- end
183
-
184
- if @logo.nil?
185
- invalid_properties.push('invalid value for "logo", logo cannot be nil.')
186
- end
187
-
188
- if @name.nil?
189
- invalid_properties.push('invalid value for "name", name cannot be nil.')
190
- end
191
-
192
- if @transformation.nil?
193
- invalid_properties.push('invalid value for "transformation", transformation cannot be nil.')
194
- end
195
-
196
- if @transformation.to_s.length > 51200
197
- invalid_properties.push('invalid value for "transformation", the character length must be smaller than or equal to 51200.')
198
- end
199
-
200
- if @transformation.to_s.length < 10
201
- invalid_properties.push('invalid value for "transformation", the character length must be great than or equal to 10.')
202
- end
203
-
204
- invalid_properties
205
- end
206
-
207
- # Check to see if the all the properties in the model are valid
208
- # @return true if the model is valid
209
- def valid?
210
- warn '[DEPRECATED] the `valid?` method is obsolete'
211
- return false if !@feature_flag.nil? && @feature_flag.to_s.length > 256
212
- return false if !@feature_flag.nil? && @feature_flag !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
213
- return false if !@filter_types.nil? && @filter_types.length < 1
214
- return false if @logo.nil?
215
- return false if @name.nil?
216
- return false if @transformation.nil?
217
- return false if @transformation.to_s.length > 51200
218
- return false if @transformation.to_s.length < 10
219
- true
220
- end
221
-
222
- # Custom attribute writer method with validation
223
- # @param [Object] feature_flag Value to be assigned
224
- def feature_flag=(feature_flag)
225
- if !feature_flag.nil? && feature_flag.to_s.length > 256
226
- fail ArgumentError, 'invalid value for "feature_flag", the character length must be smaller than or equal to 256.'
227
- end
228
-
229
- pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
230
- if !feature_flag.nil? && feature_flag !~ pattern
231
- fail ArgumentError, "invalid value for \"feature_flag\", must conform to the pattern #{pattern}."
232
- end
233
-
234
- @feature_flag = feature_flag
235
- end
236
-
237
- # Custom attribute writer method with validation
238
- # @param [Object] filter_types Value to be assigned
239
- def filter_types=(filter_types)
240
- if !filter_types.nil? && filter_types.length < 1
241
- fail ArgumentError, 'invalid value for "filter_types", number of items must be greater than or equal to 1.'
242
- end
243
-
244
- @filter_types = filter_types
245
- end
246
-
247
- # Custom attribute writer method with validation
248
- # @param [Object] transformation Value to be assigned
249
- def transformation=(transformation)
250
- if transformation.nil?
251
- fail ArgumentError, 'transformation cannot be nil'
252
- end
253
-
254
- if transformation.to_s.length > 51200
255
- fail ArgumentError, 'invalid value for "transformation", the character length must be smaller than or equal to 51200.'
256
- end
257
-
258
- if transformation.to_s.length < 10
259
- fail ArgumentError, 'invalid value for "transformation", the character length must be great than or equal to 10.'
260
- end
261
-
262
- @transformation = transformation
263
- end
264
-
265
- # Checks equality by comparing each attribute.
266
- # @param [Object] Object to be compared
267
- def ==(o)
268
- return true if self.equal?(o)
269
- self.class == o.class &&
270
- description == o.description &&
271
- feature_flag == o.feature_flag &&
272
- filter_types == o.filter_types &&
273
- instructions == o.instructions &&
274
- instructions_link == o.instructions_link &&
275
- kind == o.kind &&
276
- logo == o.logo &&
277
- name == o.name &&
278
- transformation == o.transformation
279
- end
280
-
281
- # @see the `==` method
282
- # @param [Object] Object to be compared
283
- def eql?(o)
284
- self == o
285
- end
286
-
287
- # Calculates hash code according to all attributes.
288
- # @return [Integer] Hash code
289
- def hash
290
- [description, feature_flag, filter_types, instructions, instructions_link, kind, logo, name, transformation].hash
291
- end
292
-
293
- # Builds the object from hash
294
- # @param [Hash] attributes Model attributes in the form of hash
295
- # @return [Object] Returns the model itself
296
- def self.build_from_hash(attributes)
297
- return nil unless attributes.is_a?(Hash)
298
- attributes = attributes.transform_keys(&:to_sym)
299
- transformed_hash = {}
300
- openapi_types.each_pair do |key, type|
301
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
302
- transformed_hash["#{key}"] = nil
303
- elsif type =~ /\AArray<(.*)>/i
304
- # check to ensure the input is an array given that the attribute
305
- # is documented as an array but the input is not
306
- if attributes[attribute_map[key]].is_a?(Array)
307
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
308
- end
309
- elsif !attributes[attribute_map[key]].nil?
310
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
311
- end
312
- end
313
- new(transformed_hash)
314
- end
315
-
316
- # Deserializes the data based on type
317
- # @param string type Data type
318
- # @param string value Value to be deserialized
319
- # @return [Object] Deserialized data
320
- def self._deserialize(type, value)
321
- case type.to_sym
322
- when :Time
323
- Time.parse(value)
324
- when :Date
325
- Date.parse(value)
326
- when :String
327
- value.to_s
328
- when :Integer
329
- value.to_i
330
- when :Float
331
- value.to_f
332
- when :Boolean
333
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
334
- true
335
- else
336
- false
337
- end
338
- when :Object
339
- # generic object (usually a Hash), return directly
340
- value
341
- when /\AArray<(?<inner_type>.+)>\z/
342
- inner_type = Regexp.last_match[:inner_type]
343
- value.map { |v| _deserialize(inner_type, v) }
344
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
345
- k_type = Regexp.last_match[:k_type]
346
- v_type = Regexp.last_match[:v_type]
347
- {}.tap do |hash|
348
- value.each do |k, v|
349
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
350
- end
351
- end
352
- else # model
353
- # models (e.g. Pet) or oneOf
354
- klass = Svix.const_get(type)
355
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
356
- end
357
- end
358
-
359
- # Returns the string representation of the object
360
- # @return [String] String presentation of the object
361
- def to_s
362
- to_hash.to_s
363
- end
364
-
365
- # to_body is an alias to to_hash (backward compatibility)
366
- # @return [Hash] Returns the object in the form of hash
367
- def to_body
368
- to_hash
369
- end
370
-
371
- # Returns the object in the form of hash
372
- # @return [Hash] Returns the object in the form of hash
373
- def to_hash
374
- hash = {}
375
- self.class.attribute_map.each_pair do |attr, param|
376
- value = self.send(attr)
377
- if value.nil?
378
- is_nullable = self.class.openapi_nullable.include?(attr)
379
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
380
- end
381
-
382
- hash[param] = _to_hash(value)
383
- end
384
- hash
385
- end
386
-
387
- # Outputs non-array value in the form of hash
388
- # For object, use to_hash. Otherwise, just return the value
389
- # @param [Object] value Any valid value
390
- # @return [Hash] Returns the value in the form of hash
391
- def _to_hash(value)
392
- if value.is_a?(Array)
393
- value.compact.map { |v| _to_hash(v) }
394
- elsif value.is_a?(Hash)
395
- {}.tap do |hash|
396
- value.each { |k, v| hash[k] = _to_hash(v) }
397
- end
398
- elsif value.respond_to? :to_hash
399
- value.to_hash
400
- else
401
- value
402
- end
403
- end
404
-
405
79
  end
406
-
407
80
  end
@@ -1,18 +1,5 @@
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
17
4
  class ConnectorKind
18
5
  CUSTOM = "Custom".freeze
@@ -29,22 +16,37 @@ module Svix
29
16
  ZAPIER = "Zapier".freeze
30
17
 
31
18
  def self.all_vars
32
- @all_vars ||= [CUSTOM, CUSTOMER_IO, DISCORD, HUBSPOT, INNGEST, SALESFORCE, SEGMENT, SLACK, TEAMS, TRIGGER_DEV, WINDMILL, ZAPIER].freeze
19
+ @all_vars ||= [
20
+ CUSTOM,
21
+ CUSTOMER_IO,
22
+ DISCORD,
23
+ HUBSPOT,
24
+ INNGEST,
25
+ SALESFORCE,
26
+ SEGMENT,
27
+ SLACK,
28
+ TEAMS,
29
+ TRIGGER_DEV,
30
+ WINDMILL,
31
+ ZAPIER
32
+ ].freeze
33
33
  end
34
34
 
35
- # Builds the enum from string
36
- # @param [String] The enum value in the form of the string
37
- # @return [String] The enum value
38
- def self.build_from_hash(value)
39
- new.build_from_hash(value)
35
+ def initialize(value)
36
+ unless ConnectorKind.all_vars.include?(value)
37
+ raise "Invalid ENUM value '#{value}' for class #ConnectorKind"
38
+ end
39
+
40
+ @value = value
40
41
  end
41
42
 
42
- # Builds the enum from string
43
- # @param [String] The enum value in the form of the string
44
- # @return [String] The enum value
45
- def build_from_hash(value)
43
+ def self.deserialize(value)
46
44
  return value if ConnectorKind.all_vars.include?(value)
47
- raise "Invalid ENUM value #{value} for class #ConnectorKind"
45
+ raise "Invalid ENUM value '#{value}' for class #ConnectorKind"
46
+ end
47
+
48
+ def serialize
49
+ @value
48
50
  end
49
51
  end
50
52
  end