mailslurp_client 15.19.12 → 15.19.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/email_controller_api.rb +68 -2
  3. data/lib/mailslurp_client/api/inbox_controller_api.rb +182 -2
  4. data/lib/mailslurp_client/models/alias_projection.rb +15 -15
  5. data/lib/mailslurp_client/models/connector_projection.rb +15 -15
  6. data/lib/mailslurp_client/models/create_domain_options.rb +1 -1
  7. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  8. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  9. data/lib/mailslurp_client/models/imap_access_details.rb +61 -1
  10. data/lib/mailslurp_client/models/imap_smtp_access_details.rb +61 -1
  11. data/lib/mailslurp_client/models/imap_smtp_access_servers.rb +254 -0
  12. data/lib/mailslurp_client/models/inbox_dto.rb +1 -1
  13. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +11 -11
  14. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +11 -11
  15. data/lib/mailslurp_client/models/page_alias.rb +10 -10
  16. data/lib/mailslurp_client/models/page_attachment_entity.rb +10 -10
  17. data/lib/mailslurp_client/models/page_bounced_email.rb +10 -10
  18. data/lib/mailslurp_client/models/page_bounced_recipients.rb +10 -10
  19. data/lib/mailslurp_client/models/page_complaint.rb +10 -10
  20. data/lib/mailslurp_client/models/page_connector.rb +10 -10
  21. data/lib/mailslurp_client/models/page_connector_sync_events.rb +10 -10
  22. data/lib/mailslurp_client/models/page_contact_projection.rb +10 -10
  23. data/lib/mailslurp_client/models/page_delivery_status.rb +10 -10
  24. data/lib/mailslurp_client/models/page_email_preview.rb +10 -10
  25. data/lib/mailslurp_client/models/page_email_projection.rb +10 -10
  26. data/lib/mailslurp_client/models/page_email_validation_request.rb +10 -10
  27. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +10 -10
  28. data/lib/mailslurp_client/models/page_group_projection.rb +10 -10
  29. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +10 -10
  30. data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +10 -10
  31. data/lib/mailslurp_client/models/page_inbox_projection.rb +10 -10
  32. data/lib/mailslurp_client/models/page_inbox_replier_dto.rb +10 -10
  33. data/lib/mailslurp_client/models/page_inbox_replier_events.rb +10 -10
  34. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +10 -10
  35. data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +10 -10
  36. data/lib/mailslurp_client/models/page_missed_email_projection.rb +10 -10
  37. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +10 -10
  38. data/lib/mailslurp_client/models/page_phone_number_projection.rb +10 -10
  39. data/lib/mailslurp_client/models/page_scheduled_jobs.rb +10 -10
  40. data/lib/mailslurp_client/models/page_sent_email_projection.rb +10 -10
  41. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +10 -10
  42. data/lib/mailslurp_client/models/page_sms_projection.rb +10 -10
  43. data/lib/mailslurp_client/models/page_template_projection.rb +10 -10
  44. data/lib/mailslurp_client/models/page_thread_projection.rb +10 -10
  45. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +10 -10
  46. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +10 -10
  47. data/lib/mailslurp_client/models/page_webhook_projection.rb +10 -10
  48. data/lib/mailslurp_client/models/page_webhook_result.rb +10 -10
  49. data/lib/mailslurp_client/models/pageable_object.rb +10 -10
  50. data/lib/mailslurp_client/models/sent_email_projection.rb +21 -21
  51. data/lib/mailslurp_client/models/server_endpoints.rb +255 -0
  52. data/lib/mailslurp_client/models/thread_projection.rb +16 -16
  53. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  54. data/lib/mailslurp_client/models/update_imap_access_options.rb +220 -0
  55. data/lib/mailslurp_client/models/update_smtp_access_options.rb +220 -0
  56. data/lib/mailslurp_client/version.rb +1 -1
  57. data/lib/mailslurp_client.rb +4 -0
  58. metadata +6 -2
@@ -27,14 +27,14 @@ module MailSlurpClient
27
27
 
28
28
  attr_accessor :number_of_elements
29
29
 
30
- attr_accessor :first
31
-
32
30
  attr_accessor :size
33
31
 
34
32
  attr_accessor :number
35
33
 
36
34
  attr_accessor :sort
37
35
 
36
+ attr_accessor :first
37
+
38
38
  attr_accessor :empty
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -46,10 +46,10 @@ module MailSlurpClient
46
46
  :'total_elements' => :'totalElements',
47
47
  :'last' => :'last',
