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
@@ -0,0 +1,274 @@
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 DomainInformation
17
+ attr_accessor :domain_name
18
+
19
+ attr_accessor :verified
20
+
21
+ # Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
22
+ attr_accessor :domain_type
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'domain_name' => :'domainName',
50
+ :'verified' => :'verified',
51
+ :'domain_type' => :'domainType'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'domain_name' => :'String',
59
+ :'verified' => :'Boolean',
60
+ :'domain_type' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::DomainInformation` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::DomainInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'domain_name')
86
+ self.domain_name = attributes[:'domain_name']
87
+ end
88
+
89
+ if attributes.key?(:'verified')
90
+ self.verified = attributes[:'verified']
91
+ end
92
+
93
+ if attributes.key?(:'domain_type')
94
+ self.domain_type = attributes[:'domain_type']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ invalid_properties = Array.new
102
+ if @domain_name.nil?
103
+ invalid_properties.push('invalid value for "domain_name", domain_name cannot be nil.')
104
+ end
105
+
106
+ if @verified.nil?
107
+ invalid_properties.push('invalid value for "verified", verified cannot be nil.')
108
+ end
109
+
110
+ if @domain_type.nil?
111
+ invalid_properties.push('invalid value for "domain_type", domain_type cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return false if @domain_name.nil?
121
+ return false if @verified.nil?
122
+ return false if @domain_type.nil?
123
+ domain_type_validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_DOMAIN"])
124
+ return false unless domain_type_validator.valid?(@domain_type)
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method checking allowed values (enum).
129
+ # @param [Object] domain_type Object to be assigned
130
+ def domain_type=(domain_type)
131
+ validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_DOMAIN"])
132
+ unless validator.valid?(domain_type)
133
+ fail ArgumentError, "invalid value for \"domain_type\", must be one of #{validator.allowable_values}."
134
+ end
135
+ @domain_type = domain_type
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ domain_name == o.domain_name &&
144
+ verified == o.verified &&
145
+ domain_type == o.domain_type
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [domain_name, verified, domain_type].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ new.build_from_hash(attributes)
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
182
+ end
183
+
184
+ self
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def _deserialize(type, value)
192
+ case type.to_sym
193
+ when :DateTime
194
+ DateTime.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :Boolean
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ MailSlurpClient.const_get(type).build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ # Returns the object in the form of hash
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_hash
243
+ hash = {}
244
+ self.class.attribute_map.each_pair do |attr, param|
245
+ value = self.send(attr)
246
+ if value.nil?
247
+ is_nullable = self.class.openapi_nullable.include?(attr)
248
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
249
+ end
250
+
251
+ hash[param] = _to_hash(value)
252
+ end
253
+ hash
254
+ end
255
+
256
+ # Outputs non-array value in the form of hash
257
+ # For object, use to_hash. Otherwise, just return the value
258
+ # @param [Object] value Any valid value
259
+ # @return [Hash] Returns the value in the form of hash
260
+ def _to_hash(value)
261
+ if value.is_a?(Array)
262
+ value.compact.map { |v| _to_hash(v) }
263
+ elsif value.is_a?(Hash)
264
+ {}.tap do |hash|
265
+ value.each { |k, v| hash[k] = _to_hash(v) }
266
+ end
267
+ elsif value.respond_to? :to_hash
268
+ value.to_hash
269
+ else
270
+ value
271
+ end
272
+ end
273
+ end
274
+ end
@@ -19,11 +19,14 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :plain_html_body_url
21
21
 
22
+ attr_accessor :origin
23
+
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
23
25
  def self.attribute_map
24
26
  {
25
27
  :'raw_smtp_message_url' => :'rawSmtpMessageUrl',
26
- :'plain_html_body_url' => :'plainHtmlBodyUrl'
28
+ :'plain_html_body_url' => :'plainHtmlBodyUrl',
29
+ :'origin' => :'origin'
27
30
  }
28
31
  end
29
32
 
@@ -31,7 +34,8 @@ module MailSlurpClient
31
34
  def self.openapi_types
32
35
  {
33
36
  :'raw_smtp_message_url' => :'String',
34
- :'plain_html_body_url' => :'String'
37
+ :'plain_html_body_url' => :'String',
38
+ :'origin' => :'String'
35
39
  }
36
40
  end
37
41
 
@@ -63,6 +67,10 @@ module MailSlurpClient
63
67
  if attributes.key?(:'plain_html_body_url')
64
68
  self.plain_html_body_url = attributes[:'plain_html_body_url']
65
69
  end
70
+
71
+ if attributes.key?(:'origin')
72
+ self.origin = attributes[:'origin']
73
+ end
66
74
  end
67
75
 
68
76
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -77,6 +85,10 @@ module MailSlurpClient
77
85
  invalid_properties.push('invalid value for "plain_html_body_url", plain_html_body_url cannot be nil.')
78
86
  end
79
87
 
88
+ if @origin.nil?
89
+ invalid_properties.push('invalid value for "origin", origin cannot be nil.')
90
+ end
91
+
80
92
  invalid_properties
81
93
  end
82
94
 
@@ -85,6 +97,7 @@ module MailSlurpClient
85
97
  def valid?
86
98
  return false if @raw_smtp_message_url.nil?
87
99
  return false if @plain_html_body_url.nil?
100
+ return false if @origin.nil?
88
101
  true
89
102
  end
90
103
 
@@ -94,7 +107,8 @@ module MailSlurpClient
94
107
  return true if self.equal?(o)
95
108
  self.class == o.class &&
96
109
  raw_smtp_message_url == o.raw_smtp_message_url &&
97
- plain_html_body_url == o.plain_html_body_url
110
+ plain_html_body_url == o.plain_html_body_url &&
111
+ origin == o.origin
98
112
  end
99
113
 
100
114
  # @see the `==` method
@@ -106,7 +120,7 @@ module MailSlurpClient
106
120
  # Calculates hash code according to all attributes.
107
121
  # @return [Integer] Hash code
108
122
  def hash
109
- [raw_smtp_message_url, plain_html_body_url].hash
123
+ [raw_smtp_message_url, plain_html_body_url, origin].hash
110
124
  end
111
125
 
112
126
  # Builds the object from hash
@@ -15,7 +15,7 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # A compact representation of a full email. Used in list endpoints to keep response sizes low. Body and attachments are not included. To get all fields of the email use the `getEmail` method with the email projection's ID. See `EmailDto` for documentation on projection properties.
17
17
  class EmailProjection
18
- attr_accessor :created_at
18
+ attr_accessor :subject
19
19
 
20
20
  attr_accessor :inbox_id
21
21
 
@@ -39,7 +39,7 @@ module MailSlurpClient
39
39
 
40
40
  attr_accessor :text_excerpt
41
41
 
42
- attr_accessor :subject
42
+ attr_accessor :created_at
43
43
 
44
44
  attr_accessor :id
45
45
 
@@ -48,7 +48,7 @@ module MailSlurpClient
48
48
  # Attribute mapping from ruby-style variable name to JSON key.
49
49
  def self.attribute_map
50
50
  {
51
- :'created_at' => :'createdAt',
51
+ :'subject' => :'subject',
52
52
  :'inbox_id' => :'inboxId',
53
53
  :'attachments' => :'attachments',
54
54
  :'to' => :'to',
@@ -60,7 +60,7 @@ module MailSlurpClient
60
60
  :'team_access' => :'teamAccess',
61
61
  :'body_md5_hash' => :'bodyMD5Hash',
62
62
  :'text_excerpt' => :'textExcerpt',
63
- :'subject' => :'subject',
63
+ :'created_at' => :'createdAt',
64
64
  :'id' => :'id',
65
65
  :'from' => :'from'
66
66
  }
@@ -69,7 +69,7 @@ module MailSlurpClient
69
69
  # Attribute type mapping.
70
70
  def self.openapi_types
71
71
  {
72
- :'created_at' => :'DateTime',
72
+ :'subject' => :'String',
73
73
  :'inbox_id' => :'String',
74
74
  :'attachments' => :'Array<String>',
75
75
  :'to' => :'Array<String>',
@@ -81,7 +81,7 @@ module MailSlurpClient
81
81
  :'team_access' => :'Boolean',
82
82
  :'body_md5_hash' => :'String',
83
83
  :'text_excerpt' => :'String',
84
- :'subject' => :'String',
84
+ :'created_at' => :'DateTime',
85
85
  :'id' => :'String',
86
86
  :'from' => :'String'
87
87
  }
@@ -90,6 +90,7 @@ module MailSlurpClient
90
90
  # List of attributes with nullable: true
91
91
  def self.openapi_nullable
92
92
  Set.new([
93
+ :'subject',
93
94
  :'attachments',
94
95
  :'domain_id',
95
96
  :'bcc',
@@ -97,7 +98,6 @@ module MailSlurpClient
97
98
  :'body_excerpt',
98
99
  :'body_md5_hash',
99
100
  :'text_excerpt',
100
- :'subject',
101
101
  :'from'
102
102
  ])
103
103
  end
@@ -117,8 +117,8 @@ module MailSlurpClient
117
117
  h[k.to_sym] = v
118
118
  }
119
119
 
120
- if attributes.key?(:'created_at')
121
- self.created_at = attributes[:'created_at']
120
+ if attributes.key?(:'subject')
121
+ self.subject = attributes[:'subject']
122
122
  end
123
123
 
124
124
  if attributes.key?(:'inbox_id')
@@ -173,8 +173,8 @@ module MailSlurpClient
173
173
  self.text_excerpt = attributes[:'text_excerpt']
174
174
  end
175
175
 
176
- if attributes.key?(:'subject')
177
- self.subject = attributes[:'subject']
176
+ if attributes.key?(:'created_at')
177
+ self.created_at = attributes[:'created_at']
178
178
  end
179
179
 
180
180
  if attributes.key?(:'id')
@@ -190,10 +190,6 @@ module MailSlurpClient
190
190
  # @return Array for valid properties with the reasons
191
191
  def list_invalid_properties
192
192
  invalid_properties = Array.new
193
- if @created_at.nil?
194
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
195
- end
196
-
197
193
  if @inbox_id.nil?
198
194
  invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
199
195
  end
@@ -210,6 +206,10 @@ module MailSlurpClient
210
206
  invalid_properties.push('invalid value for "team_access", team_access cannot be nil.')
211
207
  end
212
208
 
209
+ if @created_at.nil?
210
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
211
+ end
212
+
213
213
  if @id.nil?
214
214
  invalid_properties.push('invalid value for "id", id cannot be nil.')
215
215
  end
@@ -220,11 +220,11 @@ module MailSlurpClient
220
220
  # Check to see if the all the properties in the model are valid
221
221
  # @return true if the model is valid
222
222
  def valid?
223
- return false if @created_at.nil?
224
223
  return false if @inbox_id.nil?
225
224
  return false if @to.nil?
226
225
  return false if @read.nil?
227
226
  return false if @team_access.nil?
227
+ return false if @created_at.nil?
228
228
  return false if @id.nil?
229
229
  true
230
230
  end
@@ -234,7 +234,7 @@ module MailSlurpClient
234
234
  def ==(o)
235
235
  return true if self.equal?(o)
236
236
  self.class == o.class &&
237
- created_at == o.created_at &&
237
+ subject == o.subject &&
238
238
  inbox_id == o.inbox_id &&
239
239
  attachments == o.attachments &&
240
240
  to == o.to &&
@@ -246,7 +246,7 @@ module MailSlurpClient
246
246
  team_access == o.team_access &&
247
247
  body_md5_hash == o.body_md5_hash &&
248
248
  text_excerpt == o.text_excerpt &&
249
- subject == o.subject &&
249
+ created_at == o.created_at &&
250
250
  id == o.id &&
251
251
  from == o.from
252
252
  end
@@ -260,7 +260,7 @@ module MailSlurpClient
260
260
  # Calculates hash code according to all attributes.
261
261
  # @return [Integer] Hash code
262
262
  def hash
263
- [created_at, inbox_id, attachments, to, domain_id, bcc, cc, read, body_excerpt, team_access, body_md5_hash, text_excerpt, subject, id, from].hash
263
+ [subject, inbox_id, attachments, to, domain_id, bcc, cc, read, body_excerpt, team_access, body_md5_hash, text_excerpt, created_at, id, from].hash
264
264
  end
265
265
 
266
266
  # Builds the object from hash
@@ -0,0 +1,211 @@
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 EmailScreenshotResult
17
+ attr_accessor :base64_encoded_image
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'base64_encoded_image' => :'base64EncodedImage'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'base64_encoded_image' => :'String'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailScreenshotResult` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailScreenshotResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'base64_encoded_image')
55
+ self.base64_encoded_image = attributes[:'base64_encoded_image']
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ if @base64_encoded_image.nil?
64
+ invalid_properties.push('invalid value for "base64_encoded_image", base64_encoded_image cannot be nil.')
65
+ end
66
+
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ return false if @base64_encoded_image.nil?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ base64_encoded_image == o.base64_encoded_image
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ def hash
94
+ [base64_encoded_image].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def self.build_from_hash(attributes)
101
+ new.build_from_hash(attributes)
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.openapi_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ MailSlurpClient.const_get(type).build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map { |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end
210
+ end
211
+ end