mailslurp_client 8.2.12 → 8.2.14

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: c1405a0dc7940571561f6756aa28d85828a718776861e9b66dca61d4784cacd0
4
- data.tar.gz: 711a7b97beb529416856dc26fa338f3438c59cc74bce47d3110f68e0f4df87c0
3
+ metadata.gz: 885a47966c945561dd2f0d6ded52689c21a44d055877e7ce1c6298cbfc7b6e43
4
+ data.tar.gz: a30ae7021cefd27456e10ff7503e6674ee45e822bf9c826c69289faec89133ba
5
5
  SHA512:
6
- metadata.gz: 5d1868b8c6c4cecc100650c06f981290dd6693897b747a25a885bd5e97949a69f85511b440ac4156ac272b7d315235170d944d7011a8b89d02fdd8a525981662
7
- data.tar.gz: 03cd9bc97b2628958db31b1caa1885b419fccd57b09e225bdcf9605df81ae6e70228fd317642d42a0029ec314a534c264896aace4b267a1c4aab43fba7bdedd8
6
+ metadata.gz: f91f21f8d50b6c154ae5a2240554734dce8c922c5e213f3a9a402959c286008a53b9c47f16da51e8e95c2d06ab3fb83f946324ccbba47281c0eb1237f15cba15
7
+ data.tar.gz: 69b0b31c1248e8660446d0eb35328bd659a80080c1b62cfd0bb79f08366ff422a9064e33b48d7a2770dd5ac4f1ce3da27731487c43adf117700e029ea572d014
@@ -64,7 +64,6 @@ require 'mailslurp_client/models/page_webhook_projection'
64
64
  require 'mailslurp_client/models/pageable'
65
65
  require 'mailslurp_client/models/raw_email_json'
66
66
  require 'mailslurp_client/models/send_email_options'
67
- require 'mailslurp_client/models/sent_email'
68
67
  require 'mailslurp_client/models/sent_email_dto'
69
68
  require 'mailslurp_client/models/sent_email_projection'
70
69
  require 'mailslurp_client/models/set_inbox_favourited_options'
@@ -20,7 +20,7 @@ module MailSlurpClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
23
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
23
+ # 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
24
  # @param upload_options [UploadAttachmentOptions] uploadOptions
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Array<String>]
@@ -30,7 +30,7 @@ module MailSlurpClient
30
30
  end
31
31
 
32
32
  # Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
33
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
33
+ # 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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
34
34
  # @param upload_options [UploadAttachmentOptions] uploadOptions
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
@@ -84,7 +84,7 @@ module MailSlurpClient
84
84
  end
85
85
 
86
86
  # 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.
87
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
87
+ # 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.
88
88
  # @param [Hash] opts the optional parameters
89
89
  # @option opts [String] :string Optional contentType for file. For instance &#x60;application/pdf&#x60;
90
90
  # @option opts [String] :filename Optional filename to save upload with
@@ -96,7 +96,7 @@ module MailSlurpClient
96
96
  end
97
97
 
98
98
  # 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.
99
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
99
+ # 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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
100
100
  # @param [Hash] opts the optional parameters
101
101
  # @option opts [String] :string Optional contentType for file. For instance &#x60;application/pdf&#x60;
102
102
  # @option opts [String] :filename Optional filename to save upload with
@@ -150,7 +150,7 @@ module MailSlurpClient
150
150
  end
151
151
 
152
152
  # Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
153
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
153
+ # 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.
154
154
  # @param file [File] file
155
155
  # @param [Hash] opts the optional parameters
156
156
  # @option opts [String] :content_type Optional content type of attachment
@@ -163,7 +163,7 @@ module MailSlurpClient
163
163
  end
164
164
 
165
165
  # Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
166
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. 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.
166
+ # 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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
167
167
  # @param file [File] file
168
168
  # @param [Hash] opts the optional parameters
169
169
  # @option opts [String] :content_type Optional content type of attachment
@@ -536,7 +536,7 @@ module MailSlurpClient
536
536
  end
537
537
 
538
538
  # Get email content regex pattern match results. Runs regex against email body and returns match groups.
539
- # Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
539
+ # Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
540
540
  # @param email_id [String] ID of email to match against
541
541
  # @param content_match_options [ContentMatchOptions] contentMatchOptions
542
542
  # @param [Hash] opts the optional parameters
@@ -547,7 +547,7 @@ module MailSlurpClient
547
547
  end
