pingram 1.0.33 → 1.0.35

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/pingram/api/account_api.rb +5 -2
  4. data/lib/pingram/api/user_api.rb +0 -248
  5. data/lib/pingram/api/webhooks_api.rb +12 -12
  6. data/lib/pingram/api_client.rb +1 -1
  7. data/lib/pingram/models/create_account_request_plan.rb +2 -2
  8. data/lib/pingram/models/get_usage_history_query.rb +14 -4
  9. data/lib/pingram/models/get_usage_history_response.rb +1 -1
  10. data/lib/pingram/models/get_usage_history_response_items_inner.rb +1 -1
  11. data/lib/pingram/models/user_preferences_get_response.rb +222 -0
  12. data/lib/pingram/models/user_preferences_get_response_notifications_inner.rb +227 -0
  13. data/lib/pingram/models/user_preferences_get_response_preferences_inner.rb +249 -0
  14. data/lib/pingram/models/user_preferences_get_response_sub_notifications_inner.rb +216 -0
  15. data/lib/pingram/models/user_preferences_post_request_inner.rb +268 -0
  16. data/lib/pingram/models/user_preferences_post_response_inner.rb +253 -0
  17. data/lib/pingram/models/user_preferences_post_response_inner_channels_states_inner.rb +240 -0
  18. data/lib/pingram/models/webhook_endpoint.rb +3 -3
  19. data/lib/pingram/models/webhook_endpoint_upsert_request.rb +2 -2
  20. data/lib/pingram/models/webhook_endpoints_response_endpoints_inner.rb +3 -3
  21. data/lib/pingram/version.rb +1 -1
  22. data/lib/pingram.rb +7 -0
  23. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  24. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  25. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/gem_make.out +5 -5
  26. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/mkmf.log +3 -3
  27. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  28. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  29. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  30. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  31. metadata +9 -2
@@ -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
@@ -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