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