548
548
 
549
549
  # Get email content regex pattern match results. Runs regex against email body and returns match groups.
550
- # Return the matches for a given Java style regex pattern. Do not include the typical &#x60;/&#x60; at start or end of regex in some languages. Given an example &#x60;your code is: 12345&#x60; the pattern to extract match looks like &#x60;code is: (\\d{6})&#x60;. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: &#x60;[&#39;code is: 123456&#39;, &#39;123456&#39;]&#x60; See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
550
+ # Return the matches for a given Java style regex pattern. Do not include the typical &#x60;/&#x60; at start or end of regex in some languages. Given an example &#x60;your code is: 12345&#x60; the pattern to extract match looks like &#x60;code is: (\\d{6})&#x60;. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: &#x60;[&#39;code is: 123456&#39;, &#39;123456&#39;]&#x60; See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
551
551
  # @param email_id [String] ID of email to match against
552
552
  # @param content_match_options [ContentMatchOptions] contentMatchOptions
553
553
  # @param [Hash] opts the optional parameters
@@ -759,7 +759,7 @@ module MailSlurpClient
759
759
  # @param inbox_id [String] ID of the inbox you want to send the email from
760
760
  # @param [Hash] opts the optional parameters
761
761
  # @option opts [SendEmailOptions] :send_email_options Options for the email
762
- # @return [SentEmail]
762
+ # @return [SentEmailDto]
763
763
  def send_email_and_confirm(inbox_id, opts = {})
764
764
  data, _status_code, _headers = send_email_and_confirm_with_http_info(inbox_id, opts)
765
765
  data
@@ -770,7 +770,7 @@ module MailSlurpClient
770
770
  # @param inbox_id [String] ID of the inbox you want to send the email from
771
771
  # @param [Hash] opts the optional parameters
772
772
  # @option opts [SendEmailOptions] :send_email_options Options for the email
773
- # @return [Array<(SentEmail, Integer, Hash)>] SentEmail data, response status code and response headers
773
+ # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
774
774
  def send_email_and_confirm_with_http_info(inbox_id, opts = {})
775
775
  if @api_client.config.debugging
776
776
  @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_email_and_confirm ...'
@@ -799,7 +799,7 @@ module MailSlurpClient
799
799
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options'])
800
800
 
801
801
  # return_type
802
- return_type = opts[:return_type] || 'SentEmail'
802
+ return_type = opts[:return_type] || 'SentEmailDto'
803
803
 
804
804
  # auth_names
805
805
  auth_names = opts[:auth_names] || ['API_KEY']
@@ -213,7 +213,7 @@ module MailSlurpClient
213
213
  end
214
214
 
215
215
  # Wait or return list of emails that match simple matching patterns
216
- # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options.
216
+ # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
217
217
  # @param match_options [MatchOptions] matchOptions
218
218
  # @param [Hash] opts the optional parameters
219
219
  # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
@@ -227,7 +227,7 @@ module MailSlurpClient
227
227
  end
228
228
 
229
229
  # Wait or return list of emails that match simple matching patterns
230
- # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the &#x60;MatchOptions&#x60; object for options.
230
+ # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the &#x60;MatchOptions&#x60; object for options. An example payload is &#x60;{ matches: [{field: &#39;SUBJECT&#39;,should:&#39;CONTAIN&#39;,value:&#39;needle&#39;}] }&#x60;. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController &#x60;getEmailContentMatch&#x60; method.
231
231
  # @param match_options [MatchOptions] matchOptions
232
232
  # @param [Hash] opts the optional parameters
233
233
  # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value.
16
+ # Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController.
17
17
  class MatchOptions
18
18
  # 1 or more match options. Options are additive so if one does not match the email is excluded from results
19
19
  attr_accessor :matches
@@ -13,13 +13,16 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
+ # Sent email details
16
17
  class SentEmailDto
18
+ # Array of IDs of attachments that were sent with this email
17
19
  attr_accessor :attachments
18
20
 
19
21
  attr_accessor :bcc
20
22
 
21
23
  attr_accessor :body
22
24
 
25
+ # MD5 Hash
23
26
  attr_accessor :body_md5_hash
24
27
 
25
28
  attr_accessor :cc
@@ -28,8 +31,10 @@ module MailSlurpClient
28
31
 
29
32
  attr_accessor :from
30
33
 
