mailodds 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 (182) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +64 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddPolicyRule201Response.md +18 -0
  6. data/docs/AddSuppressionRequest.md +18 -0
  7. data/docs/AddSuppressionRequestEntriesInner.md +22 -0
  8. data/docs/AddSuppressionResponse.md +22 -0
  9. data/docs/BulkValidationApi.md +659 -0
  10. data/docs/CheckSuppressionRequest.md +18 -0
  11. data/docs/CreateJobFromS3Request.md +20 -0
  12. data/docs/CreateJobRequest.md +26 -0
  13. data/docs/CreatePolicyFromPresetRequest.md +22 -0
  14. data/docs/CreatePolicyRequest.md +24 -0
  15. data/docs/DeleteJob200Response.md +20 -0
  16. data/docs/DeletePolicy200Response.md +20 -0
  17. data/docs/DeletePolicyRule200Response.md +18 -0
  18. data/docs/EmailValidationApi.md +77 -0
  19. data/docs/ErrorResponse.md +22 -0
  20. data/docs/GetPresignedUploadRequest.md +20 -0
  21. data/docs/HealthCheck200Response.md +20 -0
  22. data/docs/Job.md +34 -0
  23. data/docs/JobListResponse.md +22 -0
  24. data/docs/JobResponse.md +20 -0
  25. data/docs/JobSummary.md +26 -0
  26. data/docs/Pagination.md +24 -0
  27. data/docs/Policy.md +34 -0
  28. data/docs/PolicyListResponse.md +22 -0
  29. data/docs/PolicyListResponseLimits.md +22 -0
  30. data/docs/PolicyPresetsResponse.md +20 -0
  31. data/docs/PolicyPresetsResponsePresetsInner.md +24 -0
  32. data/docs/PolicyResponse.md +20 -0
  33. data/docs/PolicyRule.md +28 -0
  34. data/docs/PolicyRuleAction.md +18 -0
  35. data/docs/PolicyTestResponse.md +26 -0
  36. data/docs/PresignedUploadResponse.md +20 -0
  37. data/docs/PresignedUploadResponseUpload.md +24 -0
  38. data/docs/RemoveSuppression200Response.md +20 -0
  39. data/docs/RemoveSuppressionRequest.md +18 -0
  40. data/docs/ResultsResponse.md +22 -0
  41. data/docs/SuppressionCheckResponse.md +26 -0
  42. data/docs/SuppressionEntry.md +26 -0
  43. data/docs/SuppressionListResponse.md +22 -0
  44. data/docs/SuppressionListsApi.md +362 -0
  45. data/docs/SuppressionStatsResponse.md +22 -0
  46. data/docs/SuppressionStatsResponseByType.md +20 -0
  47. data/docs/SystemApi.md +141 -0
  48. data/docs/TelemetrySummary.md +32 -0
  49. data/docs/TelemetrySummaryRates.md +24 -0
  50. data/docs/TelemetrySummaryTopDomainsInner.md +28 -0
  51. data/docs/TelemetrySummaryTopReasonsInner.md +20 -0
  52. data/docs/TelemetrySummaryTotals.md +20 -0
  53. data/docs/TestPolicyRequest.md +20 -0
  54. data/docs/TestPolicyRequestTestResult.md +26 -0
  55. data/docs/UpdatePolicyRequest.md +24 -0
  56. data/docs/ValidateRequest.md +20 -0
  57. data/docs/ValidationPoliciesApi.md +712 -0
  58. data/docs/ValidationResponse.md +40 -0
  59. data/docs/ValidationResponseSuppressionMatch.md +22 -0
  60. data/docs/ValidationResult.md +26 -0
  61. data/git_push.sh +57 -0
  62. data/lib/mailodds/api/bulk_validation_api.rb +651 -0
  63. data/lib/mailodds/api/email_validation_api.rb +90 -0
  64. data/lib/mailodds/api/suppression_lists_api.rb +356 -0
  65. data/lib/mailodds/api/system_api.rb +143 -0
  66. data/lib/mailodds/api/validation_policies_api.rb +686 -0
  67. data/lib/mailodds/api_client.rb +397 -0
  68. data/lib/mailodds/api_error.rb +58 -0
  69. data/lib/mailodds/api_model_base.rb +88 -0
  70. data/lib/mailodds/configuration.rb +308 -0
  71. data/lib/mailodds/models/add_policy_rule201_response.rb +147 -0
  72. data/lib/mailodds/models/add_suppression_request.rb +166 -0
  73. data/lib/mailodds/models/add_suppression_request_entries_inner.rb +223 -0
  74. data/lib/mailodds/models/add_suppression_response.rb +165 -0
  75. data/lib/mailodds/models/check_suppression_request.rb +164 -0
  76. data/lib/mailodds/models/create_job_from_s3_request.rb +176 -0
  77. data/lib/mailodds/models/create_job_request.rb +219 -0
  78. data/lib/mailodds/models/create_policy_from_preset_request.rb +225 -0
  79. data/lib/mailodds/models/create_policy_request.rb +223 -0
  80. data/lib/mailodds/models/delete_job200_response.rb +156 -0
  81. data/lib/mailodds/models/delete_policy200_response.rb +156 -0
  82. data/lib/mailodds/models/delete_policy_rule200_response.rb +147 -0
  83. data/lib/mailodds/models/error_response.rb +201 -0
  84. data/lib/mailodds/models/get_presigned_upload_request.rb +175 -0
  85. data/lib/mailodds/models/health_check200_response.rb +156 -0
  86. data/lib/mailodds/models/job.rb +281 -0
  87. data/lib/mailodds/models/job_list_response.rb +167 -0
  88. data/lib/mailodds/models/job_response.rb +156 -0
  89. data/lib/mailodds/models/job_summary.rb +183 -0
  90. data/lib/mailodds/models/pagination.rb +174 -0
  91. data/lib/mailodds/models/policy.rb +221 -0
  92. data/lib/mailodds/models/policy_list_response.rb +167 -0
  93. data/lib/mailodds/models/policy_list_response_limits.rb +166 -0
  94. data/lib/mailodds/models/policy_presets_response.rb +158 -0
  95. data/lib/mailodds/models/policy_presets_response_presets_inner.rb +176 -0
  96. data/lib/mailodds/models/policy_response.rb +156 -0
  97. data/lib/mailodds/models/policy_rule.rb +269 -0
  98. data/lib/mailodds/models/policy_rule_action.rb +181 -0
  99. data/lib/mailodds/models/policy_test_response.rb +187 -0
  100. data/lib/mailodds/models/presigned_upload_response.rb +156 -0
  101. data/lib/mailodds/models/presigned_upload_response_upload.rb +174 -0
  102. data/lib/mailodds/models/remove_suppression200_response.rb +156 -0
  103. data/lib/mailodds/models/remove_suppression_request.rb +166 -0
  104. data/lib/mailodds/models/results_response.rb +167 -0
  105. data/lib/mailodds/models/suppression_check_response.rb +217 -0
  106. data/lib/mailodds/models/suppression_entry.rb +217 -0
  107. data/lib/mailodds/models/suppression_list_response.rb +167 -0
  108. data/lib/mailodds/models/suppression_stats_response.rb +165 -0
  109. data/lib/mailodds/models/suppression_stats_response_by_type.rb +156 -0
  110. data/lib/mailodds/models/telemetry_summary.rb +251 -0
  111. data/lib/mailodds/models/telemetry_summary_rates.rb +179 -0
  112. data/lib/mailodds/models/telemetry_summary_top_domains_inner.rb +192 -0
  113. data/lib/mailodds/models/telemetry_summary_top_reasons_inner.rb +156 -0
  114. data/lib/mailodds/models/telemetry_summary_totals.rb +158 -0
  115. data/lib/mailodds/models/test_policy_request.rb +190 -0
  116. data/lib/mailodds/models/test_policy_request_test_result.rb +184 -0
  117. data/lib/mailodds/models/update_policy_request.rb +174 -0
  118. data/lib/mailodds/models/validate_request.rb +175 -0
  119. data/lib/mailodds/models/validation_response.rb +326 -0
  120. data/lib/mailodds/models/validation_response_suppression_match.rb +199 -0
  121. data/lib/mailodds/models/validation_result.rb +183 -0
  122. data/lib/mailodds/version.rb +15 -0
  123. data/lib/mailodds.rb +96 -0
  124. data/mailodds.gemspec +31 -0
  125. data/spec/api/bulk_validation_api_spec.rb +151 -0
  126. data/spec/api/email_validation_api_spec.rb +47 -0
  127. data/spec/api/suppression_lists_api_spec.rb +97 -0
  128. data/spec/api/system_api_spec.rb +58 -0
  129. data/spec/api/validation_policies_api_spec.rb +157 -0
  130. data/spec/models/add_policy_rule201_response_spec.rb +36 -0
  131. data/spec/models/add_suppression_request_entries_inner_spec.rb +52 -0
  132. data/spec/models/add_suppression_request_spec.rb +36 -0
  133. data/spec/models/add_suppression_response_spec.rb +48 -0
  134. data/spec/models/check_suppression_request_spec.rb +36 -0
  135. data/spec/models/create_job_from_s3_request_spec.rb +42 -0
  136. data/spec/models/create_job_request_spec.rb +60 -0
  137. data/spec/models/create_policy_from_preset_request_spec.rb +52 -0
  138. data/spec/models/create_policy_request_spec.rb +54 -0
  139. data/spec/models/delete_job200_response_spec.rb +42 -0
  140. data/spec/models/delete_policy200_response_spec.rb +42 -0
  141. data/spec/models/delete_policy_rule200_response_spec.rb +36 -0
  142. data/spec/models/error_response_spec.rb +48 -0
  143. data/spec/models/get_presigned_upload_request_spec.rb +42 -0
  144. data/spec/models/health_check200_response_spec.rb +42 -0
  145. data/spec/models/job_list_response_spec.rb +48 -0
  146. data/spec/models/job_response_spec.rb +42 -0
  147. data/spec/models/job_spec.rb +88 -0
  148. data/spec/models/job_summary_spec.rb +60 -0
  149. data/spec/models/pagination_spec.rb +54 -0
  150. data/spec/models/policy_list_response_limits_spec.rb +48 -0
  151. data/spec/models/policy_list_response_spec.rb +48 -0
  152. data/spec/models/policy_presets_response_presets_inner_spec.rb +54 -0
  153. data/spec/models/policy_presets_response_spec.rb +42 -0
  154. data/spec/models/policy_response_spec.rb +42 -0
  155. data/spec/models/policy_rule_action_spec.rb +40 -0
  156. data/spec/models/policy_rule_spec.rb +70 -0
  157. data/spec/models/policy_spec.rb +84 -0
  158. data/spec/models/policy_test_response_spec.rb +60 -0
  159. data/spec/models/presigned_upload_response_spec.rb +42 -0
  160. data/spec/models/presigned_upload_response_upload_spec.rb +54 -0
  161. data/spec/models/remove_suppression200_response_spec.rb +42 -0
  162. data/spec/models/remove_suppression_request_spec.rb +36 -0
  163. data/spec/models/results_response_spec.rb +48 -0
  164. data/spec/models/suppression_check_response_spec.rb +64 -0
  165. data/spec/models/suppression_entry_spec.rb +64 -0
  166. data/spec/models/suppression_list_response_spec.rb +48 -0
  167. data/spec/models/suppression_stats_response_by_type_spec.rb +42 -0
  168. data/spec/models/suppression_stats_response_spec.rb +48 -0
  169. data/spec/models/telemetry_summary_rates_spec.rb +54 -0
  170. data/spec/models/telemetry_summary_spec.rb +82 -0
  171. data/spec/models/telemetry_summary_top_domains_inner_spec.rb +66 -0
  172. data/spec/models/telemetry_summary_top_reasons_inner_spec.rb +42 -0
  173. data/spec/models/telemetry_summary_totals_spec.rb +42 -0
  174. data/spec/models/test_policy_request_spec.rb +42 -0
  175. data/spec/models/test_policy_request_test_result_spec.rb +60 -0
  176. data/spec/models/update_policy_request_spec.rb +54 -0
  177. data/spec/models/validate_request_spec.rb +42 -0
  178. data/spec/models/validation_response_spec.rb +110 -0
  179. data/spec/models/validation_response_suppression_match_spec.rb +52 -0
  180. data/spec/models/validation_result_spec.rb +60 -0
  181. data/spec/spec_helper.rb +111 -0
  182. metadata +322 -0
