mailslurp_client 8.5.5 → 8.6.0

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: 42b10fba7f56fc8fcf4bf2a3bb77586bb199e9fdb4461192c3346cc4ad224690
4
- data.tar.gz: 389413994d502c09588649c9e5ece25a56cb5fa4a058790c91059e0b47b3566e
3
+ metadata.gz: 5ccdb7be7e424bacdae29fcbf9dad515125046d5e38878a1f4e40179e8e8b9bd
4
+ data.tar.gz: b83426fe6e87feb55e23f019caac8b51f07eeabaa52fe21a491695168f5ff0bf
5
5
  SHA512:
6
- metadata.gz: 4c358ee8a14324d4065a6c4ea368e6d5dac97435f39e8913375a286ac0fd989b80163fd659ceb8e8cc6ceec8c477563be0f24beaa7624f8043f11b609dd9cdaa
7
- data.tar.gz: 93f145359354718bec5b8ce4c613832659d7c5236dfc36d1135c17810cae9876bbf0557ff2aff3d988d976ce4cd4e6a89a5aaa5d1715ebdc43eb85a6cdda0ac4
6
+ metadata.gz: b274c058ff4fee095c2f1e72683c1280377f751ffb5f5f5d385c78eb93c62f2ebcba89185219c833e703681c91ac3cb2bd80415646567e6c8db20714bfa0024c
7
+ data.tar.gz: 81d086b54c8c9bfc0197e6fe6a63b712b5c2a23373a7e20ad806ec84205e6fa3f0ab5d32c8f29fc6fe2ac14ca4ef17e15a9ed47aed65ae5a57b4f1ea0abad5bf
@@ -70,6 +70,7 @@ require 'mailslurp_client/models/page_thread_projection'
70
70
  require 'mailslurp_client/models/page_webhook_projection'
71
71
  require 'mailslurp_client/models/pageable'
72
72
  require 'mailslurp_client/models/raw_email_json'
73
+ require 'mailslurp_client/models/reply_to_alias_email_options'
73
74
  require 'mailslurp_client/models/reply_to_email_options'
74
75
  require 'mailslurp_client/models/send_email_options'
75
76
  require 'mailslurp_client/models/sent_email_dto'
@@ -203,6 +203,81 @@ module MailSlurpClient
203
203
  return data, status_code, headers
204
204
  end
205
205
 
