mailslurp_client 15.18.5 → 15.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/connector_controller_api.rb +260 -0
  3. data/lib/mailslurp_client/api/domain_controller_api.rb +126 -0
  4. data/lib/mailslurp_client/api/email_controller_api.rb +138 -0
  5. data/lib/mailslurp_client/api/imap_controller_api.rb +279 -0
  6. data/lib/mailslurp_client/api/inbox_controller_api.rb +114 -0
  7. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +3 -0
  8. data/lib/mailslurp_client/api/mail_server_controller_api.rb +62 -0
  9. data/lib/mailslurp_client/models/alias_projection.rb +29 -29
  10. data/lib/mailslurp_client/models/attachment_projection.rb +29 -29
  11. data/lib/mailslurp_client/models/bounce_projection.rb +29 -29
  12. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +22 -22
  13. data/lib/mailslurp_client/models/connector_dto.rb +42 -108
  14. data/lib/mailslurp_client/models/connector_imap_connection_dto.rb +311 -0
  15. data/lib/mailslurp_client/models/connector_projection.rb +39 -43
  16. data/lib/mailslurp_client/models/connector_smtp_connection_dto.rb +293 -0
  17. data/lib/mailslurp_client/models/connector_sync_event_projection.rb +15 -15
  18. data/lib/mailslurp_client/models/contact_projection.rb +10 -10
  19. data/lib/mailslurp_client/models/create_connector_imap_connection_options.rb +286 -0
  20. data/lib/mailslurp_client/models/create_connector_options.rb +38 -87
  21. data/lib/mailslurp_client/models/create_connector_smtp_connection_options.rb +256 -0
  22. data/lib/mailslurp_client/models/dns_lookup_options.rb +1 -1
  23. data/lib/mailslurp_client/models/dns_lookups_options.rb +214 -0
  24. data/lib/mailslurp_client/models/domain_group.rb +261 -0
  25. data/lib/mailslurp_client/models/domain_groups_dto.rb +213 -0
  26. data/lib/mailslurp_client/models/domain_information.rb +274 -0
  27. data/lib/mailslurp_client/models/email_preview_urls.rb +18 -4
  28. data/lib/mailslurp_client/models/email_projection.rb +19 -19
  29. data/lib/mailslurp_client/models/email_screenshot_result.rb +211 -0
  30. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  31. data/lib/mailslurp_client/models/get_email_screenshot_options.rb +220 -0
  32. data/lib/mailslurp_client/models/imap_access_details.rb +273 -0
  33. data/lib/mailslurp_client/models/imap_email_projection.rb +239 -0
  34. data/lib/mailslurp_client/models/{create_connector_imap_options.rb → imap_server_fetch_item.rb} +55 -49
  35. data/lib/mailslurp_client/models/imap_server_fetch_result.rb +208 -0
  36. data/lib/mailslurp_client/models/{create_connector_imap_fetch_options.rb → imap_server_list_options.rb} +18 -16
  37. data/lib/mailslurp_client/models/imap_server_list_result.rb +213 -0
  38. data/lib/mailslurp_client/models/imap_server_search_options.rb +318 -0
  39. data/lib/mailslurp_client/models/imap_server_search_result.rb +213 -0
  40. data/lib/mailslurp_client/models/imap_smtp_access_details.rb +16 -1
  41. data/lib/mailslurp_client/models/imap_update_flags_options.rb +277 -0
  42. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +10 -10
  43. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +10 -10
  44. data/lib/mailslurp_client/models/list_unsubscribe_recipient_projection.rb +15 -15
  45. data/lib/mailslurp_client/models/match_option.rb +4 -4
  46. data/lib/mailslurp_client/models/missed_email_projection.rb +14 -14
  47. data/lib/mailslurp_client/models/page_alias.rb +15 -15
  48. data/lib/mailslurp_client/models/page_attachment_entity.rb +15 -15
  49. data/lib/mailslurp_client/models/page_bounced_email.rb +15 -15
  50. data/lib/mailslurp_client/models/page_bounced_recipients.rb +15 -15
  51. data/lib/mailslurp_client/models/page_complaint.rb +15 -15
  52. data/lib/mailslurp_client/models/page_connector.rb +15 -15
  53. data/lib/mailslurp_client/models/page_connector_sync_events.rb +15 -15
  54. data/lib/mailslurp_client/models/page_contact_projection.rb +15 -15
  55. data/lib/mailslurp_client/models/page_delivery_status.rb +15 -15
  56. data/lib/mailslurp_client/models/page_email_preview.rb +15 -15
  57. data/lib/mailslurp_client/models/page_email_projection.rb +15 -15
  58. data/lib/mailslurp_client/models/page_email_validation_request.rb +15 -15
  59. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +15 -15
  60. data/lib/mailslurp_client/models/page_group_projection.rb +15 -15
  61. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +15 -15
  62. data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +15 -15
  63. data/lib/mailslurp_client/models/page_inbox_projection.rb +15 -15
  64. data/lib/mailslurp_client/models/page_inbox_replier_dto.rb +15 -15
  65. data/lib/mailslurp_client/models/page_inbox_replier_events.rb +15 -15
  66. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +15 -15
  67. data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +15 -15
  68. data/lib/mailslurp_client/models/page_missed_email_projection.rb +15 -15
  69. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +15 -15
  70. data/lib/mailslurp_client/models/page_phone_number_projection.rb +15 -15
  71. data/lib/mailslurp_client/models/page_scheduled_jobs.rb +15 -15
  72. data/lib/mailslurp_client/models/page_sent_email_projection.rb +15 -15
  73. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +15 -15
  74. data/lib/mailslurp_client/models/page_sms_projection.rb +15 -15
  75. data/lib/mailslurp_client/models/page_template_projection.rb +15 -15
  76. data/lib/mailslurp_client/models/page_thread_projection.rb +15 -15
  77. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +15 -15
  78. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +15 -15
  79. data/lib/mailslurp_client/models/page_webhook_projection.rb +15 -15
  80. data/lib/mailslurp_client/models/page_webhook_result.rb +15 -15
  81. data/lib/mailslurp_client/models/phone_number_projection.rb +15 -15
  82. data/lib/mailslurp_client/models/sent_email_projection.rb +35 -35
  83. data/lib/mailslurp_client/models/sms_match_option.rb +2 -2
  84. data/lib/mailslurp_client/models/sms_projection.rb +29 -29
  85. data/lib/mailslurp_client/models/smtp_access_details.rb +329 -0
  86. data/lib/mailslurp_client/models/template_projection.rb +17 -17
  87. data/lib/mailslurp_client/models/thread_projection.rb +35 -35
  88. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +15 -15
  89. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +13 -13
  90. data/lib/mailslurp_client/models/webhook_projection.rb +25 -25
  91. data/lib/mailslurp_client/version.rb +1 -1
  92. data/lib/mailslurp_client.rb +21 -2
  93. metadata +23 -4
