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.
Files changed (159) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +256 -0
  5. data/Rakefile +10 -0
  6. data/docs/APIKeyCreateRequest.md +20 -0
  7. data/docs/APIKeyListResponse.md +22 -0
  8. data/docs/APIKeyMeta.md +34 -0
  9. data/docs/APIKeysApi.md +1241 -0
  10. data/docs/AuthenticationApi.md +1171 -0
  11. data/docs/BatchEmailResponse.md +28 -0
  12. data/docs/BatchValidationRequest.md +26 -0
  13. data/docs/BillingApi.md +689 -0
  14. data/docs/BodyChangePlanBillingBillingChangePlanPost.md +18 -0
  15. data/docs/CheckoutRequest.md +18 -0
  16. data/docs/CheckoutSessionResponse.md +18 -0
  17. data/docs/DNSInfo.md +26 -0
  18. data/docs/DNSRecordDKIM.md +26 -0
  19. data/docs/DNSRecordDMARC.md +24 -0
  20. data/docs/DNSRecordSPF.md +24 -0
  21. data/docs/DefaultApi.md +141 -0
  22. data/docs/DeveloperToolsApi.md +154 -0
  23. data/docs/EmailResponse.md +46 -0
  24. data/docs/EmailValidationApi.md +479 -0
  25. data/docs/EmailValidationRequest.md +26 -0
  26. data/docs/HTTPValidationError.md +18 -0
  27. data/docs/HealthApi.md +937 -0
  28. data/docs/JobCreateRequest.md +32 -0
  29. data/docs/JobCreateResponse.md +22 -0
  30. data/docs/JobResultEntry.md +34 -0
  31. data/docs/JobResultsPage.md +26 -0
  32. data/docs/JobStatusResponse.md +28 -0
  33. data/docs/JobsApi.md +433 -0
  34. data/docs/KeyRotationRequest.md +22 -0
  35. data/docs/LogsApi.md +154 -0
  36. data/docs/PlanEnum.md +15 -0
  37. data/docs/PriorityEnum.md +15 -0
  38. data/docs/RegisterEndpoint.md +18 -0
  39. data/docs/ResponseTestNotificationBillingBillingTestNotificationPostValue.md +15 -0
  40. data/docs/RiskLevelEnum.md +15 -0
  41. data/docs/RotateSecret.md +18 -0
  42. data/docs/SMTPInfo.md +26 -0
  43. data/docs/SubscriptionResponse.md +24 -0
  44. data/docs/UserLogin.md +20 -0
  45. data/docs/UserRegister.md +22 -0
  46. data/docs/ValidationApi.md +479 -0
  47. data/docs/ValidationError.md +22 -0
  48. data/docs/ValidationErrorLocInner.md +15 -0
  49. data/docs/WebhookCreate.md +24 -0
  50. data/docs/WebhookResponse.md +22 -0
  51. data/docs/WebhookUpdate.md +24 -0
  52. data/docs/WebhooksApi.md +776 -0
  53. data/docs/WebhooksManagementApi.md +500 -0
  54. data/git_push.sh +57 -0
  55. data/lib/mailsafepro/api/api_keys_api.rb +1148 -0
  56. data/lib/mailsafepro/api/authentication_api.rb +1114 -0
  57. data/lib/mailsafepro/api/billing_api.rb +670 -0
  58. data/lib/mailsafepro/api/default_api.rb +149 -0
  59. data/lib/mailsafepro/api/developer_tools_api.rb +155 -0
  60. data/lib/mailsafepro/api/email_validation_api.rb +486 -0
  61. data/lib/mailsafepro/api/health_api.rb +877 -0
  62. data/lib/mailsafepro/api/jobs_api.rb +452 -0
  63. data/lib/mailsafepro/api/logs_api.rb +155 -0
  64. data/lib/mailsafepro/api/validation_api.rb +486 -0
  65. data/lib/mailsafepro/api/webhooks_api.rb +768 -0
  66. data/lib/mailsafepro/api/webhooks_management_api.rb +480 -0
  67. data/lib/mailsafepro/api_client.rb +397 -0
  68. data/lib/mailsafepro/api_error.rb +58 -0
  69. data/lib/mailsafepro/api_model_base.rb +88 -0
  70. data/lib/mailsafepro/configuration.rb +316 -0
  71. data/lib/mailsafepro/models/api_key_create_request.rb +185 -0
  72. data/lib/mailsafepro/models/api_key_list_response.rb +240 -0
  73. data/lib/mailsafepro/models/api_key_meta.rb +338 -0
  74. data/lib/mailsafepro/models/batch_email_response.rb +348 -0
  75. data/lib/mailsafepro/models/batch_validation_request.rb +290 -0
  76. data/lib/mailsafepro/models/body_change_plan_billing_billing_change_plan_post.rb +164 -0
  77. data/lib/mailsafepro/models/checkout_request.rb +166 -0
  78. data/lib/mailsafepro/models/checkout_session_response.rb +165 -0
  79. data/lib/mailsafepro/models/dns_info.rb +193 -0
  80. data/lib/mailsafepro/models/dns_record_dkim.rb +189 -0
  81. data/lib/mailsafepro/models/dns_record_dmarc.rb +179 -0
  82. data/lib/mailsafepro/models/dns_record_spf.rb +179 -0
  83. data/lib/mailsafepro/models/email_response.rb +454 -0
  84. data/lib/mailsafepro/models/email_validation_request.rb +252 -0
  85. data/lib/mailsafepro/models/http_validation_error.rb +149 -0
  86. data/lib/mailsafepro/models/job_create_request.rb +251 -0
  87. data/lib/mailsafepro/models/job_create_response.rb +216 -0
  88. data/lib/mailsafepro/models/job_result_entry.rb +257 -0
  89. data/lib/mailsafepro/models/job_results_page.rb +270 -0
  90. data/lib/mailsafepro/models/job_status_response.rb +231 -0
  91. data/lib/mailsafepro/models/key_rotation_request.rb +269 -0
  92. data/lib/mailsafepro/models/plan_enum.rb +41 -0
  93. data/lib/mailsafepro/models/priority_enum.rb +41 -0
  94. data/lib/mailsafepro/models/register_endpoint.rb +173 -0
  95. data/lib/mailsafepro/models/response_test_notification_billing_billing_test_notification_post_value.rb +103 -0
  96. data/lib/mailsafepro/models/risk_level_enum.rb +42 -0
  97. data/lib/mailsafepro/models/rotate_secret.rb +164 -0
  98. data/lib/mailsafepro/models/smtp_info.rb +206 -0
  99. data/lib/mailsafepro/models/subscription_response.rb +196 -0
  100. data/lib/mailsafepro/models/user_login.rb +211 -0
  101. data/lib/mailsafepro/models/user_register.rb +243 -0
  102. data/lib/mailsafepro/models/validation_error.rb +218 -0
  103. data/lib/mailsafepro/models/validation_error_loc_inner.rb +103 -0
  104. data/lib/mailsafepro/models/webhook_create.rb +213 -0
  105. data/lib/mailsafepro/models/webhook_response.rb +185 -0
  106. data/lib/mailsafepro/models/webhook_update.rb +204 -0
  107. data/lib/mailsafepro/version.rb +15 -0
  108. data/lib/mailsafepro.rb +88 -0
  109. data/mailsafepro.gemspec +39 -0
  110. data/spec/api/api_keys_api_spec.rb +245 -0
  111. data/spec/api/authentication_api_spec.rb +239 -0
  112. data/spec/api/billing_api_spec.rb +155 -0
  113. data/spec/api/default_api_spec.rb +60 -0
  114. data/spec/api/developer_tools_api_spec.rb +62 -0
  115. data/spec/api/email_validation_api_spec.rb +125 -0
  116. data/spec/api/health_api_spec.rb +200 -0
  117. data/spec/api/jobs_api_spec.rb +119 -0
  118. data/spec/api/logs_api_spec.rb +62 -0
  119. data/spec/api/validation_api_spec.rb +125 -0
  120. data/spec/api/webhooks_api_spec.rb +172 -0
  121. data/spec/api/webhooks_management_api_spec.rb +120 -0
  122. data/spec/models/api_key_create_request_spec.rb +42 -0
  123. data/spec/models/api_key_list_response_spec.rb +48 -0
  124. data/spec/models/api_key_meta_spec.rb +84 -0
  125. data/spec/models/batch_email_response_spec.rb +66 -0
  126. data/spec/models/batch_validation_request_spec.rb +60 -0
  127. data/spec/models/body_change_plan_billing_billing_change_plan_post_spec.rb +36 -0
  128. data/spec/models/checkout_request_spec.rb +36 -0
  129. data/spec/models/checkout_session_response_spec.rb +36 -0
  130. data/spec/models/dns_info_spec.rb +60 -0
  131. data/spec/models/dns_record_dkim_spec.rb +60 -0
  132. data/spec/models/dns_record_dmarc_spec.rb +54 -0
  133. data/spec/models/dns_record_spf_spec.rb +54 -0
  134. data/spec/models/email_response_spec.rb +120 -0
  135. data/spec/models/email_validation_request_spec.rb +60 -0
  136. data/spec/models/http_validation_error_spec.rb +36 -0
  137. data/spec/models/job_create_request_spec.rb +78 -0
  138. data/spec/models/job_create_response_spec.rb +48 -0
  139. data/spec/models/job_result_entry_spec.rb +84 -0
  140. data/spec/models/job_results_page_spec.rb +60 -0
  141. data/spec/models/job_status_response_spec.rb +66 -0
  142. data/spec/models/key_rotation_request_spec.rb +48 -0
  143. data/spec/models/plan_enum_spec.rb +30 -0
  144. data/spec/models/priority_enum_spec.rb +30 -0
  145. data/spec/models/register_endpoint_spec.rb +36 -0
  146. data/spec/models/response_test_notification_billing_billing_test_notification_post_value_spec.rb +21 -0
  147. data/spec/models/risk_level_enum_spec.rb +30 -0
  148. data/spec/models/rotate_secret_spec.rb +36 -0
  149. data/spec/models/smtp_info_spec.rb +60 -0
  150. data/spec/models/subscription_response_spec.rb +54 -0
  151. data/spec/models/user_login_spec.rb +42 -0
  152. data/spec/models/user_register_spec.rb +48 -0
  153. data/spec/models/validation_error_loc_inner_spec.rb +21 -0
  154. data/spec/models/validation_error_spec.rb +48 -0
  155. data/spec/models/webhook_create_spec.rb +54 -0
  156. data/spec/models/webhook_response_spec.rb +48 -0
  157. data/spec/models/webhook_update_spec.rb +54 -0
  158. data/spec/spec_helper.rb +111 -0
  159. metadata +291 -0
