pingram 1.0.33 → 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 (22) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/pingram/api/user_api.rb +0 -248
  4. data/lib/pingram/api_client.rb +1 -1
  5. data/lib/pingram/models/user_preferences_get_response.rb +222 -0
  6. data/lib/pingram/models/user_preferences_get_response_notifications_inner.rb +227 -0
  7. data/lib/pingram/models/user_preferences_get_response_preferences_inner.rb +249 -0
  8. data/lib/pingram/models/user_preferences_get_response_sub_notifications_inner.rb +216 -0
  9. data/lib/pingram/models/user_preferences_post_request_inner.rb +268 -0
  10. data/lib/pingram/models/user_preferences_post_response_inner.rb +253 -0
  11. data/lib/pingram/models/user_preferences_post_response_inner_channels_states_inner.rb +240 -0
  12. data/lib/pingram/version.rb +1 -1
  13. data/lib/pingram.rb +7 -0
  14. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  15. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  16. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/gem_make.out +5 -5
  17. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/mkmf.log +3 -3
  18. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  19. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  20. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  21. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  22. metadata +9 -2
@@ -0,0 +1,227 @@
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 UserPreferencesGETResponseNotificationsInner < ApiModelBase
18
+ attr_accessor :notification_id
19
+
20
+ attr_accessor :title
21
+
22
+ attr_accessor :channels
23
+
24
+ attr_accessor :options
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'notification_id' => :'notificationId',
30
+ :'title' => :'title',
31
+ :'channels' => :'channels',
32
+ :'options' => :'options'
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_id' => :'String',
50
+ :'title' => :'String',
51
+ :'channels' => :'Array<ChannelsEnum>',
52
+ :'options' => :'GetNotificationsResponseInnerOptions'
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::UserPreferencesGETResponseNotificationsInner` 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::UserPreferencesGETResponseNotificationsInner`. 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_id')
79
+ self.notification_id = attributes[:'notification_id']
80
+ else
81
+ self.notification_id = nil
82
+ end
83
+
84
+ if attributes.key?(:'title')
85
+ self.title = attributes[:'title']
86
+ else
87
+ self.title = nil
88
+ end
89
+
90
+ if attributes.key?(:'channels')
91
+ if (value = attributes[:'channels']).is_a?(Array)
92
+ self.channels = value
93
+ end
94
+ else
95
+ self.channels = nil
96
+ end
97
+
98
+ if attributes.key?(:'options')
99
+ self.options = attributes[:'options']
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_id.nil?
109
+ invalid_properties.push('invalid value for "notification_id", notification_id cannot be nil.')
110
+ end
111
+
112
+ if @title.nil?
113
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
114
+ end
115
+
116
+ if @channels.nil?
117
+ invalid_properties.push('invalid value for "channels", channels cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @notification_id.nil?
128
+ return false if @title.nil?
129
+ return false if @channels.nil?
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] notification_id Value to be assigned
135
+ def notification_id=(notification_id)
136
+ if notification_id.nil?
137
+ fail ArgumentError, 'notification_id cannot be nil'
138
+ end
139
+
140
+ @notification_id = notification_id
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] title Value to be assigned
145
+ def title=(title)
146
+ if title.nil?
147
+ fail ArgumentError, 'title cannot be nil'
148
+ end
149
+
150
+ @title = title
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] channels Value to be assigned
155
+ def channels=(channels)
156
+ if channels.nil?
157
+ fail ArgumentError, 'channels cannot be nil'
158
+ end
159
+
160
+ @channels = channels
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ notification_id == o.notification_id &&
169
+ title == o.title &&
170
+ channels == o.channels &&
171
+ options == o.options
172
+ end
173
+
174
+ # @see the `==` method
175
+ # @param [Object] Object to be compared
176
+ def eql?(o)
177
+ self == o
178
+ end
179
+
180
+ # Calculates hash code according to all attributes.
181
+ # @return [Integer] Hash code
182
+ def hash
183
+ [notification_id, title, channels, options].hash
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def self.build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ attributes = attributes.transform_keys(&:to_sym)
192
+ transformed_hash = {}
193
+ openapi_types.each_pair do |key, type|
194
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = nil
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[attribute_map[key]].is_a?(Array)
200
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
201
+ end
202
+ elsif !attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
204
+ end
205
+ end
206
+ new(transformed_hash)
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -0,0 +1,249 @@
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 UserPreferencesGETResponsePreferencesInner < ApiModelBase
18
+ attr_accessor :notification_id
19
+
20
+ attr_accessor :channel
21
+
22
+ attr_accessor :delivery
23
+
24
+ attr_accessor :sub_notification_id
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'notification_id' => :'notificationId',
52
+ :'channel' => :'channel',
53
+ :'delivery' => :'delivery',
54
+ :'sub_notification_id' => :'subNotificationId'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'notification_id' => :'String',
72
+ :'channel' => :'ChannelsEnum',
73
+ :'delivery' => :'String',
74
+ :'sub_notification_id' => :'String'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::UserPreferencesGETResponsePreferencesInner` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::UserPreferencesGETResponsePreferencesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'notification_id')
101
+ self.notification_id = attributes[:'notification_id']
102
+ else
103
+ self.notification_id = nil
104
+ end
105
+
106
+ if attributes.key?(:'channel')
107
+ self.channel = attributes[:'channel']
108
+ else
109
+ self.channel = nil
110
+ end
111
+
112
+ if attributes.key?(:'delivery')
113
+ self.delivery = attributes[:'delivery']
114
+ else
115
+ self.delivery = nil
116
+ end
117
+
118
+ if attributes.key?(:'sub_notification_id')
119
+ self.sub_notification_id = attributes[:'sub_notification_id']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @notification_id.nil?
129
+ invalid_properties.push('invalid value for "notification_id", notification_id cannot be nil.')
130
+ end
131
+
132
+ if @channel.nil?
133
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
134
+ end
135
+
136
+ if @delivery.nil?
137
+ invalid_properties.push('invalid value for "delivery", delivery cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @notification_id.nil?
148
+ return false if @channel.nil?
149
+ return false if @delivery.nil?
150
+ delivery_validator = EnumAttributeValidator.new('String', ["off", "instant", "hourly", "daily", "weekly", "monthly"])
151
+ return false unless delivery_validator.valid?(@delivery)
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] notification_id Value to be assigned
157
+ def notification_id=(notification_id)
158
+ if notification_id.nil?
159
+ fail ArgumentError, 'notification_id cannot be nil'
160
+ end
161
+
162
+ @notification_id = notification_id
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] channel Value to be assigned
167
+ def channel=(channel)
168
+ if channel.nil?
169
+ fail ArgumentError, 'channel cannot be nil'
170
+ end
171
+
172
+ @channel = channel
173
+ end
174
+
175
+ # Custom attribute writer method checking allowed values (enum).
176
+ # @param [Object] delivery Object to be assigned
177
+ def delivery=(delivery)
178
+ validator = EnumAttributeValidator.new('String', ["off", "instant", "hourly", "daily", "weekly", "monthly"])
179
+ unless validator.valid?(delivery)
180
+ fail ArgumentError, "invalid value for \"delivery\", must be one of #{validator.allowable_values}."
181
+ end
182
+ @delivery = delivery
183
+ end
184
+
185
+ # Checks equality by comparing each attribute.
186
+ # @param [Object] Object to be compared
187
+ def ==(o)
188
+ return true if self.equal?(o)
189
+ self.class == o.class &&
190
+ notification_id == o.notification_id &&
191
+ channel == o.channel &&
192
+ delivery == o.delivery &&
193
+ sub_notification_id == o.sub_notification_id
194
+ end
195
+
196
+ # @see the `==` method
197
+ # @param [Object] Object to be compared
198
+ def eql?(o)
199
+ self == o
200
+ end
201
+
202
+ # Calculates hash code according to all attributes.
203
+ # @return [Integer] Hash code
204
+ def hash
205
+ [notification_id, channel, delivery, sub_notification_id].hash
206
+ end
207
+
208
+ # Builds the object from hash
209
+ # @param [Hash] attributes Model attributes in the form of hash
210
+ # @return [Object] Returns the model itself
211
+ def self.build_from_hash(attributes)
212
+ return nil unless attributes.is_a?(Hash)
213
+ attributes = attributes.transform_keys(&:to_sym)
214
+ transformed_hash = {}
215
+ openapi_types.each_pair do |key, type|
216
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = nil
218
+ elsif type =~ /\AArray<(.*)>/i
219
+ # check to ensure the input is an array given that the attribute
220
+ # is documented as an array but the input is not
221
+ if attributes[attribute_map[key]].is_a?(Array)
222
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
223
+ end
224
+ elsif !attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
226
+ end
227
+ end
228
+ new(transformed_hash)
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ end
248
+
249
+ end
@@ -0,0 +1,216 @@
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 UserPreferencesGETResponseSubNotificationsInner < ApiModelBase
18
+ attr_accessor :notification_id
19
+
20
+ attr_accessor :sub_notification_id
21
+
22
+ attr_accessor :title
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'notification_id' => :'notificationId',
28
+ :'sub_notification_id' => :'subNotificationId',
29
+ :'title' => :'title'
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
+ :'notification_id' => :'String',
47
+ :'sub_notification_id' => :'String',
48
+ :'title' => :'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 `Pingram::UserPreferencesGETResponseSubNotificationsInner` 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::UserPreferencesGETResponseSubNotificationsInner`. 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?(:'notification_id')
75
+ self.notification_id = attributes[:'notification_id']
76
+ else
77
+ self.notification_id = nil
78
+ end
79
+
80
+ if attributes.key?(:'sub_notification_id')
81
+ self.sub_notification_id = attributes[:'sub_notification_id']
82
+ else
83
+ self.sub_notification_id = nil
84
+ end
85
+
86
+ if attributes.key?(:'title')
87
+ self.title = attributes[:'title']
88
+ else
89
+ self.title = 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 @notification_id.nil?
99
+ invalid_properties.push('invalid value for "notification_id", notification_id cannot be nil.')
100
+ end
101
+
102
+ if @sub_notification_id.nil?
103
+ invalid_properties.push('invalid value for "sub_notification_id", sub_notification_id cannot be nil.')
104
+ end
105
+
106
+ if @title.nil?
107
+ invalid_properties.push('invalid value for "title", title 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 @notification_id.nil?
118
+ return false if @sub_notification_id.nil?
119
+ return false if @title.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] notification_id Value to be assigned
125
+ def notification_id=(notification_id)
126
+ if notification_id.nil?
127
+ fail ArgumentError, 'notification_id cannot be nil'
128
+ end
129
+
130
+ @notification_id = notification_id
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] sub_notification_id Value to be assigned
135
+ def sub_notification_id=(sub_notification_id)
136
+ if sub_notification_id.nil?
137
+ fail ArgumentError, 'sub_notification_id cannot be nil'
138
+ end
139
+
140
+ @sub_notification_id = sub_notification_id
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] title Value to be assigned
145
+ def title=(title)
146
+ if title.nil?
147
+ fail ArgumentError, 'title cannot be nil'
148
+ end
149
+
150
+ @title = title
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
+ notification_id == o.notification_id &&
159
+ sub_notification_id == o.sub_notification_id &&
160
+ title == o.title
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
+ [notification_id, sub_notification_id, title].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