svix 1.38.0 → 1.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -5
  3. data/README.md +8 -1
  4. data/lib/svix/api/application_api.rb +23 -14
  5. data/lib/svix/api/authentication_api.rb +23 -11
  6. data/lib/svix/api/background_tasks_api.rb +3 -3
  7. data/lib/svix/api/broadcast_api.rb +6 -3
  8. data/lib/svix/api/endpoint_api.rb +86 -44
  9. data/lib/svix/api/environment_api.rb +8 -5
  10. data/lib/svix/api/environment_settings_api.rb +2 -2
  11. data/lib/svix/api/event_type_api.rb +39 -21
  12. data/lib/svix/api/events_api.rb +2 -2
  13. data/lib/svix/api/health_api.rb +2 -2
  14. data/lib/svix/api/inbound_api.rb +7 -4
  15. data/lib/svix/api/integration_api.rb +16 -10
  16. data/lib/svix/api/message_api.rb +21 -15
  17. data/lib/svix/api/message_attempt_api.rb +25 -25
  18. data/lib/svix/api/sink_api.rb +7 -4
  19. data/lib/svix/api/statistics_api.rb +9 -6
  20. data/lib/svix/api/stream_api.rb +19 -10
  21. data/lib/svix/api/transformation_template_api.rb +49 -22
  22. data/lib/svix/api/webhook_endpoint_api.rb +572 -0
  23. data/lib/svix/api_client.rb +45 -28
  24. data/lib/svix/api_error.rb +2 -1
  25. data/lib/svix/configuration.rb +42 -12
  26. data/lib/svix/models/aggregate_event_types_out.rb +43 -19
  27. data/lib/svix/models/app_portal_access_in.rb +19 -19
  28. data/lib/svix/models/app_portal_access_out.rb +19 -19
  29. data/lib/svix/models/app_usage_stats_in.rb +19 -19
  30. data/lib/svix/models/app_usage_stats_out.rb +43 -19
  31. data/lib/svix/models/application_in.rb +17 -19
  32. data/lib/svix/models/application_out.rb +25 -19
  33. data/lib/svix/models/application_patch.rb +15 -19
  34. data/lib/svix/models/application_stats.rb +19 -19
  35. data/lib/svix/models/application_token_expire_in.rb +15 -19
  36. data/lib/svix/models/attempt_statistics_data.rb +15 -19
  37. data/lib/svix/models/attempt_statistics_response.rb +45 -19
  38. data/lib/svix/models/auth_token_out.rb +21 -19
  39. data/lib/svix/models/azure_blob_storage_config.rb +21 -19
  40. data/lib/svix/models/background_task_out.rb +45 -19
  41. data/lib/svix/models/background_task_status.rb +7 -4
  42. data/lib/svix/models/background_task_type.rb +7 -4
  43. data/lib/svix/models/big_query_config.rb +271 -0
  44. data/lib/svix/models/border_radius_config.rb +37 -19
  45. data/lib/svix/models/border_radius_enum.rb +7 -4
  46. data/lib/svix/models/client_secret_jwt_params_in.rb +41 -19
  47. data/lib/svix/models/completion_choice.rb +21 -19
  48. data/lib/svix/models/completion_message.rb +19 -19
  49. data/lib/svix/models/create_message_token_in.rb +17 -19
  50. data/lib/svix/models/create_stream_in.rb +30 -23
  51. data/lib/svix/models/custom_color_palette.rb +15 -19
  52. data/lib/svix/models/custom_strings_override.rb +15 -19
  53. data/lib/svix/models/custom_theme_override.rb +15 -19
  54. data/lib/svix/models/dashboard_access_out.rb +19 -19
  55. data/lib/svix/models/duration.rb +19 -19
  56. data/lib/svix/models/endpoint_created_event.rb +17 -19
  57. data/lib/svix/models/endpoint_created_event_data.rb +19 -19
  58. data/lib/svix/models/endpoint_deleted_event.rb +17 -19
  59. data/lib/svix/models/endpoint_deleted_event_data.rb +19 -19
  60. data/lib/svix/models/endpoint_disabled_event.rb +17 -19
  61. data/lib/svix/models/endpoint_disabled_event_data.rb +21 -19
  62. data/lib/svix/models/endpoint_headers_in.rb +17 -19
  63. data/lib/svix/models/endpoint_headers_out.rb +19 -19
  64. data/lib/svix/models/endpoint_headers_patch_in.rb +17 -19
  65. data/lib/svix/models/endpoint_in.rb +17 -19
  66. data/lib/svix/models/endpoint_message_out.rb +47 -19
  67. data/lib/svix/models/endpoint_mtls_config_in.rb +17 -19
  68. data/lib/svix/models/endpoint_oauth_config_in.rb +45 -19
  69. data/lib/svix/models/endpoint_out.rb +29 -19
  70. data/lib/svix/models/endpoint_patch.rb +20 -20
  71. data/lib/svix/models/endpoint_secret_out.rb +17 -19
  72. data/lib/svix/models/endpoint_secret_rotate_in.rb +15 -21
  73. data/lib/svix/models/endpoint_stats.rb +23 -19
  74. data/lib/svix/models/endpoint_transformation_in.rb +15 -19
  75. data/lib/svix/models/endpoint_transformation_out.rb +15 -19
  76. data/lib/svix/models/endpoint_transformation_simulate_in.rb +21 -19
  77. data/lib/svix/models/endpoint_transformation_simulate_out.rb +41 -19
  78. data/lib/svix/models/endpoint_update.rb +17 -19
  79. data/lib/svix/models/endpoint_updated_event.rb +17 -19
  80. data/lib/svix/models/endpoint_updated_event_data.rb +19 -19
  81. data/lib/svix/models/environment_in.rb +19 -19
  82. data/lib/svix/models/environment_out.rb +21 -19
  83. data/lib/svix/models/environment_settings_out.rb +15 -19
  84. data/lib/svix/models/event_example_in.rb +17 -19
  85. data/lib/svix/models/event_in.rb +17 -19
  86. data/lib/svix/models/event_out.rb +19 -19
  87. data/lib/svix/models/event_stream_out.rb +21 -19
  88. data/lib/svix/models/event_type_example_out.rb +17 -19
  89. data/lib/svix/models/event_type_from_open_api.rb +95 -20
  90. data/lib/svix/models/event_type_import_open_api_in.rb +15 -19
  91. data/lib/svix/models/event_type_import_open_api_out.rb +17 -19
  92. data/lib/svix/models/event_type_import_open_api_out_data.rb +17 -19
  93. data/lib/svix/models/event_type_in.rb +19 -19
  94. data/lib/svix/models/event_type_out.rb +25 -19
  95. data/lib/svix/models/event_type_patch.rb +15 -19
  96. data/lib/svix/models/event_type_schema_in.rb +17 -19
  97. data/lib/svix/models/event_type_update.rb +17 -19
  98. data/lib/svix/models/export_event_type_out.rb +43 -19
  99. data/lib/svix/models/font_size_config.rb +15 -19
  100. data/lib/svix/models/generate_in.rb +17 -19
  101. data/lib/svix/models/generate_out.rb +25 -19
  102. data/lib/svix/models/google_cloud_storage_config.rb +19 -19
  103. data/lib/svix/models/http_error_out.rb +19 -19
  104. data/lib/svix/models/http_validation_error.rb +17 -19
  105. data/lib/svix/models/hubspot_oauth_config_in.rb +17 -19
  106. data/lib/svix/models/inbound_path_params.rb +19 -19
  107. data/lib/svix/models/incoming_webhook_payload_out.rb +15 -19
  108. data/lib/svix/models/integration_in.rb +17 -19
  109. data/lib/svix/models/integration_key_out.rb +17 -19
  110. data/lib/svix/models/integration_out.rb +23 -19
  111. data/lib/svix/models/integration_update.rb +17 -19
  112. data/lib/svix/models/kafka_security_protocol_type.rb +7 -4
  113. data/lib/svix/models/list_response_application_out.rb +19 -19
  114. data/lib/svix/models/list_response_application_stats.rb +19 -19
  115. data/lib/svix/models/list_response_background_task_out.rb +19 -19
  116. data/lib/svix/models/list_response_endpoint_message_out.rb +19 -19
  117. data/lib/svix/models/list_response_endpoint_out.rb +19 -19
  118. data/lib/svix/models/list_response_event_type_out.rb +19 -19
  119. data/lib/svix/models/list_response_integration_out.rb +19 -19
  120. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +19 -19
  121. data/lib/svix/models/list_response_message_attempt_out.rb +19 -19
  122. data/lib/svix/models/list_response_message_endpoint_out.rb +19 -19
  123. data/lib/svix/models/list_response_message_out.rb +19 -19
  124. data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +259 -0
  125. data/lib/svix/models/list_response_sink_out.rb +19 -19
  126. data/lib/svix/models/list_response_stream_out.rb +19 -19
  127. data/lib/svix/models/list_response_stream_sink_out.rb +19 -19
  128. data/lib/svix/models/list_response_template_out.rb +19 -19
  129. data/lib/svix/models/message_attempt_endpoint_out.rb +57 -19
  130. data/lib/svix/models/message_attempt_exhausted_event.rb +17 -19
  131. data/lib/svix/models/message_attempt_exhausted_event_data.rb +23 -19
  132. data/lib/svix/models/message_attempt_failed_data.rb +21 -19
  133. data/lib/svix/models/message_attempt_failing_event.rb +17 -19
  134. data/lib/svix/models/message_attempt_failing_event_data.rb +23 -19
  135. data/lib/svix/models/message_attempt_headers_out.rb +19 -19
  136. data/lib/svix/models/message_attempt_out.rb +57 -19
  137. data/lib/svix/models/message_attempt_recovered_event.rb +17 -19
  138. data/lib/svix/models/message_attempt_recovered_event_data.rb +23 -19
  139. data/lib/svix/models/message_attempt_trigger_type.rb +7 -4
  140. data/lib/svix/models/message_broadcast_in.rb +19 -19
  141. data/lib/svix/models/message_broadcast_out.rb +43 -19
  142. data/lib/svix/models/message_endpoint_out.rb +51 -19
  143. data/lib/svix/models/message_events_out.rb +21 -19
  144. data/lib/svix/models/message_in.rb +19 -19
  145. data/lib/svix/models/message_out.rb +23 -19
  146. data/lib/svix/models/message_raw_payload_out.rb +17 -19
  147. data/lib/svix/models/message_status.rb +7 -4
  148. data/lib/svix/models/message_subscriber_auth_token_out.rb +19 -19
  149. data/lib/svix/models/o_auth_payload_in.rb +19 -19
  150. data/lib/svix/models/o_auth_payload_out.rb +15 -19
  151. data/lib/svix/models/oauth2_auth_method_in.rb +7 -4
  152. data/lib/svix/models/oauth2_grant_type_in.rb +7 -4
  153. data/lib/svix/models/oauth_jws_signing_algorithm.rb +7 -4
  154. data/lib/svix/models/one_time_token_in.rb +17 -19
  155. data/lib/svix/models/one_time_token_out.rb +17 -19
  156. data/lib/svix/models/operational_webhook_endpoint_in.rb +408 -0
  157. data/lib/svix/models/operational_webhook_endpoint_out.rb +442 -0
  158. data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +233 -0
  159. data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +243 -0
  160. data/lib/svix/models/operational_webhook_endpoint_update.rb +380 -0
  161. data/lib/svix/models/ordering.rb +7 -4
  162. data/lib/svix/models/recover_in.rb +17 -19
  163. data/lib/svix/models/recover_out.rb +43 -19
  164. data/lib/svix/models/redshift_config.rb +25 -19
  165. data/lib/svix/models/replay_in.rb +17 -19
  166. data/lib/svix/models/replay_out.rb +43 -19
  167. data/lib/svix/models/retry_schedule_in_out.rb +15 -19
  168. data/lib/svix/models/rotated_url_out.rb +17 -19
  169. data/lib/svix/models/s3_config.rb +23 -19
  170. data/lib/svix/models/settings_in.rb +15 -19
  171. data/lib/svix/models/settings_out.rb +15 -19
  172. data/lib/svix/models/sink_http_config.rb +17 -19
  173. data/lib/svix/models/sink_in.rb +4 -4
  174. data/lib/svix/models/sink_in_one_of.rb +21 -19
  175. data/lib/svix/models/sink_in_one_of1.rb +25 -19
  176. data/lib/svix/models/sink_in_one_of2.rb +23 -19
  177. data/lib/svix/models/sink_in_one_of3.rb +19 -19
  178. data/lib/svix/models/sink_otel_v1_config.rb +17 -19
  179. data/lib/svix/models/sink_out.rb +4 -4
  180. data/lib/svix/models/sink_payload_format.rb +7 -4
  181. data/lib/svix/models/sink_status.rb +7 -4
  182. data/lib/svix/models/sink_status_in.rb +7 -4
  183. data/lib/svix/models/sink_transform_in.rb +15 -19
  184. data/lib/svix/models/sink_transformation_out.rb +15 -19
  185. data/lib/svix/models/snowflake_config.rb +21 -19
  186. data/lib/svix/models/statistics_period.rb +7 -4
  187. data/lib/svix/models/status_code_class.rb +7 -4
  188. data/lib/svix/models/stream_in.rb +24 -22
  189. data/lib/svix/models/stream_out.rb +28 -22
  190. data/lib/svix/models/stream_patch.rb +22 -22
  191. data/lib/svix/models/stream_sink_in.rb +6 -5
  192. data/lib/svix/models/stream_sink_in_one_of.rb +19 -19
  193. data/lib/svix/models/stream_sink_in_one_of1.rb +19 -19
  194. data/lib/svix/models/stream_sink_in_one_of2.rb +19 -19
  195. data/lib/svix/models/stream_sink_in_one_of3.rb +19 -19
  196. data/lib/svix/models/stream_sink_in_one_of4.rb +19 -19
  197. data/lib/svix/models/stream_sink_in_one_of5.rb +19 -19
  198. data/lib/svix/models/stream_sink_in_one_of6.rb +19 -19
  199. data/lib/svix/models/stream_sink_in_one_of7.rb +271 -0
  200. data/lib/svix/models/stream_sink_out.rb +6 -5
  201. data/lib/svix/models/stream_sink_patch.rb +6 -5
  202. data/lib/svix/models/template_in.rb +43 -21
  203. data/lib/svix/models/template_out.rb +57 -19
  204. data/lib/svix/models/template_patch.rb +43 -21
  205. data/lib/svix/models/template_update.rb +41 -19
  206. data/lib/svix/models/transformation_http_method.rb +7 -4
  207. data/lib/svix/models/transformation_simulate_in.rb +21 -19
  208. data/lib/svix/models/transformation_simulate_out.rb +41 -19
  209. data/lib/svix/models/transformation_template_kind.rb +7 -4
  210. data/lib/svix/models/validation_error.rb +21 -19
  211. data/lib/svix/operational_webhook_endpoint_api.rb +37 -0
  212. data/lib/svix/version.rb +1 -1
  213. data/svix.gemspec +12 -2
  214. metadata +40 -21
