svix 1.38.0 → 1.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/README.md +8 -1
- data/lib/svix/api/application_api.rb +23 -14
- data/lib/svix/api/authentication_api.rb +23 -11
- data/lib/svix/api/background_tasks_api.rb +3 -3
- data/lib/svix/api/broadcast_api.rb +6 -3
- data/lib/svix/api/endpoint_api.rb +86 -44
- data/lib/svix/api/environment_api.rb +8 -5
- data/lib/svix/api/environment_settings_api.rb +2 -2
- data/lib/svix/api/event_type_api.rb +39 -21
- data/lib/svix/api/events_api.rb +2 -2
- data/lib/svix/api/health_api.rb +2 -2
- data/lib/svix/api/inbound_api.rb +7 -4
- data/lib/svix/api/integration_api.rb +16 -10
- data/lib/svix/api/message_api.rb +21 -15
- data/lib/svix/api/message_attempt_api.rb +25 -25
- data/lib/svix/api/sink_api.rb +7 -4
- data/lib/svix/api/statistics_api.rb +9 -6
- data/lib/svix/api/stream_api.rb +19 -10
- data/lib/svix/api/transformation_template_api.rb +49 -22
- data/lib/svix/api/webhook_endpoint_api.rb +572 -0
- data/lib/svix/api_client.rb +45 -28
- data/lib/svix/api_error.rb +2 -1
- data/lib/svix/configuration.rb +42 -12
- data/lib/svix/models/aggregate_event_types_out.rb +43 -19
- data/lib/svix/models/app_portal_access_in.rb +19 -19
- data/lib/svix/models/app_portal_access_out.rb +19 -19
- data/lib/svix/models/app_usage_stats_in.rb +19 -19
- data/lib/svix/models/app_usage_stats_out.rb +43 -19
- data/lib/svix/models/application_in.rb +17 -19
- data/lib/svix/models/application_out.rb +25 -19
- data/lib/svix/models/application_patch.rb +15 -19
- data/lib/svix/models/application_stats.rb +19 -19
- data/lib/svix/models/application_token_expire_in.rb +15 -19
- data/lib/svix/models/attempt_statistics_data.rb +15 -19
- data/lib/svix/models/attempt_statistics_response.rb +45 -19
- data/lib/svix/models/auth_token_out.rb +21 -19
- data/lib/svix/models/azure_blob_storage_config.rb +21 -19
- data/lib/svix/models/background_task_out.rb +45 -19
- data/lib/svix/models/background_task_status.rb +7 -4
- data/lib/svix/models/background_task_type.rb +7 -4
- data/lib/svix/models/big_query_config.rb +271 -0
- data/lib/svix/models/border_radius_config.rb +37 -19
- data/lib/svix/models/border_radius_enum.rb +7 -4
- data/lib/svix/models/client_secret_jwt_params_in.rb +41 -19
- data/lib/svix/models/completion_choice.rb +21 -19
- data/lib/svix/models/completion_message.rb +19 -19
- data/lib/svix/models/create_message_token_in.rb +17 -19
- data/lib/svix/models/create_stream_in.rb +30 -23
- data/lib/svix/models/custom_color_palette.rb +15 -19
- data/lib/svix/models/custom_strings_override.rb +15 -19
- data/lib/svix/models/custom_theme_override.rb +15 -19
- data/lib/svix/models/dashboard_access_out.rb +19 -19
- data/lib/svix/models/duration.rb +19 -19
- data/lib/svix/models/endpoint_created_event.rb +17 -19
- data/lib/svix/models/endpoint_created_event_data.rb +19 -19
- data/lib/svix/models/endpoint_deleted_event.rb +17 -19
- data/lib/svix/models/endpoint_deleted_event_data.rb +19 -19
- data/lib/svix/models/endpoint_disabled_event.rb +17 -19
- data/lib/svix/models/endpoint_disabled_event_data.rb +21 -19
- data/lib/svix/models/endpoint_headers_in.rb +17 -19
- data/lib/svix/models/endpoint_headers_out.rb +19 -19
- data/lib/svix/models/endpoint_headers_patch_in.rb +17 -19
- data/lib/svix/models/endpoint_in.rb +17 -19
- data/lib/svix/models/endpoint_message_out.rb +47 -19
- data/lib/svix/models/endpoint_mtls_config_in.rb +17 -19
- data/lib/svix/models/endpoint_oauth_config_in.rb +45 -19
- data/lib/svix/models/endpoint_out.rb +29 -19
- data/lib/svix/models/endpoint_patch.rb +20 -20
- data/lib/svix/models/endpoint_secret_out.rb +17 -19
- data/lib/svix/models/endpoint_secret_rotate_in.rb +15 -21
- data/lib/svix/models/endpoint_stats.rb +23 -19
- data/lib/svix/models/endpoint_transformation_in.rb +15 -19
- data/lib/svix/models/endpoint_transformation_out.rb +15 -19
- data/lib/svix/models/endpoint_transformation_simulate_in.rb +21 -19
- data/lib/svix/models/endpoint_transformation_simulate_out.rb +41 -19
- data/lib/svix/models/endpoint_update.rb +17 -19
- data/lib/svix/models/endpoint_updated_event.rb +17 -19
- data/lib/svix/models/endpoint_updated_event_data.rb +19 -19
- data/lib/svix/models/environment_in.rb +19 -19
- data/lib/svix/models/environment_out.rb +21 -19
- data/lib/svix/models/environment_settings_out.rb +15 -19
- data/lib/svix/models/event_example_in.rb +17 -19
- data/lib/svix/models/event_in.rb +17 -19
- data/lib/svix/models/event_out.rb +19 -19
- data/lib/svix/models/event_stream_out.rb +21 -19
- data/lib/svix/models/event_type_example_out.rb +17 -19
- data/lib/svix/models/event_type_from_open_api.rb +95 -20
- data/lib/svix/models/event_type_import_open_api_in.rb +15 -19
- data/lib/svix/models/event_type_import_open_api_out.rb +17 -19
- data/lib/svix/models/event_type_import_open_api_out_data.rb +17 -19
- data/lib/svix/models/event_type_in.rb +19 -19
- data/lib/svix/models/event_type_out.rb +25 -19
- data/lib/svix/models/event_type_patch.rb +15 -19
- data/lib/svix/models/event_type_schema_in.rb +17 -19
- data/lib/svix/models/event_type_update.rb +17 -19
- data/lib/svix/models/export_event_type_out.rb +43 -19
- data/lib/svix/models/font_size_config.rb +15 -19
- data/lib/svix/models/generate_in.rb +17 -19
- data/lib/svix/models/generate_out.rb +25 -19
- data/lib/svix/models/google_cloud_storage_config.rb +19 -19
- data/lib/svix/models/http_error_out.rb +19 -19
- data/lib/svix/models/http_validation_error.rb +17 -19
- data/lib/svix/models/hubspot_oauth_config_in.rb +17 -19
- data/lib/svix/models/inbound_path_params.rb +19 -19
- data/lib/svix/models/incoming_webhook_payload_out.rb +15 -19
- data/lib/svix/models/integration_in.rb +17 -19
- data/lib/svix/models/integration_key_out.rb +17 -19
- data/lib/svix/models/integration_out.rb +23 -19
- data/lib/svix/models/integration_update.rb +17 -19
- data/lib/svix/models/kafka_security_protocol_type.rb +7 -4
- data/lib/svix/models/list_response_application_out.rb +19 -19
- data/lib/svix/models/list_response_application_stats.rb +19 -19
- data/lib/svix/models/list_response_background_task_out.rb +19 -19
- data/lib/svix/models/list_response_endpoint_message_out.rb +19 -19
- data/lib/svix/models/list_response_endpoint_out.rb +19 -19
- data/lib/svix/models/list_response_event_type_out.rb +19 -19
- data/lib/svix/models/list_response_integration_out.rb +19 -19
- data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +19 -19
- data/lib/svix/models/list_response_message_attempt_out.rb +19 -19
- data/lib/svix/models/list_response_message_endpoint_out.rb +19 -19
- data/lib/svix/models/list_response_message_out.rb +19 -19
- data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +259 -0
- data/lib/svix/models/list_response_sink_out.rb +19 -19
- data/lib/svix/models/list_response_stream_out.rb +19 -19
- data/lib/svix/models/list_response_stream_sink_out.rb +19 -19
- data/lib/svix/models/list_response_template_out.rb +19 -19
- data/lib/svix/models/message_attempt_endpoint_out.rb +57 -19
- data/lib/svix/models/message_attempt_exhausted_event.rb +17 -19
- data/lib/svix/models/message_attempt_exhausted_event_data.rb +23 -19
- data/lib/svix/models/message_attempt_failed_data.rb +21 -19
- data/lib/svix/models/message_attempt_failing_event.rb +17 -19
- data/lib/svix/models/message_attempt_failing_event_data.rb +23 -19
- data/lib/svix/models/message_attempt_headers_out.rb +19 -19
- data/lib/svix/models/message_attempt_out.rb +57 -19
- data/lib/svix/models/message_attempt_recovered_event.rb +17 -19
- data/lib/svix/models/message_attempt_recovered_event_data.rb +23 -19
- data/lib/svix/models/message_attempt_trigger_type.rb +7 -4
- data/lib/svix/models/message_broadcast_in.rb +19 -19
- data/lib/svix/models/message_broadcast_out.rb +43 -19
- data/lib/svix/models/message_endpoint_out.rb +51 -19
- data/lib/svix/models/message_events_out.rb +21 -19
- data/lib/svix/models/message_in.rb +19 -19
- data/lib/svix/models/message_out.rb +23 -19
- data/lib/svix/models/message_raw_payload_out.rb +17 -19
- data/lib/svix/models/message_status.rb +7 -4
- data/lib/svix/models/message_subscriber_auth_token_out.rb +19 -19
- data/lib/svix/models/o_auth_payload_in.rb +19 -19
- data/lib/svix/models/o_auth_payload_out.rb +15 -19
- data/lib/svix/models/oauth2_auth_method_in.rb +7 -4
- data/lib/svix/models/oauth2_grant_type_in.rb +7 -4
- data/lib/svix/models/oauth_jws_signing_algorithm.rb +7 -4
- data/lib/svix/models/one_time_token_in.rb +17 -19
- data/lib/svix/models/one_time_token_out.rb +17 -19
- data/lib/svix/models/operational_webhook_endpoint_in.rb +408 -0
- data/lib/svix/models/operational_webhook_endpoint_out.rb +442 -0
- data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +233 -0
- data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +243 -0
- data/lib/svix/models/operational_webhook_endpoint_update.rb +380 -0
- data/lib/svix/models/ordering.rb +7 -4
- data/lib/svix/models/recover_in.rb +17 -19
- data/lib/svix/models/recover_out.rb +43 -19
- data/lib/svix/models/redshift_config.rb +25 -19
- data/lib/svix/models/replay_in.rb +17 -19
- data/lib/svix/models/replay_out.rb +43 -19
- data/lib/svix/models/retry_schedule_in_out.rb +15 -19
- data/lib/svix/models/rotated_url_out.rb +17 -19
- data/lib/svix/models/s3_config.rb +23 -19
- data/lib/svix/models/settings_in.rb +15 -19
- data/lib/svix/models/settings_out.rb +15 -19
- data/lib/svix/models/sink_http_config.rb +17 -19
- data/lib/svix/models/sink_in.rb +4 -4
- data/lib/svix/models/sink_in_one_of.rb +21 -19
- data/lib/svix/models/sink_in_one_of1.rb +25 -19
- data/lib/svix/models/sink_in_one_of2.rb +23 -19
- data/lib/svix/models/sink_in_one_of3.rb +19 -19
- data/lib/svix/models/sink_otel_v1_config.rb +17 -19
- data/lib/svix/models/sink_out.rb +4 -4
- data/lib/svix/models/sink_payload_format.rb +7 -4
- data/lib/svix/models/sink_status.rb +7 -4
- data/lib/svix/models/sink_status_in.rb +7 -4
- data/lib/svix/models/sink_transform_in.rb +15 -19
- data/lib/svix/models/sink_transformation_out.rb +15 -19
- data/lib/svix/models/snowflake_config.rb +21 -19
- data/lib/svix/models/statistics_period.rb +7 -4
- data/lib/svix/models/status_code_class.rb +7 -4
- data/lib/svix/models/stream_in.rb +24 -22
- data/lib/svix/models/stream_out.rb +28 -22
- data/lib/svix/models/stream_patch.rb +22 -22
- data/lib/svix/models/stream_sink_in.rb +6 -5
- data/lib/svix/models/stream_sink_in_one_of.rb +19 -19
- data/lib/svix/models/stream_sink_in_one_of1.rb +19 -19
- data/lib/svix/models/stream_sink_in_one_of2.rb +19 -19
- data/lib/svix/models/stream_sink_in_one_of3.rb +19 -19
- data/lib/svix/models/stream_sink_in_one_of4.rb +19 -19
- data/lib/svix/models/stream_sink_in_one_of5.rb +19 -19
- data/lib/svix/models/stream_sink_in_one_of6.rb +19 -19
- data/lib/svix/models/stream_sink_in_one_of7.rb +271 -0
- data/lib/svix/models/stream_sink_out.rb +6 -5
- data/lib/svix/models/stream_sink_patch.rb +6 -5
- data/lib/svix/models/template_in.rb +43 -21
- data/lib/svix/models/template_out.rb +57 -19
- data/lib/svix/models/template_patch.rb +43 -21
- data/lib/svix/models/template_update.rb +41 -19
- data/lib/svix/models/transformation_http_method.rb +7 -4
- data/lib/svix/models/transformation_simulate_in.rb +21 -19
- data/lib/svix/models/transformation_simulate_out.rb +41 -19
- data/lib/svix/models/transformation_template_kind.rb +7 -4
- data/lib/svix/models/validation_error.rb +21 -19
- data/lib/svix/operational_webhook_endpoint_api.rb +37 -0
- data/lib/svix/version.rb +1 -1
- data/svix.gemspec +12 -2
- metadata +40 -21
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.1.1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.9.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -39,6 +39,28 @@ module Svix
|
|
39
39
|
# The URL of the authorization server.
|
40
40
|
attr_accessor :token_url
|
41
41
|
|
42
|
+
class EnumAttributeValidator
|
43
|
+
attr_reader :datatype
|
44
|
+
attr_reader :allowable_values
|
45
|
+
|
46
|
+
def initialize(datatype, allowable_values)
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
48
|
+
case datatype.to_s
|
49
|
+
when /Integer/i
|
50
|
+
value.to_i
|
51
|
+
when /Float/i
|
52
|
+
value.to_f
|
53
|
+
else
|
54
|
+
value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def valid?(value)
|
60
|
+
!value || allowable_values.include?(value)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
42
64
|
# Attribute mapping from ruby-style variable name to JSON key.
|
43
65
|
def self.attribute_map
|
44
66
|
{
|
@@ -101,10 +123,14 @@ module Svix
|
|
101
123
|
|
102
124
|
if attributes.key?(:'auth_method')
|
103
125
|
self.auth_method = attributes[:'auth_method']
|
126
|
+
else
|
127
|
+
self.auth_method = nil
|
104
128
|
end
|
105
129
|
|
106
130
|
if attributes.key?(:'client_id')
|
107
131
|
self.client_id = attributes[:'client_id']
|
132
|
+
else
|
133
|
+
self.client_id = nil
|
108
134
|
end
|
109
135
|
|
110
136
|
if attributes.key?(:'client_secret')
|
@@ -119,6 +145,8 @@ module Svix
|
|
119
145
|
|
120
146
|
if attributes.key?(:'grant_type')
|
121
147
|
self.grant_type = attributes[:'grant_type']
|
148
|
+
else
|
149
|
+
self.grant_type = nil
|
122
150
|
end
|
123
151
|
|
124
152
|
if attributes.key?(:'jwt_params')
|
@@ -137,12 +165,15 @@ module Svix
|
|
137
165
|
|
138
166
|
if attributes.key?(:'token_url')
|
139
167
|
self.token_url = attributes[:'token_url']
|
168
|
+
else
|
169
|
+
self.token_url = nil
|
140
170
|
end
|
141
171
|
end
|
142
172
|
|
143
173
|
# Show invalid properties with the reasons. Usually used together with valid?
|
144
174
|
# @return Array for valid properties with the reasons
|
145
175
|
def list_invalid_properties
|
176
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
146
177
|
invalid_properties = Array.new
|
147
178
|
if @auth_method.nil?
|
148
179
|
invalid_properties.push('invalid value for "auth_method", auth_method cannot be nil.')
|
@@ -166,6 +197,7 @@ module Svix
|
|
166
197
|
# Check to see if the all the properties in the model are valid
|
167
198
|
# @return true if the model is valid
|
168
199
|
def valid?
|
200
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
169
201
|
return false if @auth_method.nil?
|
170
202
|
return false if @client_id.nil?
|
171
203
|
return false if @grant_type.nil?
|
@@ -205,36 +237,30 @@ module Svix
|
|
205
237
|
# @param [Hash] attributes Model attributes in the form of hash
|
206
238
|
# @return [Object] Returns the model itself
|
207
239
|
def self.build_from_hash(attributes)
|
208
|
-
new.build_from_hash(attributes)
|
209
|
-
end
|
210
|
-
|
211
|
-
# Builds the object from hash
|
212
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
213
|
-
# @return [Object] Returns the model itself
|
214
|
-
def build_from_hash(attributes)
|
215
240
|
return nil unless attributes.is_a?(Hash)
|
216
|
-
|
217
|
-
|
218
|
-
|
241
|
+
attributes = attributes.transform_keys(&:to_sym)
|
242
|
+
transformed_hash = {}
|
243
|
+
openapi_types.each_pair do |key, type|
|
244
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
245
|
+
transformed_hash["#{key}"] = nil
|
219
246
|
elsif type =~ /\AArray<(.*)>/i
|
220
247
|
# check to ensure the input is an array given that the attribute
|
221
248
|
# is documented as an array but the input is not
|
222
|
-
if attributes[
|
223
|
-
|
249
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
250
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
224
251
|
end
|
225
|
-
elsif !attributes[
|
226
|
-
|
252
|
+
elsif !attributes[attribute_map[key]].nil?
|
253
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
227
254
|
end
|
228
255
|
end
|
229
|
-
|
230
|
-
self
|
256
|
+
new(transformed_hash)
|
231
257
|
end
|
232
258
|
|
233
259
|
# Deserializes the data based on type
|
234
260
|
# @param string type Data type
|
235
261
|
# @param string value Value to be deserialized
|
236
262
|
# @return [Object] Deserialized data
|
237
|
-
def _deserialize(type, value)
|
263
|
+
def self._deserialize(type, value)
|
238
264
|
case type.to_sym
|
239
265
|
when :Time
|
240
266
|
Time.parse(value)
|
@@ -269,7 +295,7 @@ module Svix
|
|
269
295
|
else # model
|
270
296
|
# models (e.g. Pet) or oneOf
|
271
297
|
klass = Svix.const_get(type)
|
272
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
298
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
273
299
|
end
|
274
300
|
end
|
275
301
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.1.1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.9.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -117,10 +117,14 @@ module Svix
|
|
117
117
|
|
118
118
|
if attributes.key?(:'created_at')
|
119
119
|
self.created_at = attributes[:'created_at']
|
120
|
+
else
|
121
|
+
self.created_at = nil
|
120
122
|
end
|
121
123
|
|
122
124
|
if attributes.key?(:'description')
|
123
125
|
self.description = attributes[:'description']
|
126
|
+
else
|
127
|
+
self.description = nil
|
124
128
|
end
|
125
129
|
|
126
130
|
if attributes.key?(:'disabled')
|
@@ -137,12 +141,16 @@ module Svix
|
|
137
141
|
|
138
142
|
if attributes.key?(:'id')
|
139
143
|
self.id = attributes[:'id']
|
144
|
+
else
|
145
|
+
self.id = nil
|
140
146
|
end
|
141
147
|
|
142
148
|
if attributes.key?(:'metadata')
|
143
149
|
if (value = attributes[:'metadata']).is_a?(Hash)
|
144
150
|
self.metadata = value
|
145
151
|
end
|
152
|
+
else
|
153
|
+
self.metadata = nil
|
146
154
|
end
|
147
155
|
|
148
156
|
if attributes.key?(:'rate_limit')
|
@@ -155,20 +163,27 @@ module Svix
|
|
155
163
|
|
156
164
|
if attributes.key?(:'updated_at')
|
157
165
|
self.updated_at = attributes[:'updated_at']
|
166
|
+
else
|
167
|
+
self.updated_at = nil
|
158
168
|
end
|
159
169
|
|
160
170
|
if attributes.key?(:'url')
|
161
171
|
self.url = attributes[:'url']
|
172
|
+
else
|
173
|
+
self.url = nil
|
162
174
|
end
|
163
175
|
|
164
176
|
if attributes.key?(:'version')
|
165
177
|
self.version = attributes[:'version']
|
178
|
+
else
|
179
|
+
self.version = nil
|
166
180
|
end
|
167
181
|
end
|
168
182
|
|
169
183
|
# Show invalid properties with the reasons. Usually used together with valid?
|
170
184
|
# @return Array for valid properties with the reasons
|
171
185
|
def list_invalid_properties
|
186
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
172
187
|
invalid_properties = Array.new
|
173
188
|
if !@channels.nil? && @channels.length > 10
|
174
189
|
invalid_properties.push('invalid value for "channels", number of items must be less than or equal to 10.')
|
@@ -245,6 +260,7 @@ module Svix
|
|
245
260
|
# Check to see if the all the properties in the model are valid
|
246
261
|
# @return true if the model is valid
|
247
262
|
def valid?
|
263
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
248
264
|
return false if !@channels.nil? && @channels.length > 10
|
249
265
|
return false if !@channels.nil? && @channels.length < 1
|
250
266
|
return false if @created_at.nil?
|
@@ -385,36 +401,30 @@ module Svix
|
|
385
401
|
# @param [Hash] attributes Model attributes in the form of hash
|
386
402
|
# @return [Object] Returns the model itself
|
387
403
|
def self.build_from_hash(attributes)
|
388
|
-
new.build_from_hash(attributes)
|
389
|
-
end
|
390
|
-
|
391
|
-
# Builds the object from hash
|
392
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
393
|
-
# @return [Object] Returns the model itself
|
394
|
-
def build_from_hash(attributes)
|
395
404
|
return nil unless attributes.is_a?(Hash)
|
396
|
-
|
397
|
-
|
398
|
-
|
405
|
+
attributes = attributes.transform_keys(&:to_sym)
|
406
|
+
transformed_hash = {}
|
407
|
+
openapi_types.each_pair do |key, type|
|
408
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
409
|
+
transformed_hash["#{key}"] = nil
|
399
410
|
elsif type =~ /\AArray<(.*)>/i
|
400
411
|
# check to ensure the input is an array given that the attribute
|
401
412
|
# is documented as an array but the input is not
|
402
|
-
if attributes[
|
403
|
-
|
413
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
414
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
404
415
|
end
|
405
|
-
elsif !attributes[
|
406
|
-
|
416
|
+
elsif !attributes[attribute_map[key]].nil?
|
417
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
407
418
|
end
|
408
419
|
end
|
409
|
-
|
410
|
-
self
|
420
|
+
new(transformed_hash)
|
411
421
|
end
|
412
422
|
|
413
423
|
# Deserializes the data based on type
|
414
424
|
# @param string type Data type
|
415
425
|
# @param string value Value to be deserialized
|
416
426
|
# @return [Object] Deserialized data
|
417
|
-
def _deserialize(type, value)
|
427
|
+
def self._deserialize(type, value)
|
418
428
|
case type.to_sym
|
419
429
|
when :Time
|
420
430
|
Time.parse(value)
|
@@ -449,7 +459,7 @@ module Svix
|
|
449
459
|
else # model
|
450
460
|
# models (e.g. Pet) or oneOf
|
451
461
|
klass = Svix.const_get(type)
|
452
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
462
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
453
463
|
end
|
454
464
|
end
|
455
465
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.1.1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.9.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -150,6 +150,7 @@ module Svix
|
|
150
150
|
# Show invalid properties with the reasons. Usually used together with valid?
|
151
151
|
# @return Array for valid properties with the reasons
|
152
152
|
def list_invalid_properties
|
153
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
153
154
|
invalid_properties = Array.new
|
154
155
|
if !@rate_limit.nil? && @rate_limit < 0
|
155
156
|
invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 0.')
|
@@ -183,6 +184,7 @@ module Svix
|
|
183
184
|
# Check to see if the all the properties in the model are valid
|
184
185
|
# @return true if the model is valid
|
185
186
|
def valid?
|
187
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
186
188
|
return false if !@rate_limit.nil? && @rate_limit < 0
|
187
189
|
return false if !@secret.nil? && @secret !~ Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
|
188
190
|
return false if !@uid.nil? && @uid.to_s.length > 256
|
@@ -247,7 +249,11 @@ module Svix
|
|
247
249
|
# Custom attribute writer method with validation
|
248
250
|
# @param [Object] version Value to be assigned
|
249
251
|
def version=(version)
|
250
|
-
if
|
252
|
+
if version.nil?
|
253
|
+
fail ArgumentError, 'version cannot be nil'
|
254
|
+
end
|
255
|
+
|
256
|
+
if version < 1
|
251
257
|
fail ArgumentError, 'invalid value for "version", must be greater than or equal to 1.'
|
252
258
|
end
|
253
259
|
|
@@ -287,36 +293,30 @@ module Svix
|
|
287
293
|
# @param [Hash] attributes Model attributes in the form of hash
|
288
294
|
# @return [Object] Returns the model itself
|
289
295
|
def self.build_from_hash(attributes)
|
290
|
-
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
297
296
|
return nil unless attributes.is_a?(Hash)
|
298
|
-
|
299
|
-
|
300
|
-
|
297
|
+
attributes = attributes.transform_keys(&:to_sym)
|
298
|
+
transformed_hash = {}
|
299
|
+
openapi_types.each_pair do |key, type|
|
300
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
301
|
+
transformed_hash["#{key}"] = nil
|
301
302
|
elsif type =~ /\AArray<(.*)>/i
|
302
303
|
# check to ensure the input is an array given that the attribute
|
303
304
|
# is documented as an array but the input is not
|
304
|
-
if attributes[
|
305
|
-
|
305
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
306
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
306
307
|
end
|
307
|
-
elsif !attributes[
|
308
|
-
|
308
|
+
elsif !attributes[attribute_map[key]].nil?
|
309
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
309
310
|
end
|
310
311
|
end
|
311
|
-
|
312
|
-
self
|
312
|
+
new(transformed_hash)
|
313
313
|
end
|
314
314
|
|
315
315
|
# Deserializes the data based on type
|
316
316
|
# @param string type Data type
|
317
317
|
# @param string value Value to be deserialized
|
318
318
|
# @return [Object] Deserialized data
|
319
|
-
def _deserialize(type, value)
|
319
|
+
def self._deserialize(type, value)
|
320
320
|
case type.to_sym
|
321
321
|
when :Time
|
322
322
|
Time.parse(value)
|
@@ -351,7 +351,7 @@ module Svix
|
|
351
351
|
else # model
|
352
352
|
# models (e.g. Pet) or oneOf
|
353
353
|
klass = Svix.const_get(type)
|
354
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
354
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
355
355
|
end
|
356
356
|
end
|
357
357
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.1.1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.9.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -60,12 +60,15 @@ module Svix
|
|
60
60
|
|
61
61
|
if attributes.key?(:'key')
|
62
62
|
self.key = attributes[:'key']
|
63
|
+
else
|
64
|
+
self.key = nil
|
63
65
|
end
|
64
66
|
end
|
65
67
|
|
66
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
67
69
|
# @return Array for valid properties with the reasons
|
68
70
|
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
69
72
|
invalid_properties = Array.new
|
70
73
|
if @key.nil?
|
71
74
|
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
@@ -82,6 +85,7 @@ module Svix
|
|
82
85
|
# Check to see if the all the properties in the model are valid
|
83
86
|
# @return true if the model is valid
|
84
87
|
def valid?
|
88
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
85
89
|
return false if @key.nil?
|
86
90
|
return false if @key !~ Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
|
87
91
|
true
|
@@ -126,36 +130,30 @@ module Svix
|
|
126
130
|
# @param [Hash] attributes Model attributes in the form of hash
|
127
131
|
# @return [Object] Returns the model itself
|
128
132
|
def self.build_from_hash(attributes)
|
129
|
-
new.build_from_hash(attributes)
|
130
|
-
end
|
131
|
-
|
132
|
-
# Builds the object from hash
|
133
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
-
# @return [Object] Returns the model itself
|
135
|
-
def build_from_hash(attributes)
|
136
133
|
return nil unless attributes.is_a?(Hash)
|
137
|
-
|
138
|
-
|
139
|
-
|
134
|
+
attributes = attributes.transform_keys(&:to_sym)
|
135
|
+
transformed_hash = {}
|
136
|
+
openapi_types.each_pair do |key, type|
|
137
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
138
|
+
transformed_hash["#{key}"] = nil
|
140
139
|
elsif type =~ /\AArray<(.*)>/i
|
141
140
|
# check to ensure the input is an array given that the attribute
|
142
141
|
# is documented as an array but the input is not
|
143
|
-
if attributes[
|
144
|
-
|
142
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
143
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
145
144
|
end
|
146
|
-
elsif !attributes[
|
147
|
-
|
145
|
+
elsif !attributes[attribute_map[key]].nil?
|
146
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
148
147
|
end
|
149
148
|
end
|
150
|
-
|
151
|
-
self
|
149
|
+
new(transformed_hash)
|
152
150
|
end
|
153
151
|
|
154
152
|
# Deserializes the data based on type
|
155
153
|
# @param string type Data type
|
156
154
|
# @param string value Value to be deserialized
|
157
155
|
# @return [Object] Deserialized data
|
158
|
-
def _deserialize(type, value)
|
156
|
+
def self._deserialize(type, value)
|
159
157
|
case type.to_sym
|
160
158
|
when :Time
|
161
159
|
Time.parse(value)
|
@@ -190,7 +188,7 @@ module Svix
|
|
190
188
|
else # model
|
191
189
|
# models (e.g. Pet) or oneOf
|
192
190
|
klass = Svix.const_get(type)
|
193
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
191
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
192
|
end
|
195
193
|
end
|
196
194
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.1.1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.9.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -61,14 +61,13 @@ module Svix
|
|
61
61
|
|
62
62
|
if attributes.key?(:'key')
|
63
63
|
self.key = attributes[:'key']
|
64
|
-
else
|
65
|
-
self.key = 'null'
|
66
64
|
end
|
67
65
|
end
|
68
66
|
|
69
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
70
68
|
# @return Array for valid properties with the reasons
|
71
69
|
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
71
|
invalid_properties = Array.new
|
73
72
|
pattern = Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
|
74
73
|
if !@key.nil? && @key !~ pattern
|
@@ -81,6 +80,7 @@ module Svix
|
|
81
80
|
# Check to see if the all the properties in the model are valid
|
82
81
|
# @return true if the model is valid
|
83
82
|
def valid?
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
84
84
|
return false if !@key.nil? && @key !~ Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
|
85
85
|
true
|
86
86
|
end
|
@@ -120,36 +120,30 @@ module Svix
|
|
120
120
|
# @param [Hash] attributes Model attributes in the form of hash
|
121
121
|
# @return [Object] Returns the model itself
|
122
122
|
def self.build_from_hash(attributes)
|
123
|
-
new.build_from_hash(attributes)
|
124
|
-
end
|
125
|
-
|
126
|
-
# Builds the object from hash
|
127
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
-
# @return [Object] Returns the model itself
|
129
|
-
def build_from_hash(attributes)
|
130
123
|
return nil unless attributes.is_a?(Hash)
|
131
|
-
|
132
|
-
|
133
|
-
|
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
|
134
129
|
elsif type =~ /\AArray<(.*)>/i
|
135
130
|
# check to ensure the input is an array given that the attribute
|
136
131
|
# is documented as an array but the input is not
|
137
|
-
if attributes[
|
138
|
-
|
132
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
133
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
139
134
|
end
|
140
|
-
elsif !attributes[
|
141
|
-
|
135
|
+
elsif !attributes[attribute_map[key]].nil?
|
136
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
142
137
|
end
|
143
138
|
end
|
144
|
-
|
145
|
-
self
|
139
|
+
new(transformed_hash)
|
146
140
|
end
|
147
141
|
|
148
142
|
# Deserializes the data based on type
|
149
143
|
# @param string type Data type
|
150
144
|
# @param string value Value to be deserialized
|
151
145
|
# @return [Object] Deserialized data
|
152
|
-
def _deserialize(type, value)
|
146
|
+
def self._deserialize(type, value)
|
153
147
|
case type.to_sym
|
154
148
|
when :Time
|
155
149
|
Time.parse(value)
|
@@ -184,7 +178,7 @@ module Svix
|
|
184
178
|
else # model
|
185
179
|
# models (e.g. Pet) or oneOf
|
186
180
|
klass = Svix.const_get(type)
|
187
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
181
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
182
|
end
|
189
183
|
end
|
190
184
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.1.1
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.9.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -71,24 +71,33 @@ module Svix
|
|
71
71
|
|
72
72
|
if attributes.key?(:'fail')
|
73
73
|
self.fail = attributes[:'fail']
|
74
|
+
else
|
75
|
+
self.fail = nil
|
74
76
|
end
|
75
77
|
|
76
78
|
if attributes.key?(:'pending')
|
77
79
|
self.pending = attributes[:'pending']
|
80
|
+
else
|
81
|
+
self.pending = nil
|
78
82
|
end
|
79
83
|
|
80
84
|
if attributes.key?(:'sending')
|
81
85
|
self.sending = attributes[:'sending']
|
86
|
+
else
|
87
|
+
self.sending = nil
|
82
88
|
end
|
83
89
|
|
84
90
|
if attributes.key?(:'success')
|
85
91
|
self.success = attributes[:'success']
|
92
|
+
else
|
93
|
+
self.success = nil
|
86
94
|
end
|
87
95
|
end
|
88
96
|
|
89
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
90
98
|
# @return Array for valid properties with the reasons
|
91
99
|
def list_invalid_properties
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
92
101
|
invalid_properties = Array.new
|
93
102
|
if @fail.nil?
|
94
103
|
invalid_properties.push('invalid value for "fail", fail cannot be nil.')
|
@@ -112,6 +121,7 @@ module Svix
|
|
112
121
|
# Check to see if the all the properties in the model are valid
|
113
122
|
# @return true if the model is valid
|
114
123
|
def valid?
|
124
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
115
125
|
return false if @fail.nil?
|
116
126
|
return false if @pending.nil?
|
117
127
|
return false if @sending.nil?
|
@@ -146,36 +156,30 @@ module Svix
|
|
146
156
|
# @param [Hash] attributes Model attributes in the form of hash
|
147
157
|
# @return [Object] Returns the model itself
|
148
158
|
def self.build_from_hash(attributes)
|
149
|
-
new.build_from_hash(attributes)
|
150
|
-
end
|
151
|
-
|
152
|
-
# Builds the object from hash
|
153
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
154
|
-
# @return [Object] Returns the model itself
|
155
|
-
def build_from_hash(attributes)
|
156
159
|
return nil unless attributes.is_a?(Hash)
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
+
attributes = attributes.transform_keys(&:to_sym)
|
161
|
+
transformed_hash = {}
|
162
|
+
openapi_types.each_pair do |key, type|
|
163
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
164
|
+
transformed_hash["#{key}"] = nil
|
160
165
|
elsif type =~ /\AArray<(.*)>/i
|
161
166
|
# check to ensure the input is an array given that the attribute
|
162
167
|
# is documented as an array but the input is not
|
163
|
-
if attributes[
|
164
|
-
|
168
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
169
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
165
170
|
end
|
166
|
-
elsif !attributes[
|
167
|
-
|
171
|
+
elsif !attributes[attribute_map[key]].nil?
|
172
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
168
173
|
end
|
169
174
|
end
|
170
|
-
|
171
|
-
self
|
175
|
+
new(transformed_hash)
|
172
176
|
end
|
173
177
|
|
174
178
|
# Deserializes the data based on type
|
175
179
|
# @param string type Data type
|
176
180
|
# @param string value Value to be deserialized
|
177
181
|
# @return [Object] Deserialized data
|
178
|
-
def _deserialize(type, value)
|
182
|
+
def self._deserialize(type, value)
|
179
183
|
case type.to_sym
|
180
184
|
when :Time
|
181
185
|
Time.parse(value)
|
@@ -210,7 +214,7 @@ module Svix
|
|
210
214
|
else # model
|
211
215
|
# models (e.g. Pet) or oneOf
|
212
216
|
klass = Svix.const_get(type)
|
213
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
217
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
214
218
|
end
|
215
219
|
end
|
216
220
|
|