pingram 1.0.36 → 1.0.38

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/pingram/api/account_api.rb +244 -2
  4. data/lib/pingram/api/library_api.rb +2 -2
  5. data/lib/pingram/api/logs_api.rb +61 -0
  6. data/lib/pingram/api/profile_api.rb +0 -66
  7. data/lib/pingram/api/webhooks_api.rb +4 -4
  8. data/lib/pingram/api_client.rb +1 -1
  9. data/lib/pingram/models/account_get_response.rb +13 -4
  10. data/lib/pingram/models/account_get_response_billing_alerts.rb +224 -0
  11. data/lib/pingram/models/account_patch_request.rb +13 -4
  12. data/lib/pingram/models/billing_email.rb +177 -0
  13. data/lib/pingram/models/billing_post_response_body.rb +10 -1
  14. data/lib/pingram/models/cancel_subscription_request.rb +168 -0
  15. data/lib/pingram/models/{change_email_request.rb → confirm_change_email_request.rb} +19 -19
  16. data/lib/pingram/models/create_library_request.rb +1 -1
  17. data/lib/pingram/models/get_logs_response_messages_inner.rb +4 -0
  18. data/lib/pingram/models/get_logs_response_messages_inner_attachments_inner.rb +52 -4
  19. data/lib/pingram/models/logs_get_response_logs_inner.rb +60 -1
  20. data/lib/pingram/models/phone_verify_start_response.rb +14 -4
  21. data/lib/pingram/models/sender_post_body_sms.rb +1 -1
  22. data/lib/pingram/models/sender_post_body_sms_auto_reply.rb +2 -1
  23. data/lib/pingram/models/slack_connect_invite_response.rb +190 -0
  24. data/lib/pingram/models/start_change_email_request.rb +201 -0
  25. data/lib/pingram/models/update_billing_email_request.rb +184 -0
  26. data/lib/pingram/models/webhook_endpoint_upsert_request.rb +1 -1
  27. data/lib/pingram/models/webhook_event.rb +88 -6
  28. data/lib/pingram/models/webhook_event_usage_value.rb +193 -0
  29. data/lib/pingram/version.rb +1 -1
  30. data/lib/pingram.rb +8 -1
  31. data/vendor/bundle/ruby/3.2.0/cache/date-3.6.0.gem +0 -0
  32. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  33. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.6.0/date_core.so +0 -0
  34. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.6.0/gem_make.out +26 -0
  35. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{date-3.5.1 → date-3.6.0}/mkmf.log +55 -2
  36. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/gem_make.out +5 -5
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/mkmf.log +3 -3
  38. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  39. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  40. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  41. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  42. data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/Makefile +1 -1
  43. data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_core.c +293 -77
  44. data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_parse.c +14 -4
  45. data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strptime.c +13 -13
  46. data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/extconf.rb +6 -0
  47. data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/lib/date.rb +1 -1
  48. data/vendor/bundle/ruby/3.2.0/gems/date-3.6.0/lib/date_core.so +0 -0
  49. data/vendor/bundle/ruby/3.2.0/specifications/{date-3.5.1.gemspec → date-3.6.0.gemspec} +3 -3
  50. metadata +31 -24
  51. data/vendor/bundle/ruby/3.2.0/cache/date-3.5.1.gem +0 -0
  52. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/date_core.so +0 -0
  53. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +0 -24
  54. data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/lib/date_core.so +0 -0
  55. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{date-3.5.1 → date-3.6.0}/gem.build_complete +0 -0
  56. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/BSDL +0 -0
  57. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/COPYING +0 -0
  58. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/README.md +0 -0
  59. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strftime.c +0 -0
  60. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_tmx.h +0 -0
  61. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/prereq.mk +0 -0
  62. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.h +0 -0
  63. /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.list +0 -0
