mailslurp_client 15.18.5 → 15.19.1

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,10 +15,6 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # SMS projection
17
17
  class SmsProjection
18
- attr_accessor :body
19
-
20
- attr_accessor :created_at
21
-
22
18
  attr_accessor :user_id
23
19
 
24
20
  attr_accessor :phone_number
@@ -27,17 +23,21 @@ module MailSlurpClient
27
23
 
28
24
  attr_accessor :read
29
25
 
26
+ attr_accessor :body
27
+
28
+ attr_accessor :created_at
29
+
30
30
  attr_accessor :id
31
31
 
32
32
  # Attribute mapping from ruby-style variable name to JSON key.
33
33
  def self.attribute_map
34
34
  {
35
- :'body' => :'body',
36
- :'created_at' => :'createdAt',
37
35
  :'user_id' => :'userId',
38
36
  :'phone_number' => :'phoneNumber',
39
37
  :'from_number' => :'fromNumber',
40
38
  :'read' => :'read',
39
+ :'body' => :'body',
40
+ :'created_at' => :'createdAt',
41
41
  :'id' => :'id'
42
42
  }
43
43
  end
@@ -45,12 +45,12 @@ module MailSlurpClient
45
45
  # Attribute type mapping.
46
46
  def self.openapi_types
47
47
  {
48
- :'body' => :'String',
49
- :'created_at' => :'DateTime',
50
48
  :'user_id' => :'String',
51
49
  :'phone_number' => :'String',
52
50
  :'from_number' => :'String',
53
51
  :'read' => :'Boolean',
52
+ :'body' => :'String',
53
+ :'created_at' => :'DateTime',
54
54
  :'id' => :'String'
55
55
  }
56
56
  end
@@ -76,14 +76,6 @@ module MailSlurpClient
76
76
  h[k.to_sym] = v
77
77
  }
78
78
 
79
- if attributes.key?(:'body')
80
- self.body = attributes[:'body']
81
- end
82
-
83
- if attributes.key?(:'created_at')
84
- self.created_at = attributes[:'created_at']
85
- end
86
-
87
79
  if attributes.key?(:'user_id')
88
80
  self.user_id = attributes[:'user_id']
89
81
  end
@@ -100,6 +92,14 @@ module MailSlurpClient
100
92
  self.read = attributes[:'read']
101
93
  end
102
94
 
95
+ if attributes.key?(:'body')
96
+ self.body = attributes[:'body']
97
+ end
98
+
99
+ if attributes.key?(:'created_at')
100
+ self.created_at = attributes[:'created_at']
101
+ end
102
+
103
103
  if attributes.key?(:'id')
104
104
  self.id = attributes[:'id']
105
105
  end
@@ -109,14 +109,6 @@ module MailSlurpClient
109
109
  # @return Array for valid properties with the reasons
110
110
  def list_invalid_properties
111
111
  invalid_properties = Array.new
112
- if @body.nil?
113
- invalid_properties.push('invalid value for "body", body cannot be nil.')
114
- end
115
-
116
- if @created_at.nil?
117
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
118
- end
119
-
120
112
  if @user_id.nil?
121
113
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
122
114
  end
@@ -133,6 +125,14 @@ module MailSlurpClient
133
125
  invalid_properties.push('invalid value for "read", read cannot be nil.')
134
126
  end
135
127
 
128
+ if @body.nil?
129
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
130
+ end
131
+
132
+ if @created_at.nil?
133
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
134
+ end
135
+
136
136
  if @id.nil?
137
137
  invalid_properties.push('invalid value for "id", id cannot be nil.')
138
138
  end
@@ -143,12 +143,12 @@ module MailSlurpClient
143
143
  # Check to see if the all the properties in the model are valid
144
144
  # @return true if the model is valid
145
145
  def valid?
146
- return false if @body.nil?
147
- return false if @created_at.nil?
148
146
  return false if @user_id.nil?
149
147
  return false if @phone_number.nil?
150
148
  return false if @from_number.nil?
151
149
  return false if @read.nil?
150
+ return false if @body.nil?
151
+ return false if @created_at.nil?
152
152
  return false if @id.nil?
153
153
  true
154
154
  end
@@ -158,12 +158,12 @@ module MailSlurpClient
158
158
  def ==(o)
159
159
  return true if self.equal?(o)
160
160
  self.class == o.class &&
161
- body == o.body &&
162
- created_at == o.created_at &&
163
161
  user_id == o.user_id &&
164
162
  phone_number == o.phone_number &&
165
163
  from_number == o.from_number &&
166
164
  read == o.read &&
165
+ body == o.body &&
166
+ created_at == o.created_at &&
167
167
  id == o.id
168
168
  end
169
169
 
