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,240 @@
|
|
|
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
|
+
# API Key list response
|
|
18
|
+
class APIKeyListResponse < ApiModelBase
|
|
19
|
+
# List of API keys
|
|
20
|
+
attr_accessor :keys
|
|
21
|
+
|
|
22
|
+
# Total number of keys
|
|
23
|
+
attr_accessor :total_count
|
|
24
|
+
|
|
25
|
+
# Number of active keys
|
|
26
|
+
attr_accessor :active_count
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'keys' => :'keys',
|
|
32
|
+
:'total_count' => :'total_count',
|
|
33
|
+
:'active_count' => :'active_count'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'keys' => :'Array<APIKeyMeta>',
|
|
51
|
+
:'total_count' => :'Integer',
|
|
52
|
+
:'active_count' => :'Integer'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSafePro::APIKeyListResponse` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSafePro::APIKeyListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'keys')
|
|
79
|
+
if (value = attributes[:'keys']).is_a?(Array)
|
|
80
|
+
self.keys = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.keys = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'total_count')
|
|
87
|
+
self.total_count = attributes[:'total_count']
|
|
88
|
+
else
|
|
89
|
+
self.total_count = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'active_count')
|
|
93
|
+
self.active_count = attributes[:'active_count']
|
|
94
|
+
else
|
|
95
|
+
self.active_count = nil
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
100
|
+
# @return Array for valid properties with the reasons
|
|
101
|
+
def list_invalid_properties
|
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
103
|
+
invalid_properties = Array.new
|
|
104
|
+
if @keys.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "keys", keys cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @total_count.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @total_count < 0
|
|
113
|
+
invalid_properties.push('invalid value for "total_count", must be greater than or equal to 0.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @active_count.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "active_count", active_count cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @active_count < 0
|
|
121
|
+
invalid_properties.push('invalid value for "active_count", must be greater than or equal to 0.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
131
|
+
return false if @keys.nil?
|
|
132
|
+
return false if @total_count.nil?
|
|
133
|
+
return false if @total_count < 0
|
|
134
|
+
return false if @active_count.nil?
|
|
135
|
+
return false if @active_count < 0
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] keys Value to be assigned
|
|
141
|
+
def keys=(keys)
|
|
142
|
+
if keys.nil?
|
|
143
|
+
fail ArgumentError, 'keys cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@keys = keys
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] total_count Value to be assigned
|
|
151
|
+
def total_count=(total_count)
|
|
152
|
+
if total_count.nil?
|
|
153
|
+
fail ArgumentError, 'total_count cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if total_count < 0
|
|
157
|
+
fail ArgumentError, 'invalid value for "total_count", must be greater than or equal to 0.'
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
@total_count = total_count
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Custom attribute writer method with validation
|
|
164
|
+
# @param [Object] active_count Value to be assigned
|
|
165
|
+
def active_count=(active_count)
|
|
166
|
+
if active_count.nil?
|
|
167
|
+
fail ArgumentError, 'active_count cannot be nil'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if active_count < 0
|
|
171
|
+
fail ArgumentError, 'invalid value for "active_count", must be greater than or equal to 0.'
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
@active_count = active_count
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Checks equality by comparing each attribute.
|
|
178
|
+
# @param [Object] Object to be compared
|
|
179
|
+
def ==(o)
|
|
180
|
+
return true if self.equal?(o)
|
|
181
|
+
self.class == o.class &&
|
|
182
|
+
keys == o.keys &&
|
|
183
|
+
total_count == o.total_count &&
|
|
184
|
+
active_count == o.active_count
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# @see the `==` method
|
|
188
|
+
# @param [Object] Object to be compared
|
|
189
|
+
def eql?(o)
|
|
190
|
+
self == o
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Calculates hash code according to all attributes.
|
|
194
|
+
# @return [Integer] Hash code
|
|
195
|
+
def hash
|
|
196
|
+
[keys, total_count, active_count].hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Builds the object from hash
|
|
200
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
201
|
+
# @return [Object] Returns the model itself
|
|
202
|
+
def self.build_from_hash(attributes)
|
|
203
|
+
return nil unless attributes.is_a?(Hash)
|
|
204
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
205
|
+
transformed_hash = {}
|
|
206
|
+
openapi_types.each_pair do |key, type|
|
|
207
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
208
|
+
transformed_hash["#{key}"] = nil
|
|
209
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
210
|
+
# check to ensure the input is an array given that the attribute
|
|
211
|
+
# is documented as an array but the input is not
|
|
212
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
213
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
214
|
+
end
|
|
215
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
216
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
new(transformed_hash)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Returns the object in the form of hash
|
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
|
224
|
+
def to_hash
|
|
225
|
+
hash = {}
|
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
227
|
+
value = self.send(attr)
|
|
228
|
+
if value.nil?
|
|
229
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
230
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
hash[param] = _to_hash(value)
|
|
234
|
+
end
|
|
235
|
+
hash
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
@@ -0,0 +1,338 @@
|
|
|
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
|
+
# API Key metadata
|
|
18
|
+
class APIKeyMeta < ApiModelBase
|
|
19
|
+
# Unique key identifier
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Hashed key value
|
|
23
|
+
attr_accessor :key_hash
|
|
24
|
+
|
|
25
|
+
# Associated plan
|
|
26
|
+
attr_accessor :plan
|
|
27
|
+
|
|
28
|
+
# Creation timestamp
|
|
29
|
+
attr_accessor :created_at
|
|
30
|
+
|
|
31
|
+
# Revocation status
|
|
32
|
+
attr_accessor :revoked
|
|
33
|
+
|
|
34
|
+
attr_accessor :revoked_at
|
|
35
|
+
|
|
36
|
+
# Access scopes
|
|
37
|
+
attr_accessor :scopes
|
|
38
|
+
|
|
39
|
+
attr_accessor :name
|
|
40
|
+
|
|
41
|
+
attr_accessor :last_used
|
|
42
|
+
|
|
43
|
+
class EnumAttributeValidator
|
|
44
|
+
attr_reader :datatype
|
|
45
|
+
attr_reader :allowable_values
|
|
46
|
+
|
|
47
|
+
def initialize(datatype, allowable_values)
|
|
48
|
+
@allowable_values = allowable_values.map do |value|
|
|
49
|
+
case datatype.to_s
|
|
50
|
+
when /Integer/i
|
|
51
|
+
value.to_i
|
|
52
|
+
when /Float/i
|
|
53
|
+
value.to_f
|
|
54
|
+
else
|
|
55
|
+
value
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def valid?(value)
|
|
61
|
+
!value || allowable_values.include?(value)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
66
|
+
def self.attribute_map
|
|
67
|
+
{
|
|
68
|
+
:'id' => :'id',
|
|
69
|
+
:'key_hash' => :'key_hash',
|
|
70
|
+
:'plan' => :'plan',
|
|
71
|
+
:'created_at' => :'created_at',
|
|
72
|
+
:'revoked' => :'revoked',
|
|
73
|
+
:'revoked_at' => :'revoked_at',
|
|
74
|
+
:'scopes' => :'scopes',
|
|
75
|
+
:'name' => :'name',
|
|
76
|
+
:'last_used' => :'last_used'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns attribute mapping this model knows about
|
|
81
|
+
def self.acceptable_attribute_map
|
|
82
|
+
attribute_map
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Returns all the JSON keys this model knows about
|
|
86
|
+
def self.acceptable_attributes
|
|
87
|
+
acceptable_attribute_map.values
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Attribute type mapping.
|
|
91
|
+
def self.openapi_types
|
|
92
|
+
{
|
|
93
|
+
:'id' => :'String',
|
|
94
|
+
:'key_hash' => :'String',
|
|
95
|
+
:'plan' => :'PlanEnum',
|
|
96
|
+
:'created_at' => :'Time',
|
|
97
|
+
:'revoked' => :'Boolean',
|
|
98
|
+
:'revoked_at' => :'Time',
|
|
99
|
+
:'scopes' => :'Array<String>',
|
|
100
|
+
:'name' => :'String',
|
|
101
|
+
:'last_used' => :'Time'
|
|
102
|
+
}
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# List of attributes with nullable: true
|
|
106
|
+
def self.openapi_nullable
|
|
107
|
+
Set.new([
|
|
108
|
+
:'revoked_at',
|
|
109
|
+
:'name',
|
|
110
|
+
:'last_used'
|
|
111
|
+
])
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Initializes the object
|
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
116
|
+
def initialize(attributes = {})
|
|
117
|
+
if (!attributes.is_a?(Hash))
|
|
118
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSafePro::APIKeyMeta` initialize method"
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
122
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
123
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
124
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
125
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSafePro::APIKeyMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
126
|
+
end
|
|
127
|
+
h[k.to_sym] = v
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'id')
|
|
131
|
+
self.id = attributes[:'id']
|
|
132
|
+
else
|
|
133
|
+
self.id = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'key_hash')
|
|
137
|
+
self.key_hash = attributes[:'key_hash']
|
|
138
|
+
else
|
|
139
|
+
self.key_hash = nil
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'plan')
|
|
143
|
+
self.plan = attributes[:'plan']
|
|
144
|
+
else
|
|
145
|
+
self.plan = nil
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'created_at')
|
|
149
|
+
self.created_at = attributes[:'created_at']
|
|
150
|
+
else
|
|
151
|
+
self.created_at = nil
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'revoked')
|
|
155
|
+
self.revoked = attributes[:'revoked']
|
|
156
|
+
else
|
|
157
|
+
self.revoked = nil
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'revoked_at')
|
|
161
|
+
self.revoked_at = attributes[:'revoked_at']
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'scopes')
|
|
165
|
+
if (value = attributes[:'scopes']).is_a?(Array)
|
|
166
|
+
self.scopes = value
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'name')
|
|
171
|
+
self.name = attributes[:'name']
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'last_used')
|
|
175
|
+
self.last_used = attributes[:'last_used']
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
180
|
+
# @return Array for valid properties with the reasons
|
|
181
|
+
def list_invalid_properties
|
|
182
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
183
|
+
invalid_properties = Array.new
|
|
184
|
+
if @id.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @key_hash.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "key_hash", key_hash cannot be nil.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @plan.nil?
|
|
193
|
+
invalid_properties.push('invalid value for "plan", plan cannot be nil.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if @created_at.nil?
|
|
197
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if @revoked.nil?
|
|
201
|
+
invalid_properties.push('invalid value for "revoked", revoked cannot be nil.')
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
invalid_properties
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Check to see if the all the properties in the model are valid
|
|
208
|
+
# @return true if the model is valid
|
|
209
|
+
def valid?
|
|
210
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
211
|
+
return false if @id.nil?
|
|
212
|
+
return false if @key_hash.nil?
|
|
213
|
+
return false if @plan.nil?
|
|
214
|
+
return false if @created_at.nil?
|
|
215
|
+
return false if @revoked.nil?
|
|
216
|
+
true
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Custom attribute writer method with validation
|
|
220
|
+
# @param [Object] id Value to be assigned
|
|
221
|
+
def id=(id)
|
|
222
|
+
if id.nil?
|
|
223
|
+
fail ArgumentError, 'id cannot be nil'
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
@id = id
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Custom attribute writer method with validation
|
|
230
|
+
# @param [Object] key_hash Value to be assigned
|
|
231
|
+
def key_hash=(key_hash)
|
|
232
|
+
if key_hash.nil?
|
|
233
|
+
fail ArgumentError, 'key_hash cannot be nil'
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
@key_hash = key_hash
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Custom attribute writer method with validation
|
|
240
|
+
# @param [Object] plan Value to be assigned
|
|
241
|
+
def plan=(plan)
|
|
242
|
+
if plan.nil?
|
|
243
|
+
fail ArgumentError, 'plan cannot be nil'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
@plan = plan
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Custom attribute writer method with validation
|
|
250
|
+
# @param [Object] created_at Value to be assigned
|
|
251
|
+
def created_at=(created_at)
|
|
252
|
+
if created_at.nil?
|
|
253
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
@created_at = created_at
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Custom attribute writer method with validation
|
|
260
|
+
# @param [Object] revoked Value to be assigned
|
|
261
|
+
def revoked=(revoked)
|
|
262
|
+
if revoked.nil?
|
|
263
|
+
fail ArgumentError, 'revoked cannot be nil'
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
@revoked = revoked
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Checks equality by comparing each attribute.
|
|
270
|
+
# @param [Object] Object to be compared
|
|
271
|
+
def ==(o)
|
|
272
|
+
return true if self.equal?(o)
|
|
273
|
+
self.class == o.class &&
|
|
274
|
+
id == o.id &&
|
|
275
|
+
key_hash == o.key_hash &&
|
|
276
|
+
plan == o.plan &&
|
|
277
|
+
created_at == o.created_at &&
|
|
278
|
+
revoked == o.revoked &&
|
|
279
|
+
revoked_at == o.revoked_at &&
|
|
280
|
+
scopes == o.scopes &&
|
|
281
|
+
name == o.name &&
|
|
282
|
+
last_used == o.last_used
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# @see the `==` method
|
|
286
|
+
# @param [Object] Object to be compared
|
|
287
|
+
def eql?(o)
|
|
288
|
+
self == o
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Calculates hash code according to all attributes.
|
|
292
|
+
# @return [Integer] Hash code
|
|
293
|
+
def hash
|
|
294
|
+
[id, key_hash, plan, created_at, revoked, revoked_at, scopes, name, last_used].hash
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Builds the object from hash
|
|
298
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
299
|
+
# @return [Object] Returns the model itself
|
|
300
|
+
def self.build_from_hash(attributes)
|
|
301
|
+
return nil unless attributes.is_a?(Hash)
|
|
302
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
303
|
+
transformed_hash = {}
|
|
304
|
+
openapi_types.each_pair do |key, type|
|
|
305
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
306
|
+
transformed_hash["#{key}"] = nil
|
|
307
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
308
|
+
# check to ensure the input is an array given that the attribute
|
|
309
|
+
# is documented as an array but the input is not
|
|
310
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
311
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
312
|
+
end
|
|
313
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
314
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
new(transformed_hash)
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# Returns the object in the form of hash
|
|
321
|
+
# @return [Hash] Returns the object in the form of hash
|
|
322
|
+
def to_hash
|
|
323
|
+
hash = {}
|
|
324
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
325
|
+
value = self.send(attr)
|
|
326
|
+
if value.nil?
|
|
327
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
328
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
hash[param] = _to_hash(value)
|
|
332
|
+
end
|
|
333
|
+
hash
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
end
|