@@ -0,0 +1,308 @@
1
+ =begin
2
+ #MailOdds Email Validation API
3
+
4
+ #MailOdds provides email validation services to help maintain clean email lists and improve deliverability. The API performs multiple validation checks including format verification, domain validation, MX record checking, and disposable email detection. ## Authentication All API requests require authentication using a Bearer token. Include your API key in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` API keys can be created in the MailOdds dashboard. ## Rate Limits Rate limits vary by plan: - Free: 10 requests/minute - Starter: 60 requests/minute - Pro: 300 requests/minute - Business: 1000 requests/minute - Enterprise: Custom limits ## Response Format All responses include: - `schema_version`: API schema version (currently \"1.0\") - `request_id`: Unique request identifier for debugging Error responses include: - `error`: Machine-readable error code - `message`: Human-readable error description
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@mailodds.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ module Mailodds
14
+ class Configuration
15
+ # Defines url scheme
16
+ attr_accessor :scheme
17
+
18
+ # Defines url host
19
+ attr_accessor :host
20
+
21
+ # Defines url base path
22
+ attr_accessor :base_path
23
+
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
36
+ # Defines API keys used with API Key authentications.
37
+ #
38
+ # @return [Hash] key: parameter name, value: parameter value (API key)
39
+ #
40
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
+ # config.api_key['api_key'] = 'xxx'
42
+ attr_accessor :api_key
43
+
44
+ # Defines API key prefixes used with API Key authentications.
45
+ #
46
+ # @return [Hash] key: parameter name, value: API key prefix
47
+ #
48
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
+ # config.api_key_prefix['api_key'] = 'Token'
50
+ attr_accessor :api_key_prefix
51
+
52
+ # Defines the username used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :username
56
+
57
+ # Defines the password used with HTTP basic authentication.
58
+ #
59
+ # @return [String]
60
+ attr_accessor :password
61
+
62
+ # Defines the access token (Bearer) used with OAuth2.
63
+ attr_accessor :access_token
64
+
65
+ # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
66
+ # Overrides the access_token if set
67
+ # @return [Proc]
68
+ attr_accessor :access_token_getter
69
+
70
+ # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
71
+ # HTTP responses with return type `File` will be returned as a stream of binary data.
72
+ # Default to false.
73
+ attr_accessor :return_binary_data
74
+
75
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
76
+ # details will be logged with `logger.debug` (see the `logger` attribute).
77
+ # Default to false.
78
+ #
79
+ # @return [true, false]
80
+ attr_accessor :debugging
81
+
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
90
+ # Defines the logger used for debugging.
91
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
92
+ #
93
+ # @return [#debug]
94
+ attr_accessor :logger
95
+
96
+ # Defines the temporary folder to store downloaded files
97
+ # (for API endpoints that have file response).
98
+ # Default to use `Tempfile`.
99
+ #
100
+ # @return [String]
101
+ attr_accessor :temp_folder_path
102
+
103
+ # The time limit for HTTP request in seconds.
104
+ # Default to 0 (never times out).
105
+ attr_accessor :timeout
106
+
107
+ # Set this to false to skip client side validation in the operation.
108
+ # Default to true.
109
+ # @return [true, false]
110
+ attr_accessor :client_side_validation
111
+
112
+ ### TLS/SSL setting
113
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
114
+ # Default to true.
115
+ #
116
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
117
+ #
118
+ # @return [true, false]
119
+ attr_accessor :verify_ssl
120
+
121
+ ### TLS/SSL setting
122
+ # Set this to false to skip verifying SSL host name
123
+ # Default to true.
124
+ #
125
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
126
+ #
127
+ # @return [true, false]
128
+ attr_accessor :verify_ssl_host
129
+
130
+ ### TLS/SSL setting
131
+ # Set this to customize the certificate file to verify the peer.
132
+ #
133
+ # @return [String] the path to the certificate file
134
+ #
135
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
136
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
137
+ attr_accessor :ssl_ca_cert
138
+
139
+ ### TLS/SSL setting
140
+ # Client certificate file (for client certificate)
141
+ attr_accessor :cert_file
142
+
143
+ ### TLS/SSL setting
144
+ # Client private key file (for client certificate)
145
+ attr_accessor :key_file
146
+
147
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
148
+ # Default to nil.
149
+ #
150
+ # @see The params_encoding option of Ethon. Related source code:
151
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
152
+ attr_accessor :params_encoding
153
+
154
+
155
+ attr_accessor :inject_format
156
+
157
+ attr_accessor :force_ending_format
158
+
159
+ def initialize
160
+ @scheme = 'https'
161
+ @host = 'api.mailodds.com'
162
+ @base_path = '/v1'
163
+ @server_index = nil
164
+ @server_operation_index = {}
165
+ @server_variables = {}
166
+ @server_operation_variables = {}
167
+ @api_key = {}
168
+ @api_key_prefix = {}
169
+ @client_side_validation = true
170
+ @verify_ssl = true
171
+ @verify_ssl_host = true
172
+ @cert_file = nil
173
+ @key_file = nil
174
+ @timeout = 0
175
+ @params_encoding = nil
176
+ @debugging = false
177
+ @ignore_operation_servers = false
178
+ @inject_format = false
179
+ @force_ending_format = false
180
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
181
+
182
+ yield(self) if block_given?
183
+ end
184
+
185
+ # The default Configuration object.
186
+ def self.default
187
+ @@default ||= Configuration.new
188
+ end
189
+
190
+ def configure
191
+ yield(self) if block_given?
192
+ end
193
+
194
+ def scheme=(scheme)
195
+ # remove :// from scheme
196
+ @scheme = scheme.sub(/:\/\//, '')
197
+ end
198
+
199
+ def host=(host)
200
+ # remove http(s):// and anything after a slash
201
+ @host = host.sub(/https?:\/\//, '').split('/').first
202
+ end
203
+
204
+ def base_path=(base_path)
205
+ # Add leading and trailing slashes to base_path
206
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
207
+ @base_path = '' if @base_path == '/'
208
+ end
209
+
210
+ # Returns base URL for specified operation based on server settings
211
+ def base_url(operation = nil)
212
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
213
+ if operation_server_settings.key?(operation) then
214
+ index = server_operation_index.fetch(operation, server_index)
215
+ server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
216
+ else
217
+ server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
218
+ end
219
+ end
220
+
221
+ # Gets API key (with prefix if set).
222
+ # @param [String] param_name the parameter name of API key auth
223
+ def api_key_with_prefix(param_name, param_alias = nil)
224
+ key = @api_key[param_name]
225
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
226
+ if @api_key_prefix[param_name]
227
+ "#{@api_key_prefix[param_name]} #{key}"
228
+ else
229
+ key
230
+ end
231
+ end
232
+
233
+ # Gets access_token using access_token_getter or uses the static access_token
234
+ def access_token_with_refresh
235
+ return access_token if access_token_getter.nil?
236
+ access_token_getter.call
237
+ end
238
+
239
+ # Gets Basic Auth token string
240
+ def basic_auth_token
241
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
242
+ end
243
+
244
+ # Returns Auth Settings hash for api client.
245
+ def auth_settings
246
+ {
247
+ 'BearerAuth' =>
248
+ {
249
+ type: 'bearer',
250
+ in: 'header',
251
+ key: 'Authorization',
252
+ value: "Bearer #{access_token_with_refresh}"
253
+ },
254
+ }
255
+ end
256
+
257
+ # Returns an array of Server setting
258
+ def server_settings
259
+ [
260
+ {
261
+ url: "https://api.mailodds.com/v1",
262
+ description: "Production server",
263
+ }
264
+ ]
265
+ end
266
+
267
+ def operation_server_settings
268
+ {
269
+ }
270
+ end
271
+
272
+ # Returns URL based on server settings
273
+ #
274
+ # @param index array index of the server settings
275
+ # @param variables hash of variable and the corresponding value
276
+ def server_url(index, variables = {}, servers = nil)
277
+ servers = server_settings if servers == nil
278
+
279
+ # check array index out of bound
280
+ if (index.nil? || index < 0 || index >= servers.size)
281
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
282
+ end
283
+
284
+ server = servers[index]
285
+ url = server[:url]
286
+
287
+ return url unless server.key? :variables
288
+
289
+ # go through variable and assign a value
290
+ server[:variables].each do |name, variable|
291
+ if variables.key?(name)
292
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
293
+ url.gsub! "{" + name.to_s + "}", variables[name]
294
+ else
295
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
296
+ end
297
+ else
298
+ # use default value
299
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
300
+ end
301
+ end
302
+
303
+ url
304
+ end
305
+
306
+
307
+ end
308
+ end
@@ -0,0 +1,147 @@
1
+ =begin
2
+ #MailOdds Email Validation API
3
+
4
+ #MailOdds provides email validation services to help maintain clean email lists and improve deliverability. The API performs multiple validation checks including format verification, domain validation, MX record checking, and disposable email detection. ## Authentication All API requests require authentication using a Bearer token. Include your API key in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` API keys can be created in the MailOdds dashboard. ## Rate Limits Rate limits vary by plan: - Free: 10 requests/minute - Starter: 60 requests/minute - Pro: 300 requests/minute - Business: 1000 requests/minute - Enterprise: Custom limits ## Response Format All responses include: - `schema_version`: API schema version (currently \"1.0\") - `request_id`: Unique request identifier for debugging Error responses include: - `error`: Machine-readable error code - `message`: Human-readable error description
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@mailodds.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Mailodds
17
+ class AddPolicyRule201Response < ApiModelBase
18
+ attr_accessor :rule
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'rule' => :'rule'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'rule' => :'PolicyRule'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailodds::AddPolicyRule201Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailodds::AddPolicyRule201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'rule')
67
+ self.rule = attributes[:'rule']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ rule == o.rule
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [rule].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ transformed_hash = {}
113
+ openapi_types.each_pair do |key, type|
114
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
+ transformed_hash["#{key}"] = nil
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
+ end
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
+ end
125
+ end
126
+ new(transformed_hash)
127
+ end
128
+
129
+ # Returns the object in the form of hash
130
+ # @return [Hash] Returns the object in the form of hash
131
+ def to_hash
132
+ hash = {}
133
+ self.class.attribute_map.each_pair do |attr, param|
134
+ value = self.send(attr)
135
+ if value.nil?
136
+ is_nullable = self.class.openapi_nullable.include?(attr)
137
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
138
+ end
139
+
140
+ hash[param] = _to_hash(value)
141
+ end
142
+ hash
143
+ end
144
+
145
+ end
146
+
147
+ end
@@ -0,0 +1,166 @@
1
+ =begin
2
+ #MailOdds Email Validation API
3
+
4
+ #MailOdds provides email validation services to help maintain clean email lists and improve deliverability. The API performs multiple validation checks including format verification, domain validation, MX record checking, and disposable email detection. ## Authentication All API requests require authentication using a Bearer token. Include your API key in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` API keys can be created in the MailOdds dashboard. ## Rate Limits Rate limits vary by plan: - Free: 10 requests/minute - Starter: 60 requests/minute - Pro: 300 requests/minute - Business: 1000 requests/minute - Enterprise: Custom limits ## Response Format All responses include: - `schema_version`: API schema version (currently \"1.0\") - `request_id`: Unique request identifier for debugging Error responses include: - `error`: Machine-readable error code - `message`: Human-readable error description
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@mailodds.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Mailodds
17
+ class AddSuppressionRequest < ApiModelBase
18
+ attr_accessor :entries
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'entries' => :'entries'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'entries' => :'Array<AddSuppressionRequestEntriesInner>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailodds::AddSuppressionRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailodds::AddSuppressionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'entries')
67
+ if (value = attributes[:'entries']).is_a?(Array)
68
+ self.entries = value
69
+ end
70
+ else
71
+ self.entries = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @entries.nil?
81
+ invalid_properties.push('invalid value for "entries", entries cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if @entries.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] entries Value to be assigned
97
+ def entries=(entries)
98
+ if entries.nil?
99
+ fail ArgumentError, 'entries cannot be nil'
100
+ end
101
+
102
+ @entries = entries
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ entries == o.entries
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [entries].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end