pingram 1.0.32 → 1.0.34

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/pingram/api/account_api.rb +2 -2
  4. data/lib/pingram/api/sub_notifications_api.rb +167 -0
  5. data/lib/pingram/api/user_api.rb +0 -248
  6. data/lib/pingram/api_client.rb +1 -1
  7. data/lib/pingram/client_wrapper.rb +10 -0
  8. data/lib/pingram/models/sub_notification.rb +242 -0
  9. data/lib/pingram/models/sub_notification_put_request.rb +164 -0
  10. data/lib/pingram/models/user_preferences_get_response.rb +222 -0
  11. data/lib/pingram/models/user_preferences_get_response_notifications_inner.rb +227 -0
  12. data/lib/pingram/models/user_preferences_get_response_preferences_inner.rb +249 -0
  13. data/lib/pingram/models/user_preferences_get_response_sub_notifications_inner.rb +216 -0
  14. data/lib/pingram/models/user_preferences_post_request_inner.rb +268 -0
  15. data/lib/pingram/models/user_preferences_post_response_inner.rb +253 -0
  16. data/lib/pingram/models/user_preferences_post_response_inner_channels_states_inner.rb +240 -0
  17. data/lib/pingram/version.rb +1 -1
  18. data/lib/pingram.rb +10 -0
  19. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.4.gem +0 -0
  20. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  21. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  22. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.3 → io-console-0.9.4}/gem_make.out +11 -10
  23. data/vendor/bundle/ruby/3.2.0/{gems/io-console-0.9.3/lib → extensions/x86_64-linux/3.2.0/io-console-0.9.4}/io/console.so +0 -0
  24. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.3 → io-console-0.9.4}/mkmf.log +29 -6
  25. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  26. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  27. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  28. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  29. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/ext/io/console/Makefile +1 -1
  30. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/ext/io/console/console.c +4 -1
  31. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/ext/io/console/extconf.rb +12 -1
  32. data/vendor/bundle/ruby/3.2.0/{extensions/x86_64-linux/3.2.0/io-console-0.9.3 → gems/io-console-0.9.4/lib}/io/console.so +0 -0
  33. data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.3.gemspec → io-console-0.9.4.gemspec} +3 -3
  34. metadata +28 -18
  35. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.3.gem +0 -0
  36. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.3 → io-console-0.9.4}/gem.build_complete +0 -0
  37. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/.document +0 -0
  38. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/BSDL +0 -0
  39. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/COPYING +0 -0
  40. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/README.md +0 -0
  41. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/ext/io/console/win32_vk.inc +0 -0
  42. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.3 → io-console-0.9.4}/lib/io/console/size.rb +0 -0
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ class SubNotification < ApiModelBase
18
+ attr_accessor :account_id
19
+
20
+ attr_accessor :notification_id
21
+
22
+ attr_accessor :sub_notification_id
23
+
24
+ attr_accessor :title
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'account_id' => :'accountId',
30
+ :'notification_id' => :'notificationId',
31
+ :'sub_notification_id' => :'subNotificationId',
32
+ :'title' => :'title'
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
+ :'account_id' => :'String',
50
+ :'notification_id' => :'String',
51
+ :'sub_notification_id' => :'String',
52
+ :'title' => :'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 `Pingram::SubNotification` 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 `Pingram::SubNotification`. 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?(:'account_id')
79
+ self.account_id = attributes[:'account_id']
80
+ else
81
+ self.account_id = nil
82
+ end
83
+
84
+ if attributes.key?(:'notification_id')
85
+ self.notification_id = attributes[:'notification_id']
86
+ else
87
+ self.notification_id = nil
88
+ end
89
+
90
+ if attributes.key?(:'sub_notification_id')
91
+ self.sub_notification_id = attributes[:'sub_notification_id']
92
+ else
93
+ self.sub_notification_id = nil
94
+ end
95
+
96
+ if attributes.key?(:'title')
97
+ self.title = attributes[:'title']
98
+ else
99
+ self.title = 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 @account_id.nil?
109
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
110
+ end
111
+
112
+ if @notification_id.nil?
113
+ invalid_properties.push('invalid value for "notification_id", notification_id cannot be nil.')
114
+ end
115
+
116
+ if @sub_notification_id.nil?
117
+ invalid_properties.push('invalid value for "sub_notification_id", sub_notification_id cannot be nil.')
118
+ end
119
+
120
+ if @title.nil?
121
+ invalid_properties.push('invalid value for "title", title 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 @account_id.nil?
132
+ return false if @notification_id.nil?
133
+ return false if @sub_notification_id.nil?
134
+ return false if @title.nil?
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] account_id Value to be assigned
140
+ def account_id=(account_id)
141
+ if account_id.nil?
142
+ fail ArgumentError, 'account_id cannot be nil'
143
+ end
144
+
145
+ @account_id = account_id
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] notification_id Value to be assigned
150
+ def notification_id=(notification_id)
151
+ if notification_id.nil?
152
+ fail ArgumentError, 'notification_id cannot be nil'
153
+ end
154
+
155
+ @notification_id = notification_id
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] sub_notification_id Value to be assigned
160
+ def sub_notification_id=(sub_notification_id)
161
+ if sub_notification_id.nil?
162
+ fail ArgumentError, 'sub_notification_id cannot be nil'
163
+ end
164
+
165
+ @sub_notification_id = sub_notification_id
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] title Value to be assigned
170
+ def title=(title)
171
+ if title.nil?
172
+ fail ArgumentError, 'title cannot be nil'
173
+ end
174
+
175
+ @title = title
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
+ account_id == o.account_id &&
184
+ notification_id == o.notification_id &&
185
+ sub_notification_id == o.sub_notification_id &&
186
+ title == o.title
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
+ [account_id, notification_id, sub_notification_id, title].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,164 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ class SubNotificationPUTRequest < ApiModelBase
18
+ attr_accessor :title
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'title' => :'title'
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
+ :'title' => :'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 `Pingram::SubNotificationPUTRequest` 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 `Pingram::SubNotificationPUTRequest`. 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?(:'title')
67
+ self.title = attributes[:'title']
68
+ else
69
+ self.title = 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 @title.nil?
79
+ invalid_properties.push('invalid value for "title", title 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 @title.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] title Value to be assigned
95
+ def title=(title)
96
+ if title.nil?
97
+ fail ArgumentError, 'title cannot be nil'
98
+ end
99
+
100
+ @title = title
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
+ title == o.title
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
+ [title].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
@@ -0,0 +1,222 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ class UserPreferencesGETResponse < ApiModelBase
18
+ attr_accessor :preferences
19
+
20
+ attr_accessor :notifications
21
+
22
+ attr_accessor :sub_notifications
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'preferences' => :'preferences',
28
+ :'notifications' => :'notifications',
29
+ :'sub_notifications' => :'subNotifications'
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
+ :'preferences' => :'Array<UserPreferencesGETResponsePreferencesInner>',
47
+ :'notifications' => :'Array<UserPreferencesGETResponseNotificationsInner>',
48
+ :'sub_notifications' => :'Array<UserPreferencesGETResponseSubNotificationsInner>'
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 `Pingram::UserPreferencesGETResponse` 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 `Pingram::UserPreferencesGETResponse`. 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?(:'preferences')
75
+ if (value = attributes[:'preferences']).is_a?(Array)
76
+ self.preferences = value
77
+ end
78
+ else
79
+ self.preferences = nil
80
+ end
81
+
82
+ if attributes.key?(:'notifications')
83
+ if (value = attributes[:'notifications']).is_a?(Array)
84
+ self.notifications = value
85
+ end
86
+ else
87
+ self.notifications = nil
88
+ end
89
+
90
+ if attributes.key?(:'sub_notifications')
91
+ if (value = attributes[:'sub_notifications']).is_a?(Array)
92
+ self.sub_notifications = value
93
+ end
94
+ else
95
+ self.sub_notifications = nil
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ if @preferences.nil?
105
+ invalid_properties.push('invalid value for "preferences", preferences cannot be nil.')
106
+ end
107
+
108
+ if @notifications.nil?
109
+ invalid_properties.push('invalid value for "notifications", notifications cannot be nil.')
110
+ end
111
+
112
+ if @sub_notifications.nil?
113
+ invalid_properties.push('invalid value for "sub_notifications", sub_notifications cannot be nil.')
114
+ end
115
+
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ return false if @preferences.nil?
124
+ return false if @notifications.nil?
125
+ return false if @sub_notifications.nil?
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] preferences Value to be assigned
131
+ def preferences=(preferences)
132
+ if preferences.nil?
133
+ fail ArgumentError, 'preferences cannot be nil'
134
+ end
135
+
136
+ @preferences = preferences
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] notifications Value to be assigned
141
+ def notifications=(notifications)
142
+ if notifications.nil?
143
+ fail ArgumentError, 'notifications cannot be nil'
144
+ end
145
+
146
+ @notifications = notifications
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] sub_notifications Value to be assigned
151
+ def sub_notifications=(sub_notifications)
152
+ if sub_notifications.nil?
153
+ fail ArgumentError, 'sub_notifications cannot be nil'
154
+ end
155
+
156
+ @sub_notifications = sub_notifications
157
+ end
158
+
159
+ # Checks equality by comparing each attribute.
160
+ # @param [Object] Object to be compared
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ preferences == o.preferences &&
165
+ notifications == o.notifications &&
166
+ sub_notifications == o.sub_notifications
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Integer] Hash code
177
+ def hash
178
+ [preferences, notifications, sub_notifications].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def self.build_from_hash(attributes)
185
+ return nil unless attributes.is_a?(Hash)
186
+ attributes = attributes.transform_keys(&:to_sym)
187
+ transformed_hash = {}
188
+ openapi_types.each_pair do |key, type|
189
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = nil
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[attribute_map[key]].is_a?(Array)
195
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
+ end
197
+ elsif !attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
199
+ end
200
+ end
201
+ new(transformed_hash)
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ end
221
+
222
+ end