mailslurp_client 8.4.3 → 8.5.4

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: 3efaa012e6540bf6b737779f13998a6148b322c70cdf8065dd4d93b1c1045713
4
- data.tar.gz: 757d32f65229b03af69e52a7b5560abe1e369305daa0f2028586579a4e5aa049
3
+ metadata.gz: 96a25c584c5c7d158691c33861e7ca37e47e6fe6674f41cdd1979437e5ba8660
4
+ data.tar.gz: ed72e8c257aaa4eabe77f722aefa66797ed60a6fad7fc566f1d803dbffa6235f
5
5
  SHA512:
6
- metadata.gz: 203de8c176baa26b46b0a96f129e8f2cbd86e7a077373fdde18799f7c6145679d58bfbc22685b1de0067ac33c007fb0549e94b2adefe536ae2ff923cc726007c
7
- data.tar.gz: ea1f1f2e80960c491c50bbfd6ec36af4acd8dcccfc9ea286e1e2780e81a9f15367b68c74dd48329ab56d0052c4cac5b5e8f5474e7b2a4c3a484ffcb50a1d7a9b
6
+ metadata.gz: 75442cf01cf5fcac9d25f86b63e3f30da2f68d4c16bb77de6381bb468876fb4b28fe86beff7e21c3fef95d7d95252f2b0b9559537ac545fc5ac0de5bae9ee3cd
7
+ data.tar.gz: 8e2a65ce8a4f1129bd268784b7e56083580ae95217a848e9c9273972282004f7bb4f6794bf9a2007c4ca2dbbf590f1329bd18cc08c777593fedf4e8a72dd2508
@@ -66,6 +66,7 @@ require 'mailslurp_client/models/page_group_projection'
66
66
  require 'mailslurp_client/models/page_inbox_projection'
67
67
  require 'mailslurp_client/models/page_sent_email_projection'
68
68
  require 'mailslurp_client/models/page_template_projection'
69
+ require 'mailslurp_client/models/page_thread_projection'
69
70
  require 'mailslurp_client/models/page_webhook_projection'
70
71
  require 'mailslurp_client/models/pageable'
71
72
  require 'mailslurp_client/models/raw_email_json'
@@ -79,6 +80,7 @@ require 'mailslurp_client/models/sort'
79
80
  require 'mailslurp_client/models/template_dto'
80
81
  require 'mailslurp_client/models/template_projection'
81
82
  require 'mailslurp_client/models/template_variable'
83
+ require 'mailslurp_client/models/thread_projection'
82
84
  require 'mailslurp_client/models/unread_count'
83
85
  require 'mailslurp_client/models/update_alias_options'
84
86
  require 'mailslurp_client/models/update_group_contacts'
@@ -203,6 +203,81 @@ module MailSlurpClient
203
203
  return data, status_code, headers
204
204
  end
205
205
 
206
+ # Get threads created for an alias
207
+ # Returns threads created for an email alias in paginated form
208
+ # @param alias_id [String] aliasId
209
+ # @param [Hash] opts the optional parameters
210
+ # @option opts [Integer] :page Optional page index in thread list pagination (default to 0)
211
+ # @option opts [Integer] :size Optional page size in thread list pagination (default to 20)
212
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
213
+ # @return [PageThreadProjection]
214
+ def get_alias_threads(alias_id, opts = {})
215
+ data, _status_code, _headers = get_alias_threads_with_http_info(alias_id, opts)
216
+ data
217
+ end
218
+
219
+ # Get threads created for an alias
220
+ # Returns threads created for an email alias in paginated form
221
+ # @param alias_id [String] aliasId
222
+ # @param [Hash] opts the optional parameters
223
+ # @option opts [Integer] :page Optional page index in thread list pagination
224
+ # @option opts [Integer] :size Optional page size in thread list pagination
225
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
226
+ # @return [Array<(PageThreadProjection, Integer, Hash)>] PageThreadProjection data, response status code and response headers
227
+ def get_alias_threads_with_http_info(alias_id, opts = {})
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug 'Calling API: AliasControllerApi.get_alias_threads ...'
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_threads"
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}/threads'.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] || 'PageThreadProjection'
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_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
206
281
  # Get all email aliases you have created
207
282
  # Get all email aliases in paginated form
208
283
  # @param [Hash] opts the optional parameters
@@ -288,6 +288,79 @@ module MailSlurpClient
288
288
  return data, status_code, headers
289
289
  end
290
290
 