34
+ # ID of sent email
31
35
  attr_accessor :id
32
36
 
37
+ # Inbox ID email was sent from
33
38
  attr_accessor :inbox_id
34
39
 
35
40
  attr_accessor :is_html
@@ -38,8 +43,10 @@ module MailSlurpClient
38
43
 
39
44
  attr_accessor :subject
40
45
 
46
+ # Recipients email was sent to
41
47
  attr_accessor :to
42
48
 
49
+ # User ID
43
50
  attr_accessor :user_id
44
51
 
45
52
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -172,32 +179,17 @@ module MailSlurpClient
172
179
  # @return Array for valid properties with the reasons
173
180
  def list_invalid_properties
174
181
  invalid_properties = Array.new
175
- if @id.nil?
176
- invalid_properties.push('invalid value for "id", id cannot be nil.')
177
- end
178
-
179
- if @inbox_id.nil?
180
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
181
- end
182
-
183
182
  if @sent_at.nil?
184
183
  invalid_properties.push('invalid value for "sent_at", sent_at cannot be nil.')
185
184
  end
186
185
 
187
- if @user_id.nil?
188
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
189
- end
190
-
191
186
  invalid_properties
192
187
  end
193
188
 
194
189
  # Check to see if the all the properties in the model are valid
195
190
  # @return true if the model is valid
196
191
  def valid?
197
- return false if @id.nil?
198
- return false if @inbox_id.nil?
199
192
  return false if @sent_at.nil?
200
- return false if @user_id.nil?
201
193
  true
202
194
  end
203
195
 
@@ -21,7 +21,7 @@ module MailSlurpClient
21
21
  # Optional contentType for file. For instance `application/pdf`
22
22
  attr_accessor :content_type
23
23
 
24
- # Optional filename to save upload with
24
+ # Optional filename to save upload with. Will be the name that is shown in email clients
25
25
  attr_accessor :filename
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '8.2.12'
14
+ VERSION = '8.2.14'
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailslurp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.12
4
+ version: 8.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
@@ -88,7 +88,6 @@ files:
88
88
  - lib/mailslurp_client/models/pageable.rb
89
89
  - lib/mailslurp_client/models/raw_email_json.rb
90
90
  - lib/mailslurp_client/models/send_email_options.rb
91
- - lib/mailslurp_client/models/sent_email.rb
92
91
  - lib/mailslurp_client/models/sent_email_dto.rb
93
92
  - lib/mailslurp_client/models/sent_email_projection.rb
94
93
  - lib/mailslurp_client/models/set_inbox_favourited_options.rb
