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