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,176 @@
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 CreateJobFromS3Request < ApiModelBase
18
+ # S3 key from presigned upload
19
+ attr_accessor :s3_key
20
+
21
+ attr_accessor :dedup
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'s3_key' => :'s3_key',
27
+ :'dedup' => :'dedup'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'s3_key' => :'String',
45
+ :'dedup' => :'Boolean'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailodds::CreateJobFromS3Request` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailodds::CreateJobFromS3Request`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'s3_key')
72
+ self.s3_key = attributes[:'s3_key']
73
+ else
74
+ self.s3_key = nil
75
+ end
76
+
77
+ if attributes.key?(:'dedup')
78
+ self.dedup = attributes[:'dedup']
79
+ else
80
+ self.dedup = false
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ if @s3_key.nil?
90
+ invalid_properties.push('invalid value for "s3_key", s3_key cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ return false if @s3_key.nil?
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param [Object] s3_key Value to be assigned
106
+ def s3_key=(s3_key)
107
+ if s3_key.nil?
108
+ fail ArgumentError, 's3_key cannot be nil'
109
+ end
110
+
111
+ @s3_key = s3_key
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ s3_key == o.s3_key &&
120
+ dedup == o.dedup
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [s3_key, dedup].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ if value.nil?
165
+ is_nullable = self.class.openapi_nullable.include?(attr)
166
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
167
+ end
168
+
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ end
175
+
176
+ end
@@ -0,0 +1,219 @@
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
+ # Bulk jobs use the account's default validation policy. To use a specific policy, set it as default via the Policies API.
18
+ class CreateJobRequest < ApiModelBase
19
+ # List of emails to validate
20
+ attr_accessor :emails
21
+
22
+ # Remove duplicate emails
23
+ attr_accessor :dedup
24
+
25
+ # Custom metadata for the job
26
+ attr_accessor :metadata
27
+
28
+ # URL for completion webhook
29
+ attr_accessor :webhook_url
30
+
31
+ # Unique key for idempotent requests
32
+ attr_accessor :idempotency_key
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'emails' => :'emails',
38
+ :'dedup' => :'dedup',
39
+ :'metadata' => :'metadata',
40
+ :'webhook_url' => :'webhook_url',
41
+ :'idempotency_key' => :'idempotency_key'
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
+ :'dedup' => :'Boolean',
60
+ :'metadata' => :'Object',
61
+ :'webhook_url' => :'String',
62
+ :'idempotency_key' => :'String'
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 `Mailodds::CreateJobRequest` 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 `Mailodds::CreateJobRequest`. 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?(:'dedup')
97
+ self.dedup = attributes[:'dedup']
98
+ else
99
+ self.dedup = false
100
+ end
101
+
102
+ if attributes.key?(:'metadata')
103
+ self.metadata = attributes[:'metadata']
104
+ end
105
+
106
+ if attributes.key?(:'webhook_url')
107
+ self.webhook_url = attributes[:'webhook_url']
108
+ end
109
+
110
+ if attributes.key?(:'idempotency_key')
111
+ self.idempotency_key = attributes[:'idempotency_key']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @emails.nil?
121
+ invalid_properties.push('invalid value for "emails", emails cannot be nil.')
122
+ end
123
+
124
+ if @emails.length > 100000
125
+ invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 100000.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @emails.nil?
136
+ return false if @emails.length > 100000
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] emails Value to be assigned
142
+ def emails=(emails)
143
+ if emails.nil?
144
+ fail ArgumentError, 'emails cannot be nil'
145
+ end
146
+
147
+ if emails.length > 100000
148
+ fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 100000.'
149
+ end
150
+
151
+ @emails = emails
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ emails == o.emails &&
160
+ dedup == o.dedup &&
161
+ metadata == o.metadata &&
162
+ webhook_url == o.webhook_url &&
163
+ idempotency_key == o.idempotency_key
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [emails, dedup, metadata, webhook_url, idempotency_key].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -0,0 +1,225 @@
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 CreatePolicyFromPresetRequest < ApiModelBase
18
+ attr_accessor :preset_id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :is_default
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'preset_id' => :'preset_id',
50
+ :'name' => :'name',
51
+ :'is_default' => :'is_default'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'preset_id' => :'String',
69
+ :'name' => :'String',
70
+ :'is_default' => :'Boolean'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailodds::CreatePolicyFromPresetRequest` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailodds::CreatePolicyFromPresetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'preset_id')
97
+ self.preset_id = attributes[:'preset_id']
98
+ else
99
+ self.preset_id = nil
100
+ end
101
+
102
+ if attributes.key?(:'name')
103
+ self.name = attributes[:'name']
104
+ else
105
+ self.name = nil
106
+ end
107
+
108
+ if attributes.key?(:'is_default')
109
+ self.is_default = attributes[:'is_default']
110
+ else
111
+ self.is_default = false
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @preset_id.nil?
121
+ invalid_properties.push('invalid value for "preset_id", preset_id cannot be nil.')
122
+ end
123
+
124
+ if @name.nil?
125
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @preset_id.nil?
136
+ preset_id_validator = EnumAttributeValidator.new('String', ["strict", "permissive", "smtp_required"])
137
+ return false unless preset_id_validator.valid?(@preset_id)
138
+ return false if @name.nil?
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] preset_id Object to be assigned
144
+ def preset_id=(preset_id)
145
+ validator = EnumAttributeValidator.new('String', ["strict", "permissive", "smtp_required"])
146
+ unless validator.valid?(preset_id)
147
+ fail ArgumentError, "invalid value for \"preset_id\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @preset_id = preset_id
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] name Value to be assigned
154
+ def name=(name)
155
+ if name.nil?
156
+ fail ArgumentError, 'name cannot be nil'
157
+ end
158
+
159
+ @name = name
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ preset_id == o.preset_id &&
168
+ name == o.name &&
169
+ is_default == o.is_default
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ def hash
181
+ [preset_id, name, is_default].hash
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def self.build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+ transformed_hash = {}
191
+ openapi_types.each_pair do |key, type|
192
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = nil
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[attribute_map[key]].is_a?(Array)
198
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
199
+ end
200
+ elsif !attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
202
+ end
203
+ end
204
+ new(transformed_hash)
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ end
224
+
225
+ end