mailslurp_client 8.2.17 → 8.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,6 +55,9 @@ module MailSlurpClient
55
55
  # Has the email been viewed ever
56
56
  attr_accessor :read
57
57
 
58
+ # The replyTo field on the received email
59
+ attr_accessor :reply_to
60
+
58
61
  # The subject line of the email message
59
62
  attr_accessor :subject
60
63
 
@@ -84,6 +87,7 @@ module MailSlurpClient
84
87
  :'inbox_id' => :'inboxId',
85
88
  :'is_html' => :'isHTML',
86
89
  :'read' => :'read',
90
+ :'reply_to' => :'replyTo',
87
91
  :'subject' => :'subject',
88
92
  :'to' => :'to',
89
93
  :'updated_at' => :'updatedAt',
@@ -108,6 +112,7 @@ module MailSlurpClient
108
112
  :'inbox_id' => :'String',
109
113
  :'is_html' => :'Boolean',
110
114
  :'read' => :'Boolean',
115
+ :'reply_to' => :'String',
111
116
  :'subject' => :'String',
112
117
  :'to' => :'Array<String>',
113
118
  :'updated_at' => :'DateTime',
@@ -200,6 +205,10 @@ module MailSlurpClient
200
205
  self.read = attributes[:'read']
201
206
  end
202
207
 
208
+ if attributes.key?(:'reply_to')
209
+ self.reply_to = attributes[:'reply_to']
210
+ end
211
+
203
212
  if attributes.key?(:'subject')
204
213
  self.subject = attributes[:'subject']
205
214
  end
@@ -251,6 +260,7 @@ module MailSlurpClient
251
260
  inbox_id == o.inbox_id &&
252
261
  is_html == o.is_html &&
253
262
  read == o.read &&
263
+ reply_to == o.reply_to &&
254
264
  subject == o.subject &&
255
265
  to == o.to &&
256
266
  updated_at == o.updated_at &&
@@ -266,7 +276,7 @@ module MailSlurpClient
266
276
  # Calculates hash code according to all attributes.
267
277
  # @return [Integer] Hash code
268
278
  def hash
269
- [analysis, attachments, bcc, body, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, subject, to, updated_at, user_id].hash
279
+ [analysis, attachments, bcc, body, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, reply_to, subject, to, updated_at, user_id].hash
270
280
  end
271
281
 
272
282
  # Builds the object from hash
@@ -24,10 +24,10 @@ module MailSlurpClient
24
24
 
25
25
  attr_accessor :name
26
26
 
27
- attr_accessor :proxied
28
-
29
27
  attr_accessor :updated_at
30
28
 
29
+ attr_accessor :use_threads
30
+
31
31
  attr_accessor :user_id
32
32
 
33
33
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -38,8 +38,8 @@ module MailSlurpClient
38
38
  :'id' => :'id',
39
39
  :'inbox_id' => :'inboxId',
40
40
  :'name' => :'name',
41
- :'proxied' => :'proxied',
42
41
  :'updated_at' => :'updatedAt',
42
+ :'use_threads' => :'useThreads',
43
43
  :'user_id' => :'userId'
44
44
  }
45
45
  end
@@ -52,8 +52,8 @@ module MailSlurpClient
52
52
  :'id' => :'String',
53
53
  :'inbox_id' => :'String',
54
54
  :'name' => :'String',
55
- :'proxied' => :'Boolean',
56
55
  :'updated_at' => :'DateTime',
56
+ :'use_threads' => :'Boolean',
57
57
  :'user_id' => :'String'
58
58
  }
59
59
  end
@@ -99,14 +99,14 @@ module MailSlurpClient
99
99
  self.name = attributes[:'name']
100
100
  end
101
101
 
102
- if attributes.key?(:'proxied')
103
- self.proxied = attributes[:'proxied']
104
- end
105
-
106
102
  if attributes.key?(:'updated_at')
107
103
  self.updated_at = attributes[:'updated_at']
108
104
  end
109
105
 
106
+ if attributes.key?(:'use_threads')
107
+ self.use_threads = attributes[:'use_threads']
108
+ end
109
+
110
110
  if attributes.key?(:'user_id')
111
111
  self.user_id = attributes[:'user_id']
112
112
  end
@@ -124,10 +124,18 @@ module MailSlurpClient
124
124
  invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
125
125
  end
126
126
 
127
+ if @inbox_id.nil?
128
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
129
+ end
130
+
127
131
  if @updated_at.nil?
128
132
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
129
133
  end
130
134
 