@@ -1,360 +0,0 @@
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 SentEmail
17
- attr_accessor :attachments
18
-
19
- attr_accessor :bcc
20
-
21
- attr_accessor :body_md5_hash
22
-
23
- attr_accessor :body_s3_key
24
-
25
- attr_accessor :cc
26
-
27
- attr_accessor :charset
28
-
29
- attr_accessor :created_at
30
-
31
- attr_accessor :from
32
-
33
- attr_accessor :id
34
-
35
- attr_accessor :inbox_id
36
-
37
- attr_accessor :is_html
38
-
39
- attr_accessor :subject
40
-
41
- attr_accessor :to
42
-
43
- attr_accessor :updated_at
44
-
45
- attr_accessor :user_id
46
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'attachments' => :'attachments',
51
- :'bcc' => :'bcc',
52
- :'body_md5_hash' => :'bodyMD5Hash',
53
- :'body_s3_key' => :'bodyS3Key',
54
- :'cc' => :'cc',
55
- :'charset' => :'charset',
56
- :'created_at' => :'createdAt',
57
- :'from' => :'from',
58
- :'id' => :'id',
59
- :'inbox_id' => :'inboxId',
60
- :'is_html' => :'isHTML',
61
- :'subject' => :'subject',
62
- :'to' => :'to',
63
- :'updated_at' => :'updatedAt',
64
- :'user_id' => :'userId'
65
- }
66
- end
67
-
68
- # Attribute type mapping.
69
- def self.openapi_types
70
- {
71
- :'attachments' => :'Array<String>',
72
- :'bcc' => :'Array<String>',
73
- :'body_md5_hash' => :'String',
74
- :'body_s3_key' => :'String',
75
- :'cc' => :'Array<String>',
76
- :'charset' => :'String',
77
- :'created_at' => :'DateTime',
78
- :'from' => :'String',
79
- :'id' => :'String',
80
- :'inbox_id' => :'String',
81
- :'is_html' => :'Boolean',
82
- :'subject' => :'String',
83
- :'to' => :'Array<String>',
84
- :'updated_at' => :'DateTime',
85
- :'user_id' => :'String'
86
- }
87
- end
88
-
89
- # List of attributes with nullable: true
90
- def self.openapi_nullable
91
- Set.new([
92
- ])
93
- end
94
-
95
- # Initializes the object
96
- # @param [Hash] attributes Model attributes in the form of hash
97
- def initialize(attributes = {})
98
- if (!attributes.is_a?(Hash))
99
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::SentEmail` initialize method"
100
- end
101
-
102
- # check to see if the attribute exists and convert string to symbol for hash key
103
- attributes = attributes.each_with_object({}) { |(k, v), h|
104
- if (!self.class.attribute_map.key?(k.to_sym))
105
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::SentEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
106
- end
107
- h[k.to_sym] = v
108
- }
109
-
110
- if attributes.key?(:'attachments')
111
- if (value = attributes[:'attachments']).is_a?(Array)
112
- self.attachments = value
113
- end
114
- end
115
-
116
- if attributes.key?(:'bcc')
117
- if (value = attributes[:'bcc']).is_a?(Array)
118
- self.bcc = value
119
- end
120
- end
121
-
122
- if attributes.key?(:'body_md5_hash')
123
- self.body_md5_hash = attributes[:'body_md5_hash']
124
- end
125
-
126
- if attributes.key?(:'body_s3_key')
127
- self.body_s3_key = attributes[:'body_s3_key']
128
- end
129
-
130
- if attributes.key?(:'cc')
131
- if (value = attributes[:'cc']).is_a?(Array)
132
- self.cc = value
133
- end
134
- end
135
-
136
- if attributes.key?(:'charset')
137
- self.charset = attributes[:'charset']
138
- end
139
-
140
- if attributes.key?(:'created_at')
141
- self.created_at = attributes[:'created_at']
142
- end
143
-
144
- if attributes.key?(:'from')
145
- self.from = attributes[:'from']
146
- end
147
-
148
- if attributes.key?(:'id')
149
- self.id = attributes[:'id']
150
- end
151
-
152
- if attributes.key?(:'inbox_id')
153
- self.inbox_id = attributes[:'inbox_id']
154
- end
155
-
156
- if attributes.key?(:'is_html')
157
- self.is_html = attributes[:'is_html']
158
- end
159
-
160
- if attributes.key?(:'subject')
161
- self.subject = attributes[:'subject']
162
- end
163
-
164
- if attributes.key?(:'to')
165
- if (value = attributes[:'to']).is_a?(Array)
166
- self.to = value
167
- end
168
- end
169
-
170
- if attributes.key?(:'updated_at')
171
- self.updated_at = attributes[:'updated_at']
172
- end
173
-
174
- if attributes.key?(:'user_id')
175
- self.user_id = attributes[:'user_id']
176
- end
177
- end
178
-
179
- # Show invalid properties with the reasons. Usually used together with valid?
180
- # @return Array for valid properties with the reasons
181
- def list_invalid_properties
182
- invalid_properties = Array.new
183
- if @created_at.nil?
184
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
185
- end
186
-
187
- if @inbox_id.nil?
188
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
189
- end
190
-
191
- if @updated_at.nil?
192
- invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
193
- end
194
-
195
- if @user_id.nil?
196
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
197
- end
198
-
199
- invalid_properties
200
- end
201
-
202
- # Check to see if the all the properties in the model are valid
203
- # @return true if the model is valid
204
- def valid?
205
- return false if @created_at.nil?
206
- return false if @inbox_id.nil?
207
- return false if @updated_at.nil?
208
- return false if @user_id.nil?
209
- true
210
- end
211
-
212
- # Checks equality by comparing each attribute.
213
- # @param [Object] Object to be compared
214
- def ==(o)
215
- return true if self.equal?(o)
216
- self.class == o.class &&
217
- attachments == o.attachments &&
218
- bcc == o.bcc &&
219
- body_md5_hash == o.body_md5_hash &&
220
- body_s3_key == o.body_s3_key &&
221
- cc == o.cc &&
222
- charset == o.charset &&
223
- created_at == o.created_at &&
224
- from == o.from &&
225
- id == o.id &&
226
- inbox_id == o.inbox_id &&
227
- is_html == o.is_html &&
228
- subject == o.subject &&
229
- to == o.to &&
230
- updated_at == o.updated_at &&
231
- user_id == o.user_id
232
- end
233
-
234
- # @see the `==` method
235
- # @param [Object] Object to be compared
236
- def eql?(o)
237
- self == o
238
- end
239
-
240
- # Calculates hash code according to all attributes.
241
- # @return [Integer] Hash code
242
- def hash
243
- [attachments, bcc, body_md5_hash, body_s3_key, cc, charset, created_at, from, id, inbox_id, is_html, subject, to, updated_at, user_id].hash
244
- end
245
-
246
- # Builds the object from hash
247
- # @param [Hash] attributes Model attributes in the form of hash
248
- # @return [Object] Returns the model itself
249
- def self.build_from_hash(attributes)
250
- new.build_from_hash(attributes)
251
- end
252
-
253
- # Builds the object from hash
254
- # @param [Hash] attributes Model attributes in the form of hash
255
- # @return [Object] Returns the model itself
256
- def build_from_hash(attributes)
257
- return nil unless attributes.is_a?(Hash)
258
- self.class.openapi_types.each_pair do |key, type|
259
- if type =~ /\AArray<(.*)>/i
260
- # check to ensure the input is an array given that the attribute
261
- # is documented as an array but the input is not
262
- if attributes[self.class.attribute_map[key]].is_a?(Array)
263
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
264
- end
265
- elsif !attributes[self.class.attribute_map[key]].nil?
266
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
267
- end # or else data not found in attributes(hash), not an issue as the data can be optional
268
- end
269
-
270
- self
271
- end
272
-
273
- # Deserializes the data based on type
274
- # @param string type Data type
275
- # @param string value Value to be deserialized
276
- # @return [Object] Deserialized data
277
- def _deserialize(type, value)
278
- case type.to_sym
279
- when :DateTime
280
- DateTime.parse(value)
281
- when :Date
282
- Date.parse(value)
283
- when :String
284
- value.to_s
285
- when :Integer
286
- value.to_i
287
- when :Float
288
- value.to_f
289
- when :Boolean
290
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
291
- true
292
- else
293
- false
294
- end
295
- when :Object
296
- # generic object (usually a Hash), return directly
297
- value
298
- when /\AArray<(?<inner_type>.+)>\z/
299
- inner_type = Regexp.last_match[:inner_type]
300
- value.map { |v| _deserialize(inner_type, v) }
301
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
302
- k_type = Regexp.last_match[:k_type]
303
- v_type = Regexp.last_match[:v_type]
304
- {}.tap do |hash|
305
- value.each do |k, v|
306
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
307
- end
308
- end
309
- else # model
310
- MailSlurpClient.const_get(type).build_from_hash(value)
311
- end
312
- end
313
-
314
- # Returns the string representation of the object
315
- # @return [String] String presentation of the object
316
- def to_s
317
- to_hash.to_s
318
- end
319
-
320
- # to_body is an alias to to_hash (backward compatibility)
321
- # @return [Hash] Returns the object in the form of hash
322
- def to_body
323
- to_hash
324
- end
325
-
326
- # Returns the object in the form of hash
327
- # @return [Hash] Returns the object in the form of hash
328
- def to_hash
329
- hash = {}
330
- self.class.attribute_map.each_pair do |attr, param|
331
- value = self.send(attr)
332
- if value.nil?
333
- is_nullable = self.class.openapi_nullable.include?(attr)
334
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
335
- end
336
-
337
- hash[param] = _to_hash(value)
338
- end
339
- hash
340
- end
341
-
342
- # Outputs non-array value in the form of hash
343
- # For object, use to_hash. Otherwise, just return the value
344
- # @param [Object] value Any valid value
345
- # @return [Hash] Returns the value in the form of hash
346
- def _to_hash(value)
347
- if value.is_a?(Array)
348
- value.compact.map { |v| _to_hash(v) }
349
- elsif value.is_a?(Hash)
350
- {}.tap do |hash|
351
- value.each { |k, v| hash[k] = _to_hash(v) }
352
- end
353
- elsif value.respond_to? :to_hash
354
- value.to_hash
355
- else
356
- value
357
- end
358
- end
359
- end
360
- end