mailodds 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +194 -41
- data/ci/Dockerfile +6 -0
- data/ci/smoke_test.rb +78 -0
- data/docs/EmailValidationApi.md +70 -0
- data/docs/ErrorResponse.md +1 -1
- data/docs/ValidateBatch200Response.md +24 -0
- data/docs/ValidateBatch200ResponseSummary.md +26 -0
- data/docs/ValidateBatchRequest.md +22 -0
- data/docs/ValidateRequest.md +2 -0
- data/docs/ValidationResponse.md +24 -10
- data/docs/ValidationResponsePolicyApplied.md +24 -0
- data/docs/ValidationResponseSuppressionMatch.md +3 -3
- data/git_push.sh +2 -2
- data/lib/mailodds/api/email_validation_api.rb +68 -0
- data/lib/mailodds/models/error_response.rb +0 -17
- data/lib/mailodds/models/validate_batch200_response.rb +176 -0
- data/lib/mailodds/models/validate_batch200_response_summary.rb +183 -0
- data/lib/mailodds/models/validate_batch_request.rb +231 -0
- data/lib/mailodds/models/validate_request.rb +47 -1
- data/lib/mailodds/models/validation_response.rb +239 -14
- data/lib/mailodds/models/validation_response_policy_applied.rb +175 -0
- data/lib/mailodds/models/validation_response_suppression_match.rb +14 -13
- data/lib/mailodds/version.rb +1 -1
- data/lib/mailodds.rb +4 -0
- data/mailodds.gemspec +18 -10
- data/spec/models/validate_batch200_response_spec.rb +54 -0
- data/spec/models/validate_batch200_response_summary_spec.rb +60 -0
- data/spec/models/validate_batch_request_spec.rb +52 -0
- data/spec/models/validation_response_policy_applied_spec.rb +54 -0
- metadata +36 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df5ac8671ac5380f8deb9ac57b952a7a141e351834213acb057da74a52c23567
|
|
4
|
+
data.tar.gz: 1057007574bcafe015dd61ecb8fe4523da89434fc76d5ed85a4d7e8098d38c4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f6b45ff83a93ffbc5d3cb6341250db4d12514930ee6a85ffe4ef60e4841de9ba4a4c781e0ce2fc52801aa6b9817030ee0b3a1eb02b984232c2afe1f8d8bddb11
|
|
7
|
+
data.tar.gz: a9b38ba562bf131c311dae3dd3e6acbbb1d45e5817ad68f8e120ce2722a5b003a7b47c73e15d017be3babf702b4adebed5f8c104b435d6904f7adc6177ba90fd
|
data/README.md
CHANGED
|
@@ -1,64 +1,217 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mailodds
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Mailodds - the Ruby gem for the MailOdds Email Validation API
|
|
4
|
+
|
|
5
|
+
MailOdds provides email validation services to help maintain clean email lists
|
|
6
|
+
and improve deliverability. The API performs multiple validation checks including
|
|
7
|
+
format verification, domain validation, MX record checking, and disposable email detection.
|
|
8
|
+
|
|
9
|
+
## Authentication
|
|
10
|
+
|
|
11
|
+
All API requests require authentication using a Bearer token. Include your API key
|
|
12
|
+
in the Authorization header:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Authorization: Bearer YOUR_API_KEY
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
API keys can be created in the MailOdds dashboard.
|
|
19
|
+
|
|
20
|
+
## Rate Limits
|
|
21
|
+
|
|
22
|
+
Rate limits vary by plan:
|
|
23
|
+
- Free: 10 requests/minute
|
|
24
|
+
- Starter: 60 requests/minute
|
|
25
|
+
- Pro: 300 requests/minute
|
|
26
|
+
- Business: 1000 requests/minute
|
|
27
|
+
- Enterprise: Custom limits
|
|
28
|
+
|
|
29
|
+
## Response Format
|
|
30
|
+
|
|
31
|
+
All responses include:
|
|
32
|
+
- `schema_version`: API schema version (currently \"1.0\")
|
|
33
|
+
- `request_id`: Unique request identifier for debugging
|
|
34
|
+
|
|
35
|
+
Error responses include:
|
|
36
|
+
- `error`: Machine-readable error code
|
|
37
|
+
- `message`: Human-readable error description
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
41
|
+
|
|
42
|
+
- API version: 1.0.0
|
|
43
|
+
- Package version: 1.0.0
|
|
44
|
+
- Generator version: 7.19.0
|
|
45
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
46
|
+
For more information, please visit [https://mailodds.com/contact](https://mailodds.com/contact)
|
|
4
47
|
|
|
5
48
|
## Installation
|
|
6
49
|
|
|
50
|
+
### Build a gem
|
|
51
|
+
|
|
52
|
+
To build the Ruby code into a gem:
|
|
53
|
+
|
|
7
54
|
```shell
|
|
8
|
-
gem
|
|
55
|
+
gem build mailodds.gemspec
|
|
9
56
|
```
|
|
10
57
|
|
|
11
|
-
|
|
58
|
+
Then either install the gem locally:
|
|
12
59
|
|
|
13
|
-
```
|
|
14
|
-
gem
|
|
60
|
+
```shell
|
|
61
|
+
gem install ./mailodds-1.0.0.gem
|
|
15
62
|
```
|
|
16
63
|
|
|
17
|
-
|
|
64
|
+
(for development, run `gem install --dev ./mailodds-1.0.0.gem` to install the development dependencies)
|
|
18
65
|
|
|
19
|
-
|
|
20
|
-
require 'mailodds'
|
|
66
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
21
67
|
|
|
22
|
-
|
|
23
|
-
config.access_token = 'mo_live_your_api_key'
|
|
24
|
-
end
|
|
68
|
+
Finally add this to the Gemfile:
|
|
25
69
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
70
|
+
gem 'mailodds', '~> 1.0.0'
|
|
71
|
+
|
|
72
|
+
### Install from Git
|
|
73
|
+
|
|
74
|
+
If the Ruby gem is hosted at a git repository: https://github.com/mailodds/ruby-sdk, then add the following in the Gemfile:
|
|
75
|
+
|
|
76
|
+
gem 'mailodds', :git => 'https://github.com/mailodds/ruby-sdk.git'
|
|
77
|
+
|
|
78
|
+
### Include the Ruby code directly
|
|
79
|
+
|
|
80
|
+
Include the Ruby code directly using `-I` as follows:
|
|
81
|
+
|
|
82
|
+
```shell
|
|
83
|
+
ruby -Ilib script.rb
|
|
40
84
|
```
|
|
41
85
|
|
|
42
|
-
##
|
|
86
|
+
## Getting Started
|
|
43
87
|
|
|
44
|
-
|
|
88
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
|
45
89
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| `accept_with_caution` | Valid but risky (catch-all, role account) | Flag for review |
|
|
50
|
-
| `reject` | Invalid or disposable | Do not send |
|
|
51
|
-
| `retry_later` | Temporary failure | Retry after backoff |
|
|
90
|
+
```ruby
|
|
91
|
+
# Load the gem
|
|
92
|
+
require 'mailodds'
|
|
52
93
|
|
|
53
|
-
|
|
94
|
+
# Setup authorization
|
|
95
|
+
Mailodds.configure do |config|
|
|
96
|
+
# Configure Bearer authorization: BearerAuth
|
|
97
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
98
|
+
# Configure a proc to get access tokens in lieu of the static access_token configuration
|
|
99
|
+
config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
|
|
100
|
+
end
|
|
54
101
|
|
|
55
|
-
|
|
102
|
+
api_instance = Mailodds::BulkValidationApi.new
|
|
103
|
+
job_id = 'job_id_example' # String |
|
|
56
104
|
|
|
57
|
-
|
|
105
|
+
begin
|
|
106
|
+
#Cancel a job
|
|
107
|
+
result = api_instance.cancel_job(job_id)
|
|
108
|
+
p result
|
|
109
|
+
rescue Mailodds::ApiError => e
|
|
110
|
+
puts "Exception when calling BulkValidationApi->cancel_job: #{e}"
|
|
111
|
+
end
|
|
58
112
|
|
|
59
|
-
|
|
60
|
-
OpenAPI spec: https://mailodds.com/openapi.yaml
|
|
113
|
+
```
|
|
61
114
|
|
|
62
|
-
##
|
|
115
|
+
## Documentation for API Endpoints
|
|
116
|
+
|
|
117
|
+
All URIs are relative to *https://api.mailodds.com/v1*
|
|
118
|
+
|
|
119
|
+
Class | Method | HTTP request | Description
|
|
120
|
+
------------ | ------------- | ------------- | -------------
|
|
121
|
+
*Mailodds::BulkValidationApi* | [**cancel_job**](docs/BulkValidationApi.md#cancel_job) | **POST** /v1/jobs/{job_id}/cancel | Cancel a job
|
|
122
|
+
*Mailodds::BulkValidationApi* | [**create_job**](docs/BulkValidationApi.md#create_job) | **POST** /v1/jobs | Create bulk validation job (JSON)
|
|
123
|
+
*Mailodds::BulkValidationApi* | [**create_job_from_s3**](docs/BulkValidationApi.md#create_job_from_s3) | **POST** /v1/jobs/upload/s3 | Create job from S3 upload
|
|
124
|
+
*Mailodds::BulkValidationApi* | [**create_job_upload**](docs/BulkValidationApi.md#create_job_upload) | **POST** /v1/jobs/upload | Create bulk validation job (file upload)
|
|
125
|
+
*Mailodds::BulkValidationApi* | [**delete_job**](docs/BulkValidationApi.md#delete_job) | **DELETE** /v1/jobs/{job_id} | Delete a job
|
|
126
|
+
*Mailodds::BulkValidationApi* | [**get_job**](docs/BulkValidationApi.md#get_job) | **GET** /v1/jobs/{job_id} | Get job status
|
|
127
|
+
*Mailodds::BulkValidationApi* | [**get_job_results**](docs/BulkValidationApi.md#get_job_results) | **GET** /v1/jobs/{job_id}/results | Get job results
|
|
128
|
+
*Mailodds::BulkValidationApi* | [**get_presigned_upload**](docs/BulkValidationApi.md#get_presigned_upload) | **POST** /v1/jobs/upload/presigned | Get S3 presigned upload URL
|
|
129
|
+
*Mailodds::BulkValidationApi* | [**list_jobs**](docs/BulkValidationApi.md#list_jobs) | **GET** /v1/jobs | List validation jobs
|
|
130
|
+
*Mailodds::EmailValidationApi* | [**validate_batch**](docs/EmailValidationApi.md#validate_batch) | **POST** /v1/validate/batch | Validate multiple emails (sync)
|
|
131
|
+
*Mailodds::EmailValidationApi* | [**validate_email**](docs/EmailValidationApi.md#validate_email) | **POST** /v1/validate | Validate single email
|
|
132
|
+
*Mailodds::SuppressionListsApi* | [**add_suppression**](docs/SuppressionListsApi.md#add_suppression) | **POST** /v1/suppression | Add suppression entries
|
|
133
|
+
*Mailodds::SuppressionListsApi* | [**check_suppression**](docs/SuppressionListsApi.md#check_suppression) | **POST** /v1/suppression/check | Check suppression status
|
|
134
|
+
*Mailodds::SuppressionListsApi* | [**get_suppression_stats**](docs/SuppressionListsApi.md#get_suppression_stats) | **GET** /v1/suppression/stats | Get suppression statistics
|
|
135
|
+
*Mailodds::SuppressionListsApi* | [**list_suppression**](docs/SuppressionListsApi.md#list_suppression) | **GET** /v1/suppression | List suppression entries
|
|
136
|
+
*Mailodds::SuppressionListsApi* | [**remove_suppression**](docs/SuppressionListsApi.md#remove_suppression) | **DELETE** /v1/suppression | Remove suppression entries
|
|
137
|
+
*Mailodds::SystemApi* | [**get_telemetry_summary**](docs/SystemApi.md#get_telemetry_summary) | **GET** /v1/telemetry/summary | Get validation telemetry
|
|
138
|
+
*Mailodds::SystemApi* | [**health_check**](docs/SystemApi.md#health_check) | **GET** /health | Health check
|
|
139
|
+
*Mailodds::ValidationPoliciesApi* | [**add_policy_rule**](docs/ValidationPoliciesApi.md#add_policy_rule) | **POST** /v1/policies/{policy_id}/rules | Add rule to policy
|
|
140
|
+
*Mailodds::ValidationPoliciesApi* | [**create_policy**](docs/ValidationPoliciesApi.md#create_policy) | **POST** /v1/policies | Create policy
|
|
141
|
+
*Mailodds::ValidationPoliciesApi* | [**create_policy_from_preset**](docs/ValidationPoliciesApi.md#create_policy_from_preset) | **POST** /v1/policies/from-preset | Create policy from preset
|
|
142
|
+
*Mailodds::ValidationPoliciesApi* | [**delete_policy**](docs/ValidationPoliciesApi.md#delete_policy) | **DELETE** /v1/policies/{policy_id} | Delete policy
|
|
143
|
+
*Mailodds::ValidationPoliciesApi* | [**delete_policy_rule**](docs/ValidationPoliciesApi.md#delete_policy_rule) | **DELETE** /v1/policies/{policy_id}/rules/{rule_id} | Delete rule
|
|
144
|
+
*Mailodds::ValidationPoliciesApi* | [**get_policy**](docs/ValidationPoliciesApi.md#get_policy) | **GET** /v1/policies/{policy_id} | Get policy
|
|
145
|
+
*Mailodds::ValidationPoliciesApi* | [**get_policy_presets**](docs/ValidationPoliciesApi.md#get_policy_presets) | **GET** /v1/policies/presets | Get policy presets
|
|
146
|
+
*Mailodds::ValidationPoliciesApi* | [**list_policies**](docs/ValidationPoliciesApi.md#list_policies) | **GET** /v1/policies | List policies
|
|
147
|
+
*Mailodds::ValidationPoliciesApi* | [**test_policy**](docs/ValidationPoliciesApi.md#test_policy) | **POST** /v1/policies/test | Test policy evaluation
|
|
148
|
+
*Mailodds::ValidationPoliciesApi* | [**update_policy**](docs/ValidationPoliciesApi.md#update_policy) | **PUT** /v1/policies/{policy_id} | Update policy
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
## Documentation for Models
|
|
152
|
+
|
|
153
|
+
- [Mailodds::AddPolicyRule201Response](docs/AddPolicyRule201Response.md)
|
|
154
|
+
- [Mailodds::AddSuppressionRequest](docs/AddSuppressionRequest.md)
|
|
155
|
+
- [Mailodds::AddSuppressionRequestEntriesInner](docs/AddSuppressionRequestEntriesInner.md)
|
|
156
|
+
- [Mailodds::AddSuppressionResponse](docs/AddSuppressionResponse.md)
|
|
157
|
+
- [Mailodds::CheckSuppressionRequest](docs/CheckSuppressionRequest.md)
|
|
158
|
+
- [Mailodds::CreateJobFromS3Request](docs/CreateJobFromS3Request.md)
|
|
159
|
+
- [Mailodds::CreateJobRequest](docs/CreateJobRequest.md)
|
|
160
|
+
- [Mailodds::CreatePolicyFromPresetRequest](docs/CreatePolicyFromPresetRequest.md)
|
|
161
|
+
- [Mailodds::CreatePolicyRequest](docs/CreatePolicyRequest.md)
|
|
162
|
+
- [Mailodds::DeleteJob200Response](docs/DeleteJob200Response.md)
|
|
163
|
+
- [Mailodds::DeletePolicy200Response](docs/DeletePolicy200Response.md)
|
|
164
|
+
- [Mailodds::DeletePolicyRule200Response](docs/DeletePolicyRule200Response.md)
|
|
165
|
+
- [Mailodds::ErrorResponse](docs/ErrorResponse.md)
|
|
166
|
+
- [Mailodds::GetPresignedUploadRequest](docs/GetPresignedUploadRequest.md)
|
|
167
|
+
- [Mailodds::HealthCheck200Response](docs/HealthCheck200Response.md)
|
|
168
|
+
- [Mailodds::Job](docs/Job.md)
|
|
169
|
+
- [Mailodds::JobListResponse](docs/JobListResponse.md)
|
|
170
|
+
- [Mailodds::JobResponse](docs/JobResponse.md)
|
|
171
|
+
- [Mailodds::JobSummary](docs/JobSummary.md)
|
|
172
|
+
- [Mailodds::Pagination](docs/Pagination.md)
|
|
173
|
+
- [Mailodds::Policy](docs/Policy.md)
|
|
174
|
+
- [Mailodds::PolicyListResponse](docs/PolicyListResponse.md)
|
|
175
|
+
- [Mailodds::PolicyListResponseLimits](docs/PolicyListResponseLimits.md)
|
|
176
|
+
- [Mailodds::PolicyPresetsResponse](docs/PolicyPresetsResponse.md)
|
|
177
|
+
- [Mailodds::PolicyPresetsResponsePresetsInner](docs/PolicyPresetsResponsePresetsInner.md)
|
|
178
|
+
- [Mailodds::PolicyResponse](docs/PolicyResponse.md)
|
|
179
|
+
- [Mailodds::PolicyRule](docs/PolicyRule.md)
|
|
180
|
+
- [Mailodds::PolicyRuleAction](docs/PolicyRuleAction.md)
|
|
181
|
+
- [Mailodds::PolicyTestResponse](docs/PolicyTestResponse.md)
|
|
182
|
+
- [Mailodds::PresignedUploadResponse](docs/PresignedUploadResponse.md)
|
|
183
|
+
- [Mailodds::PresignedUploadResponseUpload](docs/PresignedUploadResponseUpload.md)
|
|
184
|
+
- [Mailodds::RemoveSuppression200Response](docs/RemoveSuppression200Response.md)
|
|
185
|
+
- [Mailodds::RemoveSuppressionRequest](docs/RemoveSuppressionRequest.md)
|
|
186
|
+
- [Mailodds::ResultsResponse](docs/ResultsResponse.md)
|
|
187
|
+
- [Mailodds::SuppressionCheckResponse](docs/SuppressionCheckResponse.md)
|
|
188
|
+
- [Mailodds::SuppressionEntry](docs/SuppressionEntry.md)
|
|
189
|
+
- [Mailodds::SuppressionListResponse](docs/SuppressionListResponse.md)
|
|
190
|
+
- [Mailodds::SuppressionStatsResponse](docs/SuppressionStatsResponse.md)
|
|
191
|
+
- [Mailodds::SuppressionStatsResponseByType](docs/SuppressionStatsResponseByType.md)
|
|
192
|
+
- [Mailodds::TelemetrySummary](docs/TelemetrySummary.md)
|
|
193
|
+
- [Mailodds::TelemetrySummaryRates](docs/TelemetrySummaryRates.md)
|
|
194
|
+
- [Mailodds::TelemetrySummaryTopDomainsInner](docs/TelemetrySummaryTopDomainsInner.md)
|
|
195
|
+
- [Mailodds::TelemetrySummaryTopReasonsInner](docs/TelemetrySummaryTopReasonsInner.md)
|
|
196
|
+
- [Mailodds::TelemetrySummaryTotals](docs/TelemetrySummaryTotals.md)
|
|
197
|
+
- [Mailodds::TestPolicyRequest](docs/TestPolicyRequest.md)
|
|
198
|
+
- [Mailodds::TestPolicyRequestTestResult](docs/TestPolicyRequestTestResult.md)
|
|
199
|
+
- [Mailodds::UpdatePolicyRequest](docs/UpdatePolicyRequest.md)
|
|
200
|
+
- [Mailodds::ValidateBatch200Response](docs/ValidateBatch200Response.md)
|
|
201
|
+
- [Mailodds::ValidateBatch200ResponseSummary](docs/ValidateBatch200ResponseSummary.md)
|
|
202
|
+
- [Mailodds::ValidateBatchRequest](docs/ValidateBatchRequest.md)
|
|
203
|
+
- [Mailodds::ValidateRequest](docs/ValidateRequest.md)
|
|
204
|
+
- [Mailodds::ValidationResponse](docs/ValidationResponse.md)
|
|
205
|
+
- [Mailodds::ValidationResponsePolicyApplied](docs/ValidationResponsePolicyApplied.md)
|
|
206
|
+
- [Mailodds::ValidationResponseSuppressionMatch](docs/ValidationResponseSuppressionMatch.md)
|
|
207
|
+
- [Mailodds::ValidationResult](docs/ValidationResult.md)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## Documentation for Authorization
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
Authentication schemes defined for the API:
|
|
214
|
+
### BearerAuth
|
|
215
|
+
|
|
216
|
+
- **Type**: Bearer authentication
|
|
63
217
|
|
|
64
|
-
MIT
|
data/ci/Dockerfile
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
FROM docker.io/library/ruby:3.3-slim
|
|
2
|
+
RUN apt-get update -qq && apt-get install -y build-essential libcurl4-openssl-dev && rm -rf /var/lib/apt/lists/*
|
|
3
|
+
WORKDIR /sdk
|
|
4
|
+
COPY . .
|
|
5
|
+
RUN gem build mailodds.gemspec && gem install mailodds-*.gem
|
|
6
|
+
CMD ["ruby", "ci/smoke_test.rb"]
|
data/ci/smoke_test.rb
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# SDK smoke test -- validates build-from-source and API integration using the SDK client.
|
|
2
|
+
require 'mailodds'
|
|
3
|
+
|
|
4
|
+
api_key = ENV['MAILODDS_TEST_KEY']
|
|
5
|
+
abort('ERROR: MAILODDS_TEST_KEY not set') if api_key.nil? || api_key.empty?
|
|
6
|
+
|
|
7
|
+
Mailodds.configure do |c|
|
|
8
|
+
c.access_token = api_key
|
|
9
|
+
c.base_path = ''
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
api = Mailodds::EmailValidationApi.new
|
|
13
|
+
|
|
14
|
+
$passed = 0
|
|
15
|
+
$failed = 0
|
|
16
|
+
|
|
17
|
+
def check(label, expected, actual)
|
|
18
|
+
if expected == actual
|
|
19
|
+
$passed += 1
|
|
20
|
+
else
|
|
21
|
+
$failed += 1
|
|
22
|
+
puts " FAIL: #{label} expected=#{expected.inspect} got=#{actual.inspect}"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
cases = [
|
|
27
|
+
['test@deliverable.mailodds.com', 'valid', 'accept', nil],
|
|
28
|
+
['test@invalid.mailodds.com', 'invalid', 'reject', 'smtp_rejected'],
|
|
29
|
+
['test@risky.mailodds.com', 'catch_all', 'accept_with_caution', 'catch_all_detected'],
|
|
30
|
+
['test@disposable.mailodds.com', 'do_not_mail', 'reject', 'disposable'],
|
|
31
|
+
['test@role.mailodds.com', 'do_not_mail', 'reject', 'role_account'],
|
|
32
|
+
['test@timeout.mailodds.com', 'unknown', 'retry_later', 'smtp_unreachable'],
|
|
33
|
+
['test@freeprovider.mailodds.com', 'valid', 'accept', nil],
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
cases.each do |email, exp_status, exp_action, exp_sub|
|
|
37
|
+
domain = email.split('@')[1].split('.')[0]
|
|
38
|
+
begin
|
|
39
|
+
req = Mailodds::ValidateRequest.new(email: email)
|
|
40
|
+
resp = api.validate_email(req)
|
|
41
|
+
check("#{domain}.status", exp_status, resp.status)
|
|
42
|
+
check("#{domain}.action", exp_action, resp.action)
|
|
43
|
+
check("#{domain}.sub_status", exp_sub, resp.sub_status)
|
|
44
|
+
rescue => e
|
|
45
|
+
$failed += 1
|
|
46
|
+
puts " FAIL: #{domain} #{e.class}: #{e.message}"
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Error handling: 401 with bad key
|
|
51
|
+
begin
|
|
52
|
+
bad_config = Mailodds::Configuration.new { |c| c.access_token = 'invalid_key'; c.base_path = '' }
|
|
53
|
+
bad_api = Mailodds::EmailValidationApi.new(Mailodds::ApiClient.new(bad_config))
|
|
54
|
+
bad_api.validate_email(Mailodds::ValidateRequest.new(email: 'test@deliverable.mailodds.com'))
|
|
55
|
+
$failed += 1
|
|
56
|
+
puts ' FAIL: error.401 no exception raised'
|
|
57
|
+
rescue Mailodds::ApiError => e
|
|
58
|
+
check('error.401', 401, e.code)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Error handling: 400/422 with missing email
|
|
62
|
+
begin
|
|
63
|
+
api.validate_email(Mailodds::ValidateRequest.new(email: ''))
|
|
64
|
+
$failed += 1
|
|
65
|
+
puts ' FAIL: error.400 no exception raised'
|
|
66
|
+
rescue Mailodds::ApiError => e
|
|
67
|
+
if [400, 422].include?(e.code)
|
|
68
|
+
$passed += 1
|
|
69
|
+
else
|
|
70
|
+
$failed += 1
|
|
71
|
+
puts " FAIL: error.400 expected=400|422 got=#{e.code}"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
total = $passed + $failed
|
|
76
|
+
result = $failed == 0 ? 'PASS' : 'FAIL'
|
|
77
|
+
puts "\n#{result}: Ruby SDK (#{$passed}/#{total})"
|
|
78
|
+
exit($failed == 0 ? 0 : 1)
|
data/docs/EmailValidationApi.md
CHANGED
|
@@ -4,9 +4,79 @@ All URIs are relative to *https://api.mailodds.com/v1*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**validate_batch**](EmailValidationApi.md#validate_batch) | **POST** /v1/validate/batch | Validate multiple emails (sync) |
|
|
7
8
|
| [**validate_email**](EmailValidationApi.md#validate_email) | **POST** /v1/validate | Validate single email |
|
|
8
9
|
|
|
9
10
|
|
|
11
|
+
## validate_batch
|
|
12
|
+
|
|
13
|
+
> <ValidateBatch200Response> validate_batch(validate_batch_request)
|
|
14
|
+
|
|
15
|
+
Validate multiple emails (sync)
|
|
16
|
+
|
|
17
|
+
Validate up to 100 email addresses synchronously. For larger lists, use the bulk jobs API.
|
|
18
|
+
|
|
19
|
+
### Examples
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
require 'time'
|
|
23
|
+
require 'mailodds'
|
|
24
|
+
# setup authorization
|
|
25
|
+
Mailodds.configure do |config|
|
|
26
|
+
# Configure Bearer authorization: BearerAuth
|
|
27
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
api_instance = Mailodds::EmailValidationApi.new
|
|
31
|
+
validate_batch_request = Mailodds::ValidateBatchRequest.new({emails: ['emails_example']}) # ValidateBatchRequest |
|
|
32
|
+
|
|
33
|
+
begin
|
|
34
|
+
# Validate multiple emails (sync)
|
|
35
|
+
result = api_instance.validate_batch(validate_batch_request)
|
|
36
|
+
p result
|
|
37
|
+
rescue Mailodds::ApiError => e
|
|
38
|
+
puts "Error when calling EmailValidationApi->validate_batch: #{e}"
|
|
39
|
+
end
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Using the validate_batch_with_http_info variant
|
|
43
|
+
|
|
44
|
+
This returns an Array which contains the response data, status code and headers.
|
|
45
|
+
|
|
46
|
+
> <Array(<ValidateBatch200Response>, Integer, Hash)> validate_batch_with_http_info(validate_batch_request)
|
|
47
|
+
|
|
48
|
+
```ruby
|
|
49
|
+
begin
|
|
50
|
+
# Validate multiple emails (sync)
|
|
51
|
+
data, status_code, headers = api_instance.validate_batch_with_http_info(validate_batch_request)
|
|
52
|
+
p status_code # => 2xx
|
|
53
|
+
p headers # => { ... }
|
|
54
|
+
p data # => <ValidateBatch200Response>
|
|
55
|
+
rescue Mailodds::ApiError => e
|
|
56
|
+
puts "Error when calling EmailValidationApi->validate_batch_with_http_info: #{e}"
|
|
57
|
+
end
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Parameters
|
|
61
|
+
|
|
62
|
+
| Name | Type | Description | Notes |
|
|
63
|
+
| ---- | ---- | ----------- | ----- |
|
|
64
|
+
| **validate_batch_request** | [**ValidateBatchRequest**](ValidateBatchRequest.md) | | |
|
|
65
|
+
|
|
66
|
+
### Return type
|
|
67
|
+
|
|
68
|
+
[**ValidateBatch200Response**](ValidateBatch200Response.md)
|
|
69
|
+
|
|
70
|
+
### Authorization
|
|
71
|
+
|
|
72
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
73
|
+
|
|
74
|
+
### HTTP request headers
|
|
75
|
+
|
|
76
|
+
- **Content-Type**: application/json
|
|
77
|
+
- **Accept**: application/json
|
|
78
|
+
|
|
79
|
+
|
|
10
80
|
## validate_email
|
|
11
81
|
|
|
12
82
|
> <ValidationResponse> validate_email(validate_request)
|
data/docs/ErrorResponse.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **schema_version** | **String** | | [optional] |
|
|
8
8
|
| **error** | **String** | Machine-readable error code | |
|
|
9
|
-
| **message** | **String** | Human-readable error message |
|
|
9
|
+
| **message** | **String** | Human-readable error message | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
|
12
12
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Mailodds::ValidateBatch200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **schema_version** | **String** | | [optional] |
|
|
8
|
+
| **total** | **Integer** | | [optional] |
|
|
9
|
+
| **summary** | [**ValidateBatch200ResponseSummary**](ValidateBatch200ResponseSummary.md) | | [optional] |
|
|
10
|
+
| **results** | [**Array<ValidationResponse>**](ValidationResponse.md) | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'mailodds'
|
|
16
|
+
|
|
17
|
+
instance = Mailodds::ValidateBatch200Response.new(
|
|
18
|
+
schema_version: null,
|
|
19
|
+
total: null,
|
|
20
|
+
summary: null,
|
|
21
|
+
results: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Mailodds::ValidateBatch200ResponseSummary
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **valid** | **Integer** | | [optional] |
|
|
8
|
+
| **invalid** | **Integer** | | [optional] |
|
|
9
|
+
| **catch_all** | **Integer** | | [optional] |
|
|
10
|
+
| **unknown** | **Integer** | | [optional] |
|
|
11
|
+
| **do_not_mail** | **Integer** | | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'mailodds'
|
|
17
|
+
|
|
18
|
+
instance = Mailodds::ValidateBatch200ResponseSummary.new(
|
|
19
|
+
valid: null,
|
|
20
|
+
invalid: null,
|
|
21
|
+
catch_all: null,
|
|
22
|
+
unknown: null,
|
|
23
|
+
do_not_mail: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Mailodds::ValidateBatchRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **emails** | **Array<String>** | List of emails to validate | |
|
|
8
|
+
| **depth** | **String** | | [optional][default to 'enhanced'] |
|
|
9
|
+
| **policy_id** | **Integer** | Optional policy ID | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'mailodds'
|
|
15
|
+
|
|
16
|
+
instance = Mailodds::ValidateBatchRequest.new(
|
|
17
|
+
emails: null,
|
|
18
|
+
depth: null,
|
|
19
|
+
policy_id: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/ValidateRequest.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **email** | **String** | Email address to validate | |
|
|
8
|
+
| **depth** | **String** | Validation depth. 'standard' skips SMTP verification. | [optional][default to 'enhanced'] |
|
|
8
9
|
| **policy_id** | **Integer** | Optional policy ID to use instead of default policy | [optional] |
|
|
9
10
|
|
|
10
11
|
## Example
|
|
@@ -14,6 +15,7 @@ require 'mailodds'
|
|
|
14
15
|
|
|
15
16
|
instance = Mailodds::ValidateRequest.new(
|
|
16
17
|
email: null,
|
|
18
|
+
depth: null,
|
|
17
19
|
policy_id: null
|
|
18
20
|
)
|
|
19
21
|
```
|
data/docs/ValidationResponse.md
CHANGED
|
@@ -4,18 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **schema_version** | **String** | |
|
|
7
|
+
| **schema_version** | **String** | | |
|
|
8
8
|
| **email** | **String** | | |
|
|
9
9
|
| **status** | **String** | Validation status | |
|
|
10
|
-
| **sub_status** | **String** | Detailed status reason | [optional] |
|
|
11
10
|
| **action** | **String** | Recommended action | |
|
|
12
|
-
| **
|
|
13
|
-
| **
|
|
14
|
-
| **
|
|
15
|
-
| **
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
11
|
+
| **sub_status** | **String** | Detailed status reason. Omitted when none. | [optional] |
|
|
12
|
+
| **domain** | **String** | | |
|
|
13
|
+
| **mx_found** | **Boolean** | Whether MX records were found for the domain | |
|
|
14
|
+
| **mx_host** | **String** | Primary MX hostname. Omitted when MX not resolved. | [optional] |
|
|
15
|
+
| **smtp_check** | **Boolean** | Whether SMTP verification passed. Omitted when SMTP not checked. | [optional] |
|
|
16
|
+
| **catch_all** | **Boolean** | Whether domain is catch-all. Omitted when SMTP not checked. | [optional] |
|
|
17
|
+
| **disposable** | **Boolean** | Whether domain is a known disposable email provider | |
|
|
18
|
+
| **role_account** | **Boolean** | Whether address is a role account (e.g., info@, admin@) | |
|
|
19
|
+
| **free_provider** | **Boolean** | Whether domain is a known free email provider (e.g., gmail.com) | |
|
|
20
|
+
| **depth** | **String** | Validation depth used for this check | |
|
|
21
|
+
| **processed_at** | **Time** | ISO 8601 timestamp of validation | |
|
|
22
|
+
| **suggested_email** | **String** | Typo correction suggestion. Omitted when no typo detected. | [optional] |
|
|
23
|
+
| **retry_after_ms** | **Integer** | Suggested retry delay in milliseconds. Present only for retry_later action. | [optional] |
|
|
18
24
|
| **suppression_match** | [**ValidationResponseSuppressionMatch**](ValidationResponseSuppressionMatch.md) | | [optional] |
|
|
25
|
+
| **policy_applied** | [**ValidationResponsePolicyApplied**](ValidationResponsePolicyApplied.md) | | [optional] |
|
|
19
26
|
|
|
20
27
|
## Example
|
|
21
28
|
|
|
@@ -26,15 +33,22 @@ instance = Mailodds::ValidationResponse.new(
|
|
|
26
33
|
schema_version: 1.0,
|
|
27
34
|
email: null,
|
|
28
35
|
status: null,
|
|
29
|
-
sub_status: null,
|
|
30
36
|
action: null,
|
|
37
|
+
sub_status: null,
|
|
31
38
|
domain: null,
|
|
32
39
|
mx_found: null,
|
|
40
|
+
mx_host: null,
|
|
33
41
|
smtp_check: null,
|
|
42
|
+
catch_all: null,
|
|
34
43
|
disposable: null,
|
|
35
44
|
role_account: null,
|
|
36
45
|
free_provider: null,
|
|
37
|
-
|
|
46
|
+
depth: null,
|
|
47
|
+
processed_at: null,
|
|
48
|
+
suggested_email: null,
|
|
49
|
+
retry_after_ms: null,
|
|
50
|
+
suppression_match: null,
|
|
51
|
+
policy_applied: null
|
|
38
52
|
)
|
|
39
53
|
```
|
|
40
54
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Mailodds::ValidationResponsePolicyApplied
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **policy_id** | **Integer** | | [optional] |
|
|
8
|
+
| **policy_name** | **String** | | [optional] |
|
|
9
|
+
| **rule_id** | **Integer** | | [optional] |
|
|
10
|
+
| **rule_type** | **String** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'mailodds'
|
|
16
|
+
|
|
17
|
+
instance = Mailodds::ValidationResponsePolicyApplied.new(
|
|
18
|
+
policy_id: null,
|
|
19
|
+
policy_name: null,
|
|
20
|
+
rule_id: null,
|
|
21
|
+
rule_type: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **matched** | **Boolean** | | [optional] |
|
|
8
7
|
| **match_type** | **String** | | [optional] |
|
|
9
8
|
| **match_value** | **String** | | [optional] |
|
|
9
|
+
| **reason** | **String** | | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
|
12
12
|
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
require 'mailodds'
|
|
15
15
|
|
|
16
16
|
instance = Mailodds::ValidationResponseSuppressionMatch.new(
|
|
17
|
-
matched: null,
|
|
18
17
|
match_type: null,
|
|
19
|
-
match_value: null
|
|
18
|
+
match_value: null,
|
|
19
|
+
reason: null
|
|
20
20
|
)
|
|
21
21
|
```
|
|
22
22
|
|
data/git_push.sh
CHANGED
|
@@ -14,12 +14,12 @@ if [ "$git_host" = "" ]; then
|
|
|
14
14
|
fi
|
|
15
15
|
|
|
16
16
|
if [ "$git_user_id" = "" ]; then
|
|
17
|
-
git_user_id="
|
|
17
|
+
git_user_id="GIT_USER_ID"
|
|
18
18
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
|
19
19
|
fi
|
|
20
20
|
|
|
21
21
|
if [ "$git_repo_id" = "" ]; then
|
|
22
|
-
git_repo_id="
|
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
|
23
23
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
|
24
24
|
fi
|
|
25
25
|
|