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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +64 -0
- data/Rakefile +10 -0
- data/docs/AddPolicyRule201Response.md +18 -0
- data/docs/AddSuppressionRequest.md +18 -0
- data/docs/AddSuppressionRequestEntriesInner.md +22 -0
- data/docs/AddSuppressionResponse.md +22 -0
- data/docs/BulkValidationApi.md +659 -0
- data/docs/CheckSuppressionRequest.md +18 -0
- data/docs/CreateJobFromS3Request.md +20 -0
- data/docs/CreateJobRequest.md +26 -0
- data/docs/CreatePolicyFromPresetRequest.md +22 -0
- data/docs/CreatePolicyRequest.md +24 -0
- data/docs/DeleteJob200Response.md +20 -0
- data/docs/DeletePolicy200Response.md +20 -0
- data/docs/DeletePolicyRule200Response.md +18 -0
- data/docs/EmailValidationApi.md +77 -0
- data/docs/ErrorResponse.md +22 -0
- data/docs/GetPresignedUploadRequest.md +20 -0
- data/docs/HealthCheck200Response.md +20 -0
- data/docs/Job.md +34 -0
- data/docs/JobListResponse.md +22 -0
- data/docs/JobResponse.md +20 -0
- data/docs/JobSummary.md +26 -0
- data/docs/Pagination.md +24 -0
- data/docs/Policy.md +34 -0
- data/docs/PolicyListResponse.md +22 -0
- data/docs/PolicyListResponseLimits.md +22 -0
- data/docs/PolicyPresetsResponse.md +20 -0
- data/docs/PolicyPresetsResponsePresetsInner.md +24 -0
- data/docs/PolicyResponse.md +20 -0
- data/docs/PolicyRule.md +28 -0
- data/docs/PolicyRuleAction.md +18 -0
- data/docs/PolicyTestResponse.md +26 -0
- data/docs/PresignedUploadResponse.md +20 -0
- data/docs/PresignedUploadResponseUpload.md +24 -0
- data/docs/RemoveSuppression200Response.md +20 -0
- data/docs/RemoveSuppressionRequest.md +18 -0
- data/docs/ResultsResponse.md +22 -0
- data/docs/SuppressionCheckResponse.md +26 -0
- data/docs/SuppressionEntry.md +26 -0
- data/docs/SuppressionListResponse.md +22 -0
- data/docs/SuppressionListsApi.md +362 -0
- data/docs/SuppressionStatsResponse.md +22 -0
- data/docs/SuppressionStatsResponseByType.md +20 -0
- data/docs/SystemApi.md +141 -0
- data/docs/TelemetrySummary.md +32 -0
- data/docs/TelemetrySummaryRates.md +24 -0
- data/docs/TelemetrySummaryTopDomainsInner.md +28 -0
- data/docs/TelemetrySummaryTopReasonsInner.md +20 -0
- data/docs/TelemetrySummaryTotals.md +20 -0
- data/docs/TestPolicyRequest.md +20 -0
- data/docs/TestPolicyRequestTestResult.md +26 -0
- data/docs/UpdatePolicyRequest.md +24 -0
- data/docs/ValidateRequest.md +20 -0
- data/docs/ValidationPoliciesApi.md +712 -0
- data/docs/ValidationResponse.md +40 -0
- data/docs/ValidationResponseSuppressionMatch.md +22 -0
- data/docs/ValidationResult.md +26 -0
- data/git_push.sh +57 -0
- data/lib/mailodds/api/bulk_validation_api.rb +651 -0
- data/lib/mailodds/api/email_validation_api.rb +90 -0
- data/lib/mailodds/api/suppression_lists_api.rb +356 -0
- data/lib/mailodds/api/system_api.rb +143 -0
- data/lib/mailodds/api/validation_policies_api.rb +686 -0
- data/lib/mailodds/api_client.rb +397 -0
- data/lib/mailodds/api_error.rb +58 -0
- data/lib/mailodds/api_model_base.rb +88 -0
- data/lib/mailodds/configuration.rb +308 -0
- data/lib/mailodds/models/add_policy_rule201_response.rb +147 -0
- data/lib/mailodds/models/add_suppression_request.rb +166 -0
- data/lib/mailodds/models/add_suppression_request_entries_inner.rb +223 -0
- data/lib/mailodds/models/add_suppression_response.rb +165 -0
- data/lib/mailodds/models/check_suppression_request.rb +164 -0
- data/lib/mailodds/models/create_job_from_s3_request.rb +176 -0
- data/lib/mailodds/models/create_job_request.rb +219 -0
- data/lib/mailodds/models/create_policy_from_preset_request.rb +225 -0
- data/lib/mailodds/models/create_policy_request.rb +223 -0
- data/lib/mailodds/models/delete_job200_response.rb +156 -0
- data/lib/mailodds/models/delete_policy200_response.rb +156 -0
- data/lib/mailodds/models/delete_policy_rule200_response.rb +147 -0
- data/lib/mailodds/models/error_response.rb +201 -0
- data/lib/mailodds/models/get_presigned_upload_request.rb +175 -0
- data/lib/mailodds/models/health_check200_response.rb +156 -0
- data/lib/mailodds/models/job.rb +281 -0
- data/lib/mailodds/models/job_list_response.rb +167 -0
- data/lib/mailodds/models/job_response.rb +156 -0
- data/lib/mailodds/models/job_summary.rb +183 -0
- data/lib/mailodds/models/pagination.rb +174 -0
- data/lib/mailodds/models/policy.rb +221 -0
- data/lib/mailodds/models/policy_list_response.rb +167 -0
- data/lib/mailodds/models/policy_list_response_limits.rb +166 -0
- data/lib/mailodds/models/policy_presets_response.rb +158 -0
- data/lib/mailodds/models/policy_presets_response_presets_inner.rb +176 -0
- data/lib/mailodds/models/policy_response.rb +156 -0
- data/lib/mailodds/models/policy_rule.rb +269 -0
- data/lib/mailodds/models/policy_rule_action.rb +181 -0
- data/lib/mailodds/models/policy_test_response.rb +187 -0
- data/lib/mailodds/models/presigned_upload_response.rb +156 -0
- data/lib/mailodds/models/presigned_upload_response_upload.rb +174 -0
- data/lib/mailodds/models/remove_suppression200_response.rb +156 -0
- data/lib/mailodds/models/remove_suppression_request.rb +166 -0
- data/lib/mailodds/models/results_response.rb +167 -0
- data/lib/mailodds/models/suppression_check_response.rb +217 -0
- data/lib/mailodds/models/suppression_entry.rb +217 -0
- data/lib/mailodds/models/suppression_list_response.rb +167 -0
- data/lib/mailodds/models/suppression_stats_response.rb +165 -0
- data/lib/mailodds/models/suppression_stats_response_by_type.rb +156 -0
- data/lib/mailodds/models/telemetry_summary.rb +251 -0
- data/lib/mailodds/models/telemetry_summary_rates.rb +179 -0
- data/lib/mailodds/models/telemetry_summary_top_domains_inner.rb +192 -0
- data/lib/mailodds/models/telemetry_summary_top_reasons_inner.rb +156 -0
- data/lib/mailodds/models/telemetry_summary_totals.rb +158 -0
- data/lib/mailodds/models/test_policy_request.rb +190 -0
- data/lib/mailodds/models/test_policy_request_test_result.rb +184 -0
- data/lib/mailodds/models/update_policy_request.rb +174 -0
- data/lib/mailodds/models/validate_request.rb +175 -0
- data/lib/mailodds/models/validation_response.rb +326 -0
- data/lib/mailodds/models/validation_response_suppression_match.rb +199 -0
- data/lib/mailodds/models/validation_result.rb +183 -0
- data/lib/mailodds/version.rb +15 -0
- data/lib/mailodds.rb +96 -0
- data/mailodds.gemspec +31 -0
- data/spec/api/bulk_validation_api_spec.rb +151 -0
- data/spec/api/email_validation_api_spec.rb +47 -0
- data/spec/api/suppression_lists_api_spec.rb +97 -0
- data/spec/api/system_api_spec.rb +58 -0
- data/spec/api/validation_policies_api_spec.rb +157 -0
- data/spec/models/add_policy_rule201_response_spec.rb +36 -0
- data/spec/models/add_suppression_request_entries_inner_spec.rb +52 -0
- data/spec/models/add_suppression_request_spec.rb +36 -0
- data/spec/models/add_suppression_response_spec.rb +48 -0
- data/spec/models/check_suppression_request_spec.rb +36 -0
- data/spec/models/create_job_from_s3_request_spec.rb +42 -0
- data/spec/models/create_job_request_spec.rb +60 -0
- data/spec/models/create_policy_from_preset_request_spec.rb +52 -0
- data/spec/models/create_policy_request_spec.rb +54 -0
- data/spec/models/delete_job200_response_spec.rb +42 -0
- data/spec/models/delete_policy200_response_spec.rb +42 -0
- data/spec/models/delete_policy_rule200_response_spec.rb +36 -0
- data/spec/models/error_response_spec.rb +48 -0
- data/spec/models/get_presigned_upload_request_spec.rb +42 -0
- data/spec/models/health_check200_response_spec.rb +42 -0
- data/spec/models/job_list_response_spec.rb +48 -0
- data/spec/models/job_response_spec.rb +42 -0
- data/spec/models/job_spec.rb +88 -0
- data/spec/models/job_summary_spec.rb +60 -0
- data/spec/models/pagination_spec.rb +54 -0
- data/spec/models/policy_list_response_limits_spec.rb +48 -0
- data/spec/models/policy_list_response_spec.rb +48 -0
- data/spec/models/policy_presets_response_presets_inner_spec.rb +54 -0
- data/spec/models/policy_presets_response_spec.rb +42 -0
- data/spec/models/policy_response_spec.rb +42 -0
- data/spec/models/policy_rule_action_spec.rb +40 -0
- data/spec/models/policy_rule_spec.rb +70 -0
- data/spec/models/policy_spec.rb +84 -0
- data/spec/models/policy_test_response_spec.rb +60 -0
- data/spec/models/presigned_upload_response_spec.rb +42 -0
- data/spec/models/presigned_upload_response_upload_spec.rb +54 -0
- data/spec/models/remove_suppression200_response_spec.rb +42 -0
- data/spec/models/remove_suppression_request_spec.rb +36 -0
- data/spec/models/results_response_spec.rb +48 -0
- data/spec/models/suppression_check_response_spec.rb +64 -0
- data/spec/models/suppression_entry_spec.rb +64 -0
- data/spec/models/suppression_list_response_spec.rb +48 -0
- data/spec/models/suppression_stats_response_by_type_spec.rb +42 -0
- data/spec/models/suppression_stats_response_spec.rb +48 -0
- data/spec/models/telemetry_summary_rates_spec.rb +54 -0
- data/spec/models/telemetry_summary_spec.rb +82 -0
- data/spec/models/telemetry_summary_top_domains_inner_spec.rb +66 -0
- data/spec/models/telemetry_summary_top_reasons_inner_spec.rb +42 -0
- data/spec/models/telemetry_summary_totals_spec.rb +42 -0
- data/spec/models/test_policy_request_spec.rb +42 -0
- data/spec/models/test_policy_request_test_result_spec.rb +60 -0
- data/spec/models/update_policy_request_spec.rb +54 -0
- data/spec/models/validate_request_spec.rb +42 -0
- data/spec/models/validation_response_spec.rb +110 -0
- data/spec/models/validation_response_suppression_match_spec.rb +52 -0
- data/spec/models/validation_result_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- metadata +322 -0
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
# Mailodds::ValidationPoliciesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.mailodds.com/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**add_policy_rule**](ValidationPoliciesApi.md#add_policy_rule) | **POST** /v1/policies/{policy_id}/rules | Add rule to policy |
|
|
8
|
+
| [**create_policy**](ValidationPoliciesApi.md#create_policy) | **POST** /v1/policies | Create policy |
|
|
9
|
+
| [**create_policy_from_preset**](ValidationPoliciesApi.md#create_policy_from_preset) | **POST** /v1/policies/from-preset | Create policy from preset |
|
|
10
|
+
| [**delete_policy**](ValidationPoliciesApi.md#delete_policy) | **DELETE** /v1/policies/{policy_id} | Delete policy |
|
|
11
|
+
| [**delete_policy_rule**](ValidationPoliciesApi.md#delete_policy_rule) | **DELETE** /v1/policies/{policy_id}/rules/{rule_id} | Delete rule |
|
|
12
|
+
| [**get_policy**](ValidationPoliciesApi.md#get_policy) | **GET** /v1/policies/{policy_id} | Get policy |
|
|
13
|
+
| [**get_policy_presets**](ValidationPoliciesApi.md#get_policy_presets) | **GET** /v1/policies/presets | Get policy presets |
|
|
14
|
+
| [**list_policies**](ValidationPoliciesApi.md#list_policies) | **GET** /v1/policies | List policies |
|
|
15
|
+
| [**test_policy**](ValidationPoliciesApi.md#test_policy) | **POST** /v1/policies/test | Test policy evaluation |
|
|
16
|
+
| [**update_policy**](ValidationPoliciesApi.md#update_policy) | **PUT** /v1/policies/{policy_id} | Update policy |
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## add_policy_rule
|
|
20
|
+
|
|
21
|
+
> <AddPolicyRule201Response> add_policy_rule(policy_id, policy_rule)
|
|
22
|
+
|
|
23
|
+
Add rule to policy
|
|
24
|
+
|
|
25
|
+
Add a new rule to an existing policy.
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
require 'time'
|
|
31
|
+
require 'mailodds'
|
|
32
|
+
# setup authorization
|
|
33
|
+
Mailodds.configure do |config|
|
|
34
|
+
# Configure Bearer authorization: BearerAuth
|
|
35
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
39
|
+
policy_id = 56 # Integer |
|
|
40
|
+
policy_rule = Mailodds::PolicyRule.new({type: 'status_override', condition: 3.56, action: Mailodds::PolicyRuleAction.new}) # PolicyRule |
|
|
41
|
+
|
|
42
|
+
begin
|
|
43
|
+
# Add rule to policy
|
|
44
|
+
result = api_instance.add_policy_rule(policy_id, policy_rule)
|
|
45
|
+
p result
|
|
46
|
+
rescue Mailodds::ApiError => e
|
|
47
|
+
puts "Error when calling ValidationPoliciesApi->add_policy_rule: #{e}"
|
|
48
|
+
end
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Using the add_policy_rule_with_http_info variant
|
|
52
|
+
|
|
53
|
+
This returns an Array which contains the response data, status code and headers.
|
|
54
|
+
|
|
55
|
+
> <Array(<AddPolicyRule201Response>, Integer, Hash)> add_policy_rule_with_http_info(policy_id, policy_rule)
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
begin
|
|
59
|
+
# Add rule to policy
|
|
60
|
+
data, status_code, headers = api_instance.add_policy_rule_with_http_info(policy_id, policy_rule)
|
|
61
|
+
p status_code # => 2xx
|
|
62
|
+
p headers # => { ... }
|
|
63
|
+
p data # => <AddPolicyRule201Response>
|
|
64
|
+
rescue Mailodds::ApiError => e
|
|
65
|
+
puts "Error when calling ValidationPoliciesApi->add_policy_rule_with_http_info: #{e}"
|
|
66
|
+
end
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Parameters
|
|
70
|
+
|
|
71
|
+
| Name | Type | Description | Notes |
|
|
72
|
+
| ---- | ---- | ----------- | ----- |
|
|
73
|
+
| **policy_id** | **Integer** | | |
|
|
74
|
+
| **policy_rule** | [**PolicyRule**](PolicyRule.md) | | |
|
|
75
|
+
|
|
76
|
+
### Return type
|
|
77
|
+
|
|
78
|
+
[**AddPolicyRule201Response**](AddPolicyRule201Response.md)
|
|
79
|
+
|
|
80
|
+
### Authorization
|
|
81
|
+
|
|
82
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
83
|
+
|
|
84
|
+
### HTTP request headers
|
|
85
|
+
|
|
86
|
+
- **Content-Type**: application/json
|
|
87
|
+
- **Accept**: application/json
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## create_policy
|
|
91
|
+
|
|
92
|
+
> <PolicyResponse> create_policy(create_policy_request)
|
|
93
|
+
|
|
94
|
+
Create policy
|
|
95
|
+
|
|
96
|
+
Create a new validation policy with rules.
|
|
97
|
+
|
|
98
|
+
### Examples
|
|
99
|
+
|
|
100
|
+
```ruby
|
|
101
|
+
require 'time'
|
|
102
|
+
require 'mailodds'
|
|
103
|
+
# setup authorization
|
|
104
|
+
Mailodds.configure do |config|
|
|
105
|
+
# Configure Bearer authorization: BearerAuth
|
|
106
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
110
|
+
create_policy_request = Mailodds::CreatePolicyRequest.new({name: 'name_example'}) # CreatePolicyRequest |
|
|
111
|
+
|
|
112
|
+
begin
|
|
113
|
+
# Create policy
|
|
114
|
+
result = api_instance.create_policy(create_policy_request)
|
|
115
|
+
p result
|
|
116
|
+
rescue Mailodds::ApiError => e
|
|
117
|
+
puts "Error when calling ValidationPoliciesApi->create_policy: #{e}"
|
|
118
|
+
end
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Using the create_policy_with_http_info variant
|
|
122
|
+
|
|
123
|
+
This returns an Array which contains the response data, status code and headers.
|
|
124
|
+
|
|
125
|
+
> <Array(<PolicyResponse>, Integer, Hash)> create_policy_with_http_info(create_policy_request)
|
|
126
|
+
|
|
127
|
+
```ruby
|
|
128
|
+
begin
|
|
129
|
+
# Create policy
|
|
130
|
+
data, status_code, headers = api_instance.create_policy_with_http_info(create_policy_request)
|
|
131
|
+
p status_code # => 2xx
|
|
132
|
+
p headers # => { ... }
|
|
133
|
+
p data # => <PolicyResponse>
|
|
134
|
+
rescue Mailodds::ApiError => e
|
|
135
|
+
puts "Error when calling ValidationPoliciesApi->create_policy_with_http_info: #{e}"
|
|
136
|
+
end
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Parameters
|
|
140
|
+
|
|
141
|
+
| Name | Type | Description | Notes |
|
|
142
|
+
| ---- | ---- | ----------- | ----- |
|
|
143
|
+
| **create_policy_request** | [**CreatePolicyRequest**](CreatePolicyRequest.md) | | |
|
|
144
|
+
|
|
145
|
+
### Return type
|
|
146
|
+
|
|
147
|
+
[**PolicyResponse**](PolicyResponse.md)
|
|
148
|
+
|
|
149
|
+
### Authorization
|
|
150
|
+
|
|
151
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
152
|
+
|
|
153
|
+
### HTTP request headers
|
|
154
|
+
|
|
155
|
+
- **Content-Type**: application/json
|
|
156
|
+
- **Accept**: application/json
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
## create_policy_from_preset
|
|
160
|
+
|
|
161
|
+
> <PolicyResponse> create_policy_from_preset(create_policy_from_preset_request)
|
|
162
|
+
|
|
163
|
+
Create policy from preset
|
|
164
|
+
|
|
165
|
+
Create a policy using a preset template.
|
|
166
|
+
|
|
167
|
+
### Examples
|
|
168
|
+
|
|
169
|
+
```ruby
|
|
170
|
+
require 'time'
|
|
171
|
+
require 'mailodds'
|
|
172
|
+
# setup authorization
|
|
173
|
+
Mailodds.configure do |config|
|
|
174
|
+
# Configure Bearer authorization: BearerAuth
|
|
175
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
179
|
+
create_policy_from_preset_request = Mailodds::CreatePolicyFromPresetRequest.new({preset_id: 'strict', name: 'name_example'}) # CreatePolicyFromPresetRequest |
|
|
180
|
+
|
|
181
|
+
begin
|
|
182
|
+
# Create policy from preset
|
|
183
|
+
result = api_instance.create_policy_from_preset(create_policy_from_preset_request)
|
|
184
|
+
p result
|
|
185
|
+
rescue Mailodds::ApiError => e
|
|
186
|
+
puts "Error when calling ValidationPoliciesApi->create_policy_from_preset: #{e}"
|
|
187
|
+
end
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### Using the create_policy_from_preset_with_http_info variant
|
|
191
|
+
|
|
192
|
+
This returns an Array which contains the response data, status code and headers.
|
|
193
|
+
|
|
194
|
+
> <Array(<PolicyResponse>, Integer, Hash)> create_policy_from_preset_with_http_info(create_policy_from_preset_request)
|
|
195
|
+
|
|
196
|
+
```ruby
|
|
197
|
+
begin
|
|
198
|
+
# Create policy from preset
|
|
199
|
+
data, status_code, headers = api_instance.create_policy_from_preset_with_http_info(create_policy_from_preset_request)
|
|
200
|
+
p status_code # => 2xx
|
|
201
|
+
p headers # => { ... }
|
|
202
|
+
p data # => <PolicyResponse>
|
|
203
|
+
rescue Mailodds::ApiError => e
|
|
204
|
+
puts "Error when calling ValidationPoliciesApi->create_policy_from_preset_with_http_info: #{e}"
|
|
205
|
+
end
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Parameters
|
|
209
|
+
|
|
210
|
+
| Name | Type | Description | Notes |
|
|
211
|
+
| ---- | ---- | ----------- | ----- |
|
|
212
|
+
| **create_policy_from_preset_request** | [**CreatePolicyFromPresetRequest**](CreatePolicyFromPresetRequest.md) | | |
|
|
213
|
+
|
|
214
|
+
### Return type
|
|
215
|
+
|
|
216
|
+
[**PolicyResponse**](PolicyResponse.md)
|
|
217
|
+
|
|
218
|
+
### Authorization
|
|
219
|
+
|
|
220
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
221
|
+
|
|
222
|
+
### HTTP request headers
|
|
223
|
+
|
|
224
|
+
- **Content-Type**: application/json
|
|
225
|
+
- **Accept**: application/json
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
## delete_policy
|
|
229
|
+
|
|
230
|
+
> <DeletePolicy200Response> delete_policy(policy_id)
|
|
231
|
+
|
|
232
|
+
Delete policy
|
|
233
|
+
|
|
234
|
+
Delete a policy and all its rules.
|
|
235
|
+
|
|
236
|
+
### Examples
|
|
237
|
+
|
|
238
|
+
```ruby
|
|
239
|
+
require 'time'
|
|
240
|
+
require 'mailodds'
|
|
241
|
+
# setup authorization
|
|
242
|
+
Mailodds.configure do |config|
|
|
243
|
+
# Configure Bearer authorization: BearerAuth
|
|
244
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
248
|
+
policy_id = 56 # Integer |
|
|
249
|
+
|
|
250
|
+
begin
|
|
251
|
+
# Delete policy
|
|
252
|
+
result = api_instance.delete_policy(policy_id)
|
|
253
|
+
p result
|
|
254
|
+
rescue Mailodds::ApiError => e
|
|
255
|
+
puts "Error when calling ValidationPoliciesApi->delete_policy: #{e}"
|
|
256
|
+
end
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### Using the delete_policy_with_http_info variant
|
|
260
|
+
|
|
261
|
+
This returns an Array which contains the response data, status code and headers.
|
|
262
|
+
|
|
263
|
+
> <Array(<DeletePolicy200Response>, Integer, Hash)> delete_policy_with_http_info(policy_id)
|
|
264
|
+
|
|
265
|
+
```ruby
|
|
266
|
+
begin
|
|
267
|
+
# Delete policy
|
|
268
|
+
data, status_code, headers = api_instance.delete_policy_with_http_info(policy_id)
|
|
269
|
+
p status_code # => 2xx
|
|
270
|
+
p headers # => { ... }
|
|
271
|
+
p data # => <DeletePolicy200Response>
|
|
272
|
+
rescue Mailodds::ApiError => e
|
|
273
|
+
puts "Error when calling ValidationPoliciesApi->delete_policy_with_http_info: #{e}"
|
|
274
|
+
end
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Parameters
|
|
278
|
+
|
|
279
|
+
| Name | Type | Description | Notes |
|
|
280
|
+
| ---- | ---- | ----------- | ----- |
|
|
281
|
+
| **policy_id** | **Integer** | | |
|
|
282
|
+
|
|
283
|
+
### Return type
|
|
284
|
+
|
|
285
|
+
[**DeletePolicy200Response**](DeletePolicy200Response.md)
|
|
286
|
+
|
|
287
|
+
### Authorization
|
|
288
|
+
|
|
289
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
290
|
+
|
|
291
|
+
### HTTP request headers
|
|
292
|
+
|
|
293
|
+
- **Content-Type**: Not defined
|
|
294
|
+
- **Accept**: application/json
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
## delete_policy_rule
|
|
298
|
+
|
|
299
|
+
> <DeletePolicyRule200Response> delete_policy_rule(policy_id, rule_id)
|
|
300
|
+
|
|
301
|
+
Delete rule
|
|
302
|
+
|
|
303
|
+
Delete a rule from a policy.
|
|
304
|
+
|
|
305
|
+
### Examples
|
|
306
|
+
|
|
307
|
+
```ruby
|
|
308
|
+
require 'time'
|
|
309
|
+
require 'mailodds'
|
|
310
|
+
# setup authorization
|
|
311
|
+
Mailodds.configure do |config|
|
|
312
|
+
# Configure Bearer authorization: BearerAuth
|
|
313
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
317
|
+
policy_id = 56 # Integer |
|
|
318
|
+
rule_id = 56 # Integer |
|
|
319
|
+
|
|
320
|
+
begin
|
|
321
|
+
# Delete rule
|
|
322
|
+
result = api_instance.delete_policy_rule(policy_id, rule_id)
|
|
323
|
+
p result
|
|
324
|
+
rescue Mailodds::ApiError => e
|
|
325
|
+
puts "Error when calling ValidationPoliciesApi->delete_policy_rule: #{e}"
|
|
326
|
+
end
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
#### Using the delete_policy_rule_with_http_info variant
|
|
330
|
+
|
|
331
|
+
This returns an Array which contains the response data, status code and headers.
|
|
332
|
+
|
|
333
|
+
> <Array(<DeletePolicyRule200Response>, Integer, Hash)> delete_policy_rule_with_http_info(policy_id, rule_id)
|
|
334
|
+
|
|
335
|
+
```ruby
|
|
336
|
+
begin
|
|
337
|
+
# Delete rule
|
|
338
|
+
data, status_code, headers = api_instance.delete_policy_rule_with_http_info(policy_id, rule_id)
|
|
339
|
+
p status_code # => 2xx
|
|
340
|
+
p headers # => { ... }
|
|
341
|
+
p data # => <DeletePolicyRule200Response>
|
|
342
|
+
rescue Mailodds::ApiError => e
|
|
343
|
+
puts "Error when calling ValidationPoliciesApi->delete_policy_rule_with_http_info: #{e}"
|
|
344
|
+
end
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Parameters
|
|
348
|
+
|
|
349
|
+
| Name | Type | Description | Notes |
|
|
350
|
+
| ---- | ---- | ----------- | ----- |
|
|
351
|
+
| **policy_id** | **Integer** | | |
|
|
352
|
+
| **rule_id** | **Integer** | | |
|
|
353
|
+
|
|
354
|
+
### Return type
|
|
355
|
+
|
|
356
|
+
[**DeletePolicyRule200Response**](DeletePolicyRule200Response.md)
|
|
357
|
+
|
|
358
|
+
### Authorization
|
|
359
|
+
|
|
360
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
361
|
+
|
|
362
|
+
### HTTP request headers
|
|
363
|
+
|
|
364
|
+
- **Content-Type**: Not defined
|
|
365
|
+
- **Accept**: application/json
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
## get_policy
|
|
369
|
+
|
|
370
|
+
> <PolicyResponse> get_policy(policy_id)
|
|
371
|
+
|
|
372
|
+
Get policy
|
|
373
|
+
|
|
374
|
+
Get a single policy with its rules.
|
|
375
|
+
|
|
376
|
+
### Examples
|
|
377
|
+
|
|
378
|
+
```ruby
|
|
379
|
+
require 'time'
|
|
380
|
+
require 'mailodds'
|
|
381
|
+
# setup authorization
|
|
382
|
+
Mailodds.configure do |config|
|
|
383
|
+
# Configure Bearer authorization: BearerAuth
|
|
384
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
388
|
+
policy_id = 56 # Integer |
|
|
389
|
+
|
|
390
|
+
begin
|
|
391
|
+
# Get policy
|
|
392
|
+
result = api_instance.get_policy(policy_id)
|
|
393
|
+
p result
|
|
394
|
+
rescue Mailodds::ApiError => e
|
|
395
|
+
puts "Error when calling ValidationPoliciesApi->get_policy: #{e}"
|
|
396
|
+
end
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
#### Using the get_policy_with_http_info variant
|
|
400
|
+
|
|
401
|
+
This returns an Array which contains the response data, status code and headers.
|
|
402
|
+
|
|
403
|
+
> <Array(<PolicyResponse>, Integer, Hash)> get_policy_with_http_info(policy_id)
|
|
404
|
+
|
|
405
|
+
```ruby
|
|
406
|
+
begin
|
|
407
|
+
# Get policy
|
|
408
|
+
data, status_code, headers = api_instance.get_policy_with_http_info(policy_id)
|
|
409
|
+
p status_code # => 2xx
|
|
410
|
+
p headers # => { ... }
|
|
411
|
+
p data # => <PolicyResponse>
|
|
412
|
+
rescue Mailodds::ApiError => e
|
|
413
|
+
puts "Error when calling ValidationPoliciesApi->get_policy_with_http_info: #{e}"
|
|
414
|
+
end
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Parameters
|
|
418
|
+
|
|
419
|
+
| Name | Type | Description | Notes |
|
|
420
|
+
| ---- | ---- | ----------- | ----- |
|
|
421
|
+
| **policy_id** | **Integer** | | |
|
|
422
|
+
|
|
423
|
+
### Return type
|
|
424
|
+
|
|
425
|
+
[**PolicyResponse**](PolicyResponse.md)
|
|
426
|
+
|
|
427
|
+
### Authorization
|
|
428
|
+
|
|
429
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
430
|
+
|
|
431
|
+
### HTTP request headers
|
|
432
|
+
|
|
433
|
+
- **Content-Type**: Not defined
|
|
434
|
+
- **Accept**: application/json
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
## get_policy_presets
|
|
438
|
+
|
|
439
|
+
> <PolicyPresetsResponse> get_policy_presets
|
|
440
|
+
|
|
441
|
+
Get policy presets
|
|
442
|
+
|
|
443
|
+
Get available preset templates for quick policy creation.
|
|
444
|
+
|
|
445
|
+
### Examples
|
|
446
|
+
|
|
447
|
+
```ruby
|
|
448
|
+
require 'time'
|
|
449
|
+
require 'mailodds'
|
|
450
|
+
# setup authorization
|
|
451
|
+
Mailodds.configure do |config|
|
|
452
|
+
# Configure Bearer authorization: BearerAuth
|
|
453
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
457
|
+
|
|
458
|
+
begin
|
|
459
|
+
# Get policy presets
|
|
460
|
+
result = api_instance.get_policy_presets
|
|
461
|
+
p result
|
|
462
|
+
rescue Mailodds::ApiError => e
|
|
463
|
+
puts "Error when calling ValidationPoliciesApi->get_policy_presets: #{e}"
|
|
464
|
+
end
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
#### Using the get_policy_presets_with_http_info variant
|
|
468
|
+
|
|
469
|
+
This returns an Array which contains the response data, status code and headers.
|
|
470
|
+
|
|
471
|
+
> <Array(<PolicyPresetsResponse>, Integer, Hash)> get_policy_presets_with_http_info
|
|
472
|
+
|
|
473
|
+
```ruby
|
|
474
|
+
begin
|
|
475
|
+
# Get policy presets
|
|
476
|
+
data, status_code, headers = api_instance.get_policy_presets_with_http_info
|
|
477
|
+
p status_code # => 2xx
|
|
478
|
+
p headers # => { ... }
|
|
479
|
+
p data # => <PolicyPresetsResponse>
|
|
480
|
+
rescue Mailodds::ApiError => e
|
|
481
|
+
puts "Error when calling ValidationPoliciesApi->get_policy_presets_with_http_info: #{e}"
|
|
482
|
+
end
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### Parameters
|
|
486
|
+
|
|
487
|
+
This endpoint does not need any parameter.
|
|
488
|
+
|
|
489
|
+
### Return type
|
|
490
|
+
|
|
491
|
+
[**PolicyPresetsResponse**](PolicyPresetsResponse.md)
|
|
492
|
+
|
|
493
|
+
### Authorization
|
|
494
|
+
|
|
495
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
496
|
+
|
|
497
|
+
### HTTP request headers
|
|
498
|
+
|
|
499
|
+
- **Content-Type**: Not defined
|
|
500
|
+
- **Accept**: application/json
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
## list_policies
|
|
504
|
+
|
|
505
|
+
> <PolicyListResponse> list_policies(opts)
|
|
506
|
+
|
|
507
|
+
List policies
|
|
508
|
+
|
|
509
|
+
List all validation policies for your account. Includes plan limits.
|
|
510
|
+
|
|
511
|
+
### Examples
|
|
512
|
+
|
|
513
|
+
```ruby
|
|
514
|
+
require 'time'
|
|
515
|
+
require 'mailodds'
|
|
516
|
+
# setup authorization
|
|
517
|
+
Mailodds.configure do |config|
|
|
518
|
+
# Configure Bearer authorization: BearerAuth
|
|
519
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
523
|
+
opts = {
|
|
524
|
+
include_rules: true # Boolean | Include full rules in response
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
begin
|
|
528
|
+
# List policies
|
|
529
|
+
result = api_instance.list_policies(opts)
|
|
530
|
+
p result
|
|
531
|
+
rescue Mailodds::ApiError => e
|
|
532
|
+
puts "Error when calling ValidationPoliciesApi->list_policies: #{e}"
|
|
533
|
+
end
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
#### Using the list_policies_with_http_info variant
|
|
537
|
+
|
|
538
|
+
This returns an Array which contains the response data, status code and headers.
|
|
539
|
+
|
|
540
|
+
> <Array(<PolicyListResponse>, Integer, Hash)> list_policies_with_http_info(opts)
|
|
541
|
+
|
|
542
|
+
```ruby
|
|
543
|
+
begin
|
|
544
|
+
# List policies
|
|
545
|
+
data, status_code, headers = api_instance.list_policies_with_http_info(opts)
|
|
546
|
+
p status_code # => 2xx
|
|
547
|
+
p headers # => { ... }
|
|
548
|
+
p data # => <PolicyListResponse>
|
|
549
|
+
rescue Mailodds::ApiError => e
|
|
550
|
+
puts "Error when calling ValidationPoliciesApi->list_policies_with_http_info: #{e}"
|
|
551
|
+
end
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### Parameters
|
|
555
|
+
|
|
556
|
+
| Name | Type | Description | Notes |
|
|
557
|
+
| ---- | ---- | ----------- | ----- |
|
|
558
|
+
| **include_rules** | **Boolean** | Include full rules in response | [optional][default to false] |
|
|
559
|
+
|
|
560
|
+
### Return type
|
|
561
|
+
|
|
562
|
+
[**PolicyListResponse**](PolicyListResponse.md)
|
|
563
|
+
|
|
564
|
+
### Authorization
|
|
565
|
+
|
|
566
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
567
|
+
|
|
568
|
+
### HTTP request headers
|
|
569
|
+
|
|
570
|
+
- **Content-Type**: Not defined
|
|
571
|
+
- **Accept**: application/json
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
## test_policy
|
|
575
|
+
|
|
576
|
+
> <PolicyTestResponse> test_policy(test_policy_request)
|
|
577
|
+
|
|
578
|
+
Test policy evaluation
|
|
579
|
+
|
|
580
|
+
Test how a policy would evaluate a validation result without affecting production.
|
|
581
|
+
|
|
582
|
+
### Examples
|
|
583
|
+
|
|
584
|
+
```ruby
|
|
585
|
+
require 'time'
|
|
586
|
+
require 'mailodds'
|
|
587
|
+
# setup authorization
|
|
588
|
+
Mailodds.configure do |config|
|
|
589
|
+
# Configure Bearer authorization: BearerAuth
|
|
590
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
594
|
+
test_policy_request = Mailodds::TestPolicyRequest.new({policy_id: 37, test_result: Mailodds::TestPolicyRequestTestResult.new}) # TestPolicyRequest |
|
|
595
|
+
|
|
596
|
+
begin
|
|
597
|
+
# Test policy evaluation
|
|
598
|
+
result = api_instance.test_policy(test_policy_request)
|
|
599
|
+
p result
|
|
600
|
+
rescue Mailodds::ApiError => e
|
|
601
|
+
puts "Error when calling ValidationPoliciesApi->test_policy: #{e}"
|
|
602
|
+
end
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
#### Using the test_policy_with_http_info variant
|
|
606
|
+
|
|
607
|
+
This returns an Array which contains the response data, status code and headers.
|
|
608
|
+
|
|
609
|
+
> <Array(<PolicyTestResponse>, Integer, Hash)> test_policy_with_http_info(test_policy_request)
|
|
610
|
+
|
|
611
|
+
```ruby
|
|
612
|
+
begin
|
|
613
|
+
# Test policy evaluation
|
|
614
|
+
data, status_code, headers = api_instance.test_policy_with_http_info(test_policy_request)
|
|
615
|
+
p status_code # => 2xx
|
|
616
|
+
p headers # => { ... }
|
|
617
|
+
p data # => <PolicyTestResponse>
|
|
618
|
+
rescue Mailodds::ApiError => e
|
|
619
|
+
puts "Error when calling ValidationPoliciesApi->test_policy_with_http_info: #{e}"
|
|
620
|
+
end
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
### Parameters
|
|
624
|
+
|
|
625
|
+
| Name | Type | Description | Notes |
|
|
626
|
+
| ---- | ---- | ----------- | ----- |
|
|
627
|
+
| **test_policy_request** | [**TestPolicyRequest**](TestPolicyRequest.md) | | |
|
|
628
|
+
|
|
629
|
+
### Return type
|
|
630
|
+
|
|
631
|
+
[**PolicyTestResponse**](PolicyTestResponse.md)
|
|
632
|
+
|
|
633
|
+
### Authorization
|
|
634
|
+
|
|
635
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
636
|
+
|
|
637
|
+
### HTTP request headers
|
|
638
|
+
|
|
639
|
+
- **Content-Type**: application/json
|
|
640
|
+
- **Accept**: application/json
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
## update_policy
|
|
644
|
+
|
|
645
|
+
> <PolicyResponse> update_policy(policy_id, update_policy_request)
|
|
646
|
+
|
|
647
|
+
Update policy
|
|
648
|
+
|
|
649
|
+
Update a policy's settings (name, enabled, default).
|
|
650
|
+
|
|
651
|
+
### Examples
|
|
652
|
+
|
|
653
|
+
```ruby
|
|
654
|
+
require 'time'
|
|
655
|
+
require 'mailodds'
|
|
656
|
+
# setup authorization
|
|
657
|
+
Mailodds.configure do |config|
|
|
658
|
+
# Configure Bearer authorization: BearerAuth
|
|
659
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
660
|
+
end
|
|
661
|
+
|
|
662
|
+
api_instance = Mailodds::ValidationPoliciesApi.new
|
|
663
|
+
policy_id = 56 # Integer |
|
|
664
|
+
update_policy_request = Mailodds::UpdatePolicyRequest.new # UpdatePolicyRequest |
|
|
665
|
+
|
|
666
|
+
begin
|
|
667
|
+
# Update policy
|
|
668
|
+
result = api_instance.update_policy(policy_id, update_policy_request)
|
|
669
|
+
p result
|
|
670
|
+
rescue Mailodds::ApiError => e
|
|
671
|
+
puts "Error when calling ValidationPoliciesApi->update_policy: #{e}"
|
|
672
|
+
end
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
#### Using the update_policy_with_http_info variant
|
|
676
|
+
|
|
677
|
+
This returns an Array which contains the response data, status code and headers.
|
|
678
|
+
|
|
679
|
+
> <Array(<PolicyResponse>, Integer, Hash)> update_policy_with_http_info(policy_id, update_policy_request)
|
|
680
|
+
|
|
681
|
+
```ruby
|
|
682
|
+
begin
|
|
683
|
+
# Update policy
|
|
684
|
+
data, status_code, headers = api_instance.update_policy_with_http_info(policy_id, update_policy_request)
|
|
685
|
+
p status_code # => 2xx
|
|
686
|
+
p headers # => { ... }
|
|
687
|
+
p data # => <PolicyResponse>
|
|
688
|
+
rescue Mailodds::ApiError => e
|
|
689
|
+
puts "Error when calling ValidationPoliciesApi->update_policy_with_http_info: #{e}"
|
|
690
|
+
end
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
### Parameters
|
|
694
|
+
|
|
695
|
+
| Name | Type | Description | Notes |
|
|
696
|
+
| ---- | ---- | ----------- | ----- |
|
|
697
|
+
| **policy_id** | **Integer** | | |
|
|
698
|
+
| **update_policy_request** | [**UpdatePolicyRequest**](UpdatePolicyRequest.md) | | |
|
|
699
|
+
|
|
700
|
+
### Return type
|
|
701
|
+
|
|
702
|
+
[**PolicyResponse**](PolicyResponse.md)
|
|
703
|
+
|
|
704
|
+
### Authorization
|
|
705
|
+
|
|
706
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
707
|
+
|
|
708
|
+
### HTTP request headers
|
|
709
|
+
|
|
710
|
+
- **Content-Type**: application/json
|
|
711
|
+
- **Accept**: application/json
|
|
712
|
+
|