mailslurp_client 12.8.2 → 12.8.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0be4890f6575516d8fd55e9c1ecddec727214797175b97bc7a3640e854ab4efa
|
4
|
+
data.tar.gz: 5c4d1103dd95353d2a45b3c77082f53288f8d92949f81616406c854363bf31a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbdedc8356a9c4c5a0fc3dfdc118aa80933f5682062412c2e967dea81b26862332eec13e39106d24a9dc40a0cb318647389aa669f9ea9af9f4e85aa87794859a
|
7
|
+
data.tar.gz: cbf43aff215df9400b093697d8f665b2e0c3d88ad6ab169c2fc2bcd774287bb16c00547a00a0ba4bbbbc8fdfea5650296518d73c12ea8c8879062509b69e0865
|
data/lib/mailslurp_client.rb
CHANGED
@@ -20,6 +20,7 @@ require 'mailslurp_client/configuration'
|
|
20
20
|
require 'mailslurp_client/models/abstract_webhook_payload'
|
21
21
|
require 'mailslurp_client/models/alias_dto'
|
22
22
|
require 'mailslurp_client/models/alias_projection'
|
23
|
+
require 'mailslurp_client/models/attachment_entity'
|
23
24
|
require 'mailslurp_client/models/attachment_meta_data'
|
24
25
|
require 'mailslurp_client/models/attachment_projection'
|
25
26
|
require 'mailslurp_client/models/basic_auth_options'
|
@@ -19,6 +19,58 @@ module MailSlurpClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Delete all attachments
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [nil]
|
25
|
+
def delete_all_attachments(opts = {})
|
26
|
+
delete_all_attachments_with_http_info(opts)
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
|
30
|
+
# Delete all attachments
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
33
|
+
def delete_all_attachments_with_http_info(opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: AttachmentControllerApi.delete_all_attachments ...'
|
36
|
+
end
|
37
|
+
# resource path
|
38
|
+
local_var_path = '/attachments'
|
39
|
+
|
40
|
+
# query parameters
|
41
|
+
query_params = opts[:query_params] || {}
|
42
|
+
|
43
|
+
# header parameters
|
44
|
+
header_params = opts[:header_params] || {}
|
45
|
+
|
46
|
+
# form parameters
|
47
|
+
form_params = opts[:form_params] || {}
|
48
|
+
|
49
|
+
# http body (model)
|
50
|
+
post_body = opts[:body]
|
51
|
+
|
52
|
+
# return_type
|
53
|
+
return_type = opts[:return_type]
|
54
|
+
|
55
|
+
# auth_names
|
56
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
57
|
+
|
58
|
+
new_options = opts.merge(
|
59
|
+
:header_params => header_params,
|
60
|
+
:query_params => query_params,
|
61
|
+
:form_params => form_params,
|
62
|
+
:body => post_body,
|
63
|
+
:auth_names => auth_names,
|
64
|
+
:return_type => return_type
|
65
|
+
)
|
66
|
+
|
67
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
68
|
+
if @api_client.config.debugging
|
69
|
+
@api_client.config.logger.debug "API called: AttachmentControllerApi#delete_all_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
70
|
+
end
|
71
|
+
return data, status_code, headers
|
72
|
+
end
|
73
|
+
|
22
74
|
# Delete an attachment
|
23
75
|
# Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
24
76
|
# @param attachment_id [String] ID of attachment
|
@@ -203,6 +255,68 @@ module MailSlurpClient
|
|
203
255
|
return data, status_code, headers
|
204
256
|
end
|
205
257
|
|
258
|
+
# Get an attachment entity
|
259
|
+
# Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
260
|
+
# @param attachment_id [String] ID of attachment
|
261
|
+
# @param [Hash] opts the optional parameters
|
262
|
+
# @return [AttachmentEntity]
|
263
|
+
def get_attachment(attachment_id, opts = {})
|
264
|
+
data, _status_code, _headers = get_attachment_with_http_info(attachment_id, opts)
|
265
|
+
data
|
266
|
+
end
|
267
|
+
|
268
|
+
# Get an attachment entity
|
269
|
+
# Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
270
|
+
# @param attachment_id [String] ID of attachment
|
271
|
+
# @param [Hash] opts the optional parameters
|
272
|
+
# @return [Array<(AttachmentEntity, Integer, Hash)>] AttachmentEntity data, response status code and response headers
|
273
|
+
def get_attachment_with_http_info(attachment_id, opts = {})
|
274
|
+
if @api_client.config.debugging
|
275
|
+
@api_client.config.logger.debug 'Calling API: AttachmentControllerApi.get_attachment ...'
|
276
|
+
end
|
277
|
+
# verify the required parameter 'attachment_id' is set
|
278
|
+
if @api_client.config.client_side_validation && attachment_id.nil?
|
279
|
+
fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.get_attachment"
|
280
|
+
end
|
281
|
+
# resource path
|
282
|
+
local_var_path = '/attachments/{attachmentId}'.sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))
|
283
|
+
|
284
|
+
# query parameters
|
285
|
+
query_params = opts[:query_params] || {}
|
286
|
+
|
287
|
+
# header parameters
|
288
|
+
header_params = opts[:header_params] || {}
|
289
|
+
# HTTP header 'Accept' (if needed)
|
290
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
291
|
+
|
292
|
+
# form parameters
|
293
|
+
form_params = opts[:form_params] || {}
|
294
|
+
|
295
|
+
# http body (model)
|
296
|
+
post_body = opts[:body]
|
297
|
+
|
298
|
+
# return_type
|
299
|
+
return_type = opts[:return_type] || 'AttachmentEntity'
|
300
|
+
|
301
|
+
# auth_names
|
302
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
303
|
+
|
304
|
+
new_options = opts.merge(
|
305
|
+
:header_params => header_params,
|
306
|
+
:query_params => query_params,
|
307
|
+
:form_params => form_params,
|
308
|
+
:body => post_body,
|
309
|
+
:auth_names => auth_names,
|
310
|
+
:return_type => return_type
|
311
|
+
)
|
312
|
+
|
313
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
314
|
+
if @api_client.config.debugging
|
315
|
+
@api_client.config.logger.debug "API called: AttachmentControllerApi#get_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
316
|
+
end
|
317
|
+
return data, status_code, headers
|
318
|
+
end
|
319
|
+
|
206
320
|
# Get email attachment metadata information
|
207
321
|
# Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
|
208
322
|
# @param attachment_id [String] ID of attachment
|
@@ -404,7 +518,7 @@ module MailSlurpClient
|
|
404
518
|
# Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
|
405
519
|
# Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
406
520
|
# @param [Hash] opts the optional parameters
|
407
|
-
# @option opts [String] :
|
521
|
+
# @option opts [String] :content_type Optional contentType for file. For instance `application/pdf`
|
408
522
|
# @option opts [String] :filename Optional filename to save upload with
|
409
523
|
# @option opts [String] :byte_array Byte array request body
|
410
524
|
# @return [Array<String>]
|
@@ -416,7 +530,7 @@ module MailSlurpClient
|
|
416
530
|
# Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
|
417
531
|
# Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
418
532
|
# @param [Hash] opts the optional parameters
|
419
|
-
# @option opts [String] :
|
533
|
+
# @option opts [String] :content_type Optional contentType for file. For instance `application/pdf`
|
420
534
|
# @option opts [String] :filename Optional filename to save upload with
|
421
535
|
# @option opts [String] :byte_array Byte array request body
|
422
536
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
@@ -429,7 +543,7 @@ module MailSlurpClient
|
|
429
543
|
|
430
544
|
# query parameters
|
431
545
|
query_params = opts[:query_params] || {}
|
432
|
-
query_params[:'
|
546
|
+
query_params[:'contentType'] = opts[:'content_type'] if !opts[:'content_type'].nil?
|
433
547
|
query_params[:'filename'] = opts[:'filename'] if !opts[:'filename'].nil?
|
434
548
|
|
435
549
|
# header parameters
|
@@ -0,0 +1,289 @@
|
|
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 AttachmentEntity
|
17
|
+
attr_accessor :attachment_id
|
18
|
+
|
19
|
+
attr_accessor :content_length
|
20
|
+
|
21
|
+
attr_accessor :content_type
|
22
|
+
|
23
|
+
attr_accessor :created_at
|
24
|
+
|
25
|
+
attr_accessor :id
|
26
|
+
|
27
|
+
attr_accessor :name
|
28
|
+
|
29
|
+
attr_accessor :updated_at
|
30
|
+
|
31
|
+
attr_accessor :user_id
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'attachment_id' => :'attachmentId',
|
37
|
+
:'content_length' => :'contentLength',
|
38
|
+
:'content_type' => :'contentType',
|
39
|
+
:'created_at' => :'createdAt',
|
40
|
+
:'id' => :'id',
|
41
|
+
:'name' => :'name',
|
42
|
+
:'updated_at' => :'updatedAt',
|
43
|
+
:'user_id' => :'userId'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.openapi_types
|
49
|
+
{
|
50
|
+
:'attachment_id' => :'String',
|
51
|
+
:'content_length' => :'Integer',
|
52
|
+
:'content_type' => :'String',
|
53
|
+
:'created_at' => :'DateTime',
|
54
|
+
:'id' => :'String',
|
55
|
+
:'name' => :'String',
|
56
|
+
:'updated_at' => :'DateTime',
|
57
|
+
:'user_id' => :'String'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
])
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
if (!attributes.is_a?(Hash))
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::AttachmentEntity` initialize method"
|
72
|
+
end
|
73
|
+
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
76
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::AttachmentEntity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
|
+
end
|
79
|
+
h[k.to_sym] = v
|
80
|
+
}
|
81
|
+
|
82
|
+
if attributes.key?(:'attachment_id')
|
83
|
+
self.attachment_id = attributes[:'attachment_id']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'content_length')
|
87
|
+
self.content_length = attributes[:'content_length']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'content_type')
|
91
|
+
self.content_type = attributes[:'content_type']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'created_at')
|
95
|
+
self.created_at = attributes[:'created_at']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'id')
|
99
|
+
self.id = attributes[:'id']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'name')
|
103
|
+
self.name = attributes[:'name']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'updated_at')
|
107
|
+
self.updated_at = attributes[:'updated_at']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'user_id')
|
111
|
+
self.user_id = attributes[:'user_id']
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
116
|
+
# @return Array for valid properties with the reasons
|
117
|
+
def list_invalid_properties
|
118
|
+
invalid_properties = Array.new
|
119
|
+
if @attachment_id.nil?
|
120
|
+
invalid_properties.push('invalid value for "attachment_id", attachment_id cannot be nil.')
|
121
|
+
end
|
122
|
+
|
123
|
+
if @created_at.nil?
|
124
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
125
|
+
end
|
126
|
+
|
127
|
+
if @updated_at.nil?
|
128
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
129
|
+
end
|
130
|
+
|
131
|
+
if @user_id.nil?
|
132
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
133
|
+
end
|
134
|
+
|
135
|
+
invalid_properties
|
136
|
+
end
|
137
|
+
|
138
|
+
# Check to see if the all the properties in the model are valid
|
139
|
+
# @return true if the model is valid
|
140
|
+
def valid?
|
141
|
+
return false if @attachment_id.nil?
|
142
|
+
return false if @created_at.nil?
|
143
|
+
return false if @updated_at.nil?
|
144
|
+
return false if @user_id.nil?
|
145
|
+
true
|
146
|
+
end
|
147
|
+
|
148
|
+
# Checks equality by comparing each attribute.
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def ==(o)
|
151
|
+
return true if self.equal?(o)
|
152
|
+
self.class == o.class &&
|
153
|
+
attachment_id == o.attachment_id &&
|
154
|
+
content_length == o.content_length &&
|
155
|
+
content_type == o.content_type &&
|
156
|
+
created_at == o.created_at &&
|
157
|
+
id == o.id &&
|
158
|
+
name == o.name &&
|
159
|
+
updated_at == o.updated_at &&
|
160
|
+
user_id == o.user_id
|
161
|
+
end
|
162
|
+
|
163
|
+
# @see the `==` method
|
164
|
+
# @param [Object] Object to be compared
|
165
|
+
def eql?(o)
|
166
|
+
self == o
|
167
|
+
end
|
168
|
+
|
169
|
+
# Calculates hash code according to all attributes.
|
170
|
+
# @return [Integer] Hash code
|
171
|
+
def hash
|
172
|
+
[attachment_id, content_length, content_type, created_at, id, name, updated_at, user_id].hash
|
173
|
+
end
|
174
|
+
|
175
|
+
# Builds the object from hash
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
+
# @return [Object] Returns the model itself
|
178
|
+
def self.build_from_hash(attributes)
|
179
|
+
new.build_from_hash(attributes)
|
180
|
+
end
|
181
|
+
|
182
|
+
# Builds the object from hash
|
183
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
184
|
+
# @return [Object] Returns the model itself
|
185
|
+
def build_from_hash(attributes)
|
186
|
+
return nil unless attributes.is_a?(Hash)
|
187
|
+
self.class.openapi_types.each_pair do |key, type|
|
188
|
+
if type =~ /\AArray<(.*)>/i
|
189
|
+
# check to ensure the input is an array given that the attribute
|
190
|
+
# is documented as an array but the input is not
|
191
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
192
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
193
|
+
end
|
194
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
195
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
196
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
197
|
+
end
|
198
|
+
|
199
|
+
self
|
200
|
+
end
|
201
|
+
|
202
|
+
# Deserializes the data based on type
|
203
|
+
# @param string type Data type
|
204
|
+
# @param string value Value to be deserialized
|
205
|
+
# @return [Object] Deserialized data
|
206
|
+
def _deserialize(type, value)
|
207
|
+
case type.to_sym
|
208
|
+
when :DateTime
|
209
|
+
DateTime.parse(value)
|
210
|
+
when :Date
|
211
|
+
Date.parse(value)
|
212
|
+
when :String
|
213
|
+
value.to_s
|
214
|
+
when :Integer
|
215
|
+
value.to_i
|
216
|
+
when :Float
|
217
|
+
value.to_f
|
218
|
+
when :Boolean
|
219
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
220
|
+
true
|
221
|
+
else
|
222
|
+
false
|
223
|
+
end
|
224
|
+
when :Object
|
225
|
+
# generic object (usually a Hash), return directly
|
226
|
+
value
|
227
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
228
|
+
inner_type = Regexp.last_match[:inner_type]
|
229
|
+
value.map { |v| _deserialize(inner_type, v) }
|
230
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
231
|
+
k_type = Regexp.last_match[:k_type]
|
232
|
+
v_type = Regexp.last_match[:v_type]
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each do |k, v|
|
235
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
else # model
|
239
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
# Returns the string representation of the object
|
244
|
+
# @return [String] String presentation of the object
|
245
|
+
def to_s
|
246
|
+
to_hash.to_s
|
247
|
+
end
|
248
|
+
|
249
|
+
# to_body is an alias to to_hash (backward compatibility)
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_body
|
252
|
+
to_hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Returns the object in the form of hash
|
256
|
+
# @return [Hash] Returns the object in the form of hash
|
257
|
+
def to_hash
|
258
|
+
hash = {}
|
259
|
+
self.class.attribute_map.each_pair do |attr, param|
|
260
|
+
value = self.send(attr)
|
261
|
+
if value.nil?
|
262
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
263
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
264
|
+
end
|
265
|
+
|
266
|
+
hash[param] = _to_hash(value)
|
267
|
+
end
|
268
|
+
hash
|
269
|
+
end
|
270
|
+
|
271
|
+
# Outputs non-array value in the form of hash
|
272
|
+
# For object, use to_hash. Otherwise, just return the value
|
273
|
+
# @param [Object] value Any valid value
|
274
|
+
# @return [Hash] Returns the value in the form of hash
|
275
|
+
def _to_hash(value)
|
276
|
+
if value.is_a?(Array)
|
277
|
+
value.compact.map { |v| _to_hash(v) }
|
278
|
+
elsif value.is_a?(Hash)
|
279
|
+
{}.tap do |hash|
|
280
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
281
|
+
end
|
282
|
+
elsif value.respond_to? :to_hash
|
283
|
+
value.to_hash
|
284
|
+
else
|
285
|
+
value
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
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: 12.8.
|
4
|
+
version: 12.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mailslurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-23 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.
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- lib/mailslurp_client/models/abstract_webhook_payload.rb
|
52
52
|
- lib/mailslurp_client/models/alias_dto.rb
|
53
53
|
- lib/mailslurp_client/models/alias_projection.rb
|
54
|
+
- lib/mailslurp_client/models/attachment_entity.rb
|
54
55
|
- lib/mailslurp_client/models/attachment_meta_data.rb
|
55
56
|
- lib/mailslurp_client/models/attachment_projection.rb
|
56
57
|
- lib/mailslurp_client/models/basic_auth_options.rb
|