135
+ if @user_id.nil?
136
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
137
+ end
138
+
131
139
  invalid_properties
132
140
  end
133
141
 
@@ -136,7 +144,9 @@ module MailSlurpClient
136
144
  def valid?
137
145
  return false if @created_at.nil?
138
146
  return false if @email_address.nil?
147
+ return false if @inbox_id.nil?
139
148
  return false if @updated_at.nil?
149
+ return false if @user_id.nil?
140
150
  true
141
151
  end
142
152
 
@@ -150,8 +160,8 @@ module MailSlurpClient
150
160
  id == o.id &&
151
161
  inbox_id == o.inbox_id &&
152
162
  name == o.name &&
153
- proxied == o.proxied &&
154
163
  updated_at == o.updated_at &&
164
+ use_threads == o.use_threads &&
155
165
  user_id == o.user_id
156
166
  end
157
167
 
@@ -164,7 +174,7 @@ module MailSlurpClient
164
174
  # Calculates hash code according to all attributes.
165
175
  # @return [Integer] Hash code
166
176
  def hash
167
- [created_at, email_address, id, inbox_id, name, proxied, updated_at, user_id].hash
177
+ [created_at, email_address, id, inbox_id, name, updated_at, use_threads, user_id].hash
168
178
  end
169
179
 
170
180
  # Builds the object from hash
@@ -57,7 +57,7 @@ module MailSlurpClient
57
57
  # Attribute type mapping.
58
58
  def self.openapi_types
