mailslurp_client 8.2.17 → 8.4.2
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 +6 -2
- data/lib/mailslurp_client/api/alias_controller_api.rb +34 -96
- data/lib/mailslurp_client/api/domain_controller_api.rb +7 -5
- data/lib/mailslurp_client/api/email_controller_api.rb +70 -0
- data/lib/mailslurp_client/api/form_controller_api.rb +4 -7
- data/lib/mailslurp_client/api/inbox_controller_api.rb +64 -0
- data/lib/mailslurp_client/models/alias_dto.rb +299 -0
- data/lib/mailslurp_client/models/alias_projection.rb +300 -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/domain_dto.rb +16 -16
- data/lib/mailslurp_client/models/email.rb +11 -1
- data/lib/mailslurp_client/models/model_alias.rb +20 -10
- data/lib/mailslurp_client/models/page_alias.rb +1 -1
- data/lib/mailslurp_client/models/reply_to_email_options.rb +314 -0
- data/lib/mailslurp_client/models/{create_anonymous_alias_options.rb → update_alias_options.rb} +12 -12
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +8 -4
@@ -14,18 +14,18 @@ require 'date'
|
|
14
14
|
|
15
15
|
module MailSlurpClient
|
16
16
|
# Create email alias options. Email aliases can be used to mask real email addresses behind an ID. You can also attach an inbox to an alias so that any email received by the inbox email address if forwarded to the alias email address.
|
17
|
-
class
|
18
|
-
# Email address to be hidden behind alias
|
17
|
+
class CreateAliasOptions
|
18
|
+
# Email address to be hidden behind alias. Emails sent to the alias email address will be forwarded to this address. If you want to enable replies set useThreads true and the reply-to for the email will allow outbound communication via a thread.
|
19
19
|
attr_accessor :email_address
|
20
20
|
|
21
|
-
# Optional inbox ID to attach to alias. Emails received by this inbox will be forwarded to the alias email address
|
21
|
+
# Optional inbox ID to attach to alias. Null by default means an a new inbox will be created for the alias. Use a custom inbox to control what email address the alias uses. To use custom email addresses create a domain and an inbox, the use the inbox ID with this call. Emails received by this inbox will be forwarded to the alias email address
|
22
22
|
attr_accessor :inbox_id
|
23
23
|
|
24
24
|
# Optional name for alias
|
25
25
|
attr_accessor :name
|
26
26
|
|
27
|
-
#
|
28
|
-
attr_accessor :
|
27
|
+
# Enable threads options. If true emails will be sent with a unique reply-to thread address. This means you can reply to the forwarded email and it will be sent to the recipients via your alias address. That way a thread conversation is preserved.
|
28
|
+
attr_accessor :use_threads
|
29
29
|
|
30
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
31
31
|
def self.attribute_map
|
@@ -33,7 +33,7 @@ module MailSlurpClient
|
|
33
33
|
:'email_address' => :'emailAddress',
|
34
34
|
:'inbox_id' => :'inboxId',
|
35
35
|
:'name' => :'name',
|
36
|
-
:'
|
36
|
+
:'use_threads' => :'useThreads'
|
37
37
|
}
|
38
38
|
end
|
39
39
|
|
@@ -43,7 +43,7 @@ module MailSlurpClient
|
|
43
43
|
:'email_address' => :'String',
|
44
44
|
:'inbox_id' => :'String',
|
45
45
|
:'name' => :'String',
|
46
|
-
:'
|
46
|
+
:'use_threads' => :'Boolean'
|
47
47
|
}
|
48
48
|
end
|
49
49
|
|
@@ -57,13 +57,13 @@ module MailSlurpClient
|
|
57
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
58
58
|
def initialize(attributes = {})
|
59
59
|
if (!attributes.is_a?(Hash))
|
60
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateAliasOptions` initialize method"
|
61
61
|
end
|
62
62
|
|
63
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
64
64
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
65
65
|
if (!self.class.attribute_map.key?(k.to_sym))
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateAliasOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
67
67
|
end
|
68
68
|
h[k.to_sym] = v
|
69
69
|
}
|
@@ -80,8 +80,8 @@ module MailSlurpClient
|
|
80
80
|
self.name = attributes[:'name']
|
81
81
|
end
|
82
82
|
|
83
|
-
if attributes.key?(:'
|
84
|
-
self.
|
83
|
+
if attributes.key?(:'use_threads')
|
84
|
+
self.use_threads = attributes[:'use_threads']
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
@@ -106,7 +106,7 @@ module MailSlurpClient
|
|
106
106
|
email_address == o.email_address &&
|
107
107
|
inbox_id == o.inbox_id &&
|
108
108
|
name == o.name &&
|
109
|
-
|
109
|
+
use_threads == o.use_threads
|
110
110
|
end
|
111
111
|
|
112
112
|
# @see the `==` method
|
@@ -118,7 +118,7 @@ module MailSlurpClient
|
|
118
118
|
# Calculates hash code according to all attributes.
|
119
119
|
# @return [Integer] Hash code
|
120
120
|
def hash
|
121
|
-
[email_address, inbox_id, name,
|
121
|
+
[email_address, inbox_id, name, use_threads].hash
|
122
122
|
end
|
123
123
|
|
124
124
|
# Builds the object from hash
|
@@ -0,0 +1,259 @@
|
|
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
|
+
class CreateInboxDto
|
17
|
+
# Optional description of an inbox for labelling purposes
|
18
|
+
attr_accessor :description
|
19
|
+
|
20
|
+
# Optionally specify an email address you want the inbox to have. When left blank an email address will be randomly assigned to the inbox usually ending in `@mailslurp.com`. Custom email addresses must include your own custom domain that you have configured in MailSlurp. So if your domain is `mysite.com` you can created any email address ending in `@mysite.com`. All email addresses are transformed to lowercase!
|
21
|
+
attr_accessor :email_address
|
22
|
+
|
23
|
+
# 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.
|
24
|
+
attr_accessor :expires_at
|
25
|
+
|
26
|
+
# Is the inbox favorited. Favouriting inboxes is typically done in the dashboard for quick access
|
27
|
+
attr_accessor :favourite
|
28
|
+
|
29
|
+
# Optional name of the inbox. Displayed in the dashboard for easier search
|
30
|
+
attr_accessor :name
|
31
|
+
|
32
|
+
# 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.
|
33
|
+
attr_accessor :tags
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'description' => :'description',
|
39
|
+
:'email_address' => :'emailAddress',
|
40
|
+
:'expires_at' => :'expiresAt',
|
41
|
+
:'favourite' => :'favourite',
|
42
|
+
:'name' => :'name',
|
43
|
+
:'tags' => :'tags'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.openapi_types
|
49
|
+
{
|
50
|
+
:'description' => :'String',
|
51
|
+
:'email_address' => :'String',
|
52
|
+
:'expires_at' => :'DateTime',
|
53
|
+
:'favourite' => :'Boolean',
|
54
|
+
:'name' => :'String',
|
55
|
+
:'tags' => :'Array<String>'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# List of attributes with nullable: true
|
60
|
+
def self.openapi_nullable
|
61
|
+
Set.new([
|
62
|
+
])
|
63
|
+
end
|
64
|
+
|
65
|
+
# Initializes the object
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
67
|
+
def initialize(attributes = {})
|
68
|
+
if (!attributes.is_a?(Hash))
|
69
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateInboxDto` initialize method"
|
70
|
+
end
|
71
|
+
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
73
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
74
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
75
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateInboxDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
76
|
+
end
|
77
|
+
h[k.to_sym] = v
|
78
|
+
}
|
79
|
+
|
80
|
+
if attributes.key?(:'description')
|
81
|
+
self.description = attributes[:'description']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'email_address')
|
85
|
+
self.email_address = attributes[:'email_address']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'expires_at')
|
89
|
+
self.expires_at = attributes[:'expires_at']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'favourite')
|
93
|
+
self.favourite = attributes[:'favourite']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'name')
|
97
|
+
self.name = attributes[:'name']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'tags')
|
101
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
102
|
+
self.tags = value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
108
|
+
# @return Array for valid properties with the reasons
|
109
|
+
def list_invalid_properties
|
110
|
+
invalid_properties = Array.new
|
111
|
+
invalid_properties
|
112
|
+
end
|
113
|
+
|
114
|
+
# Check to see if the all the properties in the model are valid
|
115
|
+
# @return true if the model is valid
|
116
|
+
def valid?
|
117
|
+
true
|
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
|
+
description == o.description &&
|
126
|
+
email_address == o.email_address &&
|
127
|
+
expires_at == o.expires_at &&
|
128
|
+
favourite == o.favourite &&
|
129
|
+
name == o.name &&
|
130
|
+
tags == o.tags
|
131
|
+
end
|
132
|
+
|
133
|
+
# @see the `==` method
|
134
|
+
# @param [Object] Object to be compared
|
135
|
+
def eql?(o)
|
136
|
+
self == o
|
137
|
+
end
|
138
|
+
|
139
|
+
# Calculates hash code according to all attributes.
|
140
|
+
# @return [Integer] Hash code
|
141
|
+
def hash
|
142
|
+
[description, email_address, expires_at, favourite, name, tags].hash
|
143
|
+
end
|
144
|
+
|
145
|
+
# Builds the object from hash
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
# @return [Object] Returns the model itself
|
148
|
+
def self.build_from_hash(attributes)
|
149
|
+
new.build_from_hash(attributes)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Builds the object from hash
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
154
|
+
# @return [Object] Returns the model itself
|
155
|
+
def build_from_hash(attributes)
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
157
|
+
self.class.openapi_types.each_pair do |key, type|
|
158
|
+
if type =~ /\AArray<(.*)>/i
|
159
|
+
# check to ensure the input is an array given that the attribute
|
160
|
+
# is documented as an array but the input is not
|
161
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
162
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
163
|
+
end
|
164
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
165
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
166
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
167
|
+
end
|
168
|
+
|
169
|
+
self
|
170
|
+
end
|
171
|
+
|
172
|
+
# Deserializes the data based on type
|
173
|
+
# @param string type Data type
|
174
|
+
# @param string value Value to be deserialized
|
175
|
+
# @return [Object] Deserialized data
|
176
|
+
def _deserialize(type, value)
|
177
|
+
case type.to_sym
|
178
|
+
when :DateTime
|
179
|
+
DateTime.parse(value)
|
180
|
+
when :Date
|
181
|
+
Date.parse(value)
|
182
|
+
when :String
|
183
|
+
value.to_s
|
184
|
+
when :Integer
|
185
|
+
value.to_i
|
186
|
+
when :Float
|
187
|
+
value.to_f
|
188
|
+
when :Boolean
|
189
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
190
|
+
true
|
191
|
+
else
|
192
|
+
false
|
193
|
+
end
|
194
|
+
when :Object
|
195
|
+
# generic object (usually a Hash), return directly
|
196
|
+
value
|
197
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
198
|
+
inner_type = Regexp.last_match[:inner_type]
|
199
|
+
value.map { |v| _deserialize(inner_type, v) }
|
200
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
201
|
+
k_type = Regexp.last_match[:k_type]
|
202
|
+
v_type = Regexp.last_match[:v_type]
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each do |k, v|
|
205
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
else # model
|
209
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
# Returns the string representation of the object
|
214
|
+
# @return [String] String presentation of the object
|
215
|
+
def to_s
|
216
|
+
to_hash.to_s
|
217
|
+
end
|
218
|
+
|
219
|
+
# to_body is an alias to to_hash (backward compatibility)
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
221
|
+
def to_body
|
222
|
+
to_hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the object in the form of hash
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
227
|
+
def to_hash
|
228
|
+
hash = {}
|
229
|
+
self.class.attribute_map.each_pair do |attr, param|
|
230
|
+
value = self.send(attr)
|
231
|
+
if value.nil?
|
232
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
233
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
234
|
+
end
|
235
|
+
|
236
|
+
hash[param] = _to_hash(value)
|
237
|
+
end
|
238
|
+
hash
|
239
|
+
end
|
240
|
+
|
241
|
+
# Outputs non-array value in the form of hash
|
242
|
+
# For object, use to_hash. Otherwise, just return the value
|
243
|
+
# @param [Object] value Any valid value
|
244
|
+
# @return [Hash] Returns the value in the form of hash
|
245
|
+
def _to_hash(value)
|
246
|
+
if value.is_a?(Array)
|
247
|
+
value.compact.map { |v| _to_hash(v) }
|
248
|
+
elsif value.is_a?(Hash)
|
249
|
+
{}.tap do |hash|
|
250
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
251
|
+
end
|
252
|
+
elsif value.respond_to? :to_hash
|
253
|
+
value.to_hash
|
254
|
+
else
|
255
|
+
value
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
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
|