206
+ # Get emails for an alias
207
+ # Get paginated emails for an alias by ID
208
+ # @param alias_id [String] aliasId
209
+ # @param [Hash] opts the optional parameters
210
+ # @option opts [Integer] :page Optional page index alias email list pagination (default to 0)
211
+ # @option opts [Integer] :size Optional page size alias email list pagination (default to 20)
212
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
213
+ # @return [PageEmailProjection]
214
+ def get_alias_emails(alias_id, opts = {})
215
+ data, _status_code, _headers = get_alias_emails_with_http_info(alias_id, opts)
216
+ data
217
+ end
218
+
219
+ # Get emails for an alias
220
+ # Get paginated emails for an alias by ID
221
+ # @param alias_id [String] aliasId
222
+ # @param [Hash] opts the optional parameters
223
+ # @option opts [Integer] :page Optional page index alias email list pagination
224
+ # @option opts [Integer] :size Optional page size alias email list pagination
225
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
226
+ # @return [Array<(PageEmailProjection, Integer, Hash)>] PageEmailProjection data, response status code and response headers
227
+ def get_alias_emails_with_http_info(alias_id, opts = {})
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_alias_emails ...'
230
+ end
231
+ # verify the required parameter 'alias_id' is set
232
+ if @api_client.config.client_side_validation && alias_id.nil?
233
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.get_alias_emails"
234
+ end
235
+ allowable_values = ["ASC", "DESC"]
236
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
237
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
238
+ end
239
+ # resource path
240
+ local_var_path = '/aliases/{aliasId}/emails'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
245
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
246
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
247
+
248
+ # header parameters
249
+ header_params = opts[:header_params] || {}
250
+ # HTTP header 'Accept' (if needed)
251
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
252
+
253
+ # form parameters
254
+ form_params = opts[:form_params] || {}
255
+
256
+ # http body (model)
257
+ post_body = opts[:body]
258
+
259
+ # return_type
260
+ return_type = opts[:return_type] || 'PageEmailProjection'
261
+
262
+ # auth_names
263
+ auth_names = opts[:auth_names] || ['API_KEY']
264
+
265
+ new_options = opts.merge(
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :form_params => form_params,
269
+ :body => post_body,
270
+ :auth_names => auth_names,
271
+ :return_type => return_type
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: AliasControllerApi#get_alias_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
206
281
  # Get threads created for an alias
207
282
  # Returns threads created for an email alias in paginated form
208
283
  # @param alias_id [String] aliasId
@@ -347,6 +422,148 @@ module MailSlurpClient
347
422
  return data, status_code, headers
348
423
  end
349
424
 
425
+ # Reply to an email
426
+ # Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
427
+ # @param alias_id [String] ID of the alias that email belongs to
428
+ # @param email_id [String] ID of the email that should be replied to
429
+ # @param reply_to_alias_email_options [ReplyToAliasEmailOptions] replyToAliasEmailOptions
430
+ # @param [Hash] opts the optional parameters
431
+ # @return [SentEmailDto]
432
+ def reply_to_email(alias_id, email_id, reply_to_alias_email_options, opts = {})
433
+ data, _status_code, _headers = reply_to_email_with_http_info(alias_id, email_id, reply_to_alias_email_options, opts)
434
+ data
435
+ end
436
+
437
+ # Reply to an email
438
+ # Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails &#x60;to&#x60;, &#x60;cc&#x60;, and &#x60;bcc&#x60;.
439
+ # @param alias_id [String] ID of the alias that email belongs to
440
+ # @param email_id [String] ID of the email that should be replied to
441
+ # @param reply_to_alias_email_options [ReplyToAliasEmailOptions] replyToAliasEmailOptions
442
+ # @param [Hash] opts the optional parameters
443
+ # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
444
+ def reply_to_email_with_http_info(alias_id, email_id, reply_to_alias_email_options, opts = {})
445
+ if @api_client.config.debugging
446
+ @api_client.config.logger.debug 'Calling API: AliasControllerApi.reply_to_email ...'
447
+ end
448
+ # verify the required parameter 'alias_id' is set
449
+ if @api_client.config.client_side_validation && alias_id.nil?
450
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.reply_to_email"
451
+ end
452
+ # verify the required parameter 'email_id' is set
453
+ if @api_client.config.client_side_validation && email_id.nil?
454
+ fail ArgumentError, "Missing the required parameter 'email_id' when calling AliasControllerApi.reply_to_email"
455
+ end
456
+ # verify the required parameter 'reply_to_alias_email_options' is set
457
+ if @api_client.config.client_side_validation && reply_to_alias_email_options.nil?
458
+ fail ArgumentError, "Missing the required parameter 'reply_to_alias_email_options' when calling AliasControllerApi.reply_to_email"
459
+ end
460
+ # resource path
461
+ local_var_path = '/aliases/{aliasId}/emails/{emailId}'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s)).sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
462
+
463
+ # query parameters
464
+ query_params = opts[:query_params] || {}
465
+
466
+ # header parameters
467
+ header_params = opts[:header_params] || {}
468
+ # HTTP header 'Accept' (if needed)
469
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
470
+ # HTTP header 'Content-Type'
471
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
472
+
473
+ # form parameters
474
+ form_params = opts[:form_params] || {}
475
+
476
+ # http body (model)
477
+ post_body = opts[:body] || @api_client.object_to_http_body(reply_to_alias_email_options)
478
+
479
+ # return_type
480
+ return_type = opts[:return_type] || 'SentEmailDto'
481
+
482
+ # auth_names
483
+ auth_names = opts[:auth_names] || ['API_KEY']
484
+
485
+ new_options = opts.merge(
486
+ :header_params => header_params,
487
+ :query_params => query_params,
488
+ :form_params => form_params,
489
+ :body => post_body,
490
+ :auth_names => auth_names,
491
+ :return_type => return_type
492
+ )
493
+
494
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
495
+ if @api_client.config.debugging
496
+ @api_client.config.logger.debug "API called: AliasControllerApi#reply_to_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
497
+ end
498
+ return data, status_code, headers
499
+ end
500
+
501
+ # Send an email from an alias inbox
502
+ # Send an email from an alias. Replies to the email will be forwared to the alias masked email address
503
+ # @param alias_id [String] aliasId
504
+ # @param [Hash] opts the optional parameters
505
+ # @option opts [SendEmailOptions] :send_email_options Options for the email to be sent
506
+ # @return [SentEmailDto]
507
+ def send_alias_email(alias_id, opts = {})
508
+ data, _status_code, _headers = send_alias_email_with_http_info(alias_id, opts)
509
+ data
510
+ end
511
+
512
+ # Send an email from an alias inbox
513
+ # Send an email from an alias. Replies to the email will be forwared to the alias masked email address
514
+ # @param alias_id [String] aliasId
515
+ # @param [Hash] opts the optional parameters
516
+ # @option opts [SendEmailOptions] :send_email_options Options for the email to be sent
517
+ # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
518
+ def send_alias_email_with_http_info(alias_id, opts = {})
519
+ if @api_client.config.debugging
520
+ @api_client.config.logger.debug 'Calling API: AliasControllerApi.send_alias_email ...'
521
+ end
522
+ # verify the required parameter 'alias_id' is set
523
+ if @api_client.config.client_side_validation && alias_id.nil?
524
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.send_alias_email"
525
+ end
526
+ # resource path
527
+ local_var_path = '/aliases/{aliasId}/emails'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))
528
+
529
+ # query parameters
530
+ query_params = opts[:query_params] || {}
531
+
532
+ # header parameters
533
+ header_params = opts[:header_params] || {}
534
+ # HTTP header 'Accept' (if needed)
535
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
536
+ # HTTP header 'Content-Type'
537
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
538
+
539
+ # form parameters
540
+ form_params = opts[:form_params] || {}
541
+
542
+ # http body (model)
543
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options'])
544
+
545
+ # return_type
546
+ return_type = opts[:return_type] || 'SentEmailDto'
547
+
548
+ # auth_names
549
+ auth_names = opts[:auth_names] || ['API_KEY']
550
+
551
+ new_options = opts.merge(
552
+ :header_params => header_params,
553
+ :query_params => query_params,
554
+ :form_params => form_params,
555
+ :body => post_body,
556
+ :auth_names => auth_names,
557
+ :return_type => return_type
558
+ )
559
+
560
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
561
+ if @api_client.config.debugging
562
+ @api_client.config.logger.debug "API called: AliasControllerApi#send_alias_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
563
+ end
564
+ return data, status_code, headers
565
+ end
566
+
350
567
  # Update an email alias