59
59
  {
60
- :'content' => :'Array<ModelAlias>',
60
+ :'content' => :'Array<AliasProjection>',
61
61
  :'empty' => :'Boolean',
62
62
  :'first' => :'Boolean',
63
63
  :'last' => :'Boolean',
@@ -0,0 +1,314 @@
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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+
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 for replying to email with API
17
+ class ReplyToEmailOptions
18
+ # List of uploaded attachments to send with the reply. Optional.
19
+ attr_accessor :attachments
20
+
21
+ # Body of the reply email you want to send
22
+ attr_accessor :body
23
+
24
+ # The charset that your message should be sent with. Optional. Default is UTF-8
25
+ attr_accessor :charset
26
+
27
+ # Is the reply HTML
28
+ attr_accessor :is_html
29
+
30
+ # The replyTo header that should be used. Optional
31
+ attr_accessor :reply_to
32
+
33
+ # When to send the email. Typically immediately
34
+ attr_accessor :send_strategy
35
+
36
+ # Template ID to use instead of body. Will use template variable map to fill defined variable slots.
37
+ attr_accessor :template
38
+
39
+ # Template variables if using a template
40
+ attr_accessor :template_variables
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'attachments' => :'attachments',
68
+ :'body' => :'body',
69
+ :'charset' => :'charset',
70
+ :'is_html' => :'isHTML',
71
+ :'reply_to' => :'replyTo',
72
+ :'send_strategy' => :'sendStrategy',
73
+ :'template' => :'template',
74
+ :'template_variables' => :'templateVariables'
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.openapi_types
80
+ {
81
+ :'attachments' => :'Array<String>',
82
+ :'body' => :'String',
83
+ :'charset' => :'String',
84
+ :'is_html' => :'Boolean',
85
+ :'reply_to' => :'String',
86
+ :'send_strategy' => :'String',
87
+ :'template' => :'String',
88
+ :'template_variables' => :'Object'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ReplyToEmailOptions` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!self.class.attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ReplyToEmailOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'attachments')
114
+ if (value = attributes[:'attachments']).is_a?(Array)
115
+ self.attachments = value
116
+ end
117
+ end
118
+
119
+ if attributes.key?(:'body')
120
+ self.body = attributes[:'body']
121
+ end
122
+
123
+ if attributes.key?(:'charset')
124
+ self.charset = attributes[:'charset']
125
+ end
126
+
127
+ if attributes.key?(:'is_html')
128
+ self.is_html = attributes[:'is_html']
129
+ end
130
+
131
+ if attributes.key?(:'reply_to')
132
+ self.reply_to = attributes[:'reply_to']
133
+ end
134
+
135
+ if attributes.key?(:'send_strategy')
136
+ self.send_strategy = attributes[:'send_strategy']
137
+ end
138
+
139
+ if attributes.key?(:'template')
140
+ self.template = attributes[:'template']
141
+ end
142
+
143
+ if attributes.key?(:'template_variables')
144
+ self.template_variables = attributes[:'template_variables']
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ invalid_properties = Array.new
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ send_strategy_validator = EnumAttributeValidator.new('String', ["SINGLE_MESSAGE"])
159
+ return false unless send_strategy_validator.valid?(@send_strategy)
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method checking allowed values (enum).
164
+ # @param [Object] send_strategy Object to be assigned
165
+ def send_strategy=(send_strategy)
166
+ validator = EnumAttributeValidator.new('String', ["SINGLE_MESSAGE"])
167
+ unless validator.valid?(send_strategy)
168
+ fail ArgumentError, "invalid value for \"send_strategy\", must be one of #{validator.allowable_values}."
169
+ end
170
+ @send_strategy = send_strategy
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ attachments == o.attachments &&
179
+ body == o.body &&
180
+ charset == o.charset &&
181
+ is_html == o.is_html &&
182
+ reply_to == o.reply_to &&
183
+ send_strategy == o.send_strategy &&
184
+ template == o.template &&
185
+ template_variables == o.template_variables
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Integer] Hash code
196
+ def hash
197
+ [attachments, body, charset, is_html, reply_to, send_strategy, template, template_variables].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def self.build_from_hash(attributes)
204
+ new.build_from_hash(attributes)
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def build_from_hash(attributes)
211
+ return nil unless attributes.is_a?(Hash)
212
+ self.class.openapi_types.each_pair do |key, type|
213
+ if type =~ /\AArray<(.*)>/i
214
+ # check to ensure the input is an array given that the attribute
215
+ # is documented as an array but the input is not
216
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
217
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
218
+ end
219
+ elsif !attributes[self.class.attribute_map[key]].nil?
220
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
221
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
222
+ end
223
+
224
+ self
225
+ end
226
+
227
+ # Deserializes the data based on type
228
+ # @param string type Data type
229
+ # @param string value Value to be deserialized
230
+ # @return [Object] Deserialized data
231
+ def _deserialize(type, value)
232
+ case type.to_sym
233
+ when :DateTime
234
+ DateTime.parse(value)
235
+ when :Date
236
+ Date.parse(value)
237
+ when :String
238
+ value.to_s
239
+ when :Integer
240
+ value.to_i
241
+ when :Float
242
+ value.to_f
243
+ when :Boolean
244
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
245
+ true
246
+ else
247
+ false
248
+ end
249
+ when :Object
250
+ # generic object (usually a Hash), return directly
251
+ value
252
+ when /\AArray<(?<inner_type>.+)>\z/
253
+ inner_type = Regexp.last_match[:inner_type]
254
+ value.map { |v| _deserialize(inner_type, v) }
255
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
256
+ k_type = Regexp.last_match[:k_type]
257
+ v_type = Regexp.last_match[:v_type]
258
+ {}.tap do |hash|
259
+ value.each do |k, v|
260
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
261
+ end
262
+ end
263
+ else # model
264
+ MailSlurpClient.const_get(type).build_from_hash(value)
265
+ end
266
+ end
267
+
268
+ # Returns the string representation of the object
269
+ # @return [String] String presentation of the object
270
+ def to_s
271
+ to_hash.to_s
272
+ end
273
+
274
+ # to_body is an alias to to_hash (backward compatibility)
275
+ # @return [Hash] Returns the object in the form of hash
276
+ def to_body
277
+ to_hash
278
+ end
279
+
280
+ # Returns the object in the form of hash
281
+ # @return [Hash] Returns the object in the form of hash
282
+ def to_hash
283
+ hash = {}
284
+ self.class.attribute_map.each_pair do |attr, param|
285
+ value = self.send(attr)
286
+ if value.nil?
287
+ is_nullable = self.class.openapi_nullable.include?(attr)
288
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
289
+ end
290
+
291
+ hash[param] = _to_hash(value)
292
+ end
293
+ hash
294
+ end
295
+
296
+ # Outputs non-array value in the form of hash
297
+ # For object, use to_hash. Otherwise, just return the value
298
+ # @param [Object] value Any valid value
299
+ # @return [Hash] Returns the value in the form of hash
300
+ def _to_hash(value)
301
+ if value.is_a?(Array)
302
+ value.compact.map { |v| _to_hash(v) }
303
+ elsif value.is_a?(Hash)
304
+ {}.tap do |hash|
305
+ value.each { |k, v| hash[k] = _to_hash(v) }
306
+ end
307
+ elsif value.respond_to? :to_hash
308
+ value.to_hash
309
+ else
310
+ value
311
+ end
312
+ end
313
+ end
314
+ end