mailslurp_client 8.2.15 → 8.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -2
- data/lib/mailslurp_client.rb +11 -2
- data/lib/mailslurp_client/api/alias_controller_api.rb +94 -80
- data/lib/mailslurp_client/api/domain_controller_api.rb +7 -5
- data/lib/mailslurp_client/api/email_controller_api.rb +72 -2
- data/lib/mailslurp_client/api/form_controller_api.rb +4 -7
- data/lib/mailslurp_client/api/inbox_controller_api.rb +87 -10
- data/lib/mailslurp_client/api/mail_server_controller_api.rb +123 -0
- data/lib/mailslurp_client/models/alias_dto.rb +276 -0
- data/lib/mailslurp_client/models/alias_projection.rb +276 -0
- data/lib/mailslurp_client/models/alias_verification_result.rb +234 -0
- data/lib/mailslurp_client/models/{create_owned_alias_options.rb → create_alias_options.rb} +13 -13
- data/lib/mailslurp_client/models/create_inbox_dto.rb +259 -0
- data/lib/mailslurp_client/models/dns_lookup_options.rb +252 -0
- data/lib/mailslurp_client/models/dns_lookup_result.rb +288 -0
- data/lib/mailslurp_client/models/dns_lookup_results.rb +214 -0
- data/lib/mailslurp_client/models/domain_dto.rb +16 -16
- data/lib/mailslurp_client/models/email.rb +11 -1
- data/lib/mailslurp_client/models/html_validation_result.rb +3 -15
- data/lib/mailslurp_client/models/inbox.rb +5 -5
- data/lib/mailslurp_client/models/ip_address_result.rb +226 -0
- data/lib/mailslurp_client/models/model_alias.rb +36 -22
- data/lib/mailslurp_client/models/page_alias.rb +1 -1
- data/lib/mailslurp_client/models/reply_to_email_options.rb +313 -0
- data/lib/mailslurp_client/models/{create_anonymous_alias_options.rb → update_alias_options.rb} +12 -12
- data/lib/mailslurp_client/models/update_inbox_options.rb +2 -2
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +13 -4
@@ -0,0 +1,214 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
# Results of query on domain name servers
|
17
|
+
class DNSLookupResults
|
18
|
+
attr_accessor :results
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'results' => :'results'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'results' => :'Array<DNSLookupResult>'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
if (!attributes.is_a?(Hash))
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::DNSLookupResults` initialize method"
|
45
|
+
end
|
46
|
+
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::DNSLookupResults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
|
+
end
|
52
|
+
h[k.to_sym] = v
|
53
|
+
}
|
54
|
+
|
55
|
+
if attributes.key?(:'results')
|
56
|
+
if (value = attributes[:'results']).is_a?(Array)
|
57
|
+
self.results = value
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properties with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
if @results.nil?
|
67
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
68
|
+
end
|
69
|
+
|
70
|
+
invalid_properties
|
71
|
+
end
|
72
|
+
|
73
|
+
# Check to see if the all the properties in the model are valid
|
74
|
+
# @return true if the model is valid
|
75
|
+
def valid?
|
76
|
+
return false if @results.nil?
|
77
|
+
true
|
78
|
+
end
|
79
|
+
|
80
|
+
# Checks equality by comparing each attribute.
|
81
|
+
# @param [Object] Object to be compared
|
82
|
+
def ==(o)
|
83
|
+
return true if self.equal?(o)
|
84
|
+
self.class == o.class &&
|
85
|
+
results == o.results
|
86
|
+
end
|
87
|
+
|
88
|
+
# @see the `==` method
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def eql?(o)
|
91
|
+
self == o
|
92
|
+
end
|
93
|
+
|
94
|
+
# Calculates hash code according to all attributes.
|
95
|
+
# @return [Integer] Hash code
|
96
|
+
def hash
|
97
|
+
[results].hash
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def self.build_from_hash(attributes)
|
104
|
+
new.build_from_hash(attributes)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def build_from_hash(attributes)
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
112
|
+
self.class.openapi_types.each_pair do |key, type|
|
113
|
+
if type =~ /\AArray<(.*)>/i
|
114
|
+
# check to ensure the input is an array given that the attribute
|
115
|
+
# is documented as an array but the input is not
|
116
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
117
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
118
|
+
end
|
119
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
120
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
121
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
122
|
+
end
|
123
|
+
|
124
|
+
self
|
125
|
+
end
|
126
|
+
|
127
|
+
# Deserializes the data based on type
|
128
|
+
# @param string type Data type
|
129
|
+
# @param string value Value to be deserialized
|
130
|
+
# @return [Object] Deserialized data
|
131
|
+
def _deserialize(type, value)
|
132
|
+
case type.to_sym
|
133
|
+
when :DateTime
|
134
|
+
DateTime.parse(value)
|
135
|
+
when :Date
|
136
|
+
Date.parse(value)
|
137
|
+
when :String
|
138
|
+
value.to_s
|
139
|
+
when :Integer
|
140
|
+
value.to_i
|
141
|
+
when :Float
|
142
|
+
value.to_f
|
143
|
+
when :Boolean
|
144
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
145
|
+
true
|
146
|
+
else
|
147
|
+
false
|
148
|
+
end
|
149
|
+
when :Object
|
150
|
+
# generic object (usually a Hash), return directly
|
151
|
+
value
|
152
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
153
|
+
inner_type = Regexp.last_match[:inner_type]
|
154
|
+
value.map { |v| _deserialize(inner_type, v) }
|
155
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
156
|
+
k_type = Regexp.last_match[:k_type]
|
157
|
+
v_type = Regexp.last_match[:v_type]
|
158
|
+
{}.tap do |hash|
|
159
|
+
value.each do |k, v|
|
160
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
else # model
|
164
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the string representation of the object
|
169
|
+
# @return [String] String presentation of the object
|
170
|
+
def to_s
|
171
|
+
to_hash.to_s
|
172
|
+
end
|
173
|
+
|
174
|
+
# to_body is an alias to to_hash (backward compatibility)
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
176
|
+
def to_body
|
177
|
+
to_hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns the object in the form of hash
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_hash
|
183
|
+
hash = {}
|
184
|
+
self.class.attribute_map.each_pair do |attr, param|
|
185
|
+
value = self.send(attr)
|
186
|
+
if value.nil?
|
187
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
188
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
189
|
+
end
|
190
|
+
|
191
|
+
hash[param] = _to_hash(value)
|
192
|
+
end
|
193
|
+
hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Outputs non-array value in the form of hash
|
197
|
+
# For object, use to_hash. Otherwise, just return the value
|
198
|
+
# @param [Object] value Any valid value
|
199
|
+
# @return [Hash] Returns the value in the form of hash
|
200
|
+
def _to_hash(value)
|
201
|
+
if value.is_a?(Array)
|
202
|
+
value.compact.map { |v| _to_hash(v) }
|
203
|
+
elsif value.is_a?(Hash)
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
206
|
+
end
|
207
|
+
elsif value.respond_to? :to_hash
|
208
|
+
value.to_hash
|
209
|
+
else
|
210
|
+
value
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
@@ -17,22 +17,29 @@ module MailSlurpClient
|
|
17
17
|
class DomainDto
|
18
18
|
attr_accessor :created_at
|
19
19
|
|
20
|
+
# DNS records for DKIM approval
|
21
|
+
attr_accessor :dkim_tokens
|
22
|
+
|
23
|
+
# Custom domain name
|
20
24
|
attr_accessor :domain
|
21
25
|
|
22
26
|
attr_accessor :id
|
23
27
|
|
28
|
+
# Whether domain has been verified or not. If the domain is not verified after 72 hours there is most likely an issue with the domains DNS records.
|
24
29
|
attr_accessor :is_verified
|
25
30
|
|
26
31
|
attr_accessor :updated_at
|
27
32
|
|
28
33
|
attr_accessor :user_id
|
29
34
|
|
35
|
+
# A TXT record that you must place in the DNS settings of the domain to complete domain verification
|
30
36
|
attr_accessor :verification_token
|
31
37
|
|
32
38
|
# Attribute mapping from ruby-style variable name to JSON key.
|
33
39
|
def self.attribute_map
|
34
40
|
{
|
35
41
|
:'created_at' => :'createdAt',
|
42
|
+
:'dkim_tokens' => :'dkimTokens',
|
36
43
|
:'domain' => :'domain',
|
37
44
|
:'id' => :'id',
|
38
45
|
:'is_verified' => :'isVerified',
|
@@ -46,6 +53,7 @@ module MailSlurpClient
|
|
46
53
|
def self.openapi_types
|
47
54
|
{
|
48
55
|
:'created_at' => :'DateTime',
|
56
|
+
:'dkim_tokens' => :'Array<String>',
|
49
57
|
:'domain' => :'String',
|
50
58
|
:'id' => :'String',
|
51
59
|
:'is_verified' => :'Boolean',
|
@@ -80,6 +88,12 @@ module MailSlurpClient
|
|
80
88
|
self.created_at = attributes[:'created_at']
|
81
89
|
end
|
82
90
|
|
91
|
+
if attributes.key?(:'dkim_tokens')
|
92
|
+
if (value = attributes[:'dkim_tokens']).is_a?(Array)
|
93
|
+
self.dkim_tokens = value
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
83
97
|
if attributes.key?(:'domain')
|
84
98
|
self.domain = attributes[:'domain']
|
85
99
|
end
|
@@ -113,18 +127,10 @@ module MailSlurpClient
|
|
113
127
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
114
128
|
end
|
115
129
|
|
116
|
-
if @domain.nil?
|
117
|
-
invalid_properties.push('invalid value for "domain", domain cannot be nil.')
|
118
|
-
end
|
119
|
-
|
120
130
|
if @id.nil?
|
121
131
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
122
132
|
end
|
123
133
|
|
124
|
-
if @is_verified.nil?
|
125
|
-
invalid_properties.push('invalid value for "is_verified", is_verified cannot be nil.')
|
126
|
-
end
|
127
|
-
|
128
134
|
if @updated_at.nil?
|
129
135
|
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
130
136
|
end
|
@@ -133,10 +139,6 @@ module MailSlurpClient
|
|
133
139
|
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
134
140
|
end
|
135
141
|
|
136
|
-
if @verification_token.nil?
|
137
|
-
invalid_properties.push('invalid value for "verification_token", verification_token cannot be nil.')
|
138
|
-
end
|
139
|
-
|
140
142
|
invalid_properties
|
141
143
|
end
|
142
144
|
|
@@ -144,12 +146,9 @@ module MailSlurpClient
|
|
144
146
|
# @return true if the model is valid
|
145
147
|
def valid?
|
146
148
|
return false if @created_at.nil?
|
147
|
-
return false if @domain.nil?
|
148
149
|
return false if @id.nil?
|
149
|
-
return false if @is_verified.nil?
|
150
150
|
return false if @updated_at.nil?
|
151
151
|
return false if @user_id.nil?
|
152
|
-
return false if @verification_token.nil?
|
153
152
|
true
|
154
153
|
end
|
155
154
|
|
@@ -159,6 +158,7 @@ module MailSlurpClient
|
|
159
158
|
return true if self.equal?(o)
|
160
159
|
self.class == o.class &&
|
161
160
|
created_at == o.created_at &&
|
161
|
+
dkim_tokens == o.dkim_tokens &&
|
162
162
|
domain == o.domain &&
|
163
163
|
id == o.id &&
|
164
164
|
is_verified == o.is_verified &&
|
@@ -176,7 +176,7 @@ module MailSlurpClient
|
|
176
176
|
# Calculates hash code according to all attributes.
|
177
177
|
# @return [Integer] Hash code
|
178
178
|
def hash
|
179
|
-
[created_at, domain, id, is_verified, updated_at, user_id, verification_token].hash
|
179
|
+
[created_at, dkim_tokens, domain, id, is_verified, updated_at, user_id, verification_token].hash
|
180
180
|
end
|
181
181
|
|
182
182
|
# Builds the object from hash
|
@@ -55,6 +55,9 @@ module MailSlurpClient
|
|
55
55
|
# Has the email been viewed ever
|
56
56
|
attr_accessor :read
|
57
57
|
|
58
|
+
# The replyTo field on the received email
|
59
|
+
attr_accessor :reply_to
|
60
|
+
|
58
61
|
# The subject line of the email message
|
59
62
|
attr_accessor :subject
|
60
63
|
|
@@ -84,6 +87,7 @@ module MailSlurpClient
|
|
84
87
|
:'inbox_id' => :'inboxId',
|
85
88
|
:'is_html' => :'isHTML',
|
86
89
|
:'read' => :'read',
|
90
|
+
:'reply_to' => :'replyTo',
|
87
91
|
:'subject' => :'subject',
|
88
92
|
:'to' => :'to',
|
89
93
|
:'updated_at' => :'updatedAt',
|
@@ -108,6 +112,7 @@ module MailSlurpClient
|
|
108
112
|
:'inbox_id' => :'String',
|
109
113
|
:'is_html' => :'Boolean',
|
110
114
|
:'read' => :'Boolean',
|
115
|
+
:'reply_to' => :'String',
|
111
116
|
:'subject' => :'String',
|
112
117
|
:'to' => :'Array<String>',
|
113
118
|
:'updated_at' => :'DateTime',
|
@@ -200,6 +205,10 @@ module MailSlurpClient
|
|
200
205
|
self.read = attributes[:'read']
|
201
206
|
end
|
202
207
|
|
208
|
+
if attributes.key?(:'reply_to')
|
209
|
+
self.reply_to = attributes[:'reply_to']
|
210
|
+
end
|
211
|
+
|
203
212
|
if attributes.key?(:'subject')
|
204
213
|
self.subject = attributes[:'subject']
|
205
214
|
end
|
@@ -251,6 +260,7 @@ module MailSlurpClient
|
|
251
260
|
inbox_id == o.inbox_id &&
|
252
261
|
is_html == o.is_html &&
|
253
262
|
read == o.read &&
|
263
|
+
reply_to == o.reply_to &&
|
254
264
|
subject == o.subject &&
|
255
265
|
to == o.to &&
|
256
266
|
updated_at == o.updated_at &&
|
@@ -266,7 +276,7 @@ module MailSlurpClient
|
|
266
276
|
# Calculates hash code according to all attributes.
|
267
277
|
# @return [Integer] Hash code
|
268
278
|
def hash
|
269
|
-
[analysis, attachments, bcc, body, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, subject, to, updated_at, user_id].hash
|
279
|
+
[analysis, attachments, bcc, body, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, reply_to, subject, to, updated_at, user_id].hash
|
270
280
|
end
|
271
281
|
|
272
282
|
# Builds the object from hash
|
@@ -15,10 +15,13 @@ require 'date'
|
|
15
15
|
module MailSlurpClient
|
16
16
|
# HTML Validation Results
|
17
17
|
class HTMLValidationResult
|
18
|
+
# Optional errors resulting from HTML validation
|
18
19
|
attr_accessor :errors
|
19
20
|
|
21
|
+
# Is HTML validation result valid
|
20
22
|
attr_accessor :is_valid
|
21
23
|
|
24
|
+
# Optional warnings resulting from HTML validation
|
22
25
|
attr_accessor :warnings
|
23
26
|
|
24
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -81,27 +84,12 @@ module MailSlurpClient
|
|
81
84
|
# @return Array for valid properties with the reasons
|
82
85
|
def list_invalid_properties
|
83
86
|
invalid_properties = Array.new
|
84
|
-
if @errors.nil?
|
85
|
-
invalid_properties.push('invalid value for "errors", errors cannot be nil.')
|
86
|
-
end
|
87
|
-
|
88
|
-
if @is_valid.nil?
|
89
|
-
invalid_properties.push('invalid value for "is_valid", is_valid cannot be nil.')
|
90
|
-
end
|
91
|
-
|
92
|
-
if @warnings.nil?
|
93
|
-
invalid_properties.push('invalid value for "warnings", warnings cannot be nil.')
|
94
|
-
end
|
95
|
-
|
96
87
|
invalid_properties
|
97
88
|
end
|
98
89
|
|
99
90
|
# Check to see if the all the properties in the model are valid
|
100
91
|
# @return true if the model is valid
|
101
92
|
def valid?
|
102
|
-
return false if @errors.nil?
|
103
|
-
return false if @is_valid.nil?
|
104
|
-
return false if @warnings.nil?
|
105
93
|
true
|
106
94
|
end
|
107
95
|
|
@@ -15,28 +15,28 @@ require 'date'
|
|
15
15
|
module MailSlurpClient
|
16
16
|
# Representation of an inbox with an email address. Emails can be sent to or from this email address.
|
17
17
|
class Inbox
|
18
|
-
# When was the inbox created
|
18
|
+
# When was the inbox created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.
|
19
19
|
attr_accessor :created_at
|
20
20
|
|
21
21
|
# Optional description of an inbox for labelling purposes
|
22
22
|
attr_accessor :description
|
23
23
|
|
24
|
-
# The inbox's email address. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints.
|
24
|
+
# The inbox's email address. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
|
25
25
|
attr_accessor :email_address
|
26
26
|
|
27
27
|
# When, if ever, will the inbox expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. Timestamp passed as string.
|
28
28
|
attr_accessor :expires_at
|
29
29
|
|
30
|
-
# Is the inbox
|
30
|
+
# Is the inbox favorited. Favouriting inboxes is typically done in the dashboard for quick access
|
31
31
|
attr_accessor :favourite
|
32
32
|
|
33
|
-
# ID of the inbox
|
33
|
+
# ID of the inbox. The ID is a UUID-V4 string. See the emailAddress property for the email address.
|
34
34
|
attr_accessor :id
|
35
35
|
|
36
36
|
# Optional name of the inbox. Displayed in the dashboard for easier search
|
37
37
|
attr_accessor :name
|
38
38
|
|
39
|
-
# Tags that inbox has been tagged with
|
39
|
+
# Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
|
40
40
|
attr_accessor :tags
|
41
41
|
|
42
42
|
# ID of user that inbox belongs to
|