mailmock 1.1.1.pre.34026500447
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +111 -0
- data/Rakefile +10 -0
- data/docs/EmailApi.md +202 -0
- data/docs/EmailCreate200Response.md +20 -0
- data/docs/EmailCreateRequest.md +20 -0
- data/docs/EmailList200ResponseInner.md +26 -0
- data/docs/EmailListDefaultResponse.md +22 -0
- data/docs/EmailListDefaultResponseIssuesInner.md +18 -0
- data/docs/EmailRead200Response.md +36 -0
- data/docs/EmailRead200ResponseHeadersInner.md +20 -0
- data/docs/EmailReadRequest.md +20 -0
- data/docs/SendApi.md +70 -0
- data/docs/SendAws200Response.md +24 -0
- data/docs/SendAwsRequest.md +24 -0
- data/docs/SendAwsRequestMail.md +30 -0
- data/docs/SendAwsRequestMailCommonHeaders.md +28 -0
- data/docs/SendAwsRequestReceipt.md +34 -0
- data/docs/SendAwsRequestReceiptAction.md +22 -0
- data/docs/SendAwsRequestReceiptSpamVerdict.md +18 -0
- data/git_push.sh +57 -0
- data/lib/mailmock/api/email_api.rb +222 -0
- data/lib/mailmock/api/send_api.rb +86 -0
- data/lib/mailmock/api_client.rb +397 -0
- data/lib/mailmock/api_error.rb +58 -0
- data/lib/mailmock/api_model_base.rb +88 -0
- data/lib/mailmock/configuration.rb +308 -0
- data/lib/mailmock/models/email_create200_response.rb +190 -0
- data/lib/mailmock/models/email_create_request.rb +190 -0
- data/lib/mailmock/models/email_list200_response_inner.rb +292 -0
- data/lib/mailmock/models/email_list_default_response.rb +201 -0
- data/lib/mailmock/models/email_list_default_response_issues_inner.rb +164 -0
- data/lib/mailmock/models/email_read200_response.rb +370 -0
- data/lib/mailmock/models/email_read200_response_headers_inner.rb +190 -0
- data/lib/mailmock/models/email_read_request.rb +175 -0
- data/lib/mailmock/models/send_aws200_response.rb +242 -0
- data/lib/mailmock/models/send_aws_request.rb +242 -0
- data/lib/mailmock/models/send_aws_request_mail.rb +324 -0
- data/lib/mailmock/models/send_aws_request_mail_common_headers.rb +298 -0
- data/lib/mailmock/models/send_aws_request_receipt.rb +374 -0
- data/lib/mailmock/models/send_aws_request_receipt_action.rb +216 -0
- data/lib/mailmock/models/send_aws_request_receipt_spam_verdict.rb +164 -0
- data/lib/mailmock/version.rb +15 -0
- data/lib/mailmock.rb +57 -0
- data/mailmock.gemspec +39 -0
- data/spec/api/email_api_spec.rb +70 -0
- data/spec/api/send_api_spec.rb +45 -0
- data/spec/api_client_spec.rb +228 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/email_create200_response_spec.rb +40 -0
- data/spec/models/email_create_request_spec.rb +40 -0
- data/spec/models/email_list200_response_inner_spec.rb +62 -0
- data/spec/models/email_list_default_response_issues_inner_spec.rb +34 -0
- data/spec/models/email_list_default_response_spec.rb +46 -0
- data/spec/models/email_read200_response_headers_inner_spec.rb +40 -0
- data/spec/models/email_read200_response_spec.rb +88 -0
- data/spec/models/email_read_request_spec.rb +40 -0
- data/spec/models/send_aws200_response_spec.rb +52 -0
- data/spec/models/send_aws_request_mail_common_headers_spec.rb +64 -0
- data/spec/models/send_aws_request_mail_spec.rb +70 -0
- data/spec/models/send_aws_request_receipt_action_spec.rb +46 -0
- data/spec/models/send_aws_request_receipt_spam_verdict_spec.rb +34 -0
- data/spec/models/send_aws_request_receipt_spec.rb +82 -0
- data/spec/models/send_aws_request_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +168 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Mailmock API
|
|
3
|
+
|
|
4
|
+
#Mailmock API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Mailmock
|
|
17
|
+
class SendAwsRequestMail < ApiModelBase
|
|
18
|
+
attr_accessor :timestamp
|
|
19
|
+
|
|
20
|
+
attr_accessor :source
|
|
21
|
+
|
|
22
|
+
attr_accessor :message_id
|
|
23
|
+
|
|
24
|
+
attr_accessor :destination
|
|
25
|
+
|
|
26
|
+
attr_accessor :headers_truncated
|
|
27
|
+
|
|
28
|
+
attr_accessor :headers
|
|
29
|
+
|
|
30
|
+
attr_accessor :common_headers
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'timestamp' => :'timestamp',
|
|
36
|
+
:'source' => :'source',
|
|
37
|
+
:'message_id' => :'messageId',
|
|
38
|
+
:'destination' => :'destination',
|
|
39
|
+
:'headers_truncated' => :'headersTruncated',
|
|
40
|
+
:'headers' => :'headers',
|
|
41
|
+
:'common_headers' => :'commonHeaders'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns all the JSON keys this model knows about
|
|
51
|
+
def self.acceptable_attributes
|
|
52
|
+
acceptable_attribute_map.values
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute type mapping.
|
|
56
|
+
def self.openapi_types
|
|
57
|
+
{
|
|
58
|
+
:'timestamp' => :'Time',
|
|
59
|
+
:'source' => :'String',
|
|
60
|
+
:'message_id' => :'String',
|
|
61
|
+
:'destination' => :'Array<String>',
|
|
62
|
+
:'headers_truncated' => :'Boolean',
|
|
63
|
+
:'headers' => :'Array<EmailRead200ResponseHeadersInner>',
|
|
64
|
+
:'common_headers' => :'SendAwsRequestMailCommonHeaders'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# List of attributes with nullable: true
|
|
69
|
+
def self.openapi_nullable
|
|
70
|
+
Set.new([
|
|
71
|
+
])
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Initializes the object
|
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
76
|
+
def initialize(attributes = {})
|
|
77
|
+
if (!attributes.is_a?(Hash))
|
|
78
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Mailmock::SendAwsRequestMail` initialize method"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
82
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
83
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
84
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
85
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Mailmock::SendAwsRequestMail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
86
|
+
end
|
|
87
|
+
h[k.to_sym] = v
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'timestamp')
|
|
91
|
+
self.timestamp = attributes[:'timestamp']
|
|
92
|
+
else
|
|
93
|
+
self.timestamp = nil
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'source')
|
|
97
|
+
self.source = attributes[:'source']
|
|
98
|
+
else
|
|
99
|
+
self.source = nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'message_id')
|
|
103
|
+
self.message_id = attributes[:'message_id']
|
|
104
|
+
else
|
|
105
|
+
self.message_id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'destination')
|
|
109
|
+
if (value = attributes[:'destination']).is_a?(Array)
|
|
110
|
+
self.destination = value
|
|
111
|
+
end
|
|
112
|
+
else
|
|
113
|
+
self.destination = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'headers_truncated')
|
|
117
|
+
self.headers_truncated = attributes[:'headers_truncated']
|
|
118
|
+
else
|
|
119
|
+
self.headers_truncated = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'headers')
|
|
123
|
+
if (value = attributes[:'headers']).is_a?(Array)
|
|
124
|
+
self.headers = value
|
|
125
|
+
end
|
|
126
|
+
else
|
|
127
|
+
self.headers = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'common_headers')
|
|
131
|
+
self.common_headers = attributes[:'common_headers']
|
|
132
|
+
else
|
|
133
|
+
self.common_headers = nil
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
138
|
+
# @return Array for valid properties with the reasons
|
|
139
|
+
def list_invalid_properties
|
|
140
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
141
|
+
invalid_properties = Array.new
|
|
142
|
+
if @timestamp.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @source.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "source", source cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if @message_id.nil?
|
|
151
|
+
invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if @destination.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "destination", destination cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if @headers_truncated.nil?
|
|
159
|
+
invalid_properties.push('invalid value for "headers_truncated", headers_truncated cannot be nil.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if @headers.nil?
|
|
163
|
+
invalid_properties.push('invalid value for "headers", headers cannot be nil.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if @common_headers.nil?
|
|
167
|
+
invalid_properties.push('invalid value for "common_headers", common_headers 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
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
177
|
+
return false if @timestamp.nil?
|
|
178
|
+
return false if @source.nil?
|
|
179
|
+
return false if @message_id.nil?
|
|
180
|
+
return false if @destination.nil?
|
|
181
|
+
return false if @headers_truncated.nil?
|
|
182
|
+
return false if @headers.nil?
|
|
183
|
+
return false if @common_headers.nil?
|
|
184
|
+
true
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] timestamp Value to be assigned
|
|
189
|
+
def timestamp=(timestamp)
|
|
190
|
+
if timestamp.nil?
|
|
191
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@timestamp = timestamp
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] source Value to be assigned
|
|
199
|
+
def source=(source)
|
|
200
|
+
if source.nil?
|
|
201
|
+
fail ArgumentError, 'source cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@source = source
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] message_id Value to be assigned
|
|
209
|
+
def message_id=(message_id)
|
|
210
|
+
if message_id.nil?
|
|
211
|
+
fail ArgumentError, 'message_id cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@message_id = message_id
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] destination Value to be assigned
|
|
219
|
+
def destination=(destination)
|
|
220
|
+
if destination.nil?
|
|
221
|
+
fail ArgumentError, 'destination cannot be nil'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
@destination = destination
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Custom attribute writer method with validation
|
|
228
|
+
# @param [Object] headers_truncated Value to be assigned
|
|
229
|
+
def headers_truncated=(headers_truncated)
|
|
230
|
+
if headers_truncated.nil?
|
|
231
|
+
fail ArgumentError, 'headers_truncated cannot be nil'
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
@headers_truncated = headers_truncated
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Custom attribute writer method with validation
|
|
238
|
+
# @param [Object] headers Value to be assigned
|
|
239
|
+
def headers=(headers)
|
|
240
|
+
if headers.nil?
|
|
241
|
+
fail ArgumentError, 'headers cannot be nil'
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
@headers = headers
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Custom attribute writer method with validation
|
|
248
|
+
# @param [Object] common_headers Value to be assigned
|
|
249
|
+
def common_headers=(common_headers)
|
|
250
|
+
if common_headers.nil?
|
|
251
|
+
fail ArgumentError, 'common_headers cannot be nil'
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
@common_headers = common_headers
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Checks equality by comparing each attribute.
|
|
258
|
+
# @param [Object] Object to be compared
|
|
259
|
+
def ==(o)
|
|
260
|
+
return true if self.equal?(o)
|
|
261
|
+
self.class == o.class &&
|
|
262
|
+
timestamp == o.timestamp &&
|
|
263
|
+
source == o.source &&
|
|
264
|
+
message_id == o.message_id &&
|
|
265
|
+
destination == o.destination &&
|
|
266
|
+
headers_truncated == o.headers_truncated &&
|
|
267
|
+
headers == o.headers &&
|
|
268
|
+
common_headers == o.common_headers
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# @see the `==` method
|
|
272
|
+
# @param [Object] Object to be compared
|
|
273
|
+
def eql?(o)
|
|
274
|
+
self == o
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Calculates hash code according to all attributes.
|
|
278
|
+
# @return [Integer] Hash code
|
|
279
|
+
def hash
|
|
280
|
+
[timestamp, source, message_id, destination, headers_truncated, headers, common_headers].hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Builds the object from hash
|
|
284
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
285
|
+
# @return [Object] Returns the model itself
|
|
286
|
+
def self.build_from_hash(attributes)
|
|
287
|
+
return nil unless attributes.is_a?(Hash)
|
|
288
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
289
|
+
transformed_hash = {}
|
|
290
|
+
openapi_types.each_pair do |key, type|
|
|
291
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
292
|
+
transformed_hash["#{key}"] = nil
|
|
293
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
294
|
+
# check to ensure the input is an array given that the attribute
|
|
295
|
+
# is documented as an array but the input is not
|
|
296
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
297
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
298
|
+
end
|
|
299
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
300
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
new(transformed_hash)
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Returns the object in the form of hash
|
|
307
|
+
# @return [Hash] Returns the object in the form of hash
|
|
308
|
+
def to_hash
|
|
309
|
+
hash = {}
|
|
310
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
311
|
+
value = self.send(attr)
|
|
312
|
+
if value.nil?
|
|
313
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
314
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
hash[param] = _to_hash(value)
|
|
318
|
+
end
|
|
319
|
+
hash
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
end
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Mailmock API
|
|
3
|
+
|
|
4
|
+
#Mailmock API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Mailmock
|
|
17
|
+
class SendAwsRequestMailCommonHeaders < ApiModelBase
|
|
18
|
+
attr_accessor :return_path
|
|
19
|
+
|
|
20
|
+
attr_accessor :from
|
|
21
|
+
|
|
22
|
+
attr_accessor :date
|
|
23
|
+
|
|
24
|
+
attr_accessor :to
|
|
25
|
+
|
|
26
|
+
attr_accessor :message_id
|
|
27
|
+
|
|
28
|
+
attr_accessor :subject
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'return_path' => :'returnPath',
|
|
34
|
+
:'from' => :'from',
|
|
35
|
+
:'date' => :'date',
|
|
36
|
+
:'to' => :'to',
|
|
37
|
+
:'message_id' => :'messageId',
|
|
38
|
+
:'subject' => :'subject'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns attribute mapping this model knows about
|
|
43
|
+
def self.acceptable_attribute_map
|
|
44
|
+
attribute_map
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
|
48
|
+
def self.acceptable_attributes
|
|
49
|
+
acceptable_attribute_map.values
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.openapi_types
|
|
54
|
+
{
|
|
55
|
+
:'return_path' => :'String',
|
|
56
|
+
:'from' => :'Array<String>',
|
|
57
|
+
:'date' => :'String',
|
|
58
|
+
:'to' => :'Array<String>',
|
|
59
|
+
:'message_id' => :'String',
|
|
60
|
+
:'subject' => :'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 `Mailmock::SendAwsRequestMailCommonHeaders` initialize method"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
78
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Mailmock::SendAwsRequestMailCommonHeaders`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
|
+
end
|
|
83
|
+
h[k.to_sym] = v
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'return_path')
|
|
87
|
+
self.return_path = attributes[:'return_path']
|
|
88
|
+
else
|
|
89
|
+
self.return_path = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'from')
|
|
93
|
+
if (value = attributes[:'from']).is_a?(Array)
|
|
94
|
+
self.from = value
|
|
95
|
+
end
|
|
96
|
+
else
|
|
97
|
+
self.from = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'date')
|
|
101
|
+
self.date = attributes[:'date']
|
|
102
|
+
else
|
|
103
|
+
self.date = nil
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'to')
|
|
107
|
+
if (value = attributes[:'to']).is_a?(Array)
|
|
108
|
+
self.to = value
|
|
109
|
+
end
|
|
110
|
+
else
|
|
111
|
+
self.to = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'message_id')
|
|
115
|
+
self.message_id = attributes[:'message_id']
|
|
116
|
+
else
|
|
117
|
+
self.message_id = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'subject')
|
|
121
|
+
self.subject = attributes[:'subject']
|
|
122
|
+
else
|
|
123
|
+
self.subject = nil
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
128
|
+
# @return Array for valid properties with the reasons
|
|
129
|
+
def list_invalid_properties
|
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
131
|
+
invalid_properties = Array.new
|
|
132
|
+
if @return_path.nil?
|
|
133
|
+
invalid_properties.push('invalid value for "return_path", return_path cannot be nil.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @from.nil?
|
|
137
|
+
invalid_properties.push('invalid value for "from", from cannot be nil.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if @date.nil?
|
|
141
|
+
invalid_properties.push('invalid value for "date", date cannot be nil.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if @to.nil?
|
|
145
|
+
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if @message_id.nil?
|
|
149
|
+
invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if @subject.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "subject", subject cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
invalid_properties
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Check to see if the all the properties in the model are valid
|
|
160
|
+
# @return true if the model is valid
|
|
161
|
+
def valid?
|
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
163
|
+
return false if @return_path.nil?
|
|
164
|
+
return false if @from.nil?
|
|
165
|
+
return false if @date.nil?
|
|
166
|
+
return false if @to.nil?
|
|
167
|
+
return false if @message_id.nil?
|
|
168
|
+
return false if @subject.nil?
|
|
169
|
+
true
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method with validation
|
|
173
|
+
# @param [Object] return_path Value to be assigned
|
|
174
|
+
def return_path=(return_path)
|
|
175
|
+
if return_path.nil?
|
|
176
|
+
fail ArgumentError, 'return_path cannot be nil'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
@return_path = return_path
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] from Value to be assigned
|
|
184
|
+
def from=(from)
|
|
185
|
+
if from.nil?
|
|
186
|
+
fail ArgumentError, 'from cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@from = from
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] date Value to be assigned
|
|
194
|
+
def date=(date)
|
|
195
|
+
if date.nil?
|
|
196
|
+
fail ArgumentError, 'date cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@date = date
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Custom attribute writer method with validation
|
|
203
|
+
# @param [Object] to Value to be assigned
|
|
204
|
+
def to=(to)
|
|
205
|
+
if to.nil?
|
|
206
|
+
fail ArgumentError, 'to cannot be nil'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
@to = to
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Custom attribute writer method with validation
|
|
213
|
+
# @param [Object] message_id Value to be assigned
|
|
214
|
+
def message_id=(message_id)
|
|
215
|
+
if message_id.nil?
|
|
216
|
+
fail ArgumentError, 'message_id cannot be nil'
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
@message_id = message_id
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Custom attribute writer method with validation
|
|
223
|
+
# @param [Object] subject Value to be assigned
|
|
224
|
+
def subject=(subject)
|
|
225
|
+
if subject.nil?
|
|
226
|
+
fail ArgumentError, 'subject cannot be nil'
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
@subject = subject
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Checks equality by comparing each attribute.
|
|
233
|
+
# @param [Object] Object to be compared
|
|
234
|
+
def ==(o)
|
|
235
|
+
return true if self.equal?(o)
|
|
236
|
+
self.class == o.class &&
|
|
237
|
+
return_path == o.return_path &&
|
|
238
|
+
from == o.from &&
|
|
239
|
+
date == o.date &&
|
|
240
|
+
to == o.to &&
|
|
241
|
+
message_id == o.message_id &&
|
|
242
|
+
subject == o.subject
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# @see the `==` method
|
|
246
|
+
# @param [Object] Object to be compared
|
|
247
|
+
def eql?(o)
|
|
248
|
+
self == o
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Calculates hash code according to all attributes.
|
|
252
|
+
# @return [Integer] Hash code
|
|
253
|
+
def hash
|
|
254
|
+
[return_path, from, date, to, message_id, subject].hash
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Builds the object from hash
|
|
258
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
259
|
+
# @return [Object] Returns the model itself
|
|
260
|
+
def self.build_from_hash(attributes)
|
|
261
|
+
return nil unless attributes.is_a?(Hash)
|
|
262
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
263
|
+
transformed_hash = {}
|
|
264
|
+
openapi_types.each_pair do |key, type|
|
|
265
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
266
|
+
transformed_hash["#{key}"] = nil
|
|
267
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
268
|
+
# check to ensure the input is an array given that the attribute
|
|
269
|
+
# is documented as an array but the input is not
|
|
270
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
271
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
272
|
+
end
|
|
273
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
274
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
new(transformed_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
|
+
end
|
|
297
|
+
|
|
298
|
+
end
|