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,156 @@
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 PolicyResponse < ApiModelBase
18
+ attr_accessor :schema_version
19
+
20
+ attr_accessor :policy
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'schema_version' => :'schema_version',
26
+ :'policy' => :'policy'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'schema_version' => :'String',
44
+ :'policy' => :'Policy'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailodds::PolicyResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailodds::PolicyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'schema_version')
71
+ self.schema_version = attributes[:'schema_version']
72
+ end
73
+
74
+ if attributes.key?(:'policy')
75
+ self.policy = attributes[:'policy']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
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
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ schema_version == o.schema_version &&
100
+ policy == o.policy
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [schema_version, policy].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end
@@ -0,0 +1,269 @@
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 PolicyRule < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ # Rule type determines how condition is evaluated
21
+ attr_accessor :type
22
+
23
+ # Condition depends on rule type. status_override: {status}, domain_filter: {domain_mode, domains}, check_requirement: {check, required}, sub_status_override: {sub_status}
24
+ attr_accessor :condition
25
+
26
+ attr_accessor :action
27
+
28
+ attr_accessor :sequence
29
+
30
+ attr_accessor :is_enabled
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'id' => :'id',
58
+ :'type' => :'type',
59
+ :'condition' => :'condition',
60
+ :'action' => :'action',
61
+ :'sequence' => :'sequence',
62
+ :'is_enabled' => :'is_enabled'
63
+ }
64
+ end
65
+
66
+ # Returns attribute mapping this model knows about
67
+ def self.acceptable_attribute_map
68
+ attribute_map
69
+ end
70
+
71
+ # Returns all the JSON keys this model knows about
72
+ def self.acceptable_attributes
73
+ acceptable_attribute_map.values
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.openapi_types
78
+ {
79
+ :'id' => :'Integer',
80
+ :'type' => :'String',
81
+ :'condition' => :'Object',
82
+ :'action' => :'PolicyRuleAction',
83
+ :'sequence' => :'Integer',
84
+ :'is_enabled' => :'Boolean'
85
+ }
86
+ end
87
+
88
+ # List of attributes with nullable: true
89
+ def self.openapi_nullable
90
+ Set.new([
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailodds::PolicyRule` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ acceptable_attribute_map = self.class.acceptable_attribute_map
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!acceptable_attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailodds::PolicyRule`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'id')
111
+ self.id = attributes[:'id']
112
+ end
113
+
114
+ if attributes.key?(:'type')
115
+ self.type = attributes[:'type']
116
+ else
117
+ self.type = nil
118
+ end
119
+
120
+ if attributes.key?(:'condition')
121
+ self.condition = attributes[:'condition']
122
+ else
123
+ self.condition = nil
124
+ end
125
+
126
+ if attributes.key?(:'action')
127
+ self.action = attributes[:'action']
128
+ else
129
+ self.action = nil
130
+ end
131
+
132
+ if attributes.key?(:'sequence')
133
+ self.sequence = attributes[:'sequence']
134
+ end
135
+
136
+ if attributes.key?(:'is_enabled')
137
+ self.is_enabled = attributes[:'is_enabled']
138
+ end
139
+ end
140
+
141
+ # Show invalid properties with the reasons. Usually used together with valid?
142
+ # @return Array for valid properties with the reasons
143
+ def list_invalid_properties
144
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
145
+ invalid_properties = Array.new
146
+ if @type.nil?
147
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
148
+ end
149
+
150
+ if @condition.nil?
151
+ invalid_properties.push('invalid value for "condition", condition cannot be nil.')
152
+ end
153
+
154
+ if @action.nil?
155
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
156
+ end
157
+
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ warn '[DEPRECATED] the `valid?` method is obsolete'
165
+ return false if @type.nil?
166
+ type_validator = EnumAttributeValidator.new('String', ["status_override", "domain_filter", "check_requirement", "sub_status_override"])
167
+ return false unless type_validator.valid?(@type)
168
+ return false if @condition.nil?
169
+ return false if @action.nil?
170
+ true
171
+ end
172
+
173
+ # Custom attribute writer method checking allowed values (enum).
174
+ # @param [Object] type Object to be assigned
175
+ def type=(type)
176
+ validator = EnumAttributeValidator.new('String', ["status_override", "domain_filter", "check_requirement", "sub_status_override"])
177
+ unless validator.valid?(type)
178
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
179
+ end
180
+ @type = type
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] condition Value to be assigned
185
+ def condition=(condition)
186
+ if condition.nil?
187
+ fail ArgumentError, 'condition cannot be nil'
188
+ end
189
+
190
+ @condition = condition
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] action Value to be assigned
195
+ def action=(action)
196
+ if action.nil?
197
+ fail ArgumentError, 'action cannot be nil'
198
+ end
199
+
200
+ @action = action
201
+ end
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] Object to be compared
205
+ def ==(o)
206
+ return true if self.equal?(o)
207
+ self.class == o.class &&
208
+ id == o.id &&
209
+ type == o.type &&
210
+ condition == o.condition &&
211
+ action == o.action &&
212
+ sequence == o.sequence &&
213
+ is_enabled == o.is_enabled
214
+ end
215
+
216
+ # @see the `==` method
217
+ # @param [Object] Object to be compared
218
+ def eql?(o)
219
+ self == o
220
+ end
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Integer] Hash code
224
+ def hash
225
+ [id, type, condition, action, sequence, is_enabled].hash
226
+ end
227
+
228
+ # Builds the object from hash
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ # @return [Object] Returns the model itself
231
+ def self.build_from_hash(attributes)
232
+ return nil unless attributes.is_a?(Hash)
233
+ attributes = attributes.transform_keys(&:to_sym)
234
+ transformed_hash = {}
235
+ openapi_types.each_pair do |key, type|
236
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
237
+ transformed_hash["#{key}"] = nil
238
+ elsif type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[attribute_map[key]].is_a?(Array)
242
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
243
+ end
244
+ elsif !attributes[attribute_map[key]].nil?
245
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
246
+ end
247
+ end
248
+ new(transformed_hash)
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ end
268
+
269
+ end
@@ -0,0 +1,181 @@
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 PolicyRuleAction < ApiModelBase
18
+ attr_accessor :action
19
+
20
+ class EnumAttributeValidator
21
+ attr_reader :datatype
22
+ attr_reader :allowable_values
23
+
24
+ def initialize(datatype, allowable_values)
25
+ @allowable_values = allowable_values.map do |value|
26
+ case datatype.to_s
27
+ when /Integer/i
28
+ value.to_i
29
+ when /Float/i
30
+ value.to_f
31
+ else
32
+ value
33
+ end
34
+ end
35
+ end
36
+
37
+ def valid?(value)
38
+ !value || allowable_values.include?(value)
39
+ end
40
+ end
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'action' => :'action'
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
+ :'action' => :'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::PolicyRuleAction` 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::PolicyRuleAction`. 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?(:'action')
89
+ self.action = attributes[:'action']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ action_validator = EnumAttributeValidator.new('String', ["accept", "reject", "accept_with_caution", "do_not_mail", "review"])
106
+ return false unless action_validator.valid?(@action)
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method checking allowed values (enum).
111
+ # @param [Object] action Object to be assigned
112
+ def action=(action)
113
+ validator = EnumAttributeValidator.new('String', ["accept", "reject", "accept_with_caution", "do_not_mail", "review"])
114
+ unless validator.valid?(action)
115
+ fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
116
+ end
117
+ @action = action
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ action == o.action
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [action].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
146
+ transformed_hash = {}
147
+ openapi_types.each_pair do |key, type|
148
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = nil
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[attribute_map[key]].is_a?(Array)
154
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
+ end
156
+ elsif !attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
+ end
159
+ end
160
+ new(transformed_hash)
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ if value.nil?
170
+ is_nullable = self.class.openapi_nullable.include?(attr)
171
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
172
+ end
173
+
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ end
180
+
181
+ end