351
568
  # @param alias_id [String] aliasId
352
569
  # @param update_alias_options [UpdateAliasOptions] updateAliasOptions
@@ -927,32 +927,32 @@ module MailSlurpClient
927
927
 
928
928
  # Reply to an email
929
929
  # Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
930
- # @param email_id [String] emailId
930
+ # @param email_id [String] ID of the email that should be replied to
931
931
  # @param reply_to_email_options [ReplyToEmailOptions] replyToEmailOptions
932
932
  # @param [Hash] opts the optional parameters
933
933
  # @return [SentEmailDto]
934
- def reply_to_email(email_id, reply_to_email_options, opts = {})
935
- data, _status_code, _headers = reply_to_email_with_http_info(email_id, reply_to_email_options, opts)
934
+ def reply_to_email1(email_id, reply_to_email_options, opts = {})
935
+ data, _status_code, _headers = reply_to_email1_with_http_info(email_id, reply_to_email_options, opts)
936
936
  data
937
937
  end
938
938
 
939
939
  # Reply to an email
940
940
  # Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails &#x60;to&#x60;, &#x60;cc&#x60;, and &#x60;bcc&#x60;.
941
- # @param email_id [String] emailId
941
+ # @param email_id [String] ID of the email that should be replied to
942
942
  # @param reply_to_email_options [ReplyToEmailOptions] replyToEmailOptions
943
943
  # @param [Hash] opts the optional parameters
944
944
  # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
945
- def reply_to_email_with_http_info(email_id, reply_to_email_options, opts = {})
945
+ def reply_to_email1_with_http_info(email_id, reply_to_email_options, opts = {})
946
946
  if @api_client.config.debugging
947
- @api_client.config.logger.debug 'Calling API: EmailControllerApi.reply_to_email ...'
947
+ @api_client.config.logger.debug 'Calling API: EmailControllerApi.reply_to_email1 ...'
948
948
  end
949
949
  # verify the required parameter 'email_id' is set