291
+ # Wait for or return the first email that matches proved MatchOptions array
292
+ # Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is 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.
293
+ # @param match_options [MatchOptions] matchOptions
294
+ # @param [Hash] opts the optional parameters
295
+ # @option opts [String] :inbox_id Id of the inbox we are matching an email for
296
+ # @option opts [Integer] :timeout Max milliseconds to wait
297
+ # @option opts [Boolean] :unread_only Optional filter for unread only (default to false)
298
+ # @return [Email]
299
+ def wait_for_matching_first_email(match_options, opts = {})
300
+ data, _status_code, _headers = wait_for_matching_first_email_with_http_info(match_options, opts)
301
+ data
302
+ end
303
+
304
+ # Wait for or return the first email that matches proved MatchOptions array
305
+ # Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is 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.
306
+ # @param match_options [MatchOptions] matchOptions
307
+ # @param [Hash] opts the optional parameters
308
+ # @option opts [String] :inbox_id Id of the inbox we are matching an email for
309
+ # @option opts [Integer] :timeout Max milliseconds to wait
310
+ # @option opts [Boolean] :unread_only Optional filter for unread only
311
+ # @return [Array<(Email, Integer, Hash)>] Email data, response status code and response headers
312
+ def wait_for_matching_first_email_with_http_info(match_options, opts = {})
313
+ if @api_client.config.debugging
314
+ @api_client.config.logger.debug 'Calling API: WaitForControllerApi.wait_for_matching_first_email ...'
315
+ end
316
+ # verify the required parameter 'match_options' is set
317
+ if @api_client.config.client_side_validation && match_options.nil?
318
+ fail ArgumentError, "Missing the required parameter 'match_options' when calling WaitForControllerApi.wait_for_matching_first_email"
319
+ end
320
+ # resource path
321
+ local_var_path = '/waitForMatchingFirstEmail'
322
+
323
+ # query parameters
324
+ query_params = opts[:query_params] || {}
325
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
326
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
327
+ query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
328
+
329
+ # header parameters
330
+ header_params = opts[:header_params] || {}
331
+ # HTTP header 'Accept' (if needed)
332
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
333
+ # HTTP header 'Content-Type'
334
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
335
+
336
+ # form parameters
337
+ form_params = opts[:form_params] || {}
338
+
339
+ # http body (model)
340
+ post_body = opts[:body] || @api_client.object_to_http_body(match_options)
341
+
342
+ # return_type
343
+ return_type = opts[:return_type] || 'Email'
344
+
345
+ # auth_names
346
+ auth_names = opts[:auth_names] || ['API_KEY']
347
+
348
+ new_options = opts.merge(
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: WaitForControllerApi#wait_for_matching_first_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+
291
364
  # Wait for or fetch the email with a given index in the inbox specified
292
365
  # If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
293
366
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,299 @@
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
+ # Paginated email projection results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full email entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments.
17
+ class PageThreadProjection
18
+ attr_accessor :content
19
+
20
+ attr_accessor :empty
21
+
22
+ attr_accessor :first
23
+
24
+ attr_accessor :last
25
+
26
+ attr_accessor :number
27
+
28
+ attr_accessor :number_of_elements
29
+
30
+ attr_accessor :pageable
31
+
32
+ attr_accessor :size
33
+
34
+ attr_accessor :sort
35
+
36
+ attr_accessor :total_elements
37
+
38
+ attr_accessor :total_pages
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'content' => :'content',
44
+ :'empty' => :'empty',
45
+ :'first' => :'first',
46
+ :'last' => :'last',
47
+ :'number' => :'number',
48
+ :'number_of_elements' => :'numberOfElements',
49
+ :'pageable' => :'pageable',
50
+ :'size' => :'size',
51
+ :'sort' => :'sort',
52
+ :'total_elements' => :'totalElements',
53
+ :'total_pages' => :'totalPages'
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'content' => :'Array<ThreadProjection>',
61
+ :'empty' => :'Boolean',
62
+ :'first' => :'Boolean',
63
+ :'last' => :'Boolean',
64
+ :'number' => :'Integer',
65
+ :'number_of_elements' => :'Integer',
66
+ :'pageable' => :'Pageable',
67
+ :'size' => :'Integer',
68
+ :'sort' => :'Sort',
69
+ :'total_elements' => :'Integer',
70
+ :'total_pages' => :'Integer'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::PageThreadProjection` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::PageThreadProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'content')
96
+ if (value = attributes[:'content']).is_a?(Array)
97
+ self.content = value
98
+ end
99
+ end
100
+
101
+ if attributes.key?(:'empty')
102
+ self.empty = attributes[:'empty']
103
+ end
104
+
105
+ if attributes.key?(:'first')
106
+ self.first = attributes[:'first']
107
+ end
108
+
109
+ if attributes.key?(:'last')
110
+ self.last = attributes[:'last']
111
+ end
112
+
113
+ if attributes.key?(:'number')
114
+ self.number = attributes[:'number']
115
+ end
116
+
117
+ if attributes.key?(:'number_of_elements')
118
+ self.number_of_elements = attributes[:'number_of_elements']
119
+ end
120
+
121
+ if attributes.key?(:'pageable')
122
+ self.pageable = attributes[:'pageable']
123
+ end
124
+
125
+ if attributes.key?(:'size')
126
+ self.size = attributes[:'size']
127
+ end
128
+
129
+ if attributes.key?(:'sort')
130
+ self.sort = attributes[:'sort']
131
+ end
132
+
133
+ if attributes.key?(:'total_elements')
134
+ self.total_elements = attributes[:'total_elements']
135
+ end
136
+
137
+ if attributes.key?(:'total_pages')
138
+ self.total_pages = attributes[:'total_pages']
139
+ end
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properties with the reasons
144
+ def list_invalid_properties
145
+ invalid_properties = Array.new
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ true
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ content == o.content &&
161
+ empty == o.empty &&
162
+ first == o.first &&
163
+ last == o.last &&
164
+ number == o.number &&
165
+ number_of_elements == o.number_of_elements &&
166
+ pageable == o.pageable &&
167
+ size == o.size &&
168
+ sort == o.sort &&
169
+ total_elements == o.total_elements &&
170
+ total_pages == o.total_pages
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [content, empty, first, last, number, number_of_elements, pageable, size, sort, total_elements, total_pages].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ new.build_from_hash(attributes)
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ self.class.openapi_types.each_pair do |key, type|
198
+ if type =~ /\AArray<(.*)>/i
199
+ # check to ensure the input is an array given that the attribute
200
+ # is documented as an array but the input is not
201
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
202
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
203
+ end
204
+ elsif !attributes[self.class.attribute_map[key]].nil?
205
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
206
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
207
+ end
208
+
209
+ self
210
+ end
211
+
212
+ # Deserializes the data based on type
213
+ # @param string type Data type
214
+ # @param string value Value to be deserialized
215
+ # @return [Object] Deserialized data
216
+ def _deserialize(type, value)
217
+ case type.to_sym
218
+ when :DateTime
219
+ DateTime.parse(value)
220
+ when :Date
221
+ Date.parse(value)
222
+ when :String
223
+ value.to_s
224
+ when :Integer
225
+ value.to_i
226
+ when :Float
227
+ value.to_f
228
+ when :Boolean
229
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
+ true
231
+ else
232
+ false
233
+ end
234
+ when :Object
235
+ # generic object (usually a Hash), return directly
236
+ value
237
+ when /\AArray<(?<inner_type>.+)>\z/
238
+ inner_type = Regexp.last_match[:inner_type]
239
+ value.map { |v| _deserialize(inner_type, v) }
240
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
+ k_type = Regexp.last_match[:k_type]
242
+ v_type = Regexp.last_match[:v_type]
243
+ {}.tap do |hash|
244
+ value.each do |k, v|
245
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
+ end
247
+ end
248
+ else # model
249
+ MailSlurpClient.const_get(type).build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ # Outputs non-array value in the form of hash
282
+ # For object, use to_hash. Otherwise, just return the value
283
+ # @param [Object] value Any valid value
284
+ # @return [Hash] Returns the value in the form of hash
285
+ def _to_hash(value)
286
+ if value.is_a?(Array)
287
+ value.compact.map { |v| _to_hash(v) }
288
+ elsif value.is_a?(Hash)
289
+ {}.tap do |hash|
290
+ value.each { |k, v| hash[k] = _to_hash(v) }
291
+ end
292
+ elsif value.respond_to? :to_hash
293
+ value.to_hash
294
+ else
295
+ value
296
+ end
297
+ end
298
+ end
299
+ end
@@ -0,0 +1,338 @@
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
+ # A thread is a message thread created for a message received by an alias
17
+ class ThreadProjection
18
+ attr_accessor :alias_id
19
+
20
+ attr_accessor :bcc
21
+
22
+ attr_accessor :cc
23
+
24
+ attr_accessor :created_at
25
+
26
+ attr_accessor :id
27
+
28
+ attr_accessor :inbox_id
29
+
30
+ attr_accessor :name
31
+
32
+ attr_accessor :subject
33
+
34
+ attr_accessor :to
35
+
36
+ attr_accessor :updated_at
37
+
38
+ attr_accessor :user_id
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'alias_id' => :'aliasId',
44
+ :'bcc' => :'bcc',
45
+ :'cc' => :'cc',
46
+ :'created_at' => :'createdAt',
47
+ :'id' => :'id',
48
+ :'inbox_id' => :'inboxId',
49
+ :'name' => :'name',
50
+ :'subject' => :'subject',
51
+ :'to' => :'to',
52
+ :'updated_at' => :'updatedAt',
53
+ :'user_id' => :'userId'
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'alias_id' => :'String',
61
+ :'bcc' => :'Array<String>',
62
+ :'cc' => :'Array<String>',
63
+ :'created_at' => :'DateTime',
64
+ :'id' => :'String',
65
+ :'inbox_id' => :'String',
66
+ :'name' => :'String',
67
+ :'subject' => :'String',
68
+ :'to' => :'Array<String>',
69
+ :'updated_at' => :'DateTime',
70
+ :'user_id' => :'String'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ThreadProjection` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ThreadProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'alias_id')
96
+ self.alias_id = attributes[:'alias_id']
97
+ end
98
+
99
+ if attributes.key?(:'bcc')
100
+ if (value = attributes[:'bcc']).is_a?(Array)
101
+ self.bcc = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'cc')
106
+ if (value = attributes[:'cc']).is_a?(Array)
107
+ self.cc = value
108
+ end
109
+ end
110
+
111
+ if attributes.key?(:'created_at')
112
+ self.created_at = attributes[:'created_at']
113
+ end
114
+
115
+ if attributes.key?(:'id')
116
+ self.id = attributes[:'id']
117
+ end
118
+
119
+ if attributes.key?(:'inbox_id')
120
+ self.inbox_id = attributes[:'inbox_id']
121
+ end
122
+
123
+ if attributes.key?(:'name')
124
+ self.name = attributes[:'name']
125
+ end
126
+
127
+ if attributes.key?(:'subject')
128
+ self.subject = attributes[:'subject']
129
+ end
130
+
131
+ if attributes.key?(:'to')
132
+ if (value = attributes[:'to']).is_a?(Array)
133
+ self.to = value
134
+ end
135
+ end
136
+
137
+ if attributes.key?(:'updated_at')
138
+ self.updated_at = attributes[:'updated_at']
139
+ end
140
+
141
+ if attributes.key?(:'user_id')
142
+ self.user_id = attributes[:'user_id']
143
+ end
144
+ end
145
+
146
+ # Show invalid properties with the reasons. Usually used together with valid?
147
+ # @return Array for valid properties with the reasons
148
+ def list_invalid_properties
149
+ invalid_properties = Array.new
150
+ if @alias_id.nil?
151
+ invalid_properties.push('invalid value for "alias_id", alias_id cannot be nil.')
152
+ end
153
+
154
+ if @created_at.nil?
155
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
156
+ end
157
+
158
+ if @id.nil?
159
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
160
+ end
161
+
162
+ if @inbox_id.nil?
163
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
164
+ end
165
+
166
+ if @to.nil?
167
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
168
+ end
169
+
170
+ if @updated_at.nil?
171
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
172
+ end
173
+
174
+ if @user_id.nil?
175
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
176
+ end
177
+
178
+ invalid_properties
179
+ end
180
+
181
+ # Check to see if the all the properties in the model are valid
182
+ # @return true if the model is valid
183
+ def valid?
184
+ return false if @alias_id.nil?
185
+ return false if @created_at.nil?
186
+ return false if @id.nil?
187
+ return false if @inbox_id.nil?
188
+ return false if @to.nil?
189
+ return false if @updated_at.nil?
190
+ return false if @user_id.nil?
191
+ true
192
+ end
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] Object to be compared
196
+ def ==(o)
197
+ return true if self.equal?(o)
198
+ self.class == o.class &&
199
+ alias_id == o.alias_id &&
200
+ bcc == o.bcc &&
201
+ cc == o.cc &&
202
+ created_at == o.created_at &&
203
+ id == o.id &&
204
+ inbox_id == o.inbox_id &&
205
+ name == o.name &&
206
+ subject == o.subject &&
207
+ to == o.to &&
208
+ updated_at == o.updated_at &&
209
+ user_id == o.user_id
210
+ end
211
+
212
+ # @see the `==` method
213
+ # @param [Object] Object to be compared
214
+ def eql?(o)
215
+ self == o
216
+ end
217
+
218
+ # Calculates hash code according to all attributes.
219
+ # @return [Integer] Hash code
220
+ def hash
221
+ [alias_id, bcc, cc, created_at, id, inbox_id, name, subject, to, updated_at, user_id].hash
222
+ end
223
+
224
+ # Builds the object from hash
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ # @return [Object] Returns the model itself
227
+ def self.build_from_hash(attributes)
228
+ new.build_from_hash(attributes)
229
+ end
230
+
231
+ # Builds the object from hash
232
+ # @param [Hash] attributes Model attributes in the form of hash
233
+ # @return [Object] Returns the model itself
234
+ def build_from_hash(attributes)
235
+ return nil unless attributes.is_a?(Hash)
236
+ self.class.openapi_types.each_pair do |key, type|
237
+ if type =~ /\AArray<(.*)>/i
238
+ # check to ensure the input is an array given that the attribute
239
+ # is documented as an array but the input is not
240
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
241
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
242
+ end
243
+ elsif !attributes[self.class.attribute_map[key]].nil?
244
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
245
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
246
+ end
247
+
248
+ self
249
+ end
250
+
251
+ # Deserializes the data based on type
252
+ # @param string type Data type
253
+ # @param string value Value to be deserialized
254
+ # @return [Object] Deserialized data
255
+ def _deserialize(type, value)
256
+ case type.to_sym
257
+ when :DateTime
258
+ DateTime.parse(value)
259
+ when :Date
260
+ Date.parse(value)
261
+ when :String
262
+ value.to_s
263
+ when :Integer
264
+ value.to_i
265
+ when :Float
266
+ value.to_f
267
+ when :Boolean
268
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
269
+ true
270
+ else
271
+ false
272
+ end
273
+ when :Object
274
+ # generic object (usually a Hash), return directly
275
+ value
276
+ when /\AArray<(?<inner_type>.+)>\z/
277
+ inner_type = Regexp.last_match[:inner_type]
278
+ value.map { |v| _deserialize(inner_type, v) }
279
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
280
+ k_type = Regexp.last_match[:k_type]
281
+ v_type = Regexp.last_match[:v_type]
282
+ {}.tap do |hash|
283
+ value.each do |k, v|
284
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
285
+ end
286
+ end
287
+ else # model
288
+ MailSlurpClient.const_get(type).build_from_hash(value)
289
+ end
290
+ end
291
+
292
+ # Returns the string representation of the object
293
+ # @return [String] String presentation of the object
294
+ def to_s
295
+ to_hash.to_s
296
+ end
297
+
298
+ # to_body is an alias to to_hash (backward compatibility)
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_body
301
+ to_hash
302
+ end
303
+
304
+ # Returns the object in the form of hash
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_hash
307
+ hash = {}
308
+ self.class.attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ if value.nil?
311
+ is_nullable = self.class.openapi_nullable.include?(attr)
312
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
313
+ end
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ # Outputs non-array value in the form of hash
321
+ # For object, use to_hash. Otherwise, just return the value
322
+ # @param [Object] value Any valid value
323
+ # @return [Hash] Returns the value in the form of hash
324
+ def _to_hash(value)
325
+ if value.is_a?(Array)
326
+ value.compact.map { |v| _to_hash(v) }
327
+ elsif value.is_a?(Hash)
328
+ {}.tap do |hash|
329
+ value.each { |k, v| hash[k] = _to_hash(v) }
330
+ end
331
+ elsif value.respond_to? :to_hash
332
+ value.to_hash
333
+ else
334
+ value
335
+ end
336
+ end
337
+ end
338
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '8.4.3'
14
+ VERSION = '8.5.4'
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.4.3
4
+ version: 8.5.4
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-15 00:00:00.000000000 Z
11
+ date: 2020-12-20 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.
@@ -90,6 +90,7 @@ files:
90
90
  - lib/mailslurp_client/models/page_inbox_projection.rb
91
91
  - lib/mailslurp_client/models/page_sent_email_projection.rb
92
92
  - lib/mailslurp_client/models/page_template_projection.rb
93
+ - lib/mailslurp_client/models/page_thread_projection.rb
93
94
  - lib/mailslurp_client/models/page_webhook_projection.rb
94
95
  - lib/mailslurp_client/models/pageable.rb
95
96
  - lib/mailslurp_client/models/raw_email_json.rb
@@ -103,6 +104,7 @@ files:
103
104
  - lib/mailslurp_client/models/template_dto.rb
104
105
  - lib/mailslurp_client/models/template_projection.rb
105
106
  - lib/mailslurp_client/models/template_variable.rb
107
+ - lib/mailslurp_client/models/thread_projection.rb
106
108
  - lib/mailslurp_client/models/unread_count.rb
107
109
  - lib/mailslurp_client/models/update_alias_options.rb
108
110
  - lib/mailslurp_client/models/update_group_contacts.rb