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,175 @@
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 EmailReadRequest < ApiModelBase
18
+ attr_accessor :message_id
19
+
20
+ attr_accessor :mark_as_read
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'message_id' => :'messageId',
26
+ :'mark_as_read' => :'markAsRead'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'message_id' => :'String',
44
+ :'mark_as_read' => :'Boolean'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailmock::EmailReadRequest` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailmock::EmailReadRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'message_id')
71
+ self.message_id = attributes[:'message_id']
72
+ else
73
+ self.message_id = nil
74
+ end
75
+
76
+ if attributes.key?(:'mark_as_read')
77
+ self.mark_as_read = attributes[:'mark_as_read']
78
+ else
79
+ self.mark_as_read = true
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @message_id.nil?
89
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @message_id.nil?
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] message_id Value to be assigned
105
+ def message_id=(message_id)
106
+ if message_id.nil?
107
+ fail ArgumentError, 'message_id cannot be nil'
108
+ end
109
+
110
+ @message_id = message_id
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ message_id == o.message_id &&
119
+ mark_as_read == o.mark_as_read
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [message_id, mark_as_read].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
153
+ end
154
+ new(transformed_hash)
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ if value.nil?
164
+ is_nullable = self.class.openapi_nullable.include?(attr)
165
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
166
+ end
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ end
174
+
175
+ end
@@ -0,0 +1,242 @@
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 SendAws200Response < ApiModelBase
18
+ attr_accessor :user
19
+
20
+ attr_accessor :mailbox
21
+
22
+ attr_accessor :message_id
23
+
24
+ attr_accessor :ttl
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'user' => :'user',
30
+ :'mailbox' => :'mailbox',
31
+ :'message_id' => :'messageId',
32
+ :'ttl' => :'ttl'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'user' => :'String',
50
+ :'mailbox' => :'String',
51
+ :'message_id' => :'String',
52
+ :'ttl' => :'Float'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailmock::SendAws200Response` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailmock::SendAws200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'user')
79
+ self.user = attributes[:'user']
80
+ else
81
+ self.user = nil
82
+ end
83
+
84
+ if attributes.key?(:'mailbox')
85
+ self.mailbox = attributes[:'mailbox']
86
+ else
87
+ self.mailbox = nil
88
+ end
89
+
90
+ if attributes.key?(:'message_id')
91
+ self.message_id = attributes[:'message_id']
92
+ else
93
+ self.message_id = nil
94
+ end
95
+
96
+ if attributes.key?(:'ttl')
97
+ self.ttl = attributes[:'ttl']
98
+ else
99
+ self.ttl = nil
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
+ invalid_properties = Array.new
108
+ if @user.nil?
109
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
110
+ end
111
+
112
+ if @mailbox.nil?
113
+ invalid_properties.push('invalid value for "mailbox", mailbox cannot be nil.')
114
+ end
115
+
116
+ if @message_id.nil?
117
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
118
+ end
119
+
120
+ if @ttl.nil?
121
+ invalid_properties.push('invalid value for "ttl", ttl cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @user.nil?
132
+ return false if @mailbox.nil?
133
+ return false if @message_id.nil?
134
+ return false if @ttl.nil?
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] user Value to be assigned
140
+ def user=(user)
141
+ if user.nil?
142
+ fail ArgumentError, 'user cannot be nil'
143
+ end
144
+
145
+ @user = user
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] mailbox Value to be assigned
150
+ def mailbox=(mailbox)
151
+ if mailbox.nil?
152
+ fail ArgumentError, 'mailbox cannot be nil'
153
+ end
154
+
155
+ @mailbox = mailbox
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] message_id Value to be assigned
160
+ def message_id=(message_id)
161
+ if message_id.nil?
162
+ fail ArgumentError, 'message_id cannot be nil'
163
+ end
164
+
165
+ @message_id = message_id
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] ttl Value to be assigned
170
+ def ttl=(ttl)
171
+ if ttl.nil?
172
+ fail ArgumentError, 'ttl cannot be nil'
173
+ end
174
+
175
+ @ttl = ttl
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ user == o.user &&
184
+ mailbox == o.mailbox &&
185
+ message_id == o.message_id &&
186
+ ttl == o.ttl
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [user, mailbox, message_id, ttl].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -0,0 +1,242 @@
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 SendAwsRequest < ApiModelBase
18
+ attr_accessor :notification_type
19
+
20
+ attr_accessor :mail
21
+
22
+ attr_accessor :receipt
23
+
24
+ attr_accessor :content
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'notification_type' => :'notificationType',
30
+ :'mail' => :'mail',
31
+ :'receipt' => :'receipt',
32
+ :'content' => :'content'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'notification_type' => :'String',
50
+ :'mail' => :'SendAwsRequestMail',
51
+ :'receipt' => :'SendAwsRequestReceipt',
52
+ :'content' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mailmock::SendAwsRequest` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mailmock::SendAwsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'notification_type')
79
+ self.notification_type = attributes[:'notification_type']
80
+ else
81
+ self.notification_type = nil
82
+ end
83
+
84
+ if attributes.key?(:'mail')
85
+ self.mail = attributes[:'mail']
86
+ else
87
+ self.mail = nil
88
+ end
89
+
90
+ if attributes.key?(:'receipt')
91
+ self.receipt = attributes[:'receipt']
92
+ else
93
+ self.receipt = nil
94
+ end
95
+
96
+ if attributes.key?(:'content')
97
+ self.content = attributes[:'content']
98
+ else
99
+ self.content = nil
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
+ invalid_properties = Array.new
108
+ if @notification_type.nil?
109
+ invalid_properties.push('invalid value for "notification_type", notification_type cannot be nil.')
110
+ end
111
+
112
+ if @mail.nil?
113
+ invalid_properties.push('invalid value for "mail", mail cannot be nil.')
114
+ end
115
+
116
+ if @receipt.nil?
117
+ invalid_properties.push('invalid value for "receipt", receipt cannot be nil.')
118
+ end
119
+
120
+ if @content.nil?
121
+ invalid_properties.push('invalid value for "content", content cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @notification_type.nil?
132
+ return false if @mail.nil?
133
+ return false if @receipt.nil?
134
+ return false if @content.nil?
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] notification_type Value to be assigned
140
+ def notification_type=(notification_type)
141
+ if notification_type.nil?
142
+ fail ArgumentError, 'notification_type cannot be nil'
143
+ end
144
+
145
+ @notification_type = notification_type
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] mail Value to be assigned
150
+ def mail=(mail)
151
+ if mail.nil?
152
+ fail ArgumentError, 'mail cannot be nil'
153
+ end
154
+
155
+ @mail = mail
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] receipt Value to be assigned
160
+ def receipt=(receipt)
161
+ if receipt.nil?
162
+ fail ArgumentError, 'receipt cannot be nil'
163
+ end
164
+
165
+ @receipt = receipt
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] content Value to be assigned
170
+ def content=(content)
171
+ if content.nil?
172
+ fail ArgumentError, 'content cannot be nil'
173
+ end
174
+
175
+ @content = content
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ notification_type == o.notification_type &&
184
+ mail == o.mail &&
185
+ receipt == o.receipt &&
186
+ content == o.content
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [notification_type, mail, receipt, content].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end