mailsafepro 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +256 -0
- data/Rakefile +10 -0
- data/docs/APIKeyCreateRequest.md +20 -0
- data/docs/APIKeyListResponse.md +22 -0
- data/docs/APIKeyMeta.md +34 -0
- data/docs/APIKeysApi.md +1241 -0
- data/docs/AuthenticationApi.md +1171 -0
- data/docs/BatchEmailResponse.md +28 -0
- data/docs/BatchValidationRequest.md +26 -0
- data/docs/BillingApi.md +689 -0
- data/docs/BodyChangePlanBillingBillingChangePlanPost.md +18 -0
- data/docs/CheckoutRequest.md +18 -0
- data/docs/CheckoutSessionResponse.md +18 -0
- data/docs/DNSInfo.md +26 -0
- data/docs/DNSRecordDKIM.md +26 -0
- data/docs/DNSRecordDMARC.md +24 -0
- data/docs/DNSRecordSPF.md +24 -0
- data/docs/DefaultApi.md +141 -0
- data/docs/DeveloperToolsApi.md +154 -0
- data/docs/EmailResponse.md +46 -0
- data/docs/EmailValidationApi.md +479 -0
- data/docs/EmailValidationRequest.md +26 -0
- data/docs/HTTPValidationError.md +18 -0
- data/docs/HealthApi.md +937 -0
- data/docs/JobCreateRequest.md +32 -0
- data/docs/JobCreateResponse.md +22 -0
- data/docs/JobResultEntry.md +34 -0
- data/docs/JobResultsPage.md +26 -0
- data/docs/JobStatusResponse.md +28 -0
- data/docs/JobsApi.md +433 -0
- data/docs/KeyRotationRequest.md +22 -0
- data/docs/LogsApi.md +154 -0
- data/docs/PlanEnum.md +15 -0
- data/docs/PriorityEnum.md +15 -0
- data/docs/RegisterEndpoint.md +18 -0
- data/docs/ResponseTestNotificationBillingBillingTestNotificationPostValue.md +15 -0
- data/docs/RiskLevelEnum.md +15 -0
- data/docs/RotateSecret.md +18 -0
- data/docs/SMTPInfo.md +26 -0
- data/docs/SubscriptionResponse.md +24 -0
- data/docs/UserLogin.md +20 -0
- data/docs/UserRegister.md +22 -0
- data/docs/ValidationApi.md +479 -0
- data/docs/ValidationError.md +22 -0
- data/docs/ValidationErrorLocInner.md +15 -0
- data/docs/WebhookCreate.md +24 -0
- data/docs/WebhookResponse.md +22 -0
- data/docs/WebhookUpdate.md +24 -0
- data/docs/WebhooksApi.md +776 -0
- data/docs/WebhooksManagementApi.md +500 -0
- data/git_push.sh +57 -0
- data/lib/mailsafepro/api/api_keys_api.rb +1148 -0
- data/lib/mailsafepro/api/authentication_api.rb +1114 -0
- data/lib/mailsafepro/api/billing_api.rb +670 -0
- data/lib/mailsafepro/api/default_api.rb +149 -0
- data/lib/mailsafepro/api/developer_tools_api.rb +155 -0
- data/lib/mailsafepro/api/email_validation_api.rb +486 -0
- data/lib/mailsafepro/api/health_api.rb +877 -0
- data/lib/mailsafepro/api/jobs_api.rb +452 -0
- data/lib/mailsafepro/api/logs_api.rb +155 -0
- data/lib/mailsafepro/api/validation_api.rb +486 -0
- data/lib/mailsafepro/api/webhooks_api.rb +768 -0
- data/lib/mailsafepro/api/webhooks_management_api.rb +480 -0
- data/lib/mailsafepro/api_client.rb +397 -0
- data/lib/mailsafepro/api_error.rb +58 -0
- data/lib/mailsafepro/api_model_base.rb +88 -0
- data/lib/mailsafepro/configuration.rb +316 -0
- data/lib/mailsafepro/models/api_key_create_request.rb +185 -0
- data/lib/mailsafepro/models/api_key_list_response.rb +240 -0
- data/lib/mailsafepro/models/api_key_meta.rb +338 -0
- data/lib/mailsafepro/models/batch_email_response.rb +348 -0
- data/lib/mailsafepro/models/batch_validation_request.rb +290 -0
- data/lib/mailsafepro/models/body_change_plan_billing_billing_change_plan_post.rb +164 -0
- data/lib/mailsafepro/models/checkout_request.rb +166 -0
- data/lib/mailsafepro/models/checkout_session_response.rb +165 -0
- data/lib/mailsafepro/models/dns_info.rb +193 -0
- data/lib/mailsafepro/models/dns_record_dkim.rb +189 -0
- data/lib/mailsafepro/models/dns_record_dmarc.rb +179 -0
- data/lib/mailsafepro/models/dns_record_spf.rb +179 -0
- data/lib/mailsafepro/models/email_response.rb +454 -0
- data/lib/mailsafepro/models/email_validation_request.rb +252 -0
- data/lib/mailsafepro/models/http_validation_error.rb +149 -0
- data/lib/mailsafepro/models/job_create_request.rb +251 -0
- data/lib/mailsafepro/models/job_create_response.rb +216 -0
- data/lib/mailsafepro/models/job_result_entry.rb +257 -0
- data/lib/mailsafepro/models/job_results_page.rb +270 -0
- data/lib/mailsafepro/models/job_status_response.rb +231 -0
- data/lib/mailsafepro/models/key_rotation_request.rb +269 -0
- data/lib/mailsafepro/models/plan_enum.rb +41 -0
- data/lib/mailsafepro/models/priority_enum.rb +41 -0
- data/lib/mailsafepro/models/register_endpoint.rb +173 -0
- data/lib/mailsafepro/models/response_test_notification_billing_billing_test_notification_post_value.rb +103 -0
- data/lib/mailsafepro/models/risk_level_enum.rb +42 -0
- data/lib/mailsafepro/models/rotate_secret.rb +164 -0
- data/lib/mailsafepro/models/smtp_info.rb +206 -0
- data/lib/mailsafepro/models/subscription_response.rb +196 -0
- data/lib/mailsafepro/models/user_login.rb +211 -0
- data/lib/mailsafepro/models/user_register.rb +243 -0
- data/lib/mailsafepro/models/validation_error.rb +218 -0
- data/lib/mailsafepro/models/validation_error_loc_inner.rb +103 -0
- data/lib/mailsafepro/models/webhook_create.rb +213 -0
- data/lib/mailsafepro/models/webhook_response.rb +185 -0
- data/lib/mailsafepro/models/webhook_update.rb +204 -0
- data/lib/mailsafepro/version.rb +15 -0
- data/lib/mailsafepro.rb +88 -0
- data/mailsafepro.gemspec +39 -0
- data/spec/api/api_keys_api_spec.rb +245 -0
- data/spec/api/authentication_api_spec.rb +239 -0
- data/spec/api/billing_api_spec.rb +155 -0
- data/spec/api/default_api_spec.rb +60 -0
- data/spec/api/developer_tools_api_spec.rb +62 -0
- data/spec/api/email_validation_api_spec.rb +125 -0
- data/spec/api/health_api_spec.rb +200 -0
- data/spec/api/jobs_api_spec.rb +119 -0
- data/spec/api/logs_api_spec.rb +62 -0
- data/spec/api/validation_api_spec.rb +125 -0
- data/spec/api/webhooks_api_spec.rb +172 -0
- data/spec/api/webhooks_management_api_spec.rb +120 -0
- data/spec/models/api_key_create_request_spec.rb +42 -0
- data/spec/models/api_key_list_response_spec.rb +48 -0
- data/spec/models/api_key_meta_spec.rb +84 -0
- data/spec/models/batch_email_response_spec.rb +66 -0
- data/spec/models/batch_validation_request_spec.rb +60 -0
- data/spec/models/body_change_plan_billing_billing_change_plan_post_spec.rb +36 -0
- data/spec/models/checkout_request_spec.rb +36 -0
- data/spec/models/checkout_session_response_spec.rb +36 -0
- data/spec/models/dns_info_spec.rb +60 -0
- data/spec/models/dns_record_dkim_spec.rb +60 -0
- data/spec/models/dns_record_dmarc_spec.rb +54 -0
- data/spec/models/dns_record_spf_spec.rb +54 -0
- data/spec/models/email_response_spec.rb +120 -0
- data/spec/models/email_validation_request_spec.rb +60 -0
- data/spec/models/http_validation_error_spec.rb +36 -0
- data/spec/models/job_create_request_spec.rb +78 -0
- data/spec/models/job_create_response_spec.rb +48 -0
- data/spec/models/job_result_entry_spec.rb +84 -0
- data/spec/models/job_results_page_spec.rb +60 -0
- data/spec/models/job_status_response_spec.rb +66 -0
- data/spec/models/key_rotation_request_spec.rb +48 -0
- data/spec/models/plan_enum_spec.rb +30 -0
- data/spec/models/priority_enum_spec.rb +30 -0
- data/spec/models/register_endpoint_spec.rb +36 -0
- data/spec/models/response_test_notification_billing_billing_test_notification_post_value_spec.rb +21 -0
- data/spec/models/risk_level_enum_spec.rb +30 -0
- data/spec/models/rotate_secret_spec.rb +36 -0
- data/spec/models/smtp_info_spec.rb +60 -0
- data/spec/models/subscription_response_spec.rb +54 -0
- data/spec/models/user_login_spec.rb +42 -0
- data/spec/models/user_register_spec.rb +48 -0
- data/spec/models/validation_error_loc_inner_spec.rb +21 -0
- data/spec/models/validation_error_spec.rb +48 -0
- data/spec/models/webhook_create_spec.rb +54 -0
- data/spec/models/webhook_response_spec.rb +48 -0
- data/spec/models/webhook_update_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- metadata +291 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Email Validation API — Enterprise-grade Email Verification
|
|
3
|
+
|
|
4
|
+
#API robusta y segura para validación y verificación de correos electrónicos. Soporta verificación individual y en lote, detección de brechas, y autenticación JWT. Cumple con GDPR y dispone de planes de pago flexibles. **🔗 Enlaces importantes:** - [Estado del sistema](https://mailsafepro.betteruptime.com) - [Documentación completa](https://email-validation-api-jlra.onrender.com/redoc) **📧 Contacto:** mailsafepro1@gmail.com
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.5.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MailSafePro
|
|
17
|
+
class ValidationError < ApiModelBase
|
|
18
|
+
attr_accessor :loc
|
|
19
|
+
|
|
20
|
+
attr_accessor :msg
|
|
21
|
+
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'loc' => :'loc',
|
|
28
|
+
:'msg' => :'msg',
|
|
29
|
+
:'type' => :'type'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'loc' => :'Array<ValidationErrorLocInner>',
|
|
47
|
+
:'msg' => :'String',
|
|
48
|
+
:'type' => :'String'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSafePro::ValidationError` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSafePro::ValidationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'loc')
|
|
75
|
+
if (value = attributes[:'loc']).is_a?(Array)
|
|
76
|
+
self.loc = value
|
|
77
|
+
end
|
|
78
|
+
else
|
|
79
|
+
self.loc = nil
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'msg')
|
|
83
|
+
self.msg = attributes[:'msg']
|
|
84
|
+
else
|
|
85
|
+
self.msg = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'type')
|
|
89
|
+
self.type = attributes[:'type']
|
|
90
|
+
else
|
|
91
|
+
self.type = nil
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
96
|
+
# @return Array for valid properties with the reasons
|
|
97
|
+
def list_invalid_properties
|
|
98
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
|
+
invalid_properties = Array.new
|
|
100
|
+
if @loc.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "loc", loc cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @msg.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "msg", msg cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @type.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
invalid_properties
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Check to see if the all the properties in the model are valid
|
|
116
|
+
# @return true if the model is valid
|
|
117
|
+
def valid?
|
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
+
return false if @loc.nil?
|
|
120
|
+
return false if @msg.nil?
|
|
121
|
+
return false if @type.nil?
|
|
122
|
+
true
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Custom attribute writer method with validation
|
|
126
|
+
# @param [Object] loc Value to be assigned
|
|
127
|
+
def loc=(loc)
|
|
128
|
+
if loc.nil?
|
|
129
|
+
fail ArgumentError, 'loc cannot be nil'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
@loc = loc
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method with validation
|
|
136
|
+
# @param [Object] msg Value to be assigned
|
|
137
|
+
def msg=(msg)
|
|
138
|
+
if msg.nil?
|
|
139
|
+
fail ArgumentError, 'msg cannot be nil'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
@msg = msg
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] type Value to be assigned
|
|
147
|
+
def type=(type)
|
|
148
|
+
if type.nil?
|
|
149
|
+
fail ArgumentError, 'type cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@type = type
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Checks equality by comparing each attribute.
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def ==(o)
|
|
158
|
+
return true if self.equal?(o)
|
|
159
|
+
self.class == o.class &&
|
|
160
|
+
loc == o.loc &&
|
|
161
|
+
msg == o.msg &&
|
|
162
|
+
type == o.type
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# @see the `==` method
|
|
166
|
+
# @param [Object] Object to be compared
|
|
167
|
+
def eql?(o)
|
|
168
|
+
self == o
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Calculates hash code according to all attributes.
|
|
172
|
+
# @return [Integer] Hash code
|
|
173
|
+
def hash
|
|
174
|
+
[loc, msg, type].hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Builds the object from hash
|
|
178
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
179
|
+
# @return [Object] Returns the model itself
|
|
180
|
+
def self.build_from_hash(attributes)
|
|
181
|
+
return nil unless attributes.is_a?(Hash)
|
|
182
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
183
|
+
transformed_hash = {}
|
|
184
|
+
openapi_types.each_pair do |key, type|
|
|
185
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = nil
|
|
187
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
188
|
+
# check to ensure the input is an array given that the attribute
|
|
189
|
+
# is documented as an array but the input is not
|
|
190
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
191
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
192
|
+
end
|
|
193
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
new(transformed_hash)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the object in the form of hash
|
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
|
202
|
+
def to_hash
|
|
203
|
+
hash = {}
|
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
205
|
+
value = self.send(attr)
|
|
206
|
+
if value.nil?
|
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
hash[param] = _to_hash(value)
|
|
212
|
+
end
|
|
213
|
+
hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Email Validation API — Enterprise-grade Email Verification
|
|
3
|
+
|
|
4
|
+
#API robusta y segura para validación y verificación de correos electrónicos. Soporta verificación individual y en lote, detección de brechas, y autenticación JWT. Cumple con GDPR y dispone de planes de pago flexibles. **🔗 Enlaces importantes:** - [Estado del sistema](https://mailsafepro.betteruptime.com) - [Documentación completa](https://email-validation-api-jlra.onrender.com/redoc) **📧 Contacto:** mailsafepro1@gmail.com
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.5.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MailSafePro
|
|
17
|
+
module ValidationErrorLocInner
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
|
+
[
|
|
22
|
+
:'Integer',
|
|
23
|
+
:'String'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_any_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
return find_and_cast_into_type(klass, data)
|
|
41
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
51
|
+
|
|
52
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
53
|
+
def find_and_cast_into_type(klass, data)
|
|
54
|
+
return if data.nil?
|
|
55
|
+
|
|
56
|
+
case klass.to_s
|
|
57
|
+
when 'Boolean'
|
|
58
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
59
|
+
when 'Float'
|
|
60
|
+
return data if data.instance_of?(Float)
|
|
61
|
+
when 'Integer'
|
|
62
|
+
return data if data.instance_of?(Integer)
|
|
63
|
+
when 'Time'
|
|
64
|
+
return Time.parse(data)
|
|
65
|
+
when 'Date'
|
|
66
|
+
return Date.iso8601(data)
|
|
67
|
+
when 'String'
|
|
68
|
+
return data if data.instance_of?(String)
|
|
69
|
+
when 'Object' # "type: object"
|
|
70
|
+
return data if data.instance_of?(Hash)
|
|
71
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
72
|
+
if data.instance_of?(Array)
|
|
73
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
74
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
75
|
+
end
|
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
+
end
|
|
81
|
+
else # model
|
|
82
|
+
const = MailSafePro.const_get(klass)
|
|
83
|
+
if const
|
|
84
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
85
|
+
model = const.build(data)
|
|
86
|
+
return model if model
|
|
87
|
+
else
|
|
88
|
+
# raise if data contains keys that are not known to the model
|
|
89
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
90
|
+
model = const.build_from_hash(data)
|
|
91
|
+
return model if model
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
raise # if no match by now, raise
|
|
97
|
+
rescue
|
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Email Validation API — Enterprise-grade Email Verification
|
|
3
|
+
|
|
4
|
+
#API robusta y segura para validación y verificación de correos electrónicos. Soporta verificación individual y en lote, detección de brechas, y autenticación JWT. Cumple con GDPR y dispone de planes de pago flexibles. **🔗 Enlaces importantes:** - [Estado del sistema](https://mailsafepro.betteruptime.com) - [Documentación completa](https://email-validation-api-jlra.onrender.com/redoc) **📧 Contacto:** mailsafepro1@gmail.com
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.5.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MailSafePro
|
|
17
|
+
class WebhookCreate < ApiModelBase
|
|
18
|
+
attr_accessor :url
|
|
19
|
+
|
|
20
|
+
attr_accessor :events
|
|
21
|
+
|
|
22
|
+
attr_accessor :secret
|
|
23
|
+
|
|
24
|
+
attr_accessor :description
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'url' => :'url',
|
|
30
|
+
:'events' => :'events',
|
|
31
|
+
:'secret' => :'secret',
|
|
32
|
+
:'description' => :'description'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'url' => :'String',
|
|
50
|
+
:'events' => :'Array<String>',
|
|
51
|
+
:'secret' => :'String',
|
|
52
|
+
:'description' => :'String'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
:'secret',
|
|
60
|
+
:'description'
|
|
61
|
+
])
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Initializes the object
|
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
66
|
+
def initialize(attributes = {})
|
|
67
|
+
if (!attributes.is_a?(Hash))
|
|
68
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSafePro::WebhookCreate` initialize method"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
72
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
73
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
74
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
75
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSafePro::WebhookCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
76
|
+
end
|
|
77
|
+
h[k.to_sym] = v
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'url')
|
|
81
|
+
self.url = attributes[:'url']
|
|
82
|
+
else
|
|
83
|
+
self.url = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'events')
|
|
87
|
+
if (value = attributes[:'events']).is_a?(Array)
|
|
88
|
+
self.events = value
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'secret')
|
|
93
|
+
self.secret = attributes[:'secret']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'description')
|
|
97
|
+
self.description = attributes[:'description']
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
if @url.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if @url.to_s.length > 2083
|
|
111
|
+
invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 2083.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @url.to_s.length < 1
|
|
115
|
+
invalid_properties.push('invalid value for "url", the character length must be greater than or equal to 1.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
invalid_properties
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Check to see if the all the properties in the model are valid
|
|
122
|
+
# @return true if the model is valid
|
|
123
|
+
def valid?
|
|
124
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
125
|
+
return false if @url.nil?
|
|
126
|
+
return false if @url.to_s.length > 2083
|
|
127
|
+
return false if @url.to_s.length < 1
|
|
128
|
+
true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Custom attribute writer method with validation
|
|
132
|
+
# @param [Object] url Value to be assigned
|
|
133
|
+
def url=(url)
|
|
134
|
+
if url.nil?
|
|
135
|
+
fail ArgumentError, 'url cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if url.to_s.length > 2083
|
|
139
|
+
fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 2083.'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if url.to_s.length < 1
|
|
143
|
+
fail ArgumentError, 'invalid value for "url", the character length must be greater than or equal to 1.'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@url = url
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Checks equality by comparing each attribute.
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def ==(o)
|
|
152
|
+
return true if self.equal?(o)
|
|
153
|
+
self.class == o.class &&
|
|
154
|
+
url == o.url &&
|
|
155
|
+
events == o.events &&
|
|
156
|
+
secret == o.secret &&
|
|
157
|
+
description == o.description
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# @see the `==` method
|
|
161
|
+
# @param [Object] Object to be compared
|
|
162
|
+
def eql?(o)
|
|
163
|
+
self == o
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Calculates hash code according to all attributes.
|
|
167
|
+
# @return [Integer] Hash code
|
|
168
|
+
def hash
|
|
169
|
+
[url, events, secret, description].hash
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Builds the object from hash
|
|
173
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
174
|
+
# @return [Object] Returns the model itself
|
|
175
|
+
def self.build_from_hash(attributes)
|
|
176
|
+
return nil unless attributes.is_a?(Hash)
|
|
177
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
178
|
+
transformed_hash = {}
|
|
179
|
+
openapi_types.each_pair do |key, type|
|
|
180
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
181
|
+
transformed_hash["#{key}"] = nil
|
|
182
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
183
|
+
# check to ensure the input is an array given that the attribute
|
|
184
|
+
# is documented as an array but the input is not
|
|
185
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
186
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
187
|
+
end
|
|
188
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
189
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
new(transformed_hash)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Returns the object in the form of hash
|
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
|
197
|
+
def to_hash
|
|
198
|
+
hash = {}
|
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
200
|
+
value = self.send(attr)
|
|
201
|
+
if value.nil?
|
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
hash[param] = _to_hash(value)
|
|
207
|
+
end
|
|
208
|
+
hash
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
end
|