@@ -0,0 +1,224 @@
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
+ # Email alerts for monthly usage. New accounts start enabled for the creator at 80% and 100%.
18
+ class AccountGetResponseBillingAlerts < ApiModelBase
19
+ # When false, saved addresses and thresholds are kept but no email is sent.
20
+ attr_accessor :enabled
21
+
22
+ # Addresses that receive threshold emails. At most three.
23
+ attr_accessor :emails
24
+
25
+ # Percents to email, from 5 to 100 in steps of 5. At most two. At least one is required while enabled.
26
+ attr_accessor :thresholds
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'enabled' => :'enabled',
32
+ :'emails' => :'emails',
33
+ :'thresholds' => :'thresholds'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'enabled' => :'Boolean',
51
+ :'emails' => :'Array<String>',
52
+ :'thresholds' => :'Array<Float>'
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::AccountGetResponseBillingAlerts` 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::AccountGetResponseBillingAlerts`. 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?(:'enabled')
79
+ self.enabled = attributes[:'enabled']
80
+ else
81
+ self.enabled = nil
82
+ end
83
+
84
+ if attributes.key?(:'emails')
85
+ if (value = attributes[:'emails']).is_a?(Array)
86
+ self.emails = value
87
+ end
88
+ else
89
+ self.emails = nil
90
+ end
91
+
92
+ if attributes.key?(:'thresholds')
93
+ if (value = attributes[:'thresholds']).is_a?(Array)
94
+ self.thresholds = value
95
+ end
96
+ else
97
+ self.thresholds = nil
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
+ invalid_properties = Array.new
106
+ if @enabled.nil?
107
+ invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
108
+ end
109
+
110
+ if @emails.nil?
111
+ invalid_properties.push('invalid value for "emails", emails cannot be nil.')
112
+ end
113
+
114
+ if @thresholds.nil?
115
+ invalid_properties.push('invalid value for "thresholds", thresholds cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @enabled.nil?
126
+ return false if @emails.nil?
127
+ return false if @thresholds.nil?
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] enabled Value to be assigned
133
+ def enabled=(enabled)
134
+ if enabled.nil?
135
+ fail ArgumentError, 'enabled cannot be nil'
136
+ end
137
+
138
+ @enabled = enabled
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] emails Value to be assigned
143
+ def emails=(emails)
144
+ if emails.nil?
145
+ fail ArgumentError, 'emails cannot be nil'
146
+ end
147
+
148
+ @emails = emails
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] thresholds Value to be assigned
153
+ def thresholds=(thresholds)
154
+ if thresholds.nil?
155
+ fail ArgumentError, 'thresholds cannot be nil'
156
+ end
157
+
158
+ @thresholds = thresholds
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ enabled == o.enabled &&
167
+ emails == o.emails &&
168
+ thresholds == o.thresholds
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Integer] Hash code
179
+ def hash
180
+ [enabled, emails, thresholds].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def self.build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ attributes = attributes.transform_keys(&:to_sym)
189
+ transformed_hash = {}
190
+ openapi_types.each_pair do |key, type|
191
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = nil
193
+ elsif type =~ /\AArray<(.*)>/i
194
+ # check to ensure the input is an array given that the attribute
195
+ # is documented as an array but the input is not
196
+ if attributes[attribute_map[key]].is_a?(Array)
197
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
198
+ end
199
+ elsif !attributes[attribute_map[key]].nil?
200
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
201
+ end
202
+ end
203
+ new(transformed_hash)
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ end
223
+
224
+ end
@@ -19,10 +19,13 @@ module Pingram
19
19
  # When true, automatically move up one budget tier at 90% of the monthly budget.
20
20
  attr_accessor :auto_upgrade
21
21
 
22
+ attr_accessor :billing_alerts
23
+
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
23
25
  def self.attribute_map
24
26
  {
25
- :'auto_upgrade' => :'autoUpgrade'
27
+ :'auto_upgrade' => :'autoUpgrade',
28
+ :'billing_alerts' => :'billingAlerts'
26
29
  }
27
30
  end
28
31
 
@@ -39,7 +42,8 @@ module Pingram
39
42
  # Attribute type mapping.
40
43
  def self.openapi_types
41
44
  {
42
- :'auto_upgrade' => :'Boolean'
45
+ :'auto_upgrade' => :'Boolean',
46
+ :'billing_alerts' => :'AccountGetResponseBillingAlerts'
43
47
  }
44
48
  end
45
49
 
@@ -68,6 +72,10 @@ module Pingram
68
72
  if attributes.key?(:'auto_upgrade')
69
73
  self.auto_upgrade = attributes[:'auto_upgrade']
70
74
  end
75
+
76
+ if attributes.key?(:'billing_alerts')
77
+ self.billing_alerts = attributes[:'billing_alerts']
78
+ end
71
79
  end
72
80
 
73
81
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -90,7 +98,8 @@ module Pingram
90
98
  def ==(o)
91
99
  return true if self.equal?(o)
92
100
  self.class == o.class &&
93
- auto_upgrade == o.auto_upgrade
101
+ auto_upgrade == o.auto_upgrade &&
102
+ billing_alerts == o.billing_alerts
94
103
  end
95
104
 
96
105
  # @see the `==` method
@@ -102,7 +111,7 @@ module Pingram
102
111
  # Calculates hash code according to all attributes.
103
112
  # @return [Integer] Hash code
104
113
  def hash
105
- [auto_upgrade].hash
114
+ [auto_upgrade, billing_alerts].hash
106
115
  end
107
116
 
108
117
  # Builds the object from hash
