mailslurp_client 15.5.0 → 15.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,8 @@ module MailSlurpClient
18
18
 
19
19
  attr_accessor :group_id
20
20
 
21
+ attr_accessor :created_at
22
+
21
23
  attr_accessor :first_name
22
24
 
23
25
  attr_accessor :last_name
@@ -28,19 +30,17 @@ module MailSlurpClient
28
30
 
29
31
  attr_accessor :opt_out
30
32
 
31
- attr_accessor :created_at
32
-
33
33
  # Attribute mapping from ruby-style variable name to JSON key.
34
34
  def self.attribute_map
35
35
  {
36
36
  :'id' => :'id',
37
37
  :'group_id' => :'groupId',
38
+ :'created_at' => :'createdAt',
38
39
  :'first_name' => :'firstName',
39
40
  :'last_name' => :'lastName',
40
41
  :'company' => :'company',
41
42
  :'email_addresses' => :'emailAddresses',
42
- :'opt_out' => :'optOut',
43
- :'created_at' => :'createdAt'
43
+ :'opt_out' => :'optOut'
44
44
  }
45
45
  end
46
46
 
@@ -49,12 +49,12 @@ module MailSlurpClient
49
49
  {
50
50
  :'id' => :'String',
51
51
  :'group_id' => :'String',
52
+ :'created_at' => :'DateTime',
52
53
  :'first_name' => :'String',
53
54
  :'last_name' => :'String',
54
55
  :'company' => :'String',
55
56
  :'email_addresses' => :'Array<String>',
56
- :'opt_out' => :'Boolean',
57
- :'created_at' => :'DateTime'
57
+ :'opt_out' => :'Boolean'
58
58
  }
59
59
  end
60
60
 
@@ -87,6 +87,10 @@ module MailSlurpClient
87
87
  self.group_id = attributes[:'group_id']
88
88
  end
89
89
 
90
+ if attributes.key?(:'created_at')
91
+ self.created_at = attributes[:'created_at']
92
+ end
93
+
90
94
  if attributes.key?(:'first_name')
91
95
  self.first_name = attributes[:'first_name']
92
96
  end
@@ -108,10 +112,6 @@ module MailSlurpClient
108
112
  if attributes.key?(:'opt_out')
109
113
  self.opt_out = attributes[:'opt_out']
110
114
  end
111
-
112
- if attributes.key?(:'created_at')
113
- self.created_at = attributes[:'created_at']
114
- end
115
115
  end
116
116
 
117
117
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -144,12 +144,12 @@ module MailSlurpClient
144
144
  self.class == o.class &&
145
145
  id == o.id &&
146
146
  group_id == o.group_id &&
147
+ created_at == o.created_at &&
147
148
  first_name == o.first_name &&
148
149
  last_name == o.last_name &&
149
150
  company == o.company &&
150
151
  email_addresses == o.email_addresses &&
151
- opt_out == o.opt_out &&
152
- created_at == o.created_at
152
+ opt_out == o.opt_out
153
153
  end
154
154
 
155
155
  # @see the `==` method
@@ -161,7 +161,7 @@ module MailSlurpClient
161
161
  # Calculates hash code according to all attributes.
162
162
  # @return [Integer] Hash code
163
163
  def hash
164
- [id, group_id, first_name, last_name, company, email_addresses, opt_out, created_at].hash
164
+ [id, group_id, created_at, first_name, last_name, company, email_addresses, opt_out].hash
165
165
  end
166
166
 
167
167
  # Builds the object from hash
