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,374 @@
|
|
|
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 SendAwsRequestReceipt < ApiModelBase
|
|
18
|
+
attr_accessor :timestamp
|
|
19
|
+
|
|
20
|
+
attr_accessor :processing_time_millis
|
|
21
|
+
|
|
22
|
+
attr_accessor :recipients
|
|
23
|
+
|
|
24
|
+
attr_accessor :spam_verdict
|
|
25
|
+
|
|
26
|
+
attr_accessor :virus_verdict
|
|
27
|
+
|
|
28
|
+
attr_accessor :spf_verdict
|
|
29
|
+
|
|
30
|
+
attr_accessor :dkim_verdict
|
|
31
|
+
|
|
32
|
+
attr_accessor :dmarc_verdict
|
|
33
|
+
|
|
34
|
+
attr_accessor :action
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'timestamp' => :'timestamp',
|
|
40
|
+
:'processing_time_millis' => :'processingTimeMillis',
|
|
41
|
+
:'recipients' => :'recipients',
|
|
42
|
+
:'spam_verdict' => :'spamVerdict',
|
|
43
|
+
:'virus_verdict' => :'virusVerdict',
|
|
44
|
+
:'spf_verdict' => :'spfVerdict',
|
|
45
|
+
:'dkim_verdict' => :'dkimVerdict',
|
|
46
|
+
:'dmarc_verdict' => :'dmarcVerdict',
|
|
47
|
+
:'action' => :'action'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Returns attribute mapping this model knows about
|
|
52
|
+
def self.acceptable_attribute_map
|
|
53
|
+
attribute_map
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Returns all the JSON keys this model knows about
|
|
57
|
+
def self.acceptable_attributes
|
|
58
|
+
acceptable_attribute_map.values
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Attribute type mapping.
|
|
62
|
+
def self.openapi_types
|
|
63
|
+
{
|
|
64
|
+
:'timestamp' => :'Time',
|
|
65
|
+
:'processing_time_millis' => :'Float',
|
|
66
|
+
:'recipients' => :'Array<String>',
|
|
67
|
+
:'spam_verdict' => :'SendAwsRequestReceiptSpamVerdict',
|
|
68
|
+
:'virus_verdict' => :'SendAwsRequestReceiptSpamVerdict',
|
|
69
|
+
:'spf_verdict' => :'SendAwsRequestReceiptSpamVerdict',
|
|
70
|
+
:'dkim_verdict' => :'SendAwsRequestReceiptSpamVerdict',
|
|
71
|
+
:'dmarc_verdict' => :'SendAwsRequestReceiptSpamVerdict',
|
|
72
|
+
:'action' => :'SendAwsRequestReceiptAction'
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# List of attributes with nullable: true
|
|
77
|
+
def self.openapi_nullable
|
|
78
|
+
Set.new([
|
|
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 `Mailmock::SendAwsRequestReceipt` initialize method"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
90
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
91
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
92
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Mailmock::SendAwsRequestReceipt`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
94
|
+
end
|
|
95
|
+
h[k.to_sym] = v
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'timestamp')
|
|
99
|
+
self.timestamp = attributes[:'timestamp']
|
|
100
|
+
else
|
|
101
|
+
self.timestamp = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'processing_time_millis')
|
|
105
|
+
self.processing_time_millis = attributes[:'processing_time_millis']
|
|
106
|
+
else
|
|
107
|
+
self.processing_time_millis = nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'recipients')
|
|
111
|
+
if (value = attributes[:'recipients']).is_a?(Array)
|
|
112
|
+
self.recipients = value
|
|
113
|
+
end
|
|
114
|
+
else
|
|
115
|
+
self.recipients = nil
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'spam_verdict')
|
|
119
|
+
self.spam_verdict = attributes[:'spam_verdict']
|
|
120
|
+
else
|
|
121
|
+
self.spam_verdict = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'virus_verdict')
|
|
125
|
+
self.virus_verdict = attributes[:'virus_verdict']
|
|
126
|
+
else
|
|
127
|
+
self.virus_verdict = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'spf_verdict')
|
|
131
|
+
self.spf_verdict = attributes[:'spf_verdict']
|
|
132
|
+
else
|
|
133
|
+
self.spf_verdict = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'dkim_verdict')
|
|
137
|
+
self.dkim_verdict = attributes[:'dkim_verdict']
|
|
138
|
+
else
|
|
139
|
+
self.dkim_verdict = nil
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'dmarc_verdict')
|
|
143
|
+
self.dmarc_verdict = attributes[:'dmarc_verdict']
|
|
144
|
+
else
|
|
145
|
+
self.dmarc_verdict = nil
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'action')
|
|
149
|
+
self.action = attributes[:'action']
|
|
150
|
+
else
|
|
151
|
+
self.action = nil
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
156
|
+
# @return Array for valid properties with the reasons
|
|
157
|
+
def list_invalid_properties
|
|
158
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
159
|
+
invalid_properties = Array.new
|
|
160
|
+
if @timestamp.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @processing_time_millis.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "processing_time_millis", processing_time_millis cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if @recipients.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "recipients", recipients cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @spam_verdict.nil?
|
|
173
|
+
invalid_properties.push('invalid value for "spam_verdict", spam_verdict cannot be nil.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @virus_verdict.nil?
|
|
177
|
+
invalid_properties.push('invalid value for "virus_verdict", virus_verdict cannot be nil.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if @spf_verdict.nil?
|
|
181
|
+
invalid_properties.push('invalid value for "spf_verdict", spf_verdict cannot be nil.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if @dkim_verdict.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "dkim_verdict", dkim_verdict cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @dmarc_verdict.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "dmarc_verdict", dmarc_verdict cannot be nil.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @action.nil?
|
|
193
|
+
invalid_properties.push('invalid value for "action", action cannot be nil.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
invalid_properties
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Check to see if the all the properties in the model are valid
|
|
200
|
+
# @return true if the model is valid
|
|
201
|
+
def valid?
|
|
202
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
203
|
+
return false if @timestamp.nil?
|
|
204
|
+
return false if @processing_time_millis.nil?
|
|
205
|
+
return false if @recipients.nil?
|
|
206
|
+
return false if @spam_verdict.nil?
|
|
207
|
+
return false if @virus_verdict.nil?
|
|
208
|
+
return false if @spf_verdict.nil?
|
|
209
|
+
return false if @dkim_verdict.nil?
|
|
210
|
+
return false if @dmarc_verdict.nil?
|
|
211
|
+
return false if @action.nil?
|
|
212
|
+
true
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method with validation
|
|
216
|
+
# @param [Object] timestamp Value to be assigned
|
|
217
|
+
def timestamp=(timestamp)
|
|
218
|
+
if timestamp.nil?
|
|
219
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
@timestamp = timestamp
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Custom attribute writer method with validation
|
|
226
|
+
# @param [Object] processing_time_millis Value to be assigned
|
|
227
|
+
def processing_time_millis=(processing_time_millis)
|
|
228
|
+
if processing_time_millis.nil?
|
|
229
|
+
fail ArgumentError, 'processing_time_millis cannot be nil'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@processing_time_millis = processing_time_millis
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] recipients Value to be assigned
|
|
237
|
+
def recipients=(recipients)
|
|
238
|
+
if recipients.nil?
|
|
239
|
+
fail ArgumentError, 'recipients cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
@recipients = recipients
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Custom attribute writer method with validation
|
|
246
|
+
# @param [Object] spam_verdict Value to be assigned
|
|
247
|
+
def spam_verdict=(spam_verdict)
|
|
248
|
+
if spam_verdict.nil?
|
|
249
|
+
fail ArgumentError, 'spam_verdict cannot be nil'
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
@spam_verdict = spam_verdict
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Custom attribute writer method with validation
|
|
256
|
+
# @param [Object] virus_verdict Value to be assigned
|
|
257
|
+
def virus_verdict=(virus_verdict)
|
|
258
|
+
if virus_verdict.nil?
|
|
259
|
+
fail ArgumentError, 'virus_verdict cannot be nil'
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
@virus_verdict = virus_verdict
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Custom attribute writer method with validation
|
|
266
|
+
# @param [Object] spf_verdict Value to be assigned
|
|
267
|
+
def spf_verdict=(spf_verdict)
|
|
268
|
+
if spf_verdict.nil?
|
|
269
|
+
fail ArgumentError, 'spf_verdict cannot be nil'
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
@spf_verdict = spf_verdict
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Custom attribute writer method with validation
|
|
276
|
+
# @param [Object] dkim_verdict Value to be assigned
|
|
277
|
+
def dkim_verdict=(dkim_verdict)
|
|
278
|
+
if dkim_verdict.nil?
|
|
279
|
+
fail ArgumentError, 'dkim_verdict cannot be nil'
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
@dkim_verdict = dkim_verdict
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Custom attribute writer method with validation
|
|
286
|
+
# @param [Object] dmarc_verdict Value to be assigned
|
|
287
|
+
def dmarc_verdict=(dmarc_verdict)
|
|
288
|
+
if dmarc_verdict.nil?
|
|
289
|
+
fail ArgumentError, 'dmarc_verdict cannot be nil'
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
@dmarc_verdict = dmarc_verdict
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Custom attribute writer method with validation
|
|
296
|
+
# @param [Object] action Value to be assigned
|
|
297
|
+
def action=(action)
|
|
298
|
+
if action.nil?
|
|
299
|
+
fail ArgumentError, 'action cannot be nil'
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
@action = action
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Checks equality by comparing each attribute.
|
|
306
|
+
# @param [Object] Object to be compared
|
|
307
|
+
def ==(o)
|
|
308
|
+
return true if self.equal?(o)
|
|
309
|
+
self.class == o.class &&
|
|
310
|
+
timestamp == o.timestamp &&
|
|
311
|
+
processing_time_millis == o.processing_time_millis &&
|
|
312
|
+
recipients == o.recipients &&
|
|
313
|
+
spam_verdict == o.spam_verdict &&
|
|
314
|
+
virus_verdict == o.virus_verdict &&
|
|
315
|
+
spf_verdict == o.spf_verdict &&
|
|
316
|
+
dkim_verdict == o.dkim_verdict &&
|
|
317
|
+
dmarc_verdict == o.dmarc_verdict &&
|
|
318
|
+
action == o.action
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# @see the `==` method
|
|
322
|
+
# @param [Object] Object to be compared
|
|
323
|
+
def eql?(o)
|
|
324
|
+
self == o
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Calculates hash code according to all attributes.
|
|
328
|
+
# @return [Integer] Hash code
|
|
329
|
+
def hash
|
|
330
|
+
[timestamp, processing_time_millis, recipients, spam_verdict, virus_verdict, spf_verdict, dkim_verdict, dmarc_verdict, action].hash
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Builds the object from hash
|
|
334
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
335
|
+
# @return [Object] Returns the model itself
|
|
336
|
+
def self.build_from_hash(attributes)
|
|
337
|
+
return nil unless attributes.is_a?(Hash)
|
|
338
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
339
|
+
transformed_hash = {}
|
|
340
|
+
openapi_types.each_pair do |key, type|
|
|
341
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
342
|
+
transformed_hash["#{key}"] = nil
|
|
343
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
344
|
+
# check to ensure the input is an array given that the attribute
|
|
345
|
+
# is documented as an array but the input is not
|
|
346
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
347
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
348
|
+
end
|
|
349
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
350
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
new(transformed_hash)
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Returns the object in the form of hash
|
|
357
|
+
# @return [Hash] Returns the object in the form of hash
|
|
358
|
+
def to_hash
|
|
359
|
+
hash = {}
|
|
360
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
361
|
+
value = self.send(attr)
|
|
362
|
+
if value.nil?
|
|
363
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
364
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
hash[param] = _to_hash(value)
|
|
368
|
+
end
|
|
369
|
+
hash
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
end
|
|
@@ -0,0 +1,216 @@
|
|
|
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 SendAwsRequestReceiptAction < ApiModelBase
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
attr_accessor :topic_arn
|
|
21
|
+
|
|
22
|
+
attr_accessor :encoding
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'type' => :'type',
|
|
28
|
+
:'topic_arn' => :'topicArn',
|
|
29
|
+
:'encoding' => :'encoding'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'type' => :'String',
|
|
47
|
+
:'topic_arn' => :'String',
|
|
48
|
+
:'encoding' => :'String'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Mailmock::SendAwsRequestReceiptAction` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Mailmock::SendAwsRequestReceiptAction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'type')
|
|
75
|
+
self.type = attributes[:'type']
|
|
76
|
+
else
|
|
77
|
+
self.type = nil
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'topic_arn')
|
|
81
|
+
self.topic_arn = attributes[:'topic_arn']
|
|
82
|
+
else
|
|
83
|
+
self.topic_arn = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'encoding')
|
|
87
|
+
self.encoding = attributes[:'encoding']
|
|
88
|
+
else
|
|
89
|
+
self.encoding = nil
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
97
|
+
invalid_properties = Array.new
|
|
98
|
+
if @type.nil?
|
|
99
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if @topic_arn.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "topic_arn", topic_arn cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @encoding.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "encoding", encoding cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
invalid_properties
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Check to see if the all the properties in the model are valid
|
|
114
|
+
# @return true if the model is valid
|
|
115
|
+
def valid?
|
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
+
return false if @type.nil?
|
|
118
|
+
return false if @topic_arn.nil?
|
|
119
|
+
return false if @encoding.nil?
|
|
120
|
+
true
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Custom attribute writer method with validation
|
|
124
|
+
# @param [Object] type Value to be assigned
|
|
125
|
+
def type=(type)
|
|
126
|
+
if type.nil?
|
|
127
|
+
fail ArgumentError, 'type cannot be nil'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
@type = type
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Custom attribute writer method with validation
|
|
134
|
+
# @param [Object] topic_arn Value to be assigned
|
|
135
|
+
def topic_arn=(topic_arn)
|
|
136
|
+
if topic_arn.nil?
|
|
137
|
+
fail ArgumentError, 'topic_arn cannot be nil'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
@topic_arn = topic_arn
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] encoding Value to be assigned
|
|
145
|
+
def encoding=(encoding)
|
|
146
|
+
if encoding.nil?
|
|
147
|
+
fail ArgumentError, 'encoding cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@encoding = encoding
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Checks equality by comparing each attribute.
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def ==(o)
|
|
156
|
+
return true if self.equal?(o)
|
|
157
|
+
self.class == o.class &&
|
|
158
|
+
type == o.type &&
|
|
159
|
+
topic_arn == o.topic_arn &&
|
|
160
|
+
encoding == o.encoding
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# @see the `==` method
|
|
164
|
+
# @param [Object] Object to be compared
|
|
165
|
+
def eql?(o)
|
|
166
|
+
self == o
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Calculates hash code according to all attributes.
|
|
170
|
+
# @return [Integer] Hash code
|
|
171
|
+
def hash
|
|
172
|
+
[type, topic_arn, encoding].hash
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Builds the object from hash
|
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
177
|
+
# @return [Object] Returns the model itself
|
|
178
|
+
def self.build_from_hash(attributes)
|
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
|
180
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
181
|
+
transformed_hash = {}
|
|
182
|
+
openapi_types.each_pair do |key, type|
|
|
183
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = nil
|
|
185
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
186
|
+
# check to ensure the input is an array given that the attribute
|
|
187
|
+
# is documented as an array but the input is not
|
|
188
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
189
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
190
|
+
end
|
|
191
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
new(transformed_hash)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_hash
|
|
201
|
+
hash = {}
|
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
203
|
+
value = self.send(attr)
|
|
204
|
+
if value.nil?
|
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
hash[param] = _to_hash(value)
|
|
210
|
+
end
|
|
211
|
+
hash
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|