@@ -0,0 +1,177 @@
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
+ # GET/PATCH /account/billing-email response.
18
+ class BillingEmail < ApiModelBase
19
+ # Address that receives invoices and receipts.
20
+ attr_accessor :email
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'email' => :'email'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'email' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::BillingEmail` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::BillingEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'email')
69
+ self.email = attributes[:'email']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if !@email.nil? && @email.to_s.length > 320
79
+ invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 320.')
80
+ end
81
+
82
+ if !@email.nil? && @email.to_s.length < 3
83
+ invalid_properties.push('invalid value for "email", the character length must be greater than or equal to 3.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if !@email.nil? && @email.to_s.length > 320
94
+ return false if !@email.nil? && @email.to_s.length < 3
95
+ true
96
+ end
97
+
98
+ # Custom attribute writer method with validation
99
+ # @param [Object] email Value to be assigned
100
+ def email=(email)
101
+ if email.nil?
102
+ fail ArgumentError, 'email cannot be nil'
103
+ end
104
+
105
+ if email.to_s.length > 320
106
+ fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 320.'
107
+ end
108
+
109
+ if email.to_s.length < 3
110
+ fail ArgumentError, 'invalid value for "email", the character length must be greater than or equal to 3.'
111
+ end
112
+
113
+ @email = email
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ email == o.email
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [email].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ if value.nil?
166
+ is_nullable = self.class.openapi_nullable.include?(attr)
167
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
168
+ end
169
+
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ end
176
+
177
+ end
@@ -55,6 +55,8 @@ module Pingram
55
55
  # When true, paid accounts move up one budget tier at 90% of the monthly budget.
56
56
  attr_accessor :auto_upgrade
57
57
 
58
+ attr_accessor :billing_alerts
59
+
58
60
  attr_accessor :session_id
59
61
 
60
62
  attr_accessor :url
@@ -102,6 +104,7 @@ module Pingram
102
104
  :'pending_downgrade_cost_cap' => :'pendingDowngradeCostCap',
103
105
  :'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
104
106
  :'auto_upgrade' => :'autoUpgrade',
107
+ :'billing_alerts' => :'billingAlerts',
105
108
  :'session_id' => :'sessionId',
106
109
  :'url' => :'url'
107
110
  }
@@ -138,6 +141,7 @@ module Pingram
138
141
  :'pending_downgrade_cost_cap' => :'Float',
139
142
  :'pending_downgrade_account_type' => :'String',
140
143
  :'auto_upgrade' => :'Boolean',
144
+ :'billing_alerts' => :'AccountGetResponseBillingAlerts',
141
145
  :'session_id' => :'String',
142
146
  :'url' => :'String'
143
147
  }
@@ -252,6 +256,10 @@ module Pingram
252
256
  self.auto_upgrade = attributes[:'auto_upgrade']
253
257
  end
254
258
 
259
+ if attributes.key?(:'billing_alerts')
260
+ self.billing_alerts = attributes[:'billing_alerts']
261
+ end
262
+
255
263
  if attributes.key?(:'session_id')
256
264
  self.session_id = attributes[:'session_id']
257
265
  end
@@ -454,6 +462,7 @@ module Pingram
454
462
  pending_downgrade_cost_cap == o.pending_downgrade_cost_cap &&
455
463
  pending_downgrade_account_type == o.pending_downgrade_account_type &&
456
464
  auto_upgrade == o.auto_upgrade &&
465
+ billing_alerts == o.billing_alerts &&
457
466
  session_id == o.session_id &&
458
467
  url == o.url
459
468
  end
@@ -467,7 +476,7 @@ module Pingram
467
476
  # Calculates hash code according to all attributes.
468
477
  # @return [Integer] Hash code
469
478
  def hash
470
- [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type, auto_upgrade, session_id, url].hash
479
+ [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type, auto_upgrade, billing_alerts, session_id, url].hash
471
480
  end
472
481
 
473
482
  # Builds the object from hash
@@ -0,0 +1,168 @@
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
+ # POST /account/subscription/cancel request.
18
+ class CancelSubscriptionRequest < ApiModelBase
19
+ # Optional note about why you are canceling. Helps us improve the product.
20
+ attr_accessor :reason
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'reason' => :'reason'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'reason' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CancelSubscriptionRequest` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CancelSubscriptionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'reason')
69
+ self.reason = attributes[:'reason']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if !@reason.nil? && @reason.to_s.length > 5000
79
+ invalid_properties.push('invalid value for "reason", the character length must be smaller than or equal to 5000.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if !@reason.nil? && @reason.to_s.length > 5000
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] reason Value to be assigned
95
+ def reason=(reason)
96
+ if reason.nil?
97
+ fail ArgumentError, 'reason cannot be nil'
98
+ end
99
+
100
+ if reason.to_s.length > 5000
101
+ fail ArgumentError, 'invalid value for "reason", the character length must be smaller than or equal to 5000.'
102
+ end
103
+
104
+ @reason = reason
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ reason == o.reason
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [reason].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end