48
48
  :'number_of_elements' => :'numberOfElements',
49
- :'first' => :'first',
50
49
  :'size' => :'size',
51
50
  :'number' => :'number',
52
51
  :'sort' => :'sort',
52
+ :'first' => :'first',
53
53
  :'empty' => :'empty'
54
54
  }
55
55
  end
@@ -63,10 +63,10 @@ module MailSlurpClient
63
63
  :'total_elements' => :'Integer',
64
64
  :'last' => :'Boolean',
65
65
  :'number_of_elements' => :'Integer',
66
- :'first' => :'Boolean',
67
66
  :'size' => :'Integer',
68
67
  :'number' => :'Integer',
69
68
  :'sort' => :'SortObject',
69
+ :'first' => :'Boolean',
70
70
  :'empty' => :'Boolean'
71
71
  }
72
72
  end
@@ -118,10 +118,6 @@ module MailSlurpClient
118
118
  self.number_of_elements = attributes[:'number_of_elements']
119
119
  end
120
120
 
121
- if attributes.key?(:'first')
122
- self.first = attributes[:'first']
123
- end
124
-
125
121
  if attributes.key?(:'size')
126
122
  self.size = attributes[:'size']
127
123
  end
@@ -134,6 +130,10 @@ module MailSlurpClient
134
130
  self.sort = attributes[:'sort']
135
131
  end
136
132
 
133
+ if attributes.key?(:'first')
134
+ self.first = attributes[:'first']
135
+ end
136
+
137
137
  if attributes.key?(:'empty')
138
138
  self.empty = attributes[:'empty']
139
139
  end
@@ -173,10 +173,10 @@ module MailSlurpClient
173
173
  total_elements == o.total_elements &&
174
174
  last == o.last &&
175
175
  number_of_elements == o.number_of_elements &&
176
- first == o.first &&
177
176
  size == o.size &&
178
177
  number == o.number &&
179
178
  sort == o.sort &&
179
+ first == o.first &&
180
180
  empty == o.empty
181
181
  end
182
182
 
@@ -189,7 +189,7 @@ module MailSlurpClient
189
189
  # Calculates hash code according to all attributes.
190
190
  # @return [Integer] Hash code
191
191
  def hash
192
- [content, pageable, total_pages, total_elements, last, number_of_elements, first, size, number, sort, empty].hash
192
+ [content, pageable, total_pages, total_elements, last, number_of_elements, size, number, sort, first, empty].hash
193
193
  end
194
194
 
195
195
  # Builds the object from hash
@@ -27,14 +27,14 @@ module MailSlurpClient
27
27
 
28
28
  attr_accessor :number_of_elements
29
29
 
30
- attr_accessor :first
31
-
32
30
  attr_accessor :size
33
31
 
34
32
  attr_accessor :number
35
33
 
36
34
  attr_accessor :sort
37
35
 
36
+ attr_accessor :first
37
+
38
38
  attr_accessor :empty
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -46,10 +46,10 @@ module MailSlurpClient
46
46
  :'total_elements' => :'totalElements',
47
47
  :'last' => :'last',
48
48
  :'number_of_elements' => :'numberOfElements',
49
- :'first' => :'first',
50
49
  :'size' => :'size',
51
50
  :'number' => :'number',
52
51
  :'sort' => :'sort',
52
+ :'first' => :'first',
53
53
  :'empty' => :'empty'
54
54
  }
55
55
  end
@@ -63,10 +63,10 @@ module MailSlurpClient
63
63
  :'total_elements' => :'Integer',
64
64
  :'last' => :'Boolean',
65
65
  :'number_of_elements' => :'Integer',
66
- :'first' => :'Boolean',
67
66
  :'size' => :'Integer',
68
67
  :'number' => :'Integer',
69
68
  :'sort' => :'SortObject',
69
+ :'first' => :'Boolean',
70
70
  :'empty' => :'Boolean'
71
71
  }
72
72
  end
@@ -118,10 +118,6 @@ module MailSlurpClient
118
118
  self.number_of_elements = attributes[:'number_of_elements']
119
119
  end
120
120
 
121
- if attributes.key?(:'first')
122
- self.first = attributes[:'first']
123
- end
124
-
125
121
  if attributes.key?(:'size')
126
122
  self.size = attributes[:'size']
127
123
  end
@@ -134,6 +130,10 @@ module MailSlurpClient
134
130
  self.sort = attributes[:'sort']
135
131
  end
136
132
 