@@ -15,20 +15,20 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # Record of inbox expiration
17
17
  class ExpiredInboxRecordProjection
18
- attr_accessor :created_at
19
-
20
18
  attr_accessor :user_id
21
19
 
22
20
  attr_accessor :email_address
23
21
 
22
+ attr_accessor :created_at
23
+
24
24
  attr_accessor :id
25
25
 
26
26
  # Attribute mapping from ruby-style variable name to JSON key.
27
27
  def self.attribute_map
28
28
  {
29
- :'created_at' => :'createdAt',
30
29
  :'user_id' => :'userId',
31
30
  :'email_address' => :'emailAddress',
31
+ :'created_at' => :'createdAt',
32
32
  :'id' => :'id'
33
33
  }
34
34
  end
@@ -36,9 +36,9 @@ module MailSlurpClient
36
36
  # Attribute type mapping.
37
37
  def self.openapi_types
38
38
  {
39
- :'created_at' => :'DateTime',
40
39
  :'user_id' => :'String',
41
40
  :'email_address' => :'String',
41
+ :'created_at' => :'DateTime',
42
42
  :'id' => :'String'
43
43
  }
44
44
  end
@@ -64,10 +64,6 @@ module MailSlurpClient
64
64
  h[k.to_sym] = v
65
65
  }
66
66
 
67
- if attributes.key?(:'created_at')
68
- self.created_at = attributes[:'created_at']
69
- end
70
-
71
67
  if attributes.key?(:'user_id')
72
68
  self.user_id = attributes[:'user_id']
73
69
  end
@@ -76,6 +72,10 @@ module MailSlurpClient
76
72
  self.email_address = attributes[:'email_address']
77
73
  end
78
74
 
75
+ if attributes.key?(:'created_at')
76
+ self.created_at = attributes[:'created_at']
77
+ end
78
+
79
79
  if attributes.key?(:'id')
80
80
  self.id = attributes[:'id']
81
81
  end
@@ -85,10 +85,6 @@ module MailSlurpClient
85
85
  # @return Array for valid properties with the reasons
86
86
  def list_invalid_properties
87
87
  invalid_properties = Array.new
88
- if @created_at.nil?
89
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
90
- end
91
-
92
88
  if @user_id.nil?
93
89
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
94
90
  end
@@ -97,6 +93,10 @@ module MailSlurpClient
97
93
  invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
98
94
  end
99
95
 
96
+ if @created_at.nil?
97
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
98
+ end
99
+
100
100
  if @id.nil?
101
101
  invalid_properties.push('invalid value for "id", id cannot be nil.')
102
102
  end
@@ -107,9 +107,9 @@ module MailSlurpClient
107
107
  # Check to see if the all the properties in the model are valid
108
108
  # @return true if the model is valid
109
109
  def valid?
110
- return false if @created_at.nil?
111
110
  return false if @user_id.nil?
112
111
  return false if @email_address.nil?
112
+ return false if @created_at.nil?
113
113
  return false if @id.nil?
114
114
  true
115
115
  end
@@ -119,9 +119,9 @@ module MailSlurpClient
119
119
  def ==(o)
120
120
  return true if self.equal?(o)
