mailslurp_client 8.4.2 → 8.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb47aef7d9c1b1a45883e93bb8b272440edbc73d10d8449d18ff1cf6723d8e57
4
- data.tar.gz: bc9ebbad6639ab43767f76d810bf0eb841354036bf31568cfd948458fdb7e55d
3
+ metadata.gz: b424817574963026acda212a1082c37fde13f3af7264920cc5a45fd7aa2df85b
4
+ data.tar.gz: 3e02c03ea34a42e76f9d08a24ad67fbe080ac5b0b7e254670eb36cd39df23056
5
5
  SHA512:
6
- metadata.gz: b7db76fa56f6c49d6c4d0321b70d200e2f377ffea2801abf25abfcc5170140d25ebc12114c048f372656aca4ec5531ca2cb961768da58bf735824281df826ab6
7
- data.tar.gz: 410667490a172e3c9acce218c8f22637506d08b8f5beb0100541eefb85bef1854e7d87b9c4e9ac812fe12fd4a5efdf79e7c9715b7e155ae020d67d6d62b347a0
6
+ metadata.gz: dfac9b3079a7cc6b4be394e4eb34ce029fdc96d287111e437fe405b4250cf560180a9fe8d05eb9e03409318066624e3f12f269f2a36c55e74efbc87495803016
7
+ data.tar.gz: 7e974063ae7d01eadaecfb5b93fb3729fc14f9e3607ccc4ddfa94f9edd51749dc1aa1d97fe1dd699c28ccec6bafe473ca6a025ea0144376d88e6a2e8f7a174f3
@@ -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'
@@ -23,7 +23,7 @@ module MailSlurpClient
23
23
  # Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
24
24
  # @param create_alias_options [CreateAliasOptions] createAliasOptions
25
25
  # @param [Hash] opts the optional parameters
26
- # @return [ModelAlias]
26
+ # @return [AliasDto]
27
27
  def create_alias(create_alias_options, opts = {})
28
28
  data, _status_code, _headers = create_alias_with_http_info(create_alias_options, opts)
29
29
  data
@@ -33,7 +33,7 @@ module MailSlurpClient
33
33
  # Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
34
34
  # @param create_alias_options [CreateAliasOptions] createAliasOptions
35
35
  # @param [Hash] opts the optional parameters
36
- # @return [Array<(ModelAlias, Integer, Hash)>] ModelAlias data, response status code and response headers
36
+ # @return [Array<(AliasDto, Integer, Hash)>] AliasDto data, response status code and response headers
37
37
  def create_alias_with_http_info(create_alias_options, opts = {})
38
38
  if @api_client.config.debugging
39
39
  @api_client.config.logger.debug 'Calling API: AliasControllerApi.create_alias ...'
@@ -62,7 +62,7 @@ module MailSlurpClient
62
62
  post_body = opts[:body] || @api_client.object_to_http_body(create_alias_options)
63
63
 
64
64
  # return_type
65
- return_type = opts[:return_type] || 'ModelAlias'
65
+ return_type = opts[:return_type] || 'AliasDto'
66
66
 
67
67
  # auth_names
68
68
  auth_names = opts[:auth_names] || ['API_KEY']
@@ -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
@@ -17,18 +17,25 @@ module MailSlurpClient
17
17
  class AliasDto
18
18
  attr_accessor :created_at
19
19
 
20
+ # The alias's email address for receiving email
20
21
  attr_accessor :email_address
21
22
 
22
23
  attr_accessor :id
23
24
 
25
+ # Inbox that is associated with the alias
24
26
  attr_accessor :inbox_id
25
27
 
28
+ # Has the alias been verified. You must verify an alias if the masked email address has not yet been verified by your account
26
29
  attr_accessor :is_verified
27
30
 
31
+ # The underlying email address that is hidden and will received forwarded email
32
+ attr_accessor :masked_email_address
33
+
28
34
  attr_accessor :name
29
35
 
30
36
  attr_accessor :updated_at
31
37
 
38
+ # If alias will generate response threads or not when email are received by it
32
39
  attr_accessor :use_threads
33
40
 
34
41
  attr_accessor :user_id
@@ -41,6 +48,7 @@ module MailSlurpClient
41
48
  :'id' => :'id',
42
49
  :'inbox_id' => :'inboxId',
43
50
  :'is_verified' => :'isVerified',
51
+ :'masked_email_address' => :'maskedEmailAddress',
44
52
  :'name' => :'name',
45
53
  :'updated_at' => :'updatedAt',
46
54
  :'use_threads' => :'useThreads',
@@ -56,6 +64,7 @@ module MailSlurpClient
56
64
  :'id' => :'String',
57
65
  :'inbox_id' => :'String',
58
66
  :'is_verified' => :'Boolean',
67
+ :'masked_email_address' => :'String',
59
68
  :'name' => :'String',