@@ -0,0 +1,225 @@
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
+ 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 EmailPreviewUrls
17
+ attr_accessor :raw_smtp_message_url
18
+
19
+ attr_accessor :plain_html_body_url
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'raw_smtp_message_url' => :'rawSmtpMessageUrl',
25
+ :'plain_html_body_url' => :'plainHtmlBodyUrl'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'raw_smtp_message_url' => :'String',
33
+ :'plain_html_body_url' => :'String'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailPreviewUrls` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailPreviewUrls`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'raw_smtp_message_url')
59
+ self.raw_smtp_message_url = attributes[:'raw_smtp_message_url']
60
+ end
61
+
62
+ if attributes.key?(:'plain_html_body_url')
63
+ self.plain_html_body_url = attributes[:'plain_html_body_url']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if @raw_smtp_message_url.nil?
72
+ invalid_properties.push('invalid value for "raw_smtp_message_url", raw_smtp_message_url cannot be nil.')
73
+ end
74
+
75
+ if @plain_html_body_url.nil?
76
+ invalid_properties.push('invalid value for "plain_html_body_url", plain_html_body_url cannot be nil.')
77
+ end
78
+
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ return false if @raw_smtp_message_url.nil?
86
+ return false if @plain_html_body_url.nil?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ raw_smtp_message_url == o.raw_smtp_message_url &&
96
+ plain_html_body_url == o.plain_html_body_url
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [raw_smtp_message_url, plain_html_body_url].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ MailSlurpClient.const_get(type).build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+ end
225
+ end
@@ -21,18 +21,18 @@ module MailSlurpClient
21
21
 
22
22
  attr_accessor :subject
23
23
 
24
+ attr_accessor :attachments
25
+
24
26
  attr_accessor :inbox_id
25
27
 
26
- attr_accessor :to
28
+ attr_accessor :created_at
27
29
 
28
- attr_accessor :attachments
30
+ attr_accessor :to
29
31
 
30
32
  attr_accessor :bcc
31
33
 
32
34
  attr_accessor :cc
33
35
 
34
- attr_accessor :created_at
35
-
36
36
  attr_accessor :team_access
37
37
 
38
38
  attr_accessor :read
@@ -47,12 +47,12 @@ module MailSlurpClient
47
47
  :'id' => :'id',
48
48
  :'from' => :'from',
49
49
  :'subject' => :'subject',
50
+ :'attachments' => :'attachments',
50
51
  :'inbox_id' => :'inboxId',
52
+ :'created_at' => :'createdAt',
51
53
  :'to' => :'to',
52
- :'attachments' => :'attachments',
53
54
  :'bcc' => :'bcc',
54
55
  :'cc' => :'cc',
55
- :'created_at' => :'createdAt',
56
56
  :'team_access' => :'teamAccess',
57
57
  :'read' => :'read',
58
58
  :'body_md5_hash' => :'bodyMD5Hash',
@@ -66,12 +66,12 @@ module MailSlurpClient
66
66
  :'id' => :'String',
67
67
  :'from' => :'String',
68
68
  :'subject' => :'String',
69
+ :'attachments' => :'Array<String>',
69
70
  :'inbox_id' => :'String',
71
+ :'created_at' => :'DateTime',
70
72
  :'to' => :'Array<String>',
71
- :'attachments' => :'Array<String>',
72
73
  :'bcc' => :'Array<String>',
73
74
  :'cc' => :'Array<String>',
74
- :'created_at' => :'DateTime',
75
75
  :'team_access' => :'Boolean',
76
76
  :'read' => :'Boolean',
77
77
  :'body_md5_hash' => :'String',
@@ -112,22 +112,26 @@ module MailSlurpClient
112
112
  self.subject = attributes[:'subject']
113
113
  end
114
114
 
115
+ if attributes.key?(:'attachments')
116
+ if (value = attributes[:'attachments']).is_a?(Array)
117
+ self.attachments = value
118
+ end
119
+ end
120
+
115
121
  if attributes.key?(:'inbox_id')
116
122
  self.inbox_id = attributes[:'inbox_id']
117
123
  end
118
124
 
125
+ if attributes.key?(:'created_at')
126
+ self.created_at = attributes[:'created_at']
127
+ end
128
+
119
129
  if attributes.key?(:'to')
120
130
  if (value = attributes[:'to']).is_a?(Array)
121
131
  self.to = value
122
132
  end
123
133
  end
124
134
 
125
- if attributes.key?(:'attachments')
126
- if (value = attributes[:'attachments']).is_a?(Array)
127
- self.attachments = value
128
- end
129
- end
130
-
131
135
  if attributes.key?(:'bcc')
132
136
  if (value = attributes[:'bcc']).is_a?(Array)
133
137
  self.bcc = value
@@ -140,10 +144,6 @@ module MailSlurpClient
140
144
  end
