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