121
121
  self.class == o.class &&
122
- created_at == o.created_at &&
123
122
  user_id == o.user_id &&
124
123
  email_address == o.email_address &&
124
+ created_at == o.created_at &&
125
125
  id == o.id
126
126
  end
127
127
 
@@ -134,7 +134,7 @@ module MailSlurpClient
134
134
  # Calculates hash code according to all attributes.
135
135
  # @return [Integer] Hash code
136
136
  def hash
137
- [created_at, user_id, email_address, id].hash
137
+ [user_id, email_address, created_at, id].hash
138
138
  end
139
139
 
140
140
  # Builds the object from hash
@@ -0,0 +1,220 @@
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
+ # Options taking a screenshot capture of a rendered email
17
+ class GetEmailScreenshotOptions
18
+ # Window height in pixels
19
+ attr_accessor :height
20
+
21
+ # Window width in pixels
22
+ attr_accessor :width
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'height' => :'height',
28
+ :'width' => :'width'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'height' => :'Integer',
36
+ :'width' => :'Integer'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ :'height',
44
+ :'width'
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::GetEmailScreenshotOptions` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::GetEmailScreenshotOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'height')
64
+ self.height = attributes[:'height']
65
+ end
66
+
67
+ if attributes.key?(:'width')
68
+ self.width = attributes[:'width']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ height == o.height &&
91
+ width == o.width
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [height, width].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ new.build_from_hash(attributes)
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.openapi_types.each_pair do |key, type|
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ MailSlurpClient.const_get(type).build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+ end
220
+ end
@@ -0,0 +1,273 @@
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
+ # Access details for inbox using IMAP
17
+ class ImapAccessDetails
18
+ # IMAP server host domain
19
+ attr_accessor :imap_server_host
20
+
21
+ # IMAP server host port
22
+ attr_accessor :imap_server_port
23
+
24
+ # IMAP username for login
25
+ attr_accessor :imap_username
26
+
27
+ # IMAP password for login
28
+ attr_accessor :imap_password
29
+
30
+ # IMAP mailbox to SELECT
31
+ attr_accessor :imap_mailbox
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'imap_server_host' => :'imapServerHost',
37
+ :'imap_server_port' => :'imapServerPort',
38
+ :'imap_username' => :'imapUsername',
39
+ :'imap_password' => :'imapPassword',
40
+ :'imap_mailbox' => :'imapMailbox'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'imap_server_host' => :'String',
48
+ :'imap_server_port' => :'Integer',
49
+ :'imap_username' => :'String',
50
+ :'imap_password' => :'String',
51
+ :'imap_mailbox' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ImapAccessDetails` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ImapAccessDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'imap_server_host')
77
+ self.imap_server_host = attributes[:'imap_server_host']
78
+ end
79
+
80
+ if attributes.key?(:'imap_server_port')
81
+ self.imap_server_port = attributes[:'imap_server_port']
82
+ end
83
+
84
+ if attributes.key?(:'imap_username')
85
+ self.imap_username = attributes[:'imap_username']
86
+ end
87
+
88
+ if attributes.key?(:'imap_password')
89
+ self.imap_password = attributes[:'imap_password']
90
+ end
91
+
92
+ if attributes.key?(:'imap_mailbox')
93
+ self.imap_mailbox = attributes[:'imap_mailbox']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @imap_server_host.nil?
102
+ invalid_properties.push('invalid value for "imap_server_host", imap_server_host cannot be nil.')
103
+ end
104
+
105
+ if @imap_server_port.nil?
106
+ invalid_properties.push('invalid value for "imap_server_port", imap_server_port cannot be nil.')
107
+ end
108
+
109
+ if @imap_username.nil?
110
+ invalid_properties.push('invalid value for "imap_username", imap_username cannot be nil.')
111
+ end
112
+
113
+ if @imap_password.nil?
114
+ invalid_properties.push('invalid value for "imap_password", imap_password cannot be nil.')
115
+ end
116
+
117
+ if @imap_mailbox.nil?
118
+ invalid_properties.push('invalid value for "imap_mailbox", imap_mailbox cannot be nil.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ return false if @imap_server_host.nil?
128
+ return false if @imap_server_port.nil?
129
+ return false if @imap_username.nil?
130
+ return false if @imap_password.nil?
131
+ return false if @imap_mailbox.nil?
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ imap_server_host == o.imap_server_host &&
141
+ imap_server_port == o.imap_server_port &&
142
+ imap_username == o.imap_username &&
143
+ imap_password == o.imap_password &&
144
+ imap_mailbox == o.imap_mailbox
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [imap_server_host, imap_server_port, imap_username, imap_password, imap_mailbox].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ self.class.openapi_types.each_pair do |key, type|
172
+ if type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
176
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
177
+ end
178
+ elsif !attributes[self.class.attribute_map[key]].nil?
179
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
181
+ end
182
+
183
+ self
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def _deserialize(type, value)
191
+ case type.to_sym
192
+ when :DateTime
193
+ DateTime.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ MailSlurpClient.const_get(type).build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+ end
273
+ end