133
+ if attributes.key?(:'first')
134
+ self.first = attributes[:'first']
135
+ end
136
+
137
137
  if attributes.key?(:'empty')
138
138
  self.empty = attributes[:'empty']
139
139
  end
@@ -173,10 +173,10 @@ module MailSlurpClient
173
173
  total_elements == o.total_elements &&
174
174
  last == o.last &&
175
175
  number_of_elements == o.number_of_elements &&
176
- first == o.first &&
177
176
  size == o.size &&
178
177
  number == o.number &&
179
178
  sort == o.sort &&
179
+ first == o.first &&
180
180
  empty == o.empty
181
181
  end
182
182
 
@@ -189,7 +189,7 @@ module MailSlurpClient
189
189
  # Calculates hash code according to all attributes.
190
190
  # @return [Integer] Hash code
191
191
  def hash
192
- [content, pageable, total_pages, total_elements, last, number_of_elements, first, size, number, sort, empty].hash
192
+ [content, pageable, total_pages, total_elements, last, number_of_elements, size, number, sort, first, empty].hash
193
193
  end
194
194
 
195
195
  # Builds the object from hash
@@ -27,14 +27,14 @@ module MailSlurpClient
27
27
 
28
28
  attr_accessor :number_of_elements
29
29
 
30
- attr_accessor :first
31
-
32
30
  attr_accessor :size
33
31
 
34
32
  attr_accessor :number
35
33
 
36
34
  attr_accessor :sort
37
35
 
36
+ attr_accessor :first
37
+
38
38
  attr_accessor :empty
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -46,10 +46,10 @@ module MailSlurpClient
46
46
  :'total_elements' => :'totalElements',
47
47
  :'last' => :'last',
48
48
  :'number_of_elements' => :'numberOfElements',
49
- :'first' => :'first',
50
49
  :'size' => :'size',
51
50
  :'number' => :'number',
52
51
  :'sort' => :'sort',
52
+ :'first' => :'first',
53
53
  :'empty' => :'empty'
54
54
  }
55
55
  end
@@ -63,10 +63,10 @@ module MailSlurpClient
63
63
  :'total_elements' => :'Integer',
64
64
  :'last' => :'Boolean',
65
65
  :'number_of_elements' => :'Integer',
66
- :'first' => :'Boolean',
67
66
  :'size' => :'Integer',
68
67
  :'number' => :'Integer',
69
68
  :'sort' => :'SortObject',
69
+ :'first' => :'Boolean',
70
70
  :'empty' => :'Boolean'
71
71
  }
72
72
  end
@@ -118,10 +118,6 @@ module MailSlurpClient
118
118
  self.number_of_elements = attributes[:'number_of_elements']
119
119
  end
120
120
 
121
- if attributes.key?(:'first')
122
- self.first = attributes[:'first']
123
- end
124
-
125
121
  if attributes.key?(:'size')
126
122
  self.size = attributes[:'size']
127
123
  end
@@ -134,6 +130,10 @@ module MailSlurpClient
134
130
  self.sort = attributes[:'sort']
135
131
  end
136
132
 
133
+ if attributes.key?(:'first')
134
+ self.first = attributes[:'first']
135
+ end
136
+
137
137
  if attributes.key?(:'empty')
138
138
  self.empty = attributes[:'empty']
139
139
  end
@@ -173,10 +173,10 @@ module MailSlurpClient
173
173
  total_elements == o.total_elements &&
174
174
  last == o.last &&
175
175
  number_of_elements == o.number_of_elements &&
176
- first == o.first &&
177
176
  size == o.size &&
178
177
  number == o.number &&
179
178
  sort == o.sort &&
179
+ first == o.first &&
180
180
  empty == o.empty
181
181
  end
182
182
 
@@ -189,7 +189,7 @@ module MailSlurpClient
189
189
  # Calculates hash code according to all attributes.
190
190
  # @return [Integer] Hash code
191
191
  def hash
192
- [content, pageable, total_pages, total_elements, last, number_of_elements, first, size, number, sort, empty].hash
192
+ [content, pageable, total_pages, total_elements, last, number_of_elements, size, number, sort, first, empty].hash
193
193
  end
194
194
 
195
195
  # Builds the object from hash
@@ -18,10 +18,10 @@ module MailSlurpClient
18
18
 
19
19
  attr_accessor :page_size
20
20
 
21
- attr_accessor :unpaged
22
-
23
21
  attr_accessor :paged
24
22
 
23
+ attr_accessor :unpaged
24
+
25
25
  attr_accessor :offset
26
26
 
27
27
  attr_accessor :sort