60
69
  :'updated_at' => :'DateTime',
61
70
  :'use_threads' => :'Boolean',
@@ -104,6 +113,10 @@ module MailSlurpClient
104
113
  self.is_verified = attributes[:'is_verified']
105
114
  end
106
115
 
116
+ if attributes.key?(:'masked_email_address')
117
+ self.masked_email_address = attributes[:'masked_email_address']
118
+ end
119
+
107
120
  if attributes.key?(:'name')
108
121
  self.name = attributes[:'name']
109
122
  end
@@ -129,14 +142,6 @@ module MailSlurpClient
129
142
  invalid_properties.push('invalid value for "id", id cannot be nil.')
130
143
  end
131
144
 
132
- if @inbox_id.nil?
133
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
134
- end
135
-
136
- if @is_verified.nil?
137
- invalid_properties.push('invalid value for "is_verified", is_verified cannot be nil.')
138
- end
139
-
140
145
  if @user_id.nil?
141
146
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
142
147
  end
@@ -148,8 +153,6 @@ module MailSlurpClient
148
153
  # @return true if the model is valid
149
154
  def valid?
150
155
  return false if @id.nil?
151
- return false if @inbox_id.nil?
152
- return false if @is_verified.nil?
153
156
  return false if @user_id.nil?
154
157
  true
155
158
  end
@@ -164,6 +167,7 @@ module MailSlurpClient
164
167
  id == o.id &&
165
168
  inbox_id == o.inbox_id &&
166
169
  is_verified == o.is_verified &&
170
+ masked_email_address == o.masked_email_address &&
167
171
  name == o.name &&
168
172
  updated_at == o.updated_at &&
169
173
  use_threads == o.use_threads &&
@@ -179,7 +183,7 @@ module MailSlurpClient
179
183
  # Calculates hash code according to all attributes.
180
184
  # @return [Integer] Hash code
181
185
  def hash
182
- [created_at, email_address, id, inbox_id, is_verified, name, updated_at, use_threads, user_id].hash
186
+ [created_at, email_address, id, inbox_id, is_verified, masked_email_address, name, updated_at, use_threads, user_id].hash
183
187
  end
184
188
 
185
189
  # Builds the object from hash
@@ -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
@@ -39,6 +39,8 @@ module MailSlurpClient
39
39
 
40
40
  attr_accessor :is_html
41
41
 
42
+ attr_accessor :reply_to
43
+
42
44
  attr_accessor :sent_at
43
45
 
44
46
  attr_accessor :subject
@@ -62,6 +64,7 @@ module MailSlurpClient
62
64
  :'id' => :'id',
63
65
  :'inbox_id' => :'inboxId',
64
66
  :'is_html' => :'isHTML',
67
+ :'reply_to' => :'replyTo',
65
68
  :'sent_at' => :'sentAt',
66
69
  :'subject' => :'subject',
67
70
  :'to' => :'to',
@@ -82,6 +85,7 @@ module MailSlurpClient
82
85
  :'id' => :'String',
83
86
  :'inbox_id' => :'String',
84
87
  :'is_html' => :'Boolean',
88
+ :'reply_to' => :'String',
85
89
  :'sent_at' => :'DateTime',
86
90
  :'subject' => :'String',
87
91
  :'to' => :'Array<String>',
@@ -156,6 +160,10 @@ module MailSlurpClient
156
160
  self.is_html = attributes[:'is_html']
157
161
  end
158
162
 
163
+ if attributes.key?(:'reply_to')
164
+ self.reply_to = attributes[:'reply_to']
165
+ end
166
+
159
167
  if attributes.key?(:'sent_at')
160
168
  self.sent_at = attributes[:'sent_at']
161
169
  end
@@ -208,6 +216,7 @@ module MailSlurpClient
208
216
  id == o.id &&
209
217
  inbox_id == o.inbox_id &&
210
218
  is_html == o.is_html &&
219
+ reply_to == o.reply_to &&
211
220
  sent_at == o.sent_at &&
212
221
  subject == o.subject &&
213
222
  to == o.to &&
@@ -223,7 +232,7 @@ module MailSlurpClient
223
232
  # Calculates hash code according to all attributes.
224
233
  # @return [Integer] Hash code
225
234
  def hash
226
- [attachments, bcc, body, body_md5_hash, cc, charset, from, id, inbox_id, is_html, sent_at, subject, to, user_id].hash
235
+ [attachments, bcc, body, body_md5_hash, cc, charset, from, id, inbox_id, is_html, reply_to, sent_at, subject, to, user_id].hash
227
236
  end
228
237
 
229
238
  # Builds the object from hash
@@ -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.2'
14
+ VERSION = '8.5.3'
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.2
4
+ version: 8.5.3
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-12 00:00:00.000000000 Z
11
+ date: 2020-12-19 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