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