mailslurp_client 15.17.6 → 15.17.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/mailslurp_client/api/connector_controller_api.rb +619 -0
  4. data/lib/mailslurp_client/models/bounce_projection.rb +15 -15
  5. data/lib/mailslurp_client/models/connector_dto.rb +407 -0
  6. data/lib/mailslurp_client/models/connector_projection.rb +346 -0
  7. data/lib/mailslurp_client/models/connector_sync_event_dto.rb +310 -0
  8. data/lib/mailslurp_client/models/connector_sync_event_projection.rb +306 -0
  9. data/lib/mailslurp_client/models/connector_sync_request_result.rb +224 -0
  10. data/lib/mailslurp_client/models/connector_sync_request_result_exception.rb +246 -0
  11. data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause.rb +237 -0
  12. data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause_stack_trace.rb +269 -0
  13. data/lib/mailslurp_client/models/connector_sync_request_result_exception_cause_suppressed.rb +226 -0
  14. data/lib/mailslurp_client/models/connector_sync_result.rb +222 -0
  15. data/lib/mailslurp_client/models/create_connector_imap_options.rb +267 -0
  16. data/lib/mailslurp_client/models/create_connector_options.rb +338 -0
  17. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  18. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +13 -13
  19. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +1 -0
  20. data/lib/mailslurp_client/models/missed_email_projection.rb +11 -11
  21. data/lib/mailslurp_client/models/page_connector.rb +308 -0
  22. data/lib/mailslurp_client/models/page_connector_sync_events.rb +308 -0
  23. data/lib/mailslurp_client/models/thread_projection.rb +11 -11
  24. data/lib/mailslurp_client/version.rb +1 -1
  25. data/lib/mailslurp_client.rb +15 -0
  26. metadata +17 -2
@@ -23,10 +23,10 @@ module MailSlurpClient
23
23
 
24
24
  attr_accessor :created_at
25
25
 
26
- attr_accessor :bounce_type
27
-
28
26
  attr_accessor :bounce_mta
29
27
 
28
+ attr_accessor :bounce_type
29
+
30
30
  # Attribute mapping from ruby-style variable name to JSON key.
31
31
  def self.attribute_map
32
32
  {
@@ -34,8 +34,8 @@ module MailSlurpClient
34
34
  :'sender' => :'sender',
35
35
  :'subject' => :'subject',
36
36
  :'created_at' => :'createdAt',
37
- :'bounce_type' => :'bounceType',
38
- :'bounce_mta' => :'bounceMta'
37
+ :'bounce_mta' => :'bounceMta',
38
+ :'bounce_type' => :'bounceType'
39
39
  }
40
40
  end
41
41
 
@@ -46,8 +46,8 @@ module MailSlurpClient
46
46
  :'sender' => :'String',
47
47
  :'subject' => :'String',
48
48
  :'created_at' => :'DateTime',
49
- :'bounce_type' => :'String',
50
- :'bounce_mta' => :'String'
49
+ :'bounce_mta' => :'String',
50
+ :'bounce_type' => :'String'
51
51
  }
52
52
  end
53
53
 
@@ -55,8 +55,8 @@ module MailSlurpClient
55
55
  def self.openapi_nullable
56
56
  Set.new([
57
57
  :'subject',
58
- :'bounce_type',
59
- :'bounce_mta'
58
+ :'bounce_mta',
59
+ :'bounce_type'
60
60
  ])
61
61
  end
62
62
 
@@ -91,13 +91,13 @@ module MailSlurpClient
91
91
  self.created_at = attributes[:'created_at']
92
92
  end
93
93
 
94
- if attributes.key?(:'bounce_type')
95
- self.bounce_type = attributes[:'bounce_type']
96
- end
97
-
98
94
  if attributes.key?(:'bounce_mta')
99
95
  self.bounce_mta = attributes[:'bounce_mta']
100
96
  end
97
+
98
+ if attributes.key?(:'bounce_type')
99
+ self.bounce_type = attributes[:'bounce_type']
100
+ end
101
101
  end
102
102
 
103
103
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -132,8 +132,8 @@ module MailSlurpClient
132
132
  sender == o.sender &&
133
133
  subject == o.subject &&
134
134
  created_at == o.created_at &&
135
- bounce_type == o.bounce_type &&
136
- bounce_mta == o.bounce_mta
135
+ bounce_mta == o.bounce_mta &&
136
+ bounce_type == o.bounce_type
137
137
  end
138
138
 
139
139
  # @see the `==` method
@@ -145,7 +145,7 @@ module MailSlurpClient
145
145
  # Calculates hash code according to all attributes.
