mailslurp_client 8.3.1 → 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/lib/mailslurp_client.rb +6 -2
- data/lib/mailslurp_client/api/alias_controller_api.rb +94 -80
- 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/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/email.rb +11 -1
- 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/version.rb +1 -1
- metadata +8 -4
@@ -0,0 +1,313 @@
|
|
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 ReplyToEmailOptions
|
17
|
+
# List of uploaded attachments to send with the reply. Optional.
|
18
|
+
attr_accessor :attachments
|
19
|
+
|
20
|
+
# Body of the reply email you want to send
|
21
|
+
attr_accessor :body
|
22
|
+
|
23
|
+
# The charset that your message should be sent with. Optional. Default is UTF-8
|
24
|
+
attr_accessor :charset
|
25
|
+
|
26
|
+
# Is the reply HTML
|
27
|
+
attr_accessor :is_html
|
28
|
+
|
29
|
+
# The replyTo header that should be used. Optional
|
30
|
+
attr_accessor :reply_to
|
31
|
+
|
32
|
+
# When to send the email. Typically immediately
|
33
|
+
attr_accessor :send_strategy
|
34
|
+
|
35
|
+
# Template ID to use instead of body. Will use template variable map to fill defined variable slots.
|
36
|
+
attr_accessor :template
|
37
|
+
|
38
|
+
# Template variables if using a template
|
39
|
+
attr_accessor :template_variables
|
40
|
+
|
41
|
+
class EnumAttributeValidator
|
42
|
+
attr_reader :datatype
|
43
|
+
attr_reader :allowable_values
|
44
|
+
|
45
|
+
def initialize(datatype, allowable_values)
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
47
|
+
case datatype.to_s
|
48
|
+
when /Integer/i
|
49
|
+
value.to_i
|
50
|
+
when /Float/i
|
51
|
+
value.to_f
|
52
|
+
else
|
53
|
+
value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def valid?(value)
|
59
|
+
!value || allowable_values.include?(value)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
64
|
+
def self.attribute_map
|
65
|
+
{
|
66
|
+
:'attachments' => :'attachments',
|
67
|
+
:'body' => :'body',
|
68
|
+
:'charset' => :'charset',
|
69
|
+
:'is_html' => :'isHTML',
|
70
|
+
:'reply_to' => :'replyTo',
|
71
|
+
:'send_strategy' => :'sendStrategy',
|
72
|
+
:'template' => :'template',
|
73
|
+
:'template_variables' => :'templateVariables'
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute type mapping.
|
78
|
+
def self.openapi_types
|
79
|
+
{
|
80
|
+
:'attachments' => :'Array<String>',
|
81
|
+
:'body' => :'String',
|
82
|
+
:'charset' => :'String',
|
83
|
+
:'is_html' => :'Boolean',
|
84
|
+
:'reply_to' => :'String',
|
85
|
+
:'send_strategy' => :'String',
|
86
|
+
:'template' => :'String',
|
87
|
+
:'template_variables' => :'Object'
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
91
|
+
# List of attributes with nullable: true
|
92
|
+
def self.openapi_nullable
|
93
|
+
Set.new([
|
94
|
+
])
|
95
|
+
end
|
96
|
+
|
97
|
+
# Initializes the object
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
def initialize(attributes = {})
|
100
|
+
if (!attributes.is_a?(Hash))
|
101
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ReplyToEmailOptions` initialize method"
|
102
|
+
end
|
103
|
+
|
104
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
105
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
106
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
107
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ReplyToEmailOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
108
|
+
end
|
109
|
+
h[k.to_sym] = v
|
110
|
+
}
|
111
|
+
|
112
|
+
if attributes.key?(:'attachments')
|
113
|
+
if (value = attributes[:'attachments']).is_a?(Array)
|
114
|
+
self.attachments = value
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'body')
|
119
|
+
self.body = attributes[:'body']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'charset')
|
123
|
+
self.charset = attributes[:'charset']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'is_html')
|
127
|
+
self.is_html = attributes[:'is_html']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'reply_to')
|
131
|
+
self.reply_to = attributes[:'reply_to']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'send_strategy')
|
135
|
+
self.send_strategy = attributes[:'send_strategy']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'template')
|
139
|
+
self.template = attributes[:'template']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'template_variables')
|
143
|
+
self.template_variables = attributes[:'template_variables']
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
148
|
+
# @return Array for valid properties with the reasons
|
149
|
+
def list_invalid_properties
|
150
|
+
invalid_properties = Array.new
|
151
|
+
invalid_properties
|
152
|
+
end
|
153
|
+
|
154
|
+
# Check to see if the all the properties in the model are valid
|
155
|
+
# @return true if the model is valid
|
156
|
+
def valid?
|
157
|
+
send_strategy_validator = EnumAttributeValidator.new('String', ["SINGLE_MESSAGE"])
|
158
|
+
return false unless send_strategy_validator.valid?(@send_strategy)
|
159
|
+
true
|
160
|
+
end
|
161
|
+
|
162
|
+
# Custom attribute writer method checking allowed values (enum).
|
163
|
+
# @param [Object] send_strategy Object to be assigned
|
164
|
+
def send_strategy=(send_strategy)
|
165
|
+
validator = EnumAttributeValidator.new('String', ["SINGLE_MESSAGE"])
|
166
|
+
unless validator.valid?(send_strategy)
|
167
|
+
fail ArgumentError, "invalid value for \"send_strategy\", must be one of #{validator.allowable_values}."
|
168
|
+
end
|
169
|
+
@send_strategy = send_strategy
|
170
|
+
end
|
171
|
+
|
172
|
+
# Checks equality by comparing each attribute.
|
173
|
+
# @param [Object] Object to be compared
|
174
|
+
def ==(o)
|
175
|
+
return true if self.equal?(o)
|
176
|
+
self.class == o.class &&
|
177
|
+
attachments == o.attachments &&
|
178
|
+
body == o.body &&
|
179
|
+
charset == o.charset &&
|
180
|
+
is_html == o.is_html &&
|
181
|
+
reply_to == o.reply_to &&
|
182
|
+
send_strategy == o.send_strategy &&
|
183
|
+
template == o.template &&
|
184
|
+
template_variables == o.template_variables
|
185
|
+
end
|
186
|
+
|
187
|
+
# @see the `==` method
|
188
|
+
# @param [Object] Object to be compared
|
189
|
+
def eql?(o)
|
190
|
+
self == o
|
191
|
+
end
|
192
|
+
|
193
|
+
# Calculates hash code according to all attributes.
|
194
|
+
# @return [Integer] Hash code
|
195
|
+
def hash
|
196
|
+
[attachments, body, charset, is_html, reply_to, send_strategy, template, template_variables].hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Builds the object from hash
|
200
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
201
|
+
# @return [Object] Returns the model itself
|
202
|
+
def self.build_from_hash(attributes)
|
203
|
+
new.build_from_hash(attributes)
|
204
|
+
end
|
205
|
+
|
206
|
+
# Builds the object from hash
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
208
|
+
# @return [Object] Returns the model itself
|
209
|
+
def build_from_hash(attributes)
|
210
|
+
return nil unless attributes.is_a?(Hash)
|
211
|
+
self.class.openapi_types.each_pair do |key, type|
|
212
|
+
if type =~ /\AArray<(.*)>/i
|
213
|
+
# check to ensure the input is an array given that the attribute
|
214
|
+
# is documented as an array but the input is not
|
215
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
216
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
217
|
+
end
|
218
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
219
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
220
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
221
|
+
end
|
222
|
+
|
223
|
+
self
|
224
|
+
end
|
225
|
+
|
226
|
+
# Deserializes the data based on type
|
227
|
+
# @param string type Data type
|
228
|
+
# @param string value Value to be deserialized
|
229
|
+
# @return [Object] Deserialized data
|
230
|
+
def _deserialize(type, value)
|
231
|
+
case type.to_sym
|
232
|
+
when :DateTime
|
233
|
+
DateTime.parse(value)
|
234
|
+
when :Date
|
235
|
+
Date.parse(value)
|
236
|
+
when :String
|
237
|
+
value.to_s
|
238
|
+
when :Integer
|
239
|
+
value.to_i
|
240
|
+
when :Float
|
241
|
+
value.to_f
|
242
|
+
when :Boolean
|
243
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
244
|
+
true
|
245
|
+
else
|
246
|
+
false
|
247
|
+
end
|
248
|
+
when :Object
|
249
|
+
# generic object (usually a Hash), return directly
|
250
|
+
value
|
251
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
252
|
+
inner_type = Regexp.last_match[:inner_type]
|
253
|
+
value.map { |v| _deserialize(inner_type, v) }
|
254
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
255
|
+
k_type = Regexp.last_match[:k_type]
|
256
|
+
v_type = Regexp.last_match[:v_type]
|
257
|
+
{}.tap do |hash|
|
258
|
+
value.each do |k, v|
|
259
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
260
|
+
end
|
261
|
+
end
|
262
|
+
else # model
|
263
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
# Returns the string representation of the object
|
268
|
+
# @return [String] String presentation of the object
|
269
|
+
def to_s
|
270
|
+
to_hash.to_s
|
271
|
+
end
|
272
|
+
|
273
|
+
# to_body is an alias to to_hash (backward compatibility)
|
274
|
+
# @return [Hash] Returns the object in the form of hash
|
275
|
+
def to_body
|
276
|
+
to_hash
|
277
|
+
end
|
278
|
+
|
279
|
+
# Returns the object in the form of hash
|
280
|
+
# @return [Hash] Returns the object in the form of hash
|
281
|
+
def to_hash
|
282
|
+
hash = {}
|
283
|
+
self.class.attribute_map.each_pair do |attr, param|
|
284
|
+
value = self.send(attr)
|
285
|
+
if value.nil?
|
286
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
287
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
288
|
+
end
|
289
|
+
|
290
|
+
hash[param] = _to_hash(value)
|
291
|
+
end
|
292
|
+
hash
|
293
|
+
end
|
294
|
+
|
295
|
+
# Outputs non-array value in the form of hash
|
296
|
+
# For object, use to_hash. Otherwise, just return the value
|
297
|
+
# @param [Object] value Any valid value
|
298
|
+
# @return [Hash] Returns the value in the form of hash
|
299
|
+
def _to_hash(value)
|
300
|
+
if value.is_a?(Array)
|
301
|
+
value.compact.map { |v| _to_hash(v) }
|
302
|
+
elsif value.is_a?(Hash)
|
303
|
+
{}.tap do |hash|
|
304
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
305
|
+
end
|
306
|
+
elsif value.respond_to? :to_hash
|
307
|
+
value.to_hash
|
308
|
+
else
|
309
|
+
value
|
310
|
+
end
|
311
|
+
end
|
312
|
+
end
|
313
|
+
end
|
data/lib/mailslurp_client/models/{create_anonymous_alias_options.rb → update_alias_options.rb}
RENAMED
@@ -13,22 +13,22 @@ OpenAPI Generator version: 4.3.1
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module MailSlurpClient
|
16
|
-
#
|
17
|
-
class
|
18
|
-
#
|
19
|
-
attr_accessor :
|
16
|
+
# Update an email alias
|
17
|
+
class UpdateAliasOptions
|
18
|
+
# Optional name for alias
|
19
|
+
attr_accessor :name
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
22
|
def self.attribute_map
|
23
23
|
{
|
24
|
-
:'
|
24
|
+
:'name' => :'name'
|
25
25
|
}
|
26
26
|
end
|
27
27
|
|
28
28
|
# Attribute type mapping.
|
29
29
|
def self.openapi_types
|
30
30
|
{
|
31
|
-
:'
|
31
|
+
:'name' => :'String'
|
32
32
|
}
|
33
33
|
end
|
34
34
|
|
@@ -42,19 +42,19 @@ module MailSlurpClient
|
|
42
42
|
# @param [Hash] attributes Model attributes in the form of hash
|
43
43
|
def initialize(attributes = {})
|
44
44
|
if (!attributes.is_a?(Hash))
|
45
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::UpdateAliasOptions` initialize method"
|
46
46
|
end
|
47
47
|
|
48
48
|
# check to see if the attribute exists and convert string to symbol for hash key
|
49
49
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
50
|
if (!self.class.attribute_map.key?(k.to_sym))
|
51
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::UpdateAliasOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
52
|
end
|
53
53
|
h[k.to_sym] = v
|
54
54
|
}
|
55
55
|
|
56
|
-
if attributes.key?(:'
|
57
|
-
self.
|
56
|
+
if attributes.key?(:'name')
|
57
|
+
self.name = attributes[:'name']
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -76,7 +76,7 @@ module MailSlurpClient
|
|
76
76
|
def ==(o)
|
77
77
|
return true if self.equal?(o)
|
78
78
|
self.class == o.class &&
|
79
|
-
|
79
|
+
name == o.name
|
80
80
|
end
|
81
81
|
|
82
82
|
# @see the `==` method
|
@@ -88,7 +88,7 @@ module MailSlurpClient
|
|
88
88
|
# Calculates hash code according to all attributes.
|
89
89
|
# @return [Integer] Hash code
|
90
90
|
def hash
|
91
|
-
[
|
91
|
+
[name].hash
|
92
92
|
end
|
93
93
|
|
94
94
|
# Builds the object from hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailslurp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mailslurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Create emails addresses in Ruby then send and receive real emails and
|
14
14
|
attachments. See https://www.mailslurp.com/docs/ruby/ for full Ruby documentation.
|
@@ -41,18 +41,20 @@ files:
|
|
41
41
|
- lib/mailslurp_client/api_client.rb
|
42
42
|
- lib/mailslurp_client/api_error.rb
|
43
43
|
- lib/mailslurp_client/configuration.rb
|
44
|
+
- lib/mailslurp_client/models/alias_dto.rb
|
45
|
+
- lib/mailslurp_client/models/alias_projection.rb
|
46
|
+
- lib/mailslurp_client/models/alias_verification_result.rb
|
44
47
|
- lib/mailslurp_client/models/attachment_meta_data.rb
|
45
48
|
- lib/mailslurp_client/models/basic_auth_options.rb
|
46
49
|
- lib/mailslurp_client/models/bulk_send_email_options.rb
|
47
50
|
- lib/mailslurp_client/models/contact_dto.rb
|
48
51
|
- lib/mailslurp_client/models/contact_projection.rb
|
49
52
|
- lib/mailslurp_client/models/content_match_options.rb
|
50
|
-
- lib/mailslurp_client/models/
|
53
|
+
- lib/mailslurp_client/models/create_alias_options.rb
|
51
54
|
- lib/mailslurp_client/models/create_contact_options.rb
|
52
55
|
- lib/mailslurp_client/models/create_domain_options.rb
|
53
56
|
- lib/mailslurp_client/models/create_group_options.rb
|
54
57
|
- lib/mailslurp_client/models/create_inbox_dto.rb
|
55
|
-
- lib/mailslurp_client/models/create_owned_alias_options.rb
|
56
58
|
- lib/mailslurp_client/models/create_template_options.rb
|
57
59
|
- lib/mailslurp_client/models/create_webhook_options.rb
|
58
60
|
- lib/mailslurp_client/models/describe_domain_options.rb
|
@@ -92,6 +94,7 @@ files:
|
|
92
94
|
- lib/mailslurp_client/models/page_webhook_projection.rb
|
93
95
|
- lib/mailslurp_client/models/pageable.rb
|
94
96
|
- lib/mailslurp_client/models/raw_email_json.rb
|
97
|
+
- lib/mailslurp_client/models/reply_to_email_options.rb
|
95
98
|
- lib/mailslurp_client/models/send_email_options.rb
|
96
99
|
- lib/mailslurp_client/models/sent_email_dto.rb
|
97
100
|
- lib/mailslurp_client/models/sent_email_projection.rb
|
@@ -102,6 +105,7 @@ files:
|
|
102
105
|
- lib/mailslurp_client/models/template_projection.rb
|
103
106
|
- lib/mailslurp_client/models/template_variable.rb
|
104
107
|
- lib/mailslurp_client/models/unread_count.rb
|
108
|
+
- lib/mailslurp_client/models/update_alias_options.rb
|
105
109
|
- lib/mailslurp_client/models/update_group_contacts.rb
|
106
110
|
- lib/mailslurp_client/models/update_inbox_options.rb
|
107
111
|
- lib/mailslurp_client/models/upload_attachment_options.rb
|