mailslurp_client 16.1.5 → 16.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,10 +19,10 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :recipients
21
21
 
22
- attr_accessor :inbox_id
23
-
24
22
  attr_accessor :attachments
25
23
 
24
+ attr_accessor :inbox_id
25
+
26
26
  attr_accessor :created_at
27
27
 
28
28
  attr_accessor :to
@@ -68,8 +68,8 @@ module MailSlurpClient
68
68
  {
69
69
  :'sender' => :'sender',
70
70
  :'recipients' => :'recipients',
71
- :'inbox_id' => :'inboxId',
72
71
  :'attachments' => :'attachments',
72
+ :'inbox_id' => :'inboxId',
73
73
  :'created_at' => :'createdAt',
74
74
  :'to' => :'to',
75
75
  :'cc' => :'cc',
@@ -98,8 +98,8 @@ module MailSlurpClient
98
98
  {
99
99
  :'sender' => :'Sender',
100
100
  :'recipients' => :'EmailRecipients',
101
- :'inbox_id' => :'String',
102
101
  :'attachments' => :'Array<String>',
102
+ :'inbox_id' => :'String',
103
103
  :'created_at' => :'DateTime',
104
104
  :'to' => :'Array<String>',
105
105
  :'cc' => :'Array<String>',
@@ -170,16 +170,16 @@ module MailSlurpClient
170
170
  self.recipients = attributes[:'recipients']
171
171
  end
172
172
 
173
- if attributes.key?(:'inbox_id')
174
- self.inbox_id = attributes[:'inbox_id']
175
- end
176
-
177
173
  if attributes.key?(:'attachments')
178
174
  if (value = attributes[:'attachments']).is_a?(Array)
179
175
  self.attachments = value
180
176
  end
181
177
  end
182
178
 
179
+ if attributes.key?(:'inbox_id')
180
+ self.inbox_id = attributes[:'inbox_id']
181
+ end
182
+
183
183
  if attributes.key?(:'created_at')
184
184
  self.created_at = attributes[:'created_at']
185
185
  end
@@ -319,8 +319,8 @@ module MailSlurpClient
319
319
  self.class == o.class &&
320
320
  sender == o.sender &&
321
321
  recipients == o.recipients &&
322
- inbox_id == o.inbox_id &&
323
322
  attachments == o.attachments &&
323
+ inbox_id == o.inbox_id &&
324
324
  created_at == o.created_at &&
325
325
  to == o.to &&
326
326
  cc == o.cc &&
@@ -352,7 +352,7 @@ module MailSlurpClient
352
352
  # Calculates hash code according to all attributes.
353
353
  # @return [Integer] Hash code
354
354
  def hash
355
- [sender, recipients, inbox_id, attachments, created_at, to, cc, bcc, message_id, domain_id, favourite, plus_address, size_bytes, in_reply_to, read, body_excerpt, text_excerpt, body_part_content_types, body_md5_hash, team_access, subject, id, thread_id, from].hash
355
+ [sender, recipients, attachments, inbox_id, created_at, to, cc, bcc, message_id, domain_id, favourite, plus_address, size_bytes, in_reply_to, read, body_excerpt, text_excerpt, body_part_content_types, body_md5_hash, team_access, subject, id, thread_id, from].hash
356
356
  end
357
357
 
358
358
  # Builds the object from hash
@@ -16,20 +16,20 @@ module MailSlurpClient
16
16
  class SentEmailProjection
17
17
  attr_accessor :id
18
18
 
19
+ attr_accessor :subject
20
+
19
21
  attr_accessor :from
20
22
 
21
23
  attr_accessor :sender
22
24
 
23
25
  attr_accessor :recipients
24
26
 
25
- attr_accessor :subject
27
+ attr_accessor :attachments
26
28
 
27
29
  attr_accessor :inbox_id
28
30
 
29
31
  attr_accessor :user_id
30
32
 
31
- attr_accessor :attachments
32
-
33
33
  attr_accessor :created_at
34
34
 
35
35
  attr_accessor :to
@@ -56,13 +56,13 @@ module MailSlurpClient
56
56
  def self.attribute_map
57
57
  {
58
58
  :'id' => :'id',
59
+ :'subject' => :'subject',
59
60
  :'from' => :'from',
60
61
  :'sender' => :'sender',
61
62
  :'recipients' => :'recipients',
62
- :'subject' => :'subject',
63
+ :'attachments' => :'attachments',
63
64
  :'inbox_id' => :'inboxId',
64
65
  :'user_id' => :'userId',
65
- :'attachments' => :'attachments',
66
66
  :'created_at' => :'createdAt',
67
67
  :'to' => :'to',
68
68
  :'cc' => :'cc',
@@ -81,13 +81,13 @@ module MailSlurpClient
81
81
  def self.openapi_types
82
82
  {
83
83
  :'id' => :'String',
84
+ :'subject' => :'String',
84
85
  :'from' => :'String',
85
86
  :'sender' => :'Sender',
86
87
  :'recipients' => :'EmailRecipients',
87
- :'subject' => :'String',
88
+ :'attachments' => :'Array<String>',
88
89
  :'inbox_id' => :'String',
89
90
  :'user_id' => :'String',
90
- :'attachments' => :'Array<String>',
91
91
  :'created_at' => :'DateTime',
92
92
  :'to' => :'Array<String>',
93
93
  :'cc' => :'Array<String>',
@@ -105,10 +105,10 @@ module MailSlurpClient
105
105
  # List of attributes with nullable: true
106
106
  def self.openapi_nullable
107
107
  Set.new([
108
+ :'subject',
108
109
  :'from',
109
110
  :'sender',
110
111
  :'recipients',
111
- :'subject',
112
112
  :'attachments',
113
113
  :'message_id',
114
114
  :'in_reply_to',
@@ -138,6 +138,10 @@ module MailSlurpClient
138
138
  self.id = attributes[:'id']
139
139
  end
140
140
 
141
+ if attributes.key?(:'subject')
142
+ self.subject = attributes[:'subject']
143
+ end
144
+
141
145
  if attributes.key?(:'from')
142
146
  self.from = attributes[:'from']
143
147
  end
@@ -150,8 +154,10 @@ module MailSlurpClient
150
154
  self.recipients = attributes[:'recipients']
151
155
  end
152
156
 
153
- if attributes.key?(:'subject')
154
- self.subject = attributes[:'subject']
157
+ if attributes.key?(:'attachments')
158
+ if (value = attributes[:'attachments']).is_a?(Array)
159
+ self.attachments = value
160
+ end
155
161
  end
156
162
 
157
163
  if attributes.key?(:'inbox_id')
@@ -162,12 +168,6 @@ module MailSlurpClient
162
168
  self.user_id = attributes[:'user_id']
163
169
  end
164
170
 
165
- if attributes.key?(:'attachments')
166
- if (value = attributes[:'attachments']).is_a?(Array)
167
- self.attachments = value
168
- end
169
- end
170
-
171
171
  if attributes.key?(:'created_at')
172
172
  self.created_at = attributes[:'created_at']
173
173
  end
@@ -278,13 +278,13 @@ module MailSlurpClient
278
278
  return true if self.equal?(o)
279
279
  self.class == o.class &&
280
280
  id == o.id &&
281
+ subject == o.subject &&
281
282
  from == o.from &&
282
283
  sender == o.sender &&
283
284
  recipients == o.recipients &&
284
- subject == o.subject &&
285
+ attachments == o.attachments &&
285
286
  inbox_id == o.inbox_id &&
286
287
  user_id == o.user_id &&
287
- attachments == o.attachments &&
288
288
  created_at == o.created_at &&
289
289
  to == o.to &&
290
290
  cc == o.cc &&
@@ -307,7 +307,7 @@ module MailSlurpClient
307
307
  # Calculates hash code according to all attributes.
308
308
  # @return [Integer] Hash code
309
309
  def hash
310
- [id, from, sender, recipients, subject, inbox_id, user_id, attachments, created_at, to, cc, bcc, message_id, in_reply_to, body_excerpt, text_excerpt, body_md5_hash, virtual_send, thread_id].hash
310
+ [id, subject, from, sender, recipients, attachments, inbox_id, user_id, created_at, to, cc, bcc, message_id, in_reply_to, body_excerpt, text_excerpt, body_md5_hash, virtual_send, thread_id].hash
311
311
  end
312
312
 
313
313
  # Builds the object from hash
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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 TotpDeviceCodeDto
17
+ attr_accessor :code
18
+
19
+ attr_accessor :expires_at
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'code' => :'code',
25
+ :'expires_at' => :'expiresAt'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'code' => :'String',
33
+ :'expires_at' => :'DateTime'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ :'expires_at'
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::TotpDeviceCodeDto` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::TotpDeviceCodeDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'code')
60
+ self.code = attributes[:'code']
61
+ end
62
+
63
+ if attributes.key?(:'expires_at')
64
+ self.expires_at = attributes[:'expires_at']
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ if @code.nil?
73
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
74
+ end
75
+
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
+ return false if @code.nil?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ code == o.code &&
92
+ expires_at == o.expires_at
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [code, expires_at].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.openapi_types.each_pair do |key, type|
120
+ if type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :Boolean
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ MailSlurpClient.const_get(type).build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+ end
221
+ end