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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40cafa3ce26c9605c65945ea74595afba080c5f42b7c2b36d53239af28b1f787
4
- data.tar.gz: '0293e3b14abf37454a19a01b8bf4b99a81954d1ce25de5d74c2069a1051f5de2'
3
+ metadata.gz: b30d37411f27d79cbd5c9541640ec5013add89c8447dad19ded7b4e4b6d3c13f
4
+ data.tar.gz: d30611b7e1ec201d1102b8e1e3e19288251d9d351be6f86839bdbe8165ceca70
5
5
  SHA512:
6
- metadata.gz: a8ec073c59824edddeeb8513cc19aed931decce493f68977dcde7a6e76d2b2e86830dad019cece0968c3d41f0b53cc2ed43f575b63a36f6c90ec99027ed4575d
7
- data.tar.gz: 20c29536635b87114a1fd455fee66ecb1338b6c92fa2d5dedd9bd89cb0117afbc626be124cbd43db4acf45960edabb72d80f303567066ecc506b380f67d818de
6
+ metadata.gz: 4f3d88eb47c1fb8c237a182c90da949ae67abca0e94473d14d00655179cf8c28886af268ad652bbf0190823cd765636ee6ff94ad877b9e73a264f983113dcd9f
7
+ data.tar.gz: 95d5fb3de513033b099218f1e3537cd69872ce1e3a5fb1b36f92c49108104836208281d9589c09f35c832c1606b3b27af320479a08250fc9deb501025cfa5632
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pingram (1.0.33)
4
+ pingram (1.0.34)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -74,122 +74,6 @@ module Pingram
74
74
  return data, status_code, headers
75
75
  end
76
76
 
77
- # Get in-app notifications for a user
78
- # @param [Hash] opts the optional parameters
79
- # @option opts [String] :before Timestamp or ISO date to fetch notifications before
80
- # @option opts [Float] :count Number of notifications to return (default 10)
81
- # @return [GetInappNotificationsResponse]
82
- def user_get_in_app_notifications(opts = {})
83
- data, _status_code, _headers = user_get_in_app_notifications_with_http_info(opts)
84
- data
85
- end
86
-
87
- # Get in-app notifications for a user
88
- # @param [Hash] opts the optional parameters
89
- # @option opts [String] :before Timestamp or ISO date to fetch notifications before
90
- # @option opts [Float] :count Number of notifications to return (default 10)
91
- # @return [Array<(GetInappNotificationsResponse, Integer, Hash)>] GetInappNotificationsResponse data, response status code and response headers
92
- def user_get_in_app_notifications_with_http_info(opts = {})
93
- if @api_client.config.debugging
94
- @api_client.config.logger.debug 'Calling API: UserApi.user_get_in_app_notifications ...'
95
- end
96
- # resource path
97
- local_var_path = '/user/inapp'
98
-
99
- # query parameters
100
- query_params = opts[:query_params] || {}
101
- query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
102
- query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
103
-
104
- # header parameters
105
- header_params = opts[:header_params] || {}
106
- # HTTP header 'Accept' (if needed)
107
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
108
-
109
- # form parameters
110
- form_params = opts[:form_params] || {}
111
-
112
- # http body (model)
113
- post_body = opts[:debug_body]
114
-
115
- # return_type
116
- return_type = opts[:debug_return_type] || 'GetInappNotificationsResponse'
117
-
118
- # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
119
- auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
120
-
121
- new_options = opts.merge(
122
- :operation => :"UserApi.user_get_in_app_notifications",
123
- :header_params => header_params,
124
- :query_params => query_params,
125
- :form_params => form_params,
126
- :body => post_body,
127
- :auth_names => auth_names,
128
- :return_type => return_type
129
- )
130
-
131
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
132
- if @api_client.config.debugging
133
- @api_client.config.logger.debug "API called: UserApi#user_get_in_app_notifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
134
- end
135
- return data, status_code, headers
136
- end
137
-
138
- # Get the count of unread in-app notifications for a user
139
- # @param [Hash] opts the optional parameters
140
- # @return [InappUnreadCountResponse]
141
- def user_get_in_app_unread_count(opts = {})
142
- data, _status_code, _headers = user_get_in_app_unread_count_with_http_info(opts)
143
- data
144
- end
145
-
146
- # Get the count of unread in-app notifications for a user
147
- # @param [Hash] opts the optional parameters
148
- # @return [Array<(InappUnreadCountResponse, Integer, Hash)>] InappUnreadCountResponse data, response status code and response headers
149
- def user_get_in_app_unread_count_with_http_info(opts = {})
150
- if @api_client.config.debugging
151
- @api_client.config.logger.debug 'Calling API: UserApi.user_get_in_app_unread_count ...'
152
- end
153
- # resource path
154
- local_var_path = '/user/inapp/unread'
155
-
156
- # query parameters
157
- query_params = opts[:query_params] || {}
158
-
159
- # header parameters
160
- header_params = opts[:header_params] || {}
161
- # HTTP header 'Accept' (if needed)
162
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
163
-
164
- # form parameters
165
- form_params = opts[:form_params] || {}
166
-
167
- # http body (model)
168
- post_body = opts[:debug_body]
169
-
170
- # return_type
171
- return_type = opts[:debug_return_type] || 'InappUnreadCountResponse'
172
-
173
- # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
174
- auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
175
-
176
- new_options = opts.merge(
177
- :operation => :"UserApi.user_get_in_app_unread_count",
178
- :header_params => header_params,
179
- :query_params => query_params,
180
- :form_params => form_params,
181
- :body => post_body,
182
- :auth_names => auth_names,
183
- :return_type => return_type
184
- )
185
-
186
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
187
- if @api_client.config.debugging
188
- @api_client.config.logger.debug "API called: UserApi#user_get_in_app_unread_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
- end
190
- return data, status_code, headers
191
- end
192
-
193
77
  # Get a user by ID. All users exist implicitly, returns basic user object if not found in DB.