950
950
  if @api_client.config.client_side_validation && email_id.nil?
951
- fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.reply_to_email"
951
+ fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.reply_to_email1"
952
952
  end
953
953
  # verify the required parameter 'reply_to_email_options' is set
954
954
  if @api_client.config.client_side_validation && reply_to_email_options.nil?
955
- fail ArgumentError, "Missing the required parameter 'reply_to_email_options' when calling EmailControllerApi.reply_to_email"
955
+ fail ArgumentError, "Missing the required parameter 'reply_to_email_options' when calling EmailControllerApi.reply_to_email1"
956
956
  end
957
957
  # resource path
958
958
  local_var_path = '/emails/{emailId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
@@ -990,7 +990,7 @@ module MailSlurpClient
990
990
 
991
991
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
992
992
  if @api_client.config.debugging
993
- @api_client.config.logger.debug "API called: EmailControllerApi#reply_to_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
993
+ @api_client.config.logger.debug "API called: EmailControllerApi#reply_to_email1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
994
994
  end
995
995
  return data, status_code, headers
996
996
  end
@@ -18,6 +18,8 @@ module MailSlurpClient
18
18
 
19
19
  attr_accessor :created_at
20
20
 
21
+ attr_accessor :email_addresses
22
+
21
23
  attr_accessor :first_name
22
24
 
23
25
  attr_accessor :group_id