@@ -176,7 +176,7 @@ module MailSlurpClient
176
176
  # Calculates hash code according to all attributes.
177
177
  # @return [Integer] Hash code
178
178
  def hash
179
- [body, created_at, user_id, phone_number, from_number, read, id].hash
179
+ [user_id, phone_number, from_number, read, body, created_at, id].hash
180
180
  end
181
181
 
182
182
  # Builds the object from hash
@@ -0,0 +1,329 @@
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 SMTP
17
+ class SmtpAccessDetails
18
+ # Secure TLS SMTP server host domain
19
+ attr_accessor :secure_smtp_server_host
20
+
21
+ # Secure TLS SMTP server host port
22
+ attr_accessor :secure_smtp_server_port
23
+
24
+ # Secure TLS SMTP username for login
25
+ attr_accessor :secure_smtp_username
26
+
27
+ # Secure TLS SMTP password for login
28
+ attr_accessor :secure_smtp_password
29
+
30
+ # SMTP server host domain
31
+ attr_accessor :smtp_server_host
32
+
33
+ # SMTP server host port
34
+ attr_accessor :smtp_server_port
35
+
36
+ # SMTP username for login
37
+ attr_accessor :smtp_username
38
+
39
+ # SMTP password for login
40
+ attr_accessor :smtp_password
41
+
42
+ # Mail from domain or SMTP HELO value
43
+ attr_accessor :mail_from_domain
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'secure_smtp_server_host' => :'secureSmtpServerHost',
49
+ :'secure_smtp_server_port' => :'secureSmtpServerPort',
50
+ :'secure_smtp_username' => :'secureSmtpUsername',
51
+ :'secure_smtp_password' => :'secureSmtpPassword',
52
+ :'smtp_server_host' => :'smtpServerHost',
53
+ :'smtp_server_port' => :'smtpServerPort',
54
+ :'smtp_username' => :'smtpUsername',
55
+ :'smtp_password' => :'smtpPassword',
56
+ :'mail_from_domain' => :'mailFromDomain'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'secure_smtp_server_host' => :'String',
64
+ :'secure_smtp_server_port' => :'Integer',
65
+ :'secure_smtp_username' => :'String',
66
+ :'secure_smtp_password' => :'String',
67
+ :'smtp_server_host' => :'String',
68
+ :'smtp_server_port' => :'Integer',
69
+ :'smtp_username' => :'String',
70
+ :'smtp_password' => :'String',
71
+ :'mail_from_domain' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ :'mail_from_domain'
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::SmtpAccessDetails` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::SmtpAccessDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'secure_smtp_server_host')
98
+ self.secure_smtp_server_host = attributes[:'secure_smtp_server_host']
99
+ end
100
+
101
+ if attributes.key?(:'secure_smtp_server_port')
102
+ self.secure_smtp_server_port = attributes[:'secure_smtp_server_port']
103
+ end
104
+
105
+ if attributes.key?(:'secure_smtp_username')
106
+ self.secure_smtp_username = attributes[:'secure_smtp_username']
107
+ end
108
+
109
+ if attributes.key?(:'secure_smtp_password')
110
+ self.secure_smtp_password = attributes[:'secure_smtp_password']
111
+ end
112
+
113
+ if attributes.key?(:'smtp_server_host')
114
+ self.smtp_server_host = attributes[:'smtp_server_host']
115
+ end
116
+
117
+ if attributes.key?(:'smtp_server_port')
118
+ self.smtp_server_port = attributes[:'smtp_server_port']
119
+ end
120
+
121
+ if attributes.key?(:'smtp_username')
122
+ self.smtp_username = attributes[:'smtp_username']
123
+ end
124
+
125
+ if attributes.key?(:'smtp_password')
126
+ self.smtp_password = attributes[:'smtp_password']
127
+ end
128
+
129
+ if attributes.key?(:'mail_from_domain')
130
+ self.mail_from_domain = attributes[:'mail_from_domain']
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ if @secure_smtp_server_host.nil?
139
+ invalid_properties.push('invalid value for "secure_smtp_server_host", secure_smtp_server_host cannot be nil.')
140
+ end
141
+
142
+ if @secure_smtp_server_port.nil?
143
+ invalid_properties.push('invalid value for "secure_smtp_server_port", secure_smtp_server_port cannot be nil.')
144
+ end
145
+
146
+ if @secure_smtp_username.nil?
147
+ invalid_properties.push('invalid value for "secure_smtp_username", secure_smtp_username cannot be nil.')
148
+ end
149
+
150
+ if @secure_smtp_password.nil?
151
+ invalid_properties.push('invalid value for "secure_smtp_password", secure_smtp_password cannot be nil.')
152
+ end
153
+
154
+ if @smtp_server_host.nil?
155
+ invalid_properties.push('invalid value for "smtp_server_host", smtp_server_host cannot be nil.')
156
+ end
157
+
158
+ if @smtp_server_port.nil?
159
+ invalid_properties.push('invalid value for "smtp_server_port", smtp_server_port cannot be nil.')
160
+ end
161
+
162
+ if @smtp_username.nil?
163
+ invalid_properties.push('invalid value for "smtp_username", smtp_username cannot be nil.')
164
+ end
165
+
166
+ if @smtp_password.nil?
167
+ invalid_properties.push('invalid value for "smtp_password", smtp_password cannot be nil.')
168
+ end
169
+
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ return false if @secure_smtp_server_host.nil?
177
+ return false if @secure_smtp_server_port.nil?
178
+ return false if @secure_smtp_username.nil?
179
+ return false if @secure_smtp_password.nil?
180
+ return false if @smtp_server_host.nil?
181
+ return false if @smtp_server_port.nil?
182
+ return false if @smtp_username.nil?
183
+ return false if @smtp_password.nil?
184
+ true
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(o)
190
+ return true if self.equal?(o)
191
+ self.class == o.class &&
192
+ secure_smtp_server_host == o.secure_smtp_server_host &&
193
+ secure_smtp_server_port == o.secure_smtp_server_port &&
194
+ secure_smtp_username == o.secure_smtp_username &&
195
+ secure_smtp_password == o.secure_smtp_password &&
196
+ smtp_server_host == o.smtp_server_host &&
197
+ smtp_server_port == o.smtp_server_port &&
198
+ smtp_username == o.smtp_username &&
199
+ smtp_password == o.smtp_password &&
200
+ mail_from_domain == o.mail_from_domain
201
+ end
202
+
203
+ # @see the `==` method
204
+ # @param [Object] Object to be compared
205
+ def eql?(o)
206
+ self == o
207
+ end
208
+
209
+ # Calculates hash code according to all attributes.
210
+ # @return [Integer] Hash code
211
+ def hash
212
+ [secure_smtp_server_host, secure_smtp_server_port, secure_smtp_username, secure_smtp_password, smtp_server_host, smtp_server_port, smtp_username, smtp_password, mail_from_domain].hash
213
+ end
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def self.build_from_hash(attributes)
219
+ new.build_from_hash(attributes)
220
+ end
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+ self.class.openapi_types.each_pair do |key, type|
228
+ if type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
232
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
233
+ end
234
+ elsif !attributes[self.class.attribute_map[key]].nil?
235
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
236
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
237
+ end
238
+
239
+ self
240
+ end
241
+
242
+ # Deserializes the data based on type
243
+ # @param string type Data type
244
+ # @param string value Value to be deserialized
245
+ # @return [Object] Deserialized data
246
+ def _deserialize(type, value)
247
+ case type.to_sym
248
+ when :DateTime
249
+ DateTime.parse(value)
250
+ when :Date
251
+ Date.parse(value)
252
+ when :String
253
+ value.to_s
254
+ when :Integer
255
+ value.to_i
256
+ when :Float
257
+ value.to_f
258
+ when :Boolean
259
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
260
+ true
261
+ else
262
+ false
263
+ end
264
+ when :Object
265
+ # generic object (usually a Hash), return directly
266
+ value
267
+ when /\AArray<(?<inner_type>.+)>\z/
268
+ inner_type = Regexp.last_match[:inner_type]
269
+ value.map { |v| _deserialize(inner_type, v) }
270
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
271
+ k_type = Regexp.last_match[:k_type]
272
+ v_type = Regexp.last_match[:v_type]
273
+ {}.tap do |hash|
274
+ value.each do |k, v|
275
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
276
+ end
277
+ end
278
+ else # model
279
+ MailSlurpClient.const_get(type).build_from_hash(value)
280
+ end
281
+ end
282
+
283
+ # Returns the string representation of the object
284
+ # @return [String] String presentation of the object
285
+ def to_s
286
+ to_hash.to_s
287
+ end
288
+
289
+ # to_body is an alias to to_hash (backward compatibility)
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_body
292
+ to_hash
293
+ end
294
+
295
+ # Returns the object in the form of hash
296
+ # @return [Hash] Returns the object in the form of hash
297
+ def to_hash
298
+ hash = {}
299
+ self.class.attribute_map.each_pair do |attr, param|
300
+ value = self.send(attr)
301
+ if value.nil?
302
+ is_nullable = self.class.openapi_nullable.include?(attr)
303
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
304
+ end
305
+
306
+ hash[param] = _to_hash(value)
307
+ end
308
+ hash
309
+ end
310
+
311
+ # Outputs non-array value in the form of hash
312
+ # For object, use to_hash. Otherwise, just return the value
313
+ # @param [Object] value Any valid value
314
+ # @return [Hash] Returns the value in the form of hash
315
+ def _to_hash(value)
316
+ if value.is_a?(Array)
317
+ value.compact.map { |v| _to_hash(v) }
318
+ elsif value.is_a?(Hash)
319
+ {}.tap do |hash|
320
+ value.each { |k, v| hash[k] = _to_hash(v) }
321
+ end
322
+ elsif value.respond_to? :to_hash
323
+ value.to_hash
324
+ else
325
+ value
326
+ end
327
+ end
328
+ end
329
+ end
@@ -15,12 +15,12 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # Email template data
17
17
  class TemplateProjection
18
+ attr_accessor :variables
19
+
18
20
  attr_accessor :created_at
19
21
 
20
22
  attr_accessor :updated_at
21
23
 
22
- attr_accessor :variables
23
-
24
24
  attr_accessor :name
25
25
 
26
26
  attr_accessor :id
@@ -28,9 +28,9 @@ module MailSlurpClient
28
28
  # Attribute mapping from ruby-style variable name to JSON key.
29
29
  def self.attribute_map
30
30
  {
31
+ :'variables' => :'variables',
31
32
  :'created_at' => :'createdAt',
32
33
  :'updated_at' => :'updatedAt',
33
- :'variables' => :'variables',
34
34
  :'name' => :'name',
35
35
  :'id' => :'id'
36
36
  }
@@ -39,9 +39,9 @@ module MailSlurpClient
39
39
  # Attribute type mapping.
40
40
  def self.openapi_types
41
41
  {
42
+ :'variables' => :'Array<String>',
42
43
  :'created_at' => :'DateTime',
43
44
  :'updated_at' => :'DateTime',
44
- :'variables' => :'Array<String>',
45
45
  :'name' => :'String',
46
46
  :'id' => :'String'
47
47
  }
@@ -68,6 +68,12 @@ module MailSlurpClient
68
68
  h[k.to_sym] = v
69
69
  }
70
70
 
71
+ if attributes.key?(:'variables')
72
+ if (value = attributes[:'variables']).is_a?(Array)
73
+ self.variables = value
74
+ end
75
+ end
76
+
71
77
  if attributes.key?(:'created_at')
72
78
  self.created_at = attributes[:'created_at']
73
79
  end
@@ -76,12 +82,6 @@ module MailSlurpClient
76
82
  self.updated_at = attributes[:'updated_at']
77
83
  end
78
84
 
79
- if attributes.key?(:'variables')
80
- if (value = attributes[:'variables']).is_a?(Array)
81
- self.variables = value
82
- end
83
- end
84
-
85
85
  if attributes.key?(:'name')
86
86
  self.name = attributes[:'name']
87
87
  end
@@ -95,6 +95,10 @@ module MailSlurpClient
95
95
  # @return Array for valid properties with the reasons
96
96
  def list_invalid_properties
97
97
  invalid_properties = Array.new
98
+ if @variables.nil?
99
+ invalid_properties.push('invalid value for "variables", variables cannot be nil.')
100
+ end
101
+
98
102
  if @created_at.nil?
99
103
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
100
104
  end
@@ -103,10 +107,6 @@ module MailSlurpClient
103
107
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
104
108
  end
105
109
 
106
- if @variables.nil?
107
- invalid_properties.push('invalid value for "variables", variables cannot be nil.')
108
- end
109
-
110
110
  if @name.nil?
111
111
  invalid_properties.push('invalid value for "name", name cannot be nil.')
112
112
  end
@@ -121,9 +121,9 @@ module MailSlurpClient
121
121
  # Check to see if the all the properties in the model are valid
122
122
  # @return true if the model is valid
123
123
  def valid?
124
+ return false if @variables.nil?
124
125
  return false if @created_at.nil?
125
126
  return false if @updated_at.nil?
126
- return false if @variables.nil?
127
127
  return false if @name.nil?
128
128
  return false if @id.nil?
129
129
  true
@@ -134,9 +134,9 @@ module MailSlurpClient
134
134
  def ==(o)
135
135
  return true if self.equal?(o)
136
136
  self.class == o.class &&
137
+ variables == o.variables &&
137
138
  created_at == o.created_at &&
138
139
  updated_at == o.updated_at &&
139
- variables == o.variables &&
140
140
  name == o.name &&
141
141
  id == o.id
142
142
  end
@@ -150,7 +150,7 @@ module MailSlurpClient
150
150
  # Calculates hash code according to all attributes.
151
151
  # @return [Integer] Hash code
152
152
  def hash
153
- [created_at, updated_at, variables, name, id].hash
153
+ [variables, created_at, updated_at, name, id].hash
154
154
  end
155
155
 
156
156
  # Builds the object from hash