141
145
  end
142
146
 
143
- if attributes.key?(:'created_at')
144
- self.created_at = attributes[:'created_at']
145
- end
146
-
147
147
  if attributes.key?(:'team_access')
148
148
  self.team_access = attributes[:'team_access']
149
149
  end
@@ -173,14 +173,14 @@ module MailSlurpClient
173
173
  invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
174
174
  end
175
175
 
176
- if @to.nil?
177
- invalid_properties.push('invalid value for "to", to cannot be nil.')
178
- end
179
-
180
176
  if @created_at.nil?
181
177
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
182
178
  end
183
179
 
180
+ if @to.nil?
181
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
182
+ end
183
+
184
184
  invalid_properties
185
185
  end
186
186
 
@@ -189,8 +189,8 @@ module MailSlurpClient
189
189
  def valid?
190
190
  return false if @id.nil?
191
191
  return false if @inbox_id.nil?
192
- return false if @to.nil?
193
192
  return false if @created_at.nil?
193
+ return false if @to.nil?
194
194
  true
195
195
  end
196
196
 
@@ -202,12 +202,12 @@ module MailSlurpClient
202
202
  id == o.id &&
203
203
  from == o.from &&
204
204
  subject == o.subject &&
205
+ attachments == o.attachments &&
205
206
  inbox_id == o.inbox_id &&
207
+ created_at == o.created_at &&
206
208
  to == o.to &&
207
- attachments == o.attachments &&
208
209
  bcc == o.bcc &&
209
210
  cc == o.cc &&
210
- created_at == o.created_at &&
211
211
  team_access == o.team_access &&
212
212
  read == o.read &&
213
213
  body_md5_hash == o.body_md5_hash &&
@@ -223,7 +223,7 @@ module MailSlurpClient
223
223
  # Calculates hash code according to all attributes.
224
224
  # @return [Integer] Hash code
225
225
  def hash
226
- [id, from, subject, inbox_id, to, attachments, bcc, cc, created_at, team_access, read, body_md5_hash, body_excerpt].hash
226
+ [id, from, subject, attachments, inbox_id, created_at, to, bcc, cc, team_access, read, body_md5_hash, body_excerpt].hash
227
227
  end
228
228
 
229
229
  # Builds the object from hash
@@ -23,18 +23,18 @@ module MailSlurpClient
23
23
 
24
24
  attr_accessor :subject
25
25
 
26
+ attr_accessor :attachments
27
+
26
28
  attr_accessor :inbox_id
27
29
 
28
- attr_accessor :to
30
+ attr_accessor :created_at
29
31
 
30
- attr_accessor :attachments
32
+ attr_accessor :to
31
33
 
32
34
  attr_accessor :bcc
33
35
 
34
36
  attr_accessor :cc
35
37
 
36
- attr_accessor :created_at
37
-
38
38
  attr_accessor :body_md5_hash
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -44,12 +44,12 @@ module MailSlurpClient
44
44
  :'from' => :'from',
45
45
  :'user_id' => :'userId',
46
46
  :'subject' => :'subject',
47
+ :'attachments' => :'attachments',
47
48
  :'inbox_id' => :'inboxId',
49
+ :'created_at' => :'createdAt',
48
50
  :'to' => :'to',
49
- :'attachments' => :'attachments',
50
51
  :'bcc' => :'bcc',
51
52
  :'cc' => :'cc',
52
- :'created_at' => :'createdAt',
53
53
  :'body_md5_hash' => :'bodyMD5Hash'
54
54
  }
55
55
  end
@@ -61,12 +61,12 @@ module MailSlurpClient
61
61
  :'from' => :'String',
62
62
  :'user_id' => :'String',
63
63
  :'subject' => :'String',
64
+ :'attachments' => :'Array<String>',
64
65
  :'inbox_id' => :'String',
66
+ :'created_at' => :'DateTime',
65
67
  :'to' => :'Array<String>',
66
- :'attachments' => :'Array<String>',
67
68
  :'bcc' => :'Array<String>',
68
69
  :'cc' => :'Array<String>',
69
- :'created_at' => :'DateTime',
70
70
  :'body_md5_hash' => :'String'