@@ -33,6 +35,7 @@ module MailSlurpClient
33
35
  {
34
36
  :'company' => :'company',
35
37
  :'created_at' => :'createdAt',
38
+ :'email_addresses' => :'emailAddresses',
36
39
  :'first_name' => :'firstName',
37
40
  :'group_id' => :'groupId',
38
41
  :'id' => :'id',
@@ -46,6 +49,7 @@ module MailSlurpClient
46
49
  {
47
50
  :'company' => :'String',
48
51
  :'created_at' => :'DateTime',
52
+ :'email_addresses' => :'Array<String>',
49
53
  :'first_name' => :'String',
50
54
  :'group_id' => :'String',
51
55
  :'id' => :'String',
@@ -83,6 +87,12 @@ module MailSlurpClient
83
87
  self.created_at = attributes[:'created_at']
84
88
  end
85
89
 
90
+ if attributes.key?(:'email_addresses')
91
+ if (value = attributes[:'email_addresses']).is_a?(Array)
92
+ self.email_addresses = value
93
+ end
94
+ end
95
+
86
96
  if attributes.key?(:'first_name')
87
97
  self.first_name = attributes[:'first_name']
88
98
  end
@@ -134,6 +144,7 @@ module MailSlurpClient
134
144
  self.class == o.class &&
135
145
  company == o.company &&
136
146
  created_at == o.created_at &&
147
+ email_addresses == o.email_addresses &&
137
148
  first_name == o.first_name &&
138
149
  group_id == o.group_id &&
139
150
  id == o.id &&
@@ -150,7 +161,7 @@ module MailSlurpClient
150
161
  # Calculates hash code according to all attributes.
151
162
  # @return [Integer] Hash code
152
163
  def hash
153
- [company, created_at, first_name, group_id, id, last_name, opt_out].hash
164
+ [company, created_at, email_addresses, first_name, group_id, id, last_name, opt_out].hash
154
165
  end
155
166
 
156
167
  # Builds the object from hash
@@ -0,0 +1,304 @@
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
+ # Options for replying to an alias email using the alias inbox
17
+ class ReplyToAliasEmailOptions
18
+ # List of uploaded attachments to send with the reply. Optional.
19
+ attr_accessor :attachments
20
+
21
+ # Body of the reply email you want to send
22
+ attr_accessor :body
23
+
24
+ # The charset that your message should be sent with. Optional. Default is UTF-8
25
+ attr_accessor :charset
26
+
27
+ # Is the reply HTML
28
+ attr_accessor :is_html
29
+
30
+ # When to send the email. Typically immediately
31
+ attr_accessor :send_strategy
32
+
33
+ # Template ID to use instead of body. Will use template variable map to fill defined variable slots.
34
+ attr_accessor :template
35
+
36
+ # Template variables if using a template
37
+ attr_accessor :template_variables
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'attachments' => :'attachments',
65
+ :'body' => :'body',
66
+ :'charset' => :'charset',
67
+ :'is_html' => :'isHTML',
68
+ :'send_strategy' => :'sendStrategy',
69
+ :'template' => :'template',
70
+ :'template_variables' => :'templateVariables'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'attachments' => :'Array<String>',
78
+ :'body' => :'String',
79
+ :'charset' => :'String',
80
+ :'is_html' => :'Boolean',
81
+ :'send_strategy' => :'String',
82
+ :'template' => :'String',
83
+ :'template_variables' => :'Object'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ ])
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ def initialize(attributes = {})
96
+ if (!attributes.is_a?(Hash))
97
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ReplyToAliasEmailOptions` initialize method"
98
+ end
99
+
100
+ # check to see if the attribute exists and convert string to symbol for hash key
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!self.class.attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ReplyToAliasEmailOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'attachments')
109
+ if (value = attributes[:'attachments']).is_a?(Array)
110
+ self.attachments = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'body')
115
+ self.body = attributes[:'body']
116
+ end
117
+
118
+ if attributes.key?(:'charset')
119
+ self.charset = attributes[:'charset']
120
+ end
121
+
122
+ if attributes.key?(:'is_html')
123
+ self.is_html = attributes[:'is_html']
124
+ end
125
+
126
+ if attributes.key?(:'send_strategy')
127
+ self.send_strategy = attributes[:'send_strategy']
128
+ end
129
+
130
+ if attributes.key?(:'template')
131
+ self.template = attributes[:'template']
132
+ end
133
+
134
+ if attributes.key?(:'template_variables')
135
+ self.template_variables = attributes[:'template_variables']
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ invalid_properties = Array.new
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ send_strategy_validator = EnumAttributeValidator.new('String', ["SINGLE_MESSAGE"])
150
+ return false unless send_strategy_validator.valid?(@send_strategy)
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method checking allowed values (enum).
155
+ # @param [Object] send_strategy Object to be assigned
156
+ def send_strategy=(send_strategy)
157
+ validator = EnumAttributeValidator.new('String', ["SINGLE_MESSAGE"])
158
+ unless validator.valid?(send_strategy)
159
+ fail ArgumentError, "invalid value for \"send_strategy\", must be one of #{validator.allowable_values}."
160
+ end
161
+ @send_strategy = send_strategy
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ attachments == o.attachments &&
170
+ body == o.body &&
171
+ charset == o.charset &&
172
+ is_html == o.is_html &&
173
+ send_strategy == o.send_strategy &&
174
+ template == o.template &&
175
+ template_variables == o.template_variables
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [attachments, body, charset, is_html, send_strategy, template, template_variables].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ new.build_from_hash(attributes)
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ self.class.openapi_types.each_pair do |key, type|
203
+ if type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
207
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
208
+ end
209
+ elsif !attributes[self.class.attribute_map[key]].nil?
210
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
211
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
212
+ end
213
+
214
+ self
215
+ end
216
+
217
+ # Deserializes the data based on type
218
+ # @param string type Data type
219
+ # @param string value Value to be deserialized
220
+ # @return [Object] Deserialized data
221
+ def _deserialize(type, value)
222
+ case type.to_sym
223
+ when :DateTime
224
+ DateTime.parse(value)
225
+ when :Date
226
+ Date.parse(value)
227
+ when :String
228
+ value.to_s
229
+ when :Integer
230
+ value.to_i
231
+ when :Float
232
+ value.to_f
233
+ when :Boolean
234
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
235
+ true
236
+ else
237
+ false
238
+ end
239
+ when :Object
240
+ # generic object (usually a Hash), return directly
241
+ value
242
+ when /\AArray<(?<inner_type>.+)>\z/
243
+ inner_type = Regexp.last_match[:inner_type]
244
+ value.map { |v| _deserialize(inner_type, v) }
245
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
246
+ k_type = Regexp.last_match[:k_type]
247
+ v_type = Regexp.last_match[:v_type]
248
+ {}.tap do |hash|
249
+ value.each do |k, v|
250
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
251
+ end
252
+ end
253
+ else # model
254
+ MailSlurpClient.const_get(type).build_from_hash(value)
255
+ end
256
+ end
257
+
258
+ # Returns the string representation of the object
259
+ # @return [String] String presentation of the object
260
+ def to_s
261
+ to_hash.to_s
262
+ end
263
+
264
+ # to_body is an alias to to_hash (backward compatibility)
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_body
267
+ to_hash
268
+ end
269
+
270
+ # Returns the object in the form of hash
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_hash
273
+ hash = {}
274
+ self.class.attribute_map.each_pair do |attr, param|
275
+ value = self.send(attr)
276
+ if value.nil?
277
+ is_nullable = self.class.openapi_nullable.include?(attr)
278
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
279
+ end
280
+
281
+ hash[param] = _to_hash(value)
282
+ end
283
+ hash
284
+ end
285
+
286
+ # Outputs non-array value in the form of hash
287
+ # For object, use to_hash. Otherwise, just return the value
288
+ # @param [Object] value Any valid value
289
+ # @return [Hash] Returns the value in the form of hash
290
+ def _to_hash(value)
291
+ if value.is_a?(Array)
292
+ value.compact.map { |v| _to_hash(v) }
293
+ elsif value.is_a?(Hash)
294
+ {}.tap do |hash|
295
+ value.each { |k, v| hash[k] = _to_hash(v) }
296
+ end
297
+ elsif value.respond_to? :to_hash
298
+ value.to_hash
299
+ else
300
+ value
301
+ end
302
+ end
303
+ end
304
+ end
@@ -24,6 +24,9 @@ module MailSlurpClient
24
24
  # The charset that your message should be sent with. Optional. Default is UTF-8
25
25
  attr_accessor :charset
26
26
 
27
+ # The from header that should be used. Optional
28
+ attr_accessor :from
29
+
27
30
  # Is the reply HTML
28
31
  attr_accessor :is_html
29
32
 
@@ -67,6 +70,7 @@ module MailSlurpClient
67
70
  :'attachments' => :'attachments',
68
71
  :'body' => :'body',
69
72
  :'charset' => :'charset',
73
+ :'from' => :'from',
70
74
  :'is_html' => :'isHTML',
71
75
  :'reply_to' => :'replyTo',
72
76
  :'send_strategy' => :'sendStrategy',
@@ -81,6 +85,7 @@ module MailSlurpClient
81
85
  :'attachments' => :'Array<String>',
82
86
  :'body' => :'String',
83
87
  :'charset' => :'String',
88
+ :'from' => :'String',
84
89
  :'is_html' => :'Boolean',
85
90
  :'reply_to' => :'String',
86
91
  :'send_strategy' => :'String',
@@ -124,6 +129,10 @@ module MailSlurpClient
124
129
  self.charset = attributes[:'charset']
125
130
  end
126
131
 
132
+ if attributes.key?(:'from')
133
+ self.from = attributes[:'from']
134
+ end
135
+
127
136
  if attributes.key?(:'is_html')
128
137
  self.is_html = attributes[:'is_html']
129
138
  end
@@ -178,6 +187,7 @@ module MailSlurpClient
178
187
  attachments == o.attachments &&
179
188
  body == o.body &&
180
189
  charset == o.charset &&
190
+ from == o.from &&
181
191
  is_html == o.is_html &&
182
192
  reply_to == o.reply_to &&
183
193
  send_strategy == o.send_strategy &&
@@ -194,7 +204,7 @@ module MailSlurpClient
194
204
  # Calculates hash code according to all attributes.
195
205
  # @return [Integer] Hash code
196
206
  def hash
197
- [attachments, body, charset, is_html, reply_to, send_strategy, template, template_variables].hash
207
+ [attachments, body, charset, from, is_html, reply_to, send_strategy, template, template_variables].hash
198
208
  end
199
209
 
200
210
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '8.5.5'
14
+ VERSION = '8.6.0'
15
15
  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: 8.5.5
4
+ version: 8.6.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-20 00:00:00.000000000 Z
11
+ date: 2020-12-21 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.
@@ -94,6 +94,7 @@ files:
94
94
  - lib/mailslurp_client/models/page_webhook_projection.rb
95
95
  - lib/mailslurp_client/models/pageable.rb
96
96
  - lib/mailslurp_client/models/raw_email_json.rb
97
+ - lib/mailslurp_client/models/reply_to_alias_email_options.rb
97
98
  - lib/mailslurp_client/models/reply_to_email_options.rb
98
99
  - lib/mailslurp_client/models/send_email_options.rb
99
100
  - lib/mailslurp_client/models/sent_email_dto.rb