146
146
  # @return [Integer] Hash code
147
147
  def hash
148
- [id, sender, subject, created_at, bounce_type, bounce_mta].hash
148
+ [id, sender, subject, created_at, bounce_mta, bounce_type].hash
149
149
  end
150
150
 
151
151
  # Builds the object from hash
@@ -0,0 +1,407 @@
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+ Contact: contact@mailslurp.dev
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 ConnectorDto
17
+ attr_accessor :id
18
+
19
+ attr_accessor :user_id
20
+
21
+ attr_accessor :connector_type
22
+
23
+ attr_accessor :connector_auth_type
24
+
25
+ attr_accessor :sync_enabled
26
+
27
+ attr_accessor :sync_schedule_type
28
+
29
+ attr_accessor :sync_interval
30
+
31
+ attr_accessor :imap_host
32
+
33
+ attr_accessor :imap_port
34
+
35
+ attr_accessor :imap_username
36
+
37
+ attr_accessor :imap_password
38
+
39
+ attr_accessor :imap_ssl
40
+
41
+ attr_accessor :created_at
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'id' => :'id',
69
+ :'user_id' => :'userId',
70
+ :'connector_type' => :'connectorType',
71
+ :'connector_auth_type' => :'connectorAuthType',
72
+ :'sync_enabled' => :'syncEnabled',
73
+ :'sync_schedule_type' => :'syncScheduleType',
74
+ :'sync_interval' => :'syncInterval',
75
+ :'imap_host' => :'imapHost',
76
+ :'imap_port' => :'imapPort',
77
+ :'imap_username' => :'imapUsername',
78
+ :'imap_password' => :'imapPassword',
79
+ :'imap_ssl' => :'imapSsl',
80
+ :'created_at' => :'createdAt'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'id' => :'String',
88
+ :'user_id' => :'String',
89
+ :'connector_type' => :'String',
90
+ :'connector_auth_type' => :'String',
91
+ :'sync_enabled' => :'Boolean',
92
+ :'sync_schedule_type' => :'String',
93
+ :'sync_interval' => :'Integer',
94
+ :'imap_host' => :'String',
95
+ :'imap_port' => :'Integer',
96
+ :'imap_username' => :'String',
97
+ :'imap_password' => :'String',
98
+ :'imap_ssl' => :'Boolean',
99
+ :'created_at' => :'DateTime'
100
+ }
101
+ end
102
+
103
+ # List of attributes with nullable: true
104
+ def self.openapi_nullable
105
+ Set.new([
106
+ ])
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ def initialize(attributes = {})
112
+ if (!attributes.is_a?(Hash))
113
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ConnectorDto` initialize method"
114
+ end
115
+
116
+ # check to see if the attribute exists and convert string to symbol for hash key
117
+ attributes = attributes.each_with_object({}) { |(k, v), h|
118
+ if (!self.class.attribute_map.key?(k.to_sym))
119
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ConnectorDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
120
+ end
121
+ h[k.to_sym] = v
122
+ }
123
+
124
+ if attributes.key?(:'id')
125
+ self.id = attributes[:'id']
126
+ end
127
+
128
+ if attributes.key?(:'user_id')
129
+ self.user_id = attributes[:'user_id']
130
+ end
131
+
132
+ if attributes.key?(:'connector_type')
133
+ self.connector_type = attributes[:'connector_type']
134
+ end
135
+
136
+ if attributes.key?(:'connector_auth_type')
137
+ self.connector_auth_type = attributes[:'connector_auth_type']
138
+ end
139
+
140
+ if attributes.key?(:'sync_enabled')
141
+ self.sync_enabled = attributes[:'sync_enabled']
142
+ end
143
+
144
+ if attributes.key?(:'sync_schedule_type')
145
+ self.sync_schedule_type = attributes[:'sync_schedule_type']
146
+ end
147
+
148
+ if attributes.key?(:'sync_interval')
149
+ self.sync_interval = attributes[:'sync_interval']
150
+ end
151
+
152
+ if attributes.key?(:'imap_host')
153
+ self.imap_host = attributes[:'imap_host']
154
+ end
155
+
156
+ if attributes.key?(:'imap_port')
157
+ self.imap_port = attributes[:'imap_port']
158
+ end
159
+
160
+ if attributes.key?(:'imap_username')
161
+ self.imap_username = attributes[:'imap_username']
162
+ end
163
+
164
+ if attributes.key?(:'imap_password')
165
+ self.imap_password = attributes[:'imap_password']
166
+ end
167
+
168
+ if attributes.key?(:'imap_ssl')
169
+ self.imap_ssl = attributes[:'imap_ssl']
170
+ end
171
+
172
+ if attributes.key?(:'created_at')
173
+ self.created_at = attributes[:'created_at']
174
+ end
175
+ end
176
+
177
+ # Show invalid properties with the reasons. Usually used together with valid?
178
+ # @return Array for valid properties with the reasons
179
+ def list_invalid_properties
180
+ invalid_properties = Array.new
181
+ if @id.nil?
182
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
183
+ end
184
+
185
+ if @user_id.nil?
186
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
187
+ end
188
+
189
+ if @connector_type.nil?
190
+ invalid_properties.push('invalid value for "connector_type", connector_type cannot be nil.')
191
+ end
192
+
193
+ if @connector_auth_type.nil?
194
+ invalid_properties.push('invalid value for "connector_auth_type", connector_auth_type cannot be nil.')
195
+ end
196
+
197
+ if @sync_enabled.nil?
198
+ invalid_properties.push('invalid value for "sync_enabled", sync_enabled cannot be nil.')
199
+ end
200
+
201
+ if @sync_schedule_type.nil?
202
+ invalid_properties.push('invalid value for "sync_schedule_type", sync_schedule_type cannot be nil.')
203
+ end
204
+
205
+ if @created_at.nil?
206
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
207
+ end
208
+
209
+ invalid_properties
210
+ end
211
+
212
+ # Check to see if the all the properties in the model are valid
213
+ # @return true if the model is valid
214
+ def valid?
215
+ return false if @id.nil?
216
+ return false if @user_id.nil?
217
+ return false if @connector_type.nil?
218
+ connector_type_validator = EnumAttributeValidator.new('String', ["IMAP"])
219
+ return false unless connector_type_validator.valid?(@connector_type)
220
+ return false if @connector_auth_type.nil?
221
+ connector_auth_type_validator = EnumAttributeValidator.new('String', ["PLAIN_TEXT"])
222
+ return false unless connector_auth_type_validator.valid?(@connector_auth_type)
223
+ return false if @sync_enabled.nil?
224
+ return false if @sync_schedule_type.nil?
225
+ sync_schedule_type_validator = EnumAttributeValidator.new('String', ["INTERVAL"])
226
+ return false unless sync_schedule_type_validator.valid?(@sync_schedule_type)
227
+ return false if @created_at.nil?
228
+ true
229
+ end
230
+
231
+ # Custom attribute writer method checking allowed values (enum).
232
+ # @param [Object] connector_type Object to be assigned
233
+ def connector_type=(connector_type)
234
+ validator = EnumAttributeValidator.new('String', ["IMAP"])
235
+ unless validator.valid?(connector_type)
236
+ fail ArgumentError, "invalid value for \"connector_type\", must be one of #{validator.allowable_values}."
237
+ end
238
+ @connector_type = connector_type
239
+ end
240
+
241
+ # Custom attribute writer method checking allowed values (enum).
242
+ # @param [Object] connector_auth_type Object to be assigned
243
+ def connector_auth_type=(connector_auth_type)
244
+ validator = EnumAttributeValidator.new('String', ["PLAIN_TEXT"])
245
+ unless validator.valid?(connector_auth_type)
246
+ fail ArgumentError, "invalid value for \"connector_auth_type\", must be one of #{validator.allowable_values}."
247
+ end
248
+ @connector_auth_type = connector_auth_type
249
+ end
250
+
251
+ # Custom attribute writer method checking allowed values (enum).
252
+ # @param [Object] sync_schedule_type Object to be assigned
253
+ def sync_schedule_type=(sync_schedule_type)
254
+ validator = EnumAttributeValidator.new('String', ["INTERVAL"])
255
+ unless validator.valid?(sync_schedule_type)
256
+ fail ArgumentError, "invalid value for \"sync_schedule_type\", must be one of #{validator.allowable_values}."
257
+ end
258
+ @sync_schedule_type = sync_schedule_type
259
+ end
260
+
261
+ # Checks equality by comparing each attribute.
262
+ # @param [Object] Object to be compared
263
+ def ==(o)
264
+ return true if self.equal?(o)
265
+ self.class == o.class &&
266
+ id == o.id &&
267
+ user_id == o.user_id &&
268
+ connector_type == o.connector_type &&
269
+ connector_auth_type == o.connector_auth_type &&
270
+ sync_enabled == o.sync_enabled &&
271
+ sync_schedule_type == o.sync_schedule_type &&
272
+ sync_interval == o.sync_interval &&
273
+ imap_host == o.imap_host &&
274
+ imap_port == o.imap_port &&
275
+ imap_username == o.imap_username &&
276
+ imap_password == o.imap_password &&
277
+ imap_ssl == o.imap_ssl &&
278
+ created_at == o.created_at
279
+ end
280
+
281
+ # @see the `==` method
282
+ # @param [Object] Object to be compared
283
+ def eql?(o)
284
+ self == o
285
+ end
286
+
287
+ # Calculates hash code according to all attributes.
288
+ # @return [Integer] Hash code
289
+ def hash
290
+ [id, user_id, connector_type, connector_auth_type, sync_enabled, sync_schedule_type, sync_interval, imap_host, imap_port, imap_username, imap_password, imap_ssl, created_at].hash
291
+ end
292
+
293
+ # Builds the object from hash
294
+ # @param [Hash] attributes Model attributes in the form of hash
295
+ # @return [Object] Returns the model itself
296
+ def self.build_from_hash(attributes)
297
+ new.build_from_hash(attributes)
298
+ end
299
+
300
+ # Builds the object from hash
301
+ # @param [Hash] attributes Model attributes in the form of hash
302
+ # @return [Object] Returns the model itself
303
+ def build_from_hash(attributes)
304
+ return nil unless attributes.is_a?(Hash)
305
+ self.class.openapi_types.each_pair do |key, type|
306
+ if type =~ /\AArray<(.*)>/i
307
+ # check to ensure the input is an array given that the attribute
308
+ # is documented as an array but the input is not
309
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
310
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
311
+ end
312
+ elsif !attributes[self.class.attribute_map[key]].nil?
313
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
314
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
315
+ end
316
+
317
+ self
318
+ end
319
+
320
+ # Deserializes the data based on type
321
+ # @param string type Data type
322
+ # @param string value Value to be deserialized
323
+ # @return [Object] Deserialized data
324
+ def _deserialize(type, value)
325
+ case type.to_sym
326
+ when :DateTime
327
+ DateTime.parse(value)
328
+ when :Date
329
+ Date.parse(value)
330
+ when :String
331
+ value.to_s
332
+ when :Integer
333
+ value.to_i
334
+ when :Float
335
+ value.to_f
336
+ when :Boolean
337
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
338
+ true
339
+ else
340
+ false
341
+ end
342
+ when :Object
343
+ # generic object (usually a Hash), return directly
344
+ value
345
+ when /\AArray<(?<inner_type>.+)>\z/
346
+ inner_type = Regexp.last_match[:inner_type]
347
+ value.map { |v| _deserialize(inner_type, v) }
348
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
349
+ k_type = Regexp.last_match[:k_type]
350
+ v_type = Regexp.last_match[:v_type]
351
+ {}.tap do |hash|
352
+ value.each do |k, v|
353
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
354
+ end
355
+ end
356
+ else # model
357
+ MailSlurpClient.const_get(type).build_from_hash(value)
358
+ end
359
+ end
360
+
361
+ # Returns the string representation of the object
362
+ # @return [String] String presentation of the object
363
+ def to_s
364
+ to_hash.to_s
365
+ end
366
+
367
+ # to_body is an alias to to_hash (backward compatibility)
368
+ # @return [Hash] Returns the object in the form of hash
369
+ def to_body
370
+ to_hash
371
+ end
372
+
373
+ # Returns the object in the form of hash
374
+ # @return [Hash] Returns the object in the form of hash
375
+ def to_hash
376
+ hash = {}
377
+ self.class.attribute_map.each_pair do |attr, param|
378
+ value = self.send(attr)
379
+ if value.nil?
380
+ is_nullable = self.class.openapi_nullable.include?(attr)
381
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
382
+ end
383
+
384
+ hash[param] = _to_hash(value)
385
+ end
386
+ hash
387
+ end
388
+
389
+ # Outputs non-array value in the form of hash
390
+ # For object, use to_hash. Otherwise, just return the value
391
+ # @param [Object] value Any valid value
392
+ # @return [Hash] Returns the value in the form of hash
393
+ def _to_hash(value)
394
+ if value.is_a?(Array)
395
+ value.compact.map { |v| _to_hash(v) }
396
+ elsif value.is_a?(Hash)
397
+ {}.tap do |hash|
398
+ value.each { |k, v| hash[k] = _to_hash(v) }
399
+ end
400
+ elsif value.respond_to? :to_hash
401
+ value.to_hash
402
+ else
403
+ value
404
+ end
405
+ end
406
+ end
407
+ end