@@ -31,8 +31,8 @@ module MailSlurpClient
31
31
  {
32
32
  :'page_number' => :'pageNumber',
33
33
  :'page_size' => :'pageSize',
34
- :'unpaged' => :'unpaged',
35
34
  :'paged' => :'paged',
35
+ :'unpaged' => :'unpaged',
36
36
  :'offset' => :'offset',
37
37
  :'sort' => :'sort'
38
38
  }
@@ -43,8 +43,8 @@ module MailSlurpClient
43
43
  {
44
44
  :'page_number' => :'Integer',
45
45
  :'page_size' => :'Integer',
46
- :'unpaged' => :'Boolean',
47
46
  :'paged' => :'Boolean',
47
+ :'unpaged' => :'Boolean',
48
48
  :'offset' => :'Integer',
49
49
  :'sort' => :'SortObject'
50
50
  }
@@ -79,14 +79,14 @@ module MailSlurpClient
79
79
  self.page_size = attributes[:'page_size']
80
80
  end
81
81
 
82
- if attributes.key?(:'unpaged')
83
- self.unpaged = attributes[:'unpaged']
84
- end
85
-
86
82
  if attributes.key?(:'paged')
87
83
  self.paged = attributes[:'paged']
88
84
  end
89
85
 
86
+ if attributes.key?(:'unpaged')
87
+ self.unpaged = attributes[:'unpaged']
88
+ end
89
+
90
90
  if attributes.key?(:'offset')
91
91
  self.offset = attributes[:'offset']
92
92
  end
@@ -116,8 +116,8 @@ module MailSlurpClient
116
116
  self.class == o.class &&
117
117
  page_number == o.page_number &&
118
118
  page_size == o.page_size &&
119
- unpaged == o.unpaged &&
120
119
  paged == o.paged &&
120
+ unpaged == o.unpaged &&
121
121
  offset == o.offset &&
122
122
  sort == o.sort
123
123
  end
@@ -131,7 +131,7 @@ module MailSlurpClient
131
131
  # Calculates hash code according to all attributes.
132
132
  # @return [Integer] Hash code
133
133
  def hash
134
- [page_number, page_size, unpaged, paged, offset, sort].hash
134
+ [page_number, page_size, paged, unpaged, offset, sort].hash
135
135
  end
136
136
 
137
137
  # Builds the object from hash
@@ -20,11 +20,11 @@ module MailSlurpClient
20
20
 
21
21
  attr_accessor :subject
22
22
 
23
- attr_accessor :user_id
23
+ attr_accessor :attachments
24
24
 
25
25
  attr_accessor :inbox_id
26
26
 
27
- attr_accessor :attachments
27
+ attr_accessor :user_id
28
28
 
29
29
  attr_accessor :to
30
30
 
@@ -44,9 +44,9 @@ module MailSlurpClient
44
44
  :'id' => :'id',
45
45
  :'from' => :'from',
46
46
  :'subject' => :'subject',
47
- :'user_id' => :'userId',
48
- :'inbox_id' => :'inboxId',
49
47
  :'attachments' => :'attachments',
48
+ :'inbox_id' => :'inboxId',
49
+ :'user_id' => :'userId',
50
50
  :'to' => :'to',
51
51
  :'bcc' => :'bcc',
52
52
  :'cc' => :'cc',
@@ -62,9 +62,9 @@ module MailSlurpClient
62
62
  :'id' => :'String',
63
63
  :'from' => :'String',
64
64
  :'subject' => :'String',
65
- :'user_id' => :'String',
66
- :'inbox_id' => :'String',
67
65
  :'attachments' => :'Array<String>',
66
+ :'inbox_id' => :'String',
67
+ :'user_id' => :'String',
68
68
  :'to' => :'Array<String>',
69
69
  :'bcc' => :'Array<String>',
70
70
  :'cc' => :'Array<String>',
@@ -107,18 +107,18 @@ module MailSlurpClient
107
107
  self.subject = attributes[:'subject']
108
108
  end
109
109
 
110
- if attributes.key?(:'user_id')
111
- self.user_id = attributes[:'user_id']
110
+ if attributes.key?(:'attachments')
111
+ if (value = attributes[:'attachments']).is_a?(Array)
112
+ self.attachments = value
113
+ end
112
114
  end
113
115
 
114
116
  if attributes.key?(:'inbox_id')
115
117
  self.inbox_id = attributes[:'inbox_id']
116
118
  end
117
119
 