@@ -0,0 +1,442 @@
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
+ class OperationalWebhookEndpointOut
18
+ attr_accessor :created_at
19
+
20
+ # An example endpoint name
21
+ attr_accessor :description
22
+
23
+ attr_accessor :disabled
24
+
25
+ attr_accessor :filter_types
26
+
27
+ # The ep's ID
28
+ attr_accessor :id
29
+
30
+ attr_accessor :metadata
31
+
32
+ attr_accessor :rate_limit
33
+
34
+ # Optional unique identifier for the endpoint
35
+ attr_accessor :uid
36
+
37
+ attr_accessor :updated_at
38
+
39
+ attr_accessor :url
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'created_at' => :'createdAt',
45
+ :'description' => :'description',
46
+ :'disabled' => :'disabled',
47
+ :'filter_types' => :'filterTypes',
48
+ :'id' => :'id',
49
+ :'metadata' => :'metadata',
50
+ :'rate_limit' => :'rateLimit',
51
+ :'uid' => :'uid',
52
+ :'updated_at' => :'updatedAt',
53
+ :'url' => :'url'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'created_at' => :'Time',
66
+ :'description' => :'String',
67
+ :'disabled' => :'Boolean',
68
+ :'filter_types' => :'Array<String>',
69
+ :'id' => :'String',
70
+ :'metadata' => :'Hash<String, String>',
71
+ :'rate_limit' => :'Integer',
72
+ :'uid' => :'String',
73
+ :'updated_at' => :'Time',
74
+ :'url' => :'String'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ :'filter_types',
82
+ :'rate_limit',
83
+ :'uid',
84
+ ])
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::OperationalWebhookEndpointOut` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!self.class.attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::OperationalWebhookEndpointOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'created_at')
103
+ self.created_at = attributes[:'created_at']
104
+ else
105
+ self.created_at = nil
106
+ end
107
+
108
+ if attributes.key?(:'description')
109
+ self.description = attributes[:'description']
110
+ else
111
+ self.description = nil
112
+ end
113
+
114
+ if attributes.key?(:'disabled')
115
+ self.disabled = attributes[:'disabled']
116
+ else
117
+ self.disabled = false
118
+ end
119
+
120
+ if attributes.key?(:'filter_types')
121
+ if (value = attributes[:'filter_types']).is_a?(Array)
122
+ self.filter_types = value
123
+ end
124
+ end
125
+
126
+ if attributes.key?(:'id')
127
+ self.id = attributes[:'id']
128
+ else
129
+ self.id = nil
130
+ end
131
+
132
+ if attributes.key?(:'metadata')
133
+ if (value = attributes[:'metadata']).is_a?(Hash)
134
+ self.metadata = value
135
+ end
136
+ else
137
+ self.metadata = nil
138
+ end
139
+
140
+ if attributes.key?(:'rate_limit')
141
+ self.rate_limit = attributes[:'rate_limit']
142
+ end
143
+
144
+ if attributes.key?(:'uid')
145
+ self.uid = attributes[:'uid']
146
+ end
147
+
148
+ if attributes.key?(:'updated_at')
149
+ self.updated_at = attributes[:'updated_at']
150
+ else
151
+ self.updated_at = nil
152
+ end
153
+
154
+ if attributes.key?(:'url')
155
+ self.url = attributes[:'url']
156
+ else
157
+ self.url = nil
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
165
+ invalid_properties = Array.new
166
+ if @created_at.nil?
167
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
168
+ end
169
+
170
+ if @description.nil?
171
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
172
+ end
173
+
174
+ if !@filter_types.nil? && @filter_types.length < 1
175
+ invalid_properties.push('invalid value for "filter_types", number of items must be greater than or equal to 1.')
176
+ end
177
+
178
+ if @id.nil?
179
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
180
+ end
181
+
182
+ if @metadata.nil?
183
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
184
+ end
185
+
186
+ if !@rate_limit.nil? && @rate_limit < 0
187
+ invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 0.')
188
+ end
189
+
190
+ if !@uid.nil? && @uid.to_s.length > 256
191
+ invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 256.')
192
+ end
193
+
194
+ if !@uid.nil? && @uid.to_s.length < 1
195
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
196
+ end
197
+
198
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
199
+ if !@uid.nil? && @uid !~ pattern
200
+ invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
201
+ end
202
+
203
+ if @updated_at.nil?
204
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
205
+ end
206
+
207
+ if @url.nil?
208
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
209
+ end
210
+
211
+ if @url.to_s.length > 65536
212
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 65536.')
213
+ end
214
+
215
+ if @url.to_s.length < 1
216
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
217
+ end
218
+
219
+ invalid_properties
220
+ end
221
+
222
+ # Check to see if the all the properties in the model are valid
223
+ # @return true if the model is valid
224
+ def valid?
225
+ warn '[DEPRECATED] the `valid?` method is obsolete'
226
+ return false if @created_at.nil?
227
+ return false if @description.nil?
228
+ return false if !@filter_types.nil? && @filter_types.length < 1
229
+ return false if @id.nil?
230
+ return false if @metadata.nil?
231
+ return false if !@rate_limit.nil? && @rate_limit < 0
232
+ return false if !@uid.nil? && @uid.to_s.length > 256
233
+ return false if !@uid.nil? && @uid.to_s.length < 1
234
+ return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
235
+ return false if @updated_at.nil?
236
+ return false if @url.nil?
237
+ return false if @url.to_s.length > 65536
238
+ return false if @url.to_s.length < 1
239
+ true
240
+ end
241
+
242
+ # Custom attribute writer method with validation
243
+ # @param [Object] filter_types Value to be assigned
244
+ def filter_types=(filter_types)
245
+ if !filter_types.nil? && filter_types.length < 1
246
+ fail ArgumentError, 'invalid value for "filter_types", number of items must be greater than or equal to 1.'
247
+ end
248
+
249
+ @filter_types = filter_types
250
+ end
251
+
252
+ # Custom attribute writer method with validation
253
+ # @param [Object] rate_limit Value to be assigned
254
+ def rate_limit=(rate_limit)
255
+ if !rate_limit.nil? && rate_limit < 0
256
+ fail ArgumentError, 'invalid value for "rate_limit", must be greater than or equal to 0.'
257
+ end
258
+
259
+ @rate_limit = rate_limit
260
+ end
261
+
262
+ # Custom attribute writer method with validation
263
+ # @param [Object] uid Value to be assigned
264
+ def uid=(uid)
265
+ if !uid.nil? && uid.to_s.length > 256
266
+ fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 256.'
267
+ end
268
+
269
+ if !uid.nil? && uid.to_s.length < 1
270
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
271
+ end
272
+
273
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
274
+ if !uid.nil? && uid !~ pattern
275
+ fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
276
+ end
277
+
278
+ @uid = uid
279
+ end
280
+
281
+ # Custom attribute writer method with validation
282
+ # @param [Object] url Value to be assigned
283
+ def url=(url)
284
+ if url.nil?
285
+ fail ArgumentError, 'url cannot be nil'
286
+ end
287
+
288
+ if url.to_s.length > 65536
289
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 65536.'
290
+ end
291
+
292
+ if url.to_s.length < 1
293
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
294
+ end
295
+
296
+ @url = url
297
+ end
298
+
299
+ # Checks equality by comparing each attribute.
300
+ # @param [Object] Object to be compared
301
+ def ==(o)
302
+ return true if self.equal?(o)
303
+ self.class == o.class &&
304
+ created_at == o.created_at &&
305
+ description == o.description &&
306
+ disabled == o.disabled &&
307
+ filter_types == o.filter_types &&
308
+ id == o.id &&
309
+ metadata == o.metadata &&
310
+ rate_limit == o.rate_limit &&
311
+ uid == o.uid &&
312
+ updated_at == o.updated_at &&
313
+ url == o.url
314
+ end
315
+
316
+ # @see the `==` method
317
+ # @param [Object] Object to be compared
318
+ def eql?(o)
319
+ self == o
320
+ end
321
+
322
+ # Calculates hash code according to all attributes.
323
+ # @return [Integer] Hash code
324
+ def hash
325
+ [created_at, description, disabled, filter_types, id, metadata, rate_limit, uid, updated_at, url].hash
326
+ end
327
+
328
+ # Builds the object from hash
329
+ # @param [Hash] attributes Model attributes in the form of hash
330
+ # @return [Object] Returns the model itself
331
+ def self.build_from_hash(attributes)
332
+ return nil unless attributes.is_a?(Hash)
333
+ attributes = attributes.transform_keys(&:to_sym)
334
+ transformed_hash = {}
335
+ openapi_types.each_pair do |key, type|
336
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
337
+ transformed_hash["#{key}"] = nil
338
+ elsif type =~ /\AArray<(.*)>/i
339
+ # check to ensure the input is an array given that the attribute
340
+ # is documented as an array but the input is not
341
+ if attributes[attribute_map[key]].is_a?(Array)
342
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
343
+ end
344
+ elsif !attributes[attribute_map[key]].nil?
345
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
346
+ end
347
+ end
348
+ new(transformed_hash)
349
+ end
350
+
351
+ # Deserializes the data based on type
352
+ # @param string type Data type
353
+ # @param string value Value to be deserialized
354
+ # @return [Object] Deserialized data
355
+ def self._deserialize(type, value)
356
+ case type.to_sym
357
+ when :Time
358
+ Time.parse(value)
359
+ when :Date
360
+ Date.parse(value)
361
+ when :String
362
+ value.to_s
363
+ when :Integer
364
+ value.to_i
365
+ when :Float
366
+ value.to_f
367
+ when :Boolean
368
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
369
+ true
370
+ else
371
+ false
372
+ end
373
+ when :Object
374
+ # generic object (usually a Hash), return directly
375
+ value
376
+ when /\AArray<(?<inner_type>.+)>\z/
377
+ inner_type = Regexp.last_match[:inner_type]
378
+ value.map { |v| _deserialize(inner_type, v) }
379
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
380
+ k_type = Regexp.last_match[:k_type]
381
+ v_type = Regexp.last_match[:v_type]
382
+ {}.tap do |hash|
383
+ value.each do |k, v|
384
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
385
+ end
386
+ end
387
+ else # model
388
+ # models (e.g. Pet) or oneOf
389
+ klass = Svix.const_get(type)
390
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
391
+ end
392
+ end
393
+
394
+ # Returns the string representation of the object
395
+ # @return [String] String presentation of the object
396
+ def to_s
397
+ to_hash.to_s
398
+ end
399
+
400
+ # to_body is an alias to to_hash (backward compatibility)
401
+ # @return [Hash] Returns the object in the form of hash
402
+ def to_body
403
+ to_hash
404
+ end
405
+
406
+ # Returns the object in the form of hash
407
+ # @return [Hash] Returns the object in the form of hash
408
+ def to_hash
409
+ hash = {}
410
+ self.class.attribute_map.each_pair do |attr, param|
411
+ value = self.send(attr)
412
+ if value.nil?
413
+ is_nullable = self.class.openapi_nullable.include?(attr)
414
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
415
+ end
416
+
417
+ hash[param] = _to_hash(value)
418
+ end
419
+ hash
420
+ end
421
+
422
+ # Outputs non-array value in the form of hash
423
+ # For object, use to_hash. Otherwise, just return the value
424
+ # @param [Object] value Any valid value
425
+ # @return [Hash] Returns the value in the form of hash
426
+ def _to_hash(value)
427
+ if value.is_a?(Array)
428
+ value.compact.map { |v| _to_hash(v) }
429
+ elsif value.is_a?(Hash)
430
+ {}.tap do |hash|
431
+ value.each { |k, v| hash[k] = _to_hash(v) }
432
+ end
433
+ elsif value.respond_to? :to_hash
434
+ value.to_hash
435
+ else
436
+ value
437
+ end
438
+ end
439
+
440
+ end
441
+
442
+ end
@@ -0,0 +1,233 @@
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
+ class OperationalWebhookEndpointSecretIn
18
+ # The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.
19
+ attr_accessor :key
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'key' => :'key'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'key' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ :'key'
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::OperationalWebhookEndpointSecretIn` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::OperationalWebhookEndpointSecretIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'key')
63
+ self.key = attributes[:'key']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ pattern = Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
73
+ if !@key.nil? && @key !~ pattern
74
+ invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
75
+ end
76
+
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ return false if !@key.nil? && @key !~ Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
85
+ true
86
+ end
87
+
88
+ # Custom attribute writer method with validation
89
+ # @param [Object] key Value to be assigned
90
+ def key=(key)
91
+ pattern = Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
92
+ if !key.nil? && key !~ pattern
93
+ fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
94
+ end
95
+
96
+ @key = key
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ key == o.key
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [key].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ attributes = attributes.transform_keys(&:to_sym)
125
+ transformed_hash = {}
126
+ openapi_types.each_pair do |key, type|
127
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
134
+ end
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
137
+ end
138
+ end
139
+ new(transformed_hash)
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def self._deserialize(type, value)
147
+ case type.to_sym
148
+ when :Time
149
+ Time.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ # models (e.g. Pet) or oneOf
180
+ klass = Svix.const_get(type)
181
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+
233
+ end