@@ -0,0 +1,348 @@
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
+ # Batch validation response
18
+ class BatchEmailResponse < ApiModelBase
19
+ # Total emails processed
20
+ attr_accessor :count
21
+
22
+ # Number of valid emails
23
+ attr_accessor :valid_count
24
+
25
+ # Number of invalid emails
26
+ attr_accessor :invalid_count
27
+
28
+ # Total processing time in seconds
29
+ attr_accessor :processing_time
30
+
31
+ # Average processing time per email
32
+ attr_accessor :average_time
33
+
34
+ # Individual validation results
35
+ attr_accessor :results
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'count' => :'count',
41
+ :'valid_count' => :'valid_count',
42
+ :'invalid_count' => :'invalid_count',
43
+ :'processing_time' => :'processing_time',
44
+ :'average_time' => :'average_time',
45
+ :'results' => :'results'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'count' => :'Integer',
63
+ :'valid_count' => :'Integer',
64
+ :'invalid_count' => :'Integer',
65
+ :'processing_time' => :'Float',
66
+ :'average_time' => :'Float',
67
+ :'results' => :'Array<EmailResponse>'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSafePro::BatchEmailResponse` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSafePro::BatchEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'count')
94
+ self.count = attributes[:'count']
95
+ else
96
+ self.count = nil
97
+ end
98
+
99
+ if attributes.key?(:'valid_count')
100
+ self.valid_count = attributes[:'valid_count']
101
+ else
102
+ self.valid_count = nil
103
+ end
104
+
105
+ if attributes.key?(:'invalid_count')
106
+ self.invalid_count = attributes[:'invalid_count']
107
+ else
108
+ self.invalid_count = nil
109
+ end
110
+
111
+ if attributes.key?(:'processing_time')
112
+ self.processing_time = attributes[:'processing_time']
113
+ else
114
+ self.processing_time = nil
115
+ end
116
+
117
+ if attributes.key?(:'average_time')
118
+ self.average_time = attributes[:'average_time']
119
+ else
120
+ self.average_time = nil
121
+ end
122
+
123
+ if attributes.key?(:'results')
124
+ if (value = attributes[:'results']).is_a?(Array)
125
+ self.results = value
126
+ end
127
+ else
128
+ self.results = nil
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ if @count.nil?
138
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
139
+ end
140
+
141
+ if @count < 0
142
+ invalid_properties.push('invalid value for "count", must be greater than or equal to 0.')
143
+ end
144
+
145
+ if @valid_count.nil?
146
+ invalid_properties.push('invalid value for "valid_count", valid_count cannot be nil.')
147
+ end
148
+
149
+ if @valid_count < 0
150
+ invalid_properties.push('invalid value for "valid_count", must be greater than or equal to 0.')
151
+ end
152
+
153
+ if @invalid_count.nil?
154
+ invalid_properties.push('invalid value for "invalid_count", invalid_count cannot be nil.')
155
+ end
156
+
157
+ if @invalid_count < 0
158
+ invalid_properties.push('invalid value for "invalid_count", must be greater than or equal to 0.')
159
+ end
160
+
161
+ if @processing_time.nil?
162
+ invalid_properties.push('invalid value for "processing_time", processing_time cannot be nil.')
163
+ end
164
+
165
+ if @processing_time < 0.0
166
+ invalid_properties.push('invalid value for "processing_time", must be greater than or equal to 0.0.')
167
+ end
168
+
169
+ if @average_time.nil?
170
+ invalid_properties.push('invalid value for "average_time", average_time cannot be nil.')
171
+ end
172
+
173
+ if @average_time < 0.0
174
+ invalid_properties.push('invalid value for "average_time", must be greater than or equal to 0.0.')
175
+ end
176
+
177
+ if @results.nil?
178
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
179
+ end
180
+
181
+ invalid_properties
182
+ end
183
+
184
+ # Check to see if the all the properties in the model are valid
185
+ # @return true if the model is valid
186
+ def valid?
187
+ warn '[DEPRECATED] the `valid?` method is obsolete'
188
+ return false if @count.nil?
189
+ return false if @count < 0
190
+ return false if @valid_count.nil?
191
+ return false if @valid_count < 0
192
+ return false if @invalid_count.nil?
193
+ return false if @invalid_count < 0
194
+ return false if @processing_time.nil?
195
+ return false if @processing_time < 0.0
196
+ return false if @average_time.nil?
197
+ return false if @average_time < 0.0
198
+ return false if @results.nil?
199
+ true
200
+ end
201
+
202
+ # Custom attribute writer method with validation
203
+ # @param [Object] count Value to be assigned
204
+ def count=(count)
205
+ if count.nil?
206
+ fail ArgumentError, 'count cannot be nil'
207
+ end
208
+
209
+ if count < 0
210
+ fail ArgumentError, 'invalid value for "count", must be greater than or equal to 0.'
211
+ end
212
+
213
+ @count = count
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] valid_count Value to be assigned
218
+ def valid_count=(valid_count)
219
+ if valid_count.nil?
220
+ fail ArgumentError, 'valid_count cannot be nil'
221
+ end
222
+
223
+ if valid_count < 0
224
+ fail ArgumentError, 'invalid value for "valid_count", must be greater than or equal to 0.'
225
+ end
226
+
227
+ @valid_count = valid_count
228
+ end
229
+
230
+ # Custom attribute writer method with validation
231
+ # @param [Object] invalid_count Value to be assigned
232
+ def invalid_count=(invalid_count)
233
+ if invalid_count.nil?
234
+ fail ArgumentError, 'invalid_count cannot be nil'
235
+ end
236
+
237
+ if invalid_count < 0
238
+ fail ArgumentError, 'invalid value for "invalid_count", must be greater than or equal to 0.'
239
+ end
240
+
241
+ @invalid_count = invalid_count
242
+ end
243
+
244
+ # Custom attribute writer method with validation
245
+ # @param [Object] processing_time Value to be assigned
246
+ def processing_time=(processing_time)
247
+ if processing_time.nil?
248
+ fail ArgumentError, 'processing_time cannot be nil'
249
+ end
250
+
251
+ if processing_time < 0.0
252
+ fail ArgumentError, 'invalid value for "processing_time", must be greater than or equal to 0.0.'
253
+ end
254
+
255
+ @processing_time = processing_time
256
+ end
257
+
258
+ # Custom attribute writer method with validation
259
+ # @param [Object] average_time Value to be assigned
260
+ def average_time=(average_time)
261
+ if average_time.nil?
262
+ fail ArgumentError, 'average_time cannot be nil'
263
+ end
264
+
265
+ if average_time < 0.0
266
+ fail ArgumentError, 'invalid value for "average_time", must be greater than or equal to 0.0.'
267
+ end
268
+
269
+ @average_time = average_time
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] results Value to be assigned
274
+ def results=(results)
275
+ if results.nil?
276
+ fail ArgumentError, 'results cannot be nil'
277
+ end
278
+
279
+ @results = results
280
+ end
281
+
282
+ # Checks equality by comparing each attribute.
283
+ # @param [Object] Object to be compared
284
+ def ==(o)
285
+ return true if self.equal?(o)
286
+ self.class == o.class &&
287
+ count == o.count &&
288
+ valid_count == o.valid_count &&
289
+ invalid_count == o.invalid_count &&
290
+ processing_time == o.processing_time &&
291
+ average_time == o.average_time &&
292
+ results == o.results
293
+ end
294
+
295
+ # @see the `==` method
296
+ # @param [Object] Object to be compared
297
+ def eql?(o)
298
+ self == o
299
+ end
300
+
301
+ # Calculates hash code according to all attributes.
302
+ # @return [Integer] Hash code
303
+ def hash
304
+ [count, valid_count, invalid_count, processing_time, average_time, results].hash
305
+ end
306
+
307
+ # Builds the object from hash
308
+ # @param [Hash] attributes Model attributes in the form of hash
309
+ # @return [Object] Returns the model itself
310
+ def self.build_from_hash(attributes)
311
+ return nil unless attributes.is_a?(Hash)
312
+ attributes = attributes.transform_keys(&:to_sym)
313
+ transformed_hash = {}
314
+ openapi_types.each_pair do |key, type|
315
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = nil
317
+ elsif type =~ /\AArray<(.*)>/i
318
+ # check to ensure the input is an array given that the attribute
319
+ # is documented as an array but the input is not
320
+ if attributes[attribute_map[key]].is_a?(Array)
321
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
322
+ end
323
+ elsif !attributes[attribute_map[key]].nil?
324
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
325
+ end
326
+ end
327
+ new(transformed_hash)
328
+ end
329
+
330
+ # Returns the object in the form of hash
331
+ # @return [Hash] Returns the object in the form of hash
332
+ def to_hash
333
+ hash = {}
334
+ self.class.attribute_map.each_pair do |attr, param|
335
+ value = self.send(attr)
336
+ if value.nil?
337
+ is_nullable = self.class.openapi_nullable.include?(attr)
338
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
339
+ end
340
+
341
+ hash[param] = _to_hash(value)
342
+ end
343
+ hash
344
+ end
345
+
346
+ end
347
+
348
+ end
@@ -0,0 +1,290 @@
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
+ # Request model for batch email validation
18
+ class BatchValidationRequest < ApiModelBase
19
+ # List of email addresses to validate (can include invalid formats)
20
+ attr_accessor :emails
21
+
22
+ # Perform SMTP verification for all emails
23
+ attr_accessor :check_smtp
24
+
25
+ # Include raw DNS records in responses
26
+ attr_accessor :include_raw_dns
27
+
28
+ # Number of emails to process in each batch
29
+ attr_accessor :batch_size
30
+
31
+ # Maximum concurrent validation requests
32
+ attr_accessor :concurrent_requests
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'emails' => :'emails',
38
+ :'check_smtp' => :'check_smtp',
39
+ :'include_raw_dns' => :'include_raw_dns',
40
+ :'batch_size' => :'batch_size',
41
+ :'concurrent_requests' => :'concurrent_requests'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'emails' => :'Array<String>',
59
+ :'check_smtp' => :'Boolean',
60
+ :'include_raw_dns' => :'Boolean',
61
+ :'batch_size' => :'Integer',
62
+ :'concurrent_requests' => :'Integer'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSafePro::BatchValidationRequest` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSafePro::BatchValidationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'emails')
89
+ if (value = attributes[:'emails']).is_a?(Array)
90
+ self.emails = value
91
+ end
92
+ else
93
+ self.emails = nil
94
+ end
95
+
96
+ if attributes.key?(:'check_smtp')
97
+ self.check_smtp = attributes[:'check_smtp']
98
+ else
99
+ self.check_smtp = false
100
+ end
101
+
102
+ if attributes.key?(:'include_raw_dns')
103
+ self.include_raw_dns = attributes[:'include_raw_dns']
104
+ else
105
+ self.include_raw_dns = false
106
+ end
107
+
108
+ if attributes.key?(:'batch_size')
109
+ self.batch_size = attributes[:'batch_size']
110
+ else
111
+ self.batch_size = 100
112
+ end
113
+
114
+ if attributes.key?(:'concurrent_requests')
115
+ self.concurrent_requests = attributes[:'concurrent_requests']
116
+ else
117
+ self.concurrent_requests = 5
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ if @emails.nil?
127
+ invalid_properties.push('invalid value for "emails", emails cannot be nil.')
128
+ end
129
+
130
+ if @emails.length > 1000
131
+ invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 1000.')
132
+ end
133
+
134
+ if @emails.length < 1
135
+ invalid_properties.push('invalid value for "emails", number of items must be greater than or equal to 1.')
136
+ end
137
+
138
+ if !@batch_size.nil? && @batch_size > 1000
139
+ invalid_properties.push('invalid value for "batch_size", must be smaller than or equal to 1000.')
140
+ end
141
+
142
+ if !@batch_size.nil? && @batch_size < 1
143
+ invalid_properties.push('invalid value for "batch_size", must be greater than or equal to 1.')
144
+ end
145
+
146
+ if !@concurrent_requests.nil? && @concurrent_requests > 50
147
+ invalid_properties.push('invalid value for "concurrent_requests", must be smaller than or equal to 50.')
148
+ end
149
+
150
+ if !@concurrent_requests.nil? && @concurrent_requests < 1
151
+ invalid_properties.push('invalid value for "concurrent_requests", must be greater than or equal to 1.')
152
+ end
153
+
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
+ return false if @emails.nil?
162
+ return false if @emails.length > 1000
163
+ return false if @emails.length < 1
164
+ return false if !@batch_size.nil? && @batch_size > 1000
165
+ return false if !@batch_size.nil? && @batch_size < 1
166
+ return false if !@concurrent_requests.nil? && @concurrent_requests > 50
167
+ return false if !@concurrent_requests.nil? && @concurrent_requests < 1
168
+ true
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] emails Value to be assigned
173
+ def emails=(emails)
174
+ if emails.nil?
175
+ fail ArgumentError, 'emails cannot be nil'
176
+ end
177
+
178
+ if emails.length > 1000
179
+ fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 1000.'
180
+ end
181
+
182
+ if emails.length < 1
183
+ fail ArgumentError, 'invalid value for "emails", number of items must be greater than or equal to 1.'
184
+ end
185
+
186
+ @emails = emails
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] batch_size Value to be assigned
191
+ def batch_size=(batch_size)
192
+ if batch_size.nil?
193
+ fail ArgumentError, 'batch_size cannot be nil'
194
+ end
195
+
196
+ if batch_size > 1000
197
+ fail ArgumentError, 'invalid value for "batch_size", must be smaller than or equal to 1000.'
198
+ end
199
+
200
+ if batch_size < 1
201
+ fail ArgumentError, 'invalid value for "batch_size", must be greater than or equal to 1.'
202
+ end
203
+
204
+ @batch_size = batch_size
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] concurrent_requests Value to be assigned
209
+ def concurrent_requests=(concurrent_requests)
210
+ if concurrent_requests.nil?
211
+ fail ArgumentError, 'concurrent_requests cannot be nil'
212
+ end
213
+
214
+ if concurrent_requests > 50
215
+ fail ArgumentError, 'invalid value for "concurrent_requests", must be smaller than or equal to 50.'
216
+ end
217
+
218
+ if concurrent_requests < 1
219
+ fail ArgumentError, 'invalid value for "concurrent_requests", must be greater than or equal to 1.'
220
+ end
221
+
222
+ @concurrent_requests = concurrent_requests
223
+ end
224
+
225
+ # Checks equality by comparing each attribute.
226
+ # @param [Object] Object to be compared
227
+ def ==(o)
228
+ return true if self.equal?(o)
229
+ self.class == o.class &&
230
+ emails == o.emails &&
231
+ check_smtp == o.check_smtp &&
232
+ include_raw_dns == o.include_raw_dns &&
233
+ batch_size == o.batch_size &&
234
+ concurrent_requests == o.concurrent_requests
235
+ end
236
+
237
+ # @see the `==` method
238
+ # @param [Object] Object to be compared
239
+ def eql?(o)
240
+ self == o
241
+ end
242
+
243
+ # Calculates hash code according to all attributes.
244
+ # @return [Integer] Hash code
245
+ def hash
246
+ [emails, check_smtp, include_raw_dns, batch_size, concurrent_requests].hash
247
+ end
248
+
249
+ # Builds the object from hash
250
+ # @param [Hash] attributes Model attributes in the form of hash
251
+ # @return [Object] Returns the model itself
252
+ def self.build_from_hash(attributes)
253
+ return nil unless attributes.is_a?(Hash)
254
+ attributes = attributes.transform_keys(&:to_sym)
255
+ transformed_hash = {}
256
+ openapi_types.each_pair do |key, type|
257
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = nil
259
+ elsif type =~ /\AArray<(.*)>/i
260
+ # check to ensure the input is an array given that the attribute
261
+ # is documented as an array but the input is not
262
+ if attributes[attribute_map[key]].is_a?(Array)
263
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
264
+ end
265
+ elsif !attributes[attribute_map[key]].nil?
266
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
267
+ end
268
+ end
269
+ new(transformed_hash)
270
+ end
271
+
272
+ # Returns the object in the form of hash
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_hash
275
+ hash = {}
276
+ self.class.attribute_map.each_pair do |attr, param|
277
+ value = self.send(attr)
278
+ if value.nil?
279
+ is_nullable = self.class.openapi_nullable.include?(attr)
280
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
281
+ end
282
+
283
+ hash[param] = _to_hash(value)
284
+ end
285
+ hash
286
+ end
287
+
288
+ end
289
+
290
+ end