118
- if attributes.key?(:'attachments')
119
- if (value = attributes[:'attachments']).is_a?(Array)
120
- self.attachments = value
121
- end
120
+ if attributes.key?(:'user_id')
121
+ self.user_id = attributes[:'user_id']
122
122
  end
123
123
 
124
124
  if attributes.key?(:'to')
@@ -160,16 +160,16 @@ module MailSlurpClient
160
160
  invalid_properties.push('invalid value for "id", id cannot be nil.')
161
161
  end
162
162
 
163
- if @user_id.nil?
164
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
163
+ if @attachments.nil?
164
+ invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
165
165
  end
166
166
 
167
167
  if @inbox_id.nil?
168
168
  invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
169
169
  end
170
170
 
171
- if @attachments.nil?
172
- invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
171
+ if @user_id.nil?
172
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
173
173
  end
174
174
 
175
175
  if @to.nil?
@@ -199,9 +199,9 @@ module MailSlurpClient
199
199
  # @return true if the model is valid
200
200
  def valid?
201
201
  return false if @id.nil?
202
- return false if @user_id.nil?
203
- return false if @inbox_id.nil?
204
202
  return false if @attachments.nil?
203
+ return false if @inbox_id.nil?
204
+ return false if @user_id.nil?
205
205
  return false if @to.nil?
206
206
  return false if @bcc.nil?
207
207
  return false if @cc.nil?
@@ -218,9 +218,9 @@ module MailSlurpClient
218
218
  id == o.id &&
219
219
  from == o.from &&
220
220
  subject == o.subject &&
221
- user_id == o.user_id &&
222
- inbox_id == o.inbox_id &&
223
221
  attachments == o.attachments &&
222
+ inbox_id == o.inbox_id &&
223
+ user_id == o.user_id &&
224
224
  to == o.to &&
225
225
  bcc == o.bcc &&
226
226
  cc == o.cc &&
@@ -238,7 +238,7 @@ module MailSlurpClient
238
238
  # Calculates hash code according to all attributes.
239
239
  # @return [Integer] Hash code
240
240
  def hash
241
- [id, from, subject, user_id, inbox_id, attachments, to, bcc, cc, created_at, body_md5_hash, virtual_send].hash
241
+ [id, from, subject, attachments, inbox_id, user_id, to, bcc, cc, created_at, body_md5_hash, virtual_send].hash
242
242
  end
243
243
 
244
244
  # Builds the object from hash
@@ -0,0 +1,255 @@
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 ServerEndpoints
17
+ attr_accessor :host
18
+
19
+ attr_accessor :port
20
+
21
+ attr_accessor :tls
22
+
23
+ attr_accessor :alt_ports
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'host' => :'host',
29
+ :'port' => :'port',
30
+ :'tls' => :'tls',
31
+ :'alt_ports' => :'altPorts'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'host' => :'String',
39
+ :'port' => :'Integer',
40
+ :'tls' => :'Boolean',
41
+ :'alt_ports' => :'Array<Integer>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ServerEndpoints` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ServerEndpoints`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'host')
67
+ self.host = attributes[:'host']
68
+ end
69
+
70
+ if attributes.key?(:'port')
71
+ self.port = attributes[:'port']
72
+ end
73
+
74
+ if attributes.key?(:'tls')
75
+ self.tls = attributes[:'tls']
76
+ end
77
+
78
+ if attributes.key?(:'alt_ports')
79
+ if (value = attributes[:'alt_ports']).is_a?(Array)
80
+ self.alt_ports = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ if @host.nil?
90
+ invalid_properties.push('invalid value for "host", host cannot be nil.')
91
+ end
92
+
93
+ if @port.nil?
94
+ invalid_properties.push('invalid value for "port", port cannot be nil.')
95
+ end
96
+
97
+ if @tls.nil?
98
+ invalid_properties.push('invalid value for "tls", tls cannot be nil.')
99
+ end
100
+
101
+ if @alt_ports.nil?
102
+ invalid_properties.push('invalid value for "alt_ports", alt_ports cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if @host.nil?
112
+ return false if @port.nil?
113
+ return false if @tls.nil?
114
+ return false if @alt_ports.nil?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ host == o.host &&
124
+ port == o.port &&
125
+ tls == o.tls &&
126
+ alt_ports == o.alt_ports
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [host, port, tls, alt_ports].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ new.build_from_hash(attributes)
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ self.class.openapi_types.each_pair do |key, type|
154
+ if type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :DateTime
175
+ DateTime.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ MailSlurpClient.const_get(type).build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+ end
255
+ end