71
71
  }
72
72
  end
@@ -108,22 +108,26 @@ module MailSlurpClient
108
108
  self.subject = attributes[:'subject']
109
109
  end
110
110
 
111
+ if attributes.key?(:'attachments')
112
+ if (value = attributes[:'attachments']).is_a?(Array)
113
+ self.attachments = value
114
+ end
115
+ end
116
+
111
117
  if attributes.key?(:'inbox_id')
112
118
  self.inbox_id = attributes[:'inbox_id']
113
119
  end
114
120
 
121
+ if attributes.key?(:'created_at')
122
+ self.created_at = attributes[:'created_at']
123
+ end
124
+
115
125
  if attributes.key?(:'to')
116
126
  if (value = attributes[:'to']).is_a?(Array)
117
127
  self.to = value
118
128
  end
119
129
  end
120
130
 
121
- if attributes.key?(:'attachments')
122
- if (value = attributes[:'attachments']).is_a?(Array)
123
- self.attachments = value
124
- end
125
- end
126
-
127
131
  if attributes.key?(:'bcc')
128
132
  if (value = attributes[:'bcc']).is_a?(Array)
129
133
  self.bcc = value
@@ -136,10 +140,6 @@ module MailSlurpClient
136
140
  end
137
141
  end
138
142
 
139
- if attributes.key?(:'created_at')
140
- self.created_at = attributes[:'created_at']
141
- end
142
-
143
143
  if attributes.key?(:'body_md5_hash')
144
144
  self.body_md5_hash = attributes[:'body_md5_hash']
145
145
  end
@@ -157,16 +157,20 @@ module MailSlurpClient
157
157
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
158
158
  end
159
159
 
160
+ if @attachments.nil?
161
+ invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
162
+ end
163
+
160
164
  if @inbox_id.nil?
161
165
  invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
162
166
  end
163
167
 
164
- if @to.nil?
165
- invalid_properties.push('invalid value for "to", to cannot be nil.')
168
+ if @created_at.nil?
169
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
166
170
  end
167
171
 
168
- if @attachments.nil?
169
- invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
172
+ if @to.nil?
173
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
170
174
  end
171
175
 
172
176
  if @bcc.nil?
@@ -177,10 +181,6 @@ module MailSlurpClient
177
181
  invalid_properties.push('invalid value for "cc", cc cannot be nil.')
178
182
  end
179
183
 
180
- if @created_at.nil?
181
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
182
- end
183
-
184
184
  invalid_properties
185
185
  end
186
186
 
@@ -189,12 +189,12 @@ module MailSlurpClient
189
189
  def valid?
190
190
  return false if @id.nil?
191
191
  return false if @user_id.nil?
192
+ return false if @attachments.nil?
192
193
  return false if @inbox_id.nil?
194
+ return false if @created_at.nil?
193
195
  return false if @to.nil?
194
- return false if @attachments.nil?
195
196
  return false if @bcc.nil?
196
197
  return false if @cc.nil?
197
- return false if @created_at.nil?
198
198
  true
199
199
  end
200
200
 
@@ -207,12 +207,12 @@ module MailSlurpClient
207
207
  from == o.from &&
208
208
  user_id == o.user_id &&
209
209
  subject == o.subject &&
210
+ attachments == o.attachments &&
210
211
  inbox_id == o.inbox_id &&
212
+ created_at == o.created_at &&
211
213
  to == o.to &&
212
- attachments == o.attachments &&
213
214
  bcc == o.bcc &&
214
215
  cc == o.cc &&
215
- created_at == o.created_at &&
216
216
  body_md5_hash == o.body_md5_hash
217
217
  end
218
218
 
@@ -225,7 +225,7 @@ module MailSlurpClient
225
225
  # Calculates hash code according to all attributes.
226
226
  # @return [Integer] Hash code
227
227
  def hash
228
- [id, from, user_id, subject, inbox_id, to, attachments, bcc, cc, created_at, body_md5_hash].hash
228
+ [id, from, user_id, subject, attachments, inbox_id, created_at, to, bcc, cc, body_md5_hash].hash
229
229
  end
230
230
 
231
231
  # Builds the object from hash