194
78
  # @param user_id [String] User ID
195
79
  # @param [Hash] opts the optional parameters
@@ -322,137 +206,5 @@ module Pingram
322
206
  end
323
207
  return data, status_code, headers
324
208
  end
325
-
326
- # Mark in-app web notifications as seen/read for a user
327
- # @param in_app_notification_unread_clear_request [InAppNotificationUnreadClearRequest]
328
- # @param [Hash] opts the optional parameters
329
- # @return [SuccessResponse]
330
- def user_mark_in_app_notifications_as_seen(in_app_notification_unread_clear_request, opts = {})
331
- data, _status_code, _headers = user_mark_in_app_notifications_as_seen_with_http_info(in_app_notification_unread_clear_request, opts)
332
- data
333
- end
334
-
335
- # Mark in-app web notifications as seen/read for a user
336
- # @param in_app_notification_unread_clear_request [InAppNotificationUnreadClearRequest]
337
- # @param [Hash] opts the optional parameters
338
- # @return [Array<(SuccessResponse, Integer, Hash)>] SuccessResponse data, response status code and response headers
339
- def user_mark_in_app_notifications_as_seen_with_http_info(in_app_notification_unread_clear_request, opts = {})
340
- if @api_client.config.debugging
341
- @api_client.config.logger.debug 'Calling API: UserApi.user_mark_in_app_notifications_as_seen ...'
342
- end
343
- # verify the required parameter 'in_app_notification_unread_clear_request' is set
344
- if @api_client.config.client_side_validation && in_app_notification_unread_clear_request.nil?
345
- fail ArgumentError, "Missing the required parameter 'in_app_notification_unread_clear_request' when calling UserApi.user_mark_in_app_notifications_as_seen"
346
- end
347
- # resource path
348
- local_var_path = '/user/inapp/unread'
349
-
350
- # query parameters
351
- query_params = opts[:query_params] || {}
352
-
353
- # header parameters
354
- header_params = opts[:header_params] || {}
355
- # HTTP header 'Accept' (if needed)
356
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
357
- # HTTP header 'Content-Type'
358
- content_type = @api_client.select_header_content_type(['application/json'])
359
- if !content_type.nil?
360
- header_params['Content-Type'] = content_type
361
- end
362
-
363
- # form parameters
364
- form_params = opts[:form_params] || {}
365
-
366
- # http body (model)
367
- post_body = opts[:debug_body] || @api_client.object_to_http_body(in_app_notification_unread_clear_request)
368
-
369
- # return_type
370
- return_type = opts[:debug_return_type] || 'SuccessResponse'
371
-
372
- # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
373
- auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
374
-
375
- new_options = opts.merge(
376
- :operation => :"UserApi.user_mark_in_app_notifications_as_seen",
377
- :header_params => header_params,
378
- :query_params => query_params,
379
- :form_params => form_params,
380
- :body => post_body,
381
- :auth_names => auth_names,
382
- :return_type => return_type
383
- )
384
-
385
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
386
- if @api_client.config.debugging
387
- @api_client.config.logger.debug "API called: UserApi#user_mark_in_app_notifications_as_seen\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
388
- end
389
- return data, status_code, headers
390
- end
391
-
392
- # Update in-app web notification status (opened, archived, clicked, etc.)
393
- # @param in_app_notification_patch_request [InAppNotificationPatchRequest]
394
- # @param [Hash] opts the optional parameters
395
- # @return [SuccessResponse]
396
- def user_update_in_app_notification_status(in_app_notification_patch_request, opts = {})
397
- data, _status_code, _headers = user_update_in_app_notification_status_with_http_info(in_app_notification_patch_request, opts)
398
- data
399
- end
400
-
401
- # Update in-app web notification status (opened, archived, clicked, etc.)
402
- # @param in_app_notification_patch_request [InAppNotificationPatchRequest]
403
- # @param [Hash] opts the optional parameters
404
- # @return [Array<(SuccessResponse, Integer, Hash)>] SuccessResponse data, response status code and response headers
405
- def user_update_in_app_notification_status_with_http_info(in_app_notification_patch_request, opts = {})
406
- if @api_client.config.debugging
407
- @api_client.config.logger.debug 'Calling API: UserApi.user_update_in_app_notification_status ...'
408
- end
409
- # verify the required parameter 'in_app_notification_patch_request' is set
410
- if @api_client.config.client_side_validation && in_app_notification_patch_request.nil?
411
- fail ArgumentError, "Missing the required parameter 'in_app_notification_patch_request' when calling UserApi.user_update_in_app_notification_status"
412
- end
413
- # resource path
414
- local_var_path = '/user/inapp'
415
-
416
- # query parameters
417
- query_params = opts[:query_params] || {}
418
-
419
- # header parameters
420
- header_params = opts[:header_params] || {}
421
- # HTTP header 'Accept' (if needed)
422
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
423
- # HTTP header 'Content-Type'
424
- content_type = @api_client.select_header_content_type(['application/json'])
425
- if !content_type.nil?
426
- header_params['Content-Type'] = content_type
427
- end
428
-
429
- # form parameters
430
- form_params = opts[:form_params] || {}
431
-
432
- # http body (model)
433
- post_body = opts[:debug_body] || @api_client.object_to_http_body(in_app_notification_patch_request)
434
-
435
- # return_type
436
- return_type = opts[:debug_return_type] || 'SuccessResponse'
437
-
438
- # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
439
- auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
440
-
441
- new_options = opts.merge(
442
- :operation => :"UserApi.user_update_in_app_notification_status",
443
- :header_params => header_params,
444
- :query_params => query_params,
445
- :form_params => form_params,
446
- :body => post_body,
447
- :auth_names => auth_names,
448
- :return_type => return_type
449
- )
450
-
451
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
452
- if @api_client.config.debugging
453
- @api_client.config.logger.debug "API called: UserApi#user_update_in_app_notification_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
454
- end
455
- return data, status_code, headers
456
- end
457
209
  end
458
210
  end
@@ -32,7 +32,7 @@ module Pingram
32
32
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
33
33
  def initialize(config = Configuration.default)
34
34
  @config = config
35
- @user_agent = "pingram-ruby/1.0.33"
35
+ @user_agent = "pingram-ruby/1.0.34"
36
36
  @default_headers = {
37
37
  'Content-Type' => 'application/json',
38
38
  'User-Agent' => @user_agent
@@ -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