pingram 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/pingram/api/account_api.rb +55 -0
- data/lib/pingram/api/organization_api.rb +146 -0
- data/lib/pingram/api/webhooks_api.rb +196 -0
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/client_wrapper.rb +20 -0
- data/lib/pingram/models/account_get_response.rb +15 -92
- data/lib/pingram/models/billing_post_request_body.rb +18 -24
- data/lib/pingram/models/billing_post_response_body.rb +285 -63
- data/lib/pingram/models/events_webhook_response.rb +234 -0
- data/lib/pingram/models/events_webhook_upsert_request.rb +207 -0
- data/lib/pingram/models/{account_get_response_pending_downgrade_usage_limit.rb → get_usage_history_query.rb} +53 -61
- data/lib/pingram/models/logs_get_response_logs_inner.rb +76 -1
- data/lib/pingram/models/organization.rb +590 -0
- data/lib/pingram/models/organization_usage.rb +330 -0
- data/lib/pingram/models/{billing_post_response_body_pending_downgrade_usage_limit.rb → organization_usage_history.rb} +31 -65
- data/lib/pingram/models/organization_usage_history_items_inner.rb +303 -0
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +9 -2
- metadata +11 -4
|
@@ -15,7 +15,11 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Pingram
|
|
17
17
|
class BillingPostRequestBody < ApiModelBase
|
|
18
|
-
|
|
18
|
+
# Price ID for the message tier (EMAIL, INAPP_WEB, WEB_PUSH, PUSH, SLACK)
|
|
19
|
+
attr_accessor :message_price_id
|
|
20
|
+
|
|
21
|
+
# Price ID for the budget tier (SMS, CALL)
|
|
22
|
+
attr_accessor :budget_price_id
|
|
19
23
|
|
|
20
24
|
attr_accessor :success_url
|
|
21
25
|
|
|
@@ -24,7 +28,8 @@ module Pingram
|
|
|
24
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
29
|
def self.attribute_map
|
|
26
30
|
{
|
|
27
|
-
:'
|
|
31
|
+
:'message_price_id' => :'messagePriceId',
|
|
32
|
+
:'budget_price_id' => :'budgetPriceId',
|
|
28
33
|
:'success_url' => :'successUrl',
|
|
29
34
|
:'cancel_url' => :'cancelUrl'
|
|
30
35
|
}
|
|
@@ -43,7 +48,8 @@ module Pingram
|
|
|
43
48
|
# Attribute type mapping.
|
|
44
49
|
def self.openapi_types
|
|
45
50
|
{
|
|
46
|
-
:'
|
|
51
|
+
:'message_price_id' => :'String',
|
|
52
|
+
:'budget_price_id' => :'String',
|
|
47
53
|
:'success_url' => :'String',
|
|
48
54
|
:'cancel_url' => :'String'
|
|
49
55
|
}
|
|
@@ -71,10 +77,12 @@ module Pingram
|
|
|
71
77
|
h[k.to_sym] = v
|
|
72
78
|
}
|
|
73
79
|
|
|
74
|
-
if attributes.key?(:'
|
|
75
|
-
self.
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
if attributes.key?(:'message_price_id')
|
|
81
|
+
self.message_price_id = attributes[:'message_price_id']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'budget_price_id')
|
|
85
|
+
self.budget_price_id = attributes[:'budget_price_id']
|
|
78
86
|
end
|
|
79
87
|
|
|
80
88
|
if attributes.key?(:'success_url')
|
|
@@ -95,10 +103,6 @@ module Pingram
|
|
|
95
103
|
def list_invalid_properties
|
|
96
104
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
97
105
|
invalid_properties = Array.new
|
|
98
|
-
if @price_id.nil?
|
|
99
|
-
invalid_properties.push('invalid value for "price_id", price_id cannot be nil.')
|
|
100
|
-
end
|
|
101
|
-
|
|
102
106
|
if @success_url.nil?
|
|
103
107
|
invalid_properties.push('invalid value for "success_url", success_url cannot be nil.')
|
|
104
108
|
end
|
|
@@ -114,22 +118,11 @@ module Pingram
|
|
|
114
118
|
# @return true if the model is valid
|
|
115
119
|
def valid?
|
|
116
120
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
-
return false if @price_id.nil?
|
|
118
121
|
return false if @success_url.nil?
|
|
119
122
|
return false if @cancel_url.nil?
|
|
120
123
|
true
|
|
121
124
|
end
|
|
122
125
|
|
|
123
|
-
# Custom attribute writer method with validation
|
|
124
|
-
# @param [Object] price_id Value to be assigned
|
|
125
|
-
def price_id=(price_id)
|
|
126
|
-
if price_id.nil?
|
|
127
|
-
fail ArgumentError, 'price_id cannot be nil'
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
@price_id = price_id
|
|
131
|
-
end
|
|
132
|
-
|
|
133
126
|
# Custom attribute writer method with validation
|
|
134
127
|
# @param [Object] success_url Value to be assigned
|
|
135
128
|
def success_url=(success_url)
|
|
@@ -155,7 +148,8 @@ module Pingram
|
|
|
155
148
|
def ==(o)
|
|
156
149
|
return true if self.equal?(o)
|
|
157
150
|
self.class == o.class &&
|
|
158
|
-
|
|
151
|
+
message_price_id == o.message_price_id &&
|
|
152
|
+
budget_price_id == o.budget_price_id &&
|
|
159
153
|
success_url == o.success_url &&
|
|
160
154
|
cancel_url == o.cancel_url
|
|
161
155
|
end
|
|
@@ -169,7 +163,7 @@ module Pingram
|
|
|
169
163
|
# Calculates hash code according to all attributes.
|
|
170
164
|
# @return [Integer] Hash code
|
|
171
165
|
def hash
|
|
172
|
-
[
|
|
166
|
+
[message_price_id, budget_price_id, success_url, cancel_url].hash
|
|
173
167
|
end
|
|
174
168
|
|
|
175
169
|
# Builds the object from hash
|
|
@@ -14,34 +14,55 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Pingram
|
|
17
|
+
# POST /billing response: account + merged usage limits (when present) + optional session.
|
|
17
18
|
class BillingPostResponseBody < ApiModelBase
|
|
18
|
-
attr_accessor :
|
|
19
|
+
attr_accessor :organization_id
|
|
19
20
|
|
|
20
|
-
attr_accessor :
|
|
21
|
+
attr_accessor :organization_type
|
|
22
|
+
|
|
23
|
+
attr_accessor :creator
|
|
21
24
|
|
|
22
|
-
attr_accessor :
|
|
25
|
+
attr_accessor :messages_cap
|
|
26
|
+
|
|
27
|
+
attr_accessor :cost_cap
|
|
23
28
|
|
|
24
29
|
attr_accessor :created_at
|
|
25
30
|
|
|
26
|
-
attr_accessor :
|
|
31
|
+
attr_accessor :updated_at
|
|
27
32
|
|
|
33
|
+
# ISO date (YYYY-MM-DD) when the billing cycle resets.
|
|
34
|
+
attr_accessor :anniversary_date
|
|
35
|
+
|
|
36
|
+
attr_accessor :allow_overage
|
|
37
|
+
|
|
38
|
+
attr_accessor :name
|
|
39
|
+
|
|
40
|
+
attr_accessor :sms_cap
|
|
41
|
+
|
|
42
|
+
attr_accessor :call_cap
|
|
43
|
+
|
|
44
|
+
# Stripe subscription ID.
|
|
28
45
|
attr_accessor :stripe_customer_id
|
|
29
46
|
|
|
30
47
|
attr_accessor :stripe_subscription_id
|
|
31
48
|
|
|
32
49
|
attr_accessor :subscription_status
|
|
33
50
|
|
|
34
|
-
#
|
|
35
|
-
attr_accessor :
|
|
51
|
+
# Verification status; internalCap applies when not 'verified'.
|
|
52
|
+
attr_accessor :status
|
|
53
|
+
|
|
54
|
+
attr_accessor :pending_downgrade_cost_cap
|
|
55
|
+
|
|
56
|
+
attr_accessor :pending_downgrade_messages_cap
|
|
57
|
+
|
|
58
|
+
attr_accessor :pending_downgrade_sms_cap
|
|
59
|
+
|
|
60
|
+
attr_accessor :pending_downgrade_call_cap
|
|
36
61
|
|
|
37
|
-
# ISO date (YYYY-MM-DD) when the pending downgrade takes effect
|
|
38
62
|
attr_accessor :pending_downgrade_effective_date
|
|
39
63
|
|
|
40
|
-
# The account type to switch to when downgrade takes effect
|
|
41
64
|
attr_accessor :pending_downgrade_account_type
|
|
42
65
|
|
|
43
|
-
attr_accessor :pending_downgrade_usage_limit
|
|
44
|
-
|
|
45
66
|
attr_accessor :session_id
|
|
46
67
|
|
|
47
68
|
attr_accessor :url
|
|
@@ -71,18 +92,28 @@ module Pingram
|
|
|
71
92
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
72
93
|
def self.attribute_map
|
|
73
94
|
{
|
|
74
|
-
:'
|
|
75
|
-
:'
|
|
76
|
-
:'account_type' => :'accountType',
|
|
77
|
-
:'created_at' => :'createdAt',
|
|
95
|
+
:'organization_id' => :'organizationId',
|
|
96
|
+
:'organization_type' => :'organizationType',
|
|
78
97
|
:'creator' => :'creator',
|
|
98
|
+
:'messages_cap' => :'messagesCap',
|
|
99
|
+
:'cost_cap' => :'costCap',
|
|
100
|
+
:'created_at' => :'createdAt',
|
|
101
|
+
:'updated_at' => :'updatedAt',
|
|
102
|
+
:'anniversary_date' => :'anniversaryDate',
|
|
103
|
+
:'allow_overage' => :'allowOverage',
|
|
104
|
+
:'name' => :'name',
|
|
105
|
+
:'sms_cap' => :'smsCap',
|
|
106
|
+
:'call_cap' => :'callCap',
|
|
79
107
|
:'stripe_customer_id' => :'stripeCustomerId',
|
|
80
108
|
:'stripe_subscription_id' => :'stripeSubscriptionId',
|
|
81
109
|
:'subscription_status' => :'subscriptionStatus',
|
|
82
|
-
:'
|
|
110
|
+
:'status' => :'status',
|
|
111
|
+
:'pending_downgrade_cost_cap' => :'pendingDowngradeCostCap',
|
|
112
|
+
:'pending_downgrade_messages_cap' => :'pendingDowngradeMessagesCap',
|
|
113
|
+
:'pending_downgrade_sms_cap' => :'pendingDowngradeSmsCap',
|
|
114
|
+
:'pending_downgrade_call_cap' => :'pendingDowngradeCallCap',
|
|
83
115
|
:'pending_downgrade_effective_date' => :'pendingDowngradeEffectiveDate',
|
|
84
116
|
:'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
|
|
85
|
-
:'pending_downgrade_usage_limit' => :'pendingDowngradeUsageLimit',
|
|
86
117
|
:'session_id' => :'sessionId',
|
|
87
118
|
:'url' => :'url'
|
|
88
119
|
}
|
|
@@ -101,18 +132,28 @@ module Pingram
|
|
|
101
132
|
# Attribute type mapping.
|
|
102
133
|
def self.openapi_types
|
|
103
134
|
{
|
|
104
|
-
:'
|
|
105
|
-
:'
|
|
106
|
-
:'account_type' => :'String',
|
|
107
|
-
:'created_at' => :'String',
|
|
135
|
+
:'organization_id' => :'String',
|
|
136
|
+
:'organization_type' => :'String',
|
|
108
137
|
:'creator' => :'String',
|
|
138
|
+
:'messages_cap' => :'Float',
|
|
139
|
+
:'cost_cap' => :'Float',
|
|
140
|
+
:'created_at' => :'String',
|
|
141
|
+
:'updated_at' => :'String',
|
|
142
|
+
:'anniversary_date' => :'String',
|
|
143
|
+
:'allow_overage' => :'Boolean',
|
|
144
|
+
:'name' => :'String',
|
|
145
|
+
:'sms_cap' => :'Float',
|
|
146
|
+
:'call_cap' => :'Float',
|
|
109
147
|
:'stripe_customer_id' => :'String',
|
|
110
148
|
:'stripe_subscription_id' => :'String',
|
|
111
149
|
:'subscription_status' => :'String',
|
|
112
|
-
:'
|
|
150
|
+
:'status' => :'String',
|
|
151
|
+
:'pending_downgrade_cost_cap' => :'Float',
|
|
152
|
+
:'pending_downgrade_messages_cap' => :'Float',
|
|
153
|
+
:'pending_downgrade_sms_cap' => :'Float',
|
|
154
|
+
:'pending_downgrade_call_cap' => :'Float',
|
|
113
155
|
:'pending_downgrade_effective_date' => :'String',
|
|
114
156
|
:'pending_downgrade_account_type' => :'String',
|
|
115
|
-
:'pending_downgrade_usage_limit' => :'BillingPostResponseBodyPendingDowngradeUsageLimit',
|
|
116
157
|
:'session_id' => :'String',
|
|
117
158
|
:'url' => :'String'
|
|
118
159
|
}
|
|
@@ -141,20 +182,34 @@ module Pingram
|
|
|
141
182
|
h[k.to_sym] = v
|
|
142
183
|
}
|
|
143
184
|
|
|
144
|
-
if attributes.key?(:'
|
|
145
|
-
self.
|
|
185
|
+
if attributes.key?(:'organization_id')
|
|
186
|
+
self.organization_id = attributes[:'organization_id']
|
|
146
187
|
else
|
|
147
|
-
self.
|
|
188
|
+
self.organization_id = nil
|
|
148
189
|
end
|
|
149
190
|
|
|
150
|
-
if attributes.key?(:'
|
|
151
|
-
self.
|
|
191
|
+
if attributes.key?(:'organization_type')
|
|
192
|
+
self.organization_type = attributes[:'organization_type']
|
|
193
|
+
else
|
|
194
|
+
self.organization_type = nil
|
|
152
195
|
end
|
|
153
196
|
|
|
154
|
-
if attributes.key?(:'
|
|
155
|
-
self.
|
|
197
|
+
if attributes.key?(:'creator')
|
|
198
|
+
self.creator = attributes[:'creator']
|
|
199
|
+
else
|
|
200
|
+
self.creator = nil
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'messages_cap')
|
|
204
|
+
self.messages_cap = attributes[:'messages_cap']
|
|
156
205
|
else
|
|
157
|
-
self.
|
|
206
|
+
self.messages_cap = nil
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'cost_cap')
|
|
210
|
+
self.cost_cap = attributes[:'cost_cap']
|
|
211
|
+
else
|
|
212
|
+
self.cost_cap = nil
|
|
158
213
|
end
|
|
159
214
|
|
|
160
215
|
if attributes.key?(:'created_at')
|
|
@@ -163,8 +218,36 @@ module Pingram
|
|
|
163
218
|
self.created_at = nil
|
|
164
219
|
end
|
|
165
220
|
|
|
166
|
-
if attributes.key?(:'
|
|
167
|
-
self.
|
|
221
|
+
if attributes.key?(:'updated_at')
|
|
222
|
+
self.updated_at = attributes[:'updated_at']
|
|
223
|
+
else
|
|
224
|
+
self.updated_at = nil
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if attributes.key?(:'anniversary_date')
|
|
228
|
+
self.anniversary_date = attributes[:'anniversary_date']
|
|
229
|
+
else
|
|
230
|
+
self.anniversary_date = nil
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'allow_overage')
|
|
234
|
+
self.allow_overage = attributes[:'allow_overage']
|
|
235
|
+
else
|
|
236
|
+
self.allow_overage = nil
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if attributes.key?(:'name')
|
|
240
|
+
self.name = attributes[:'name']
|
|
241
|
+
else
|
|
242
|
+
self.name = nil
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if attributes.key?(:'sms_cap')
|
|
246
|
+
self.sms_cap = attributes[:'sms_cap']
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if attributes.key?(:'call_cap')
|
|
250
|
+
self.call_cap = attributes[:'call_cap']
|
|
168
251
|
end
|
|
169
252
|
|
|
170
253
|
if attributes.key?(:'stripe_customer_id')
|
|
@@ -179,8 +262,24 @@ module Pingram
|
|
|
179
262
|
self.subscription_status = attributes[:'subscription_status']
|
|
180
263
|
end
|
|
181
264
|
|
|
182
|
-
if attributes.key?(:'
|
|
183
|
-
self.
|
|
265
|
+
if attributes.key?(:'status')
|
|
266
|
+
self.status = attributes[:'status']
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if attributes.key?(:'pending_downgrade_cost_cap')
|
|
270
|
+
self.pending_downgrade_cost_cap = attributes[:'pending_downgrade_cost_cap']
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if attributes.key?(:'pending_downgrade_messages_cap')
|
|
274
|
+
self.pending_downgrade_messages_cap = attributes[:'pending_downgrade_messages_cap']
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if attributes.key?(:'pending_downgrade_sms_cap')
|
|
278
|
+
self.pending_downgrade_sms_cap = attributes[:'pending_downgrade_sms_cap']
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if attributes.key?(:'pending_downgrade_call_cap')
|
|
282
|
+
self.pending_downgrade_call_cap = attributes[:'pending_downgrade_call_cap']
|
|
184
283
|
end
|
|
185
284
|
|
|
186
285
|
if attributes.key?(:'pending_downgrade_effective_date')
|
|
@@ -191,10 +290,6 @@ module Pingram
|
|
|
191
290
|
self.pending_downgrade_account_type = attributes[:'pending_downgrade_account_type']
|
|
192
291
|
end
|
|
193
292
|
|
|
194
|
-
if attributes.key?(:'pending_downgrade_usage_limit')
|
|
195
|
-
self.pending_downgrade_usage_limit = attributes[:'pending_downgrade_usage_limit']
|
|
196
|
-
end
|
|
197
|
-
|
|
198
293
|
if attributes.key?(:'session_id')
|
|
199
294
|
self.session_id = attributes[:'session_id']
|
|
200
295
|
end
|
|
@@ -209,18 +304,46 @@ module Pingram
|
|
|
209
304
|
def list_invalid_properties
|
|
210
305
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
211
306
|
invalid_properties = Array.new
|
|
212
|
-
if @
|
|
213
|
-
invalid_properties.push('invalid value for "
|
|
307
|
+
if @organization_id.nil?
|
|
308
|
+
invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
if @organization_type.nil?
|
|
312
|
+
invalid_properties.push('invalid value for "organization_type", organization_type cannot be nil.')
|
|
214
313
|
end
|
|
215
314
|
|
|
216
|
-
if @
|
|
217
|
-
invalid_properties.push('invalid value for "
|
|
315
|
+
if @creator.nil?
|
|
316
|
+
invalid_properties.push('invalid value for "creator", creator cannot be nil.')
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
if @messages_cap.nil?
|
|
320
|
+
invalid_properties.push('invalid value for "messages_cap", messages_cap cannot be nil.')
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
if @cost_cap.nil?
|
|
324
|
+
invalid_properties.push('invalid value for "cost_cap", cost_cap cannot be nil.')
|
|
218
325
|
end
|
|
219
326
|
|
|
220
327
|
if @created_at.nil?
|
|
221
328
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
222
329
|
end
|
|
223
330
|
|
|
331
|
+
if @updated_at.nil?
|
|
332
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
if @anniversary_date.nil?
|
|
336
|
+
invalid_properties.push('invalid value for "anniversary_date", anniversary_date cannot be nil.')
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
if @allow_overage.nil?
|
|
340
|
+
invalid_properties.push('invalid value for "allow_overage", allow_overage cannot be nil.')
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
if @name.nil?
|
|
344
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
345
|
+
end
|
|
346
|
+
|
|
224
347
|
invalid_properties
|
|
225
348
|
end
|
|
226
349
|
|
|
@@ -228,36 +351,75 @@ module Pingram
|
|
|
228
351
|
# @return true if the model is valid
|
|
229
352
|
def valid?
|
|
230
353
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
231
|
-
return false if @
|
|
232
|
-
return false if @
|
|
233
|
-
|
|
234
|
-
return false unless
|
|
354
|
+
return false if @organization_id.nil?
|
|
355
|
+
return false if @organization_type.nil?
|
|
356
|
+
organization_type_validator = EnumAttributeValidator.new('String', ["free", "paid"])
|
|
357
|
+
return false unless organization_type_validator.valid?(@organization_type)
|
|
358
|
+
return false if @creator.nil?
|
|
359
|
+
return false if @messages_cap.nil?
|
|
360
|
+
return false if @cost_cap.nil?
|
|
235
361
|
return false if @created_at.nil?
|
|
362
|
+
return false if @updated_at.nil?
|
|
363
|
+
return false if @anniversary_date.nil?
|
|
364
|
+
return false if @allow_overage.nil?
|
|
365
|
+
return false if @name.nil?
|
|
236
366
|
subscription_status_validator = EnumAttributeValidator.new('String', ["active", "canceled", "past_due", "paused"])
|
|
237
367
|
return false unless subscription_status_validator.valid?(@subscription_status)
|
|
368
|
+
status_validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
|
|
369
|
+
return false unless status_validator.valid?(@status)
|
|
238
370
|
pending_downgrade_account_type_validator = EnumAttributeValidator.new('String', ["free"])
|
|
239
371
|
return false unless pending_downgrade_account_type_validator.valid?(@pending_downgrade_account_type)
|
|
240
372
|
true
|
|
241
373
|
end
|
|
242
374
|
|
|
243
375
|
# Custom attribute writer method with validation
|
|
244
|
-
# @param [Object]
|
|
245
|
-
def
|
|
246
|
-
if
|
|
247
|
-
fail ArgumentError, '
|
|
376
|
+
# @param [Object] organization_id Value to be assigned
|
|
377
|
+
def organization_id=(organization_id)
|
|
378
|
+
if organization_id.nil?
|
|
379
|
+
fail ArgumentError, 'organization_id cannot be nil'
|
|
248
380
|
end
|
|
249
381
|
|
|
250
|
-
@
|
|
382
|
+
@organization_id = organization_id
|
|
251
383
|
end
|
|
252
384
|
|
|
253
385
|
# Custom attribute writer method checking allowed values (enum).
|
|
254
|
-
# @param [Object]
|
|
255
|
-
def
|
|
386
|
+
# @param [Object] organization_type Object to be assigned
|
|
387
|
+
def organization_type=(organization_type)
|
|
256
388
|
validator = EnumAttributeValidator.new('String', ["free", "paid"])
|
|
257
|
-
unless validator.valid?(
|
|
258
|
-
fail ArgumentError, "invalid value for \"
|
|
389
|
+
unless validator.valid?(organization_type)
|
|
390
|
+
fail ArgumentError, "invalid value for \"organization_type\", must be one of #{validator.allowable_values}."
|
|
391
|
+
end
|
|
392
|
+
@organization_type = organization_type
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
# Custom attribute writer method with validation
|
|
396
|
+
# @param [Object] creator Value to be assigned
|
|
397
|
+
def creator=(creator)
|
|
398
|
+
if creator.nil?
|
|
399
|
+
fail ArgumentError, 'creator cannot be nil'
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
@creator = creator
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
# Custom attribute writer method with validation
|
|
406
|
+
# @param [Object] messages_cap Value to be assigned
|
|
407
|
+
def messages_cap=(messages_cap)
|
|
408
|
+
if messages_cap.nil?
|
|
409
|
+
fail ArgumentError, 'messages_cap cannot be nil'
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
@messages_cap = messages_cap
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
# Custom attribute writer method with validation
|
|
416
|
+
# @param [Object] cost_cap Value to be assigned
|
|
417
|
+
def cost_cap=(cost_cap)
|
|
418
|
+
if cost_cap.nil?
|
|
419
|
+
fail ArgumentError, 'cost_cap cannot be nil'
|
|
259
420
|
end
|
|
260
|
-
|
|
421
|
+
|
|
422
|
+
@cost_cap = cost_cap
|
|
261
423
|
end
|
|
262
424
|
|
|
263
425
|
# Custom attribute writer method with validation
|
|
@@ -270,6 +432,46 @@ module Pingram
|
|
|
270
432
|
@created_at = created_at
|
|
271
433
|
end
|
|
272
434
|
|
|
435
|
+
# Custom attribute writer method with validation
|
|
436
|
+
# @param [Object] updated_at Value to be assigned
|
|
437
|
+
def updated_at=(updated_at)
|
|
438
|
+
if updated_at.nil?
|
|
439
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
@updated_at = updated_at
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
# Custom attribute writer method with validation
|
|
446
|
+
# @param [Object] anniversary_date Value to be assigned
|
|
447
|
+
def anniversary_date=(anniversary_date)
|
|
448
|
+
if anniversary_date.nil?
|
|
449
|
+
fail ArgumentError, 'anniversary_date cannot be nil'
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
@anniversary_date = anniversary_date
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
# Custom attribute writer method with validation
|
|
456
|
+
# @param [Object] allow_overage Value to be assigned
|
|
457
|
+
def allow_overage=(allow_overage)
|
|
458
|
+
if allow_overage.nil?
|
|
459
|
+
fail ArgumentError, 'allow_overage cannot be nil'
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
@allow_overage = allow_overage
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
# Custom attribute writer method with validation
|
|
466
|
+
# @param [Object] name Value to be assigned
|
|
467
|
+
def name=(name)
|
|
468
|
+
if name.nil?
|
|
469
|
+
fail ArgumentError, 'name cannot be nil'
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
@name = name
|
|
473
|
+
end
|
|
474
|
+
|
|
273
475
|
# Custom attribute writer method checking allowed values (enum).
|
|
274
476
|
# @param [Object] subscription_status Object to be assigned
|
|
275
477
|
def subscription_status=(subscription_status)
|
|
@@ -280,6 +482,16 @@ module Pingram
|
|
|
280
482
|
@subscription_status = subscription_status
|
|
281
483
|
end
|
|
282
484
|
|
|
485
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
486
|
+
# @param [Object] status Object to be assigned
|
|
487
|
+
def status=(status)
|
|
488
|
+
validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
|
|
489
|
+
unless validator.valid?(status)
|
|
490
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
491
|
+
end
|
|
492
|
+
@status = status
|
|
493
|
+
end
|
|
494
|
+
|
|
283
495
|
# Custom attribute writer method checking allowed values (enum).
|
|
284
496
|
# @param [Object] pending_downgrade_account_type Object to be assigned
|
|
285
497
|
def pending_downgrade_account_type=(pending_downgrade_account_type)
|
|
@@ -295,18 +507,28 @@ module Pingram
|
|
|
295
507
|
def ==(o)
|
|
296
508
|
return true if self.equal?(o)
|
|
297
509
|
self.class == o.class &&
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
account_type == o.account_type &&
|
|
301
|
-
created_at == o.created_at &&
|
|
510
|
+
organization_id == o.organization_id &&
|
|
511
|
+
organization_type == o.organization_type &&
|
|
302
512
|
creator == o.creator &&
|
|
513
|
+
messages_cap == o.messages_cap &&
|
|
514
|
+
cost_cap == o.cost_cap &&
|
|
515
|
+
created_at == o.created_at &&
|
|
516
|
+
updated_at == o.updated_at &&
|
|
517
|
+
anniversary_date == o.anniversary_date &&
|
|
518
|
+
allow_overage == o.allow_overage &&
|
|
519
|
+
name == o.name &&
|
|
520
|
+
sms_cap == o.sms_cap &&
|
|
521
|
+
call_cap == o.call_cap &&
|
|
303
522
|
stripe_customer_id == o.stripe_customer_id &&
|
|
304
523
|
stripe_subscription_id == o.stripe_subscription_id &&
|
|
305
524
|
subscription_status == o.subscription_status &&
|
|
306
|
-
|
|
525
|
+
status == o.status &&
|
|
526
|
+
pending_downgrade_cost_cap == o.pending_downgrade_cost_cap &&
|
|
527
|
+
pending_downgrade_messages_cap == o.pending_downgrade_messages_cap &&
|
|
528
|
+
pending_downgrade_sms_cap == o.pending_downgrade_sms_cap &&
|
|
529
|
+
pending_downgrade_call_cap == o.pending_downgrade_call_cap &&
|
|
307
530
|
pending_downgrade_effective_date == o.pending_downgrade_effective_date &&
|
|
308
531
|
pending_downgrade_account_type == o.pending_downgrade_account_type &&
|
|
309
|
-
pending_downgrade_usage_limit == o.pending_downgrade_usage_limit &&
|
|
310
532
|
session_id == o.session_id &&
|
|
311
533
|
url == o.url
|
|
312
534
|
end
|
|
@@ -320,7 +542,7 @@ module Pingram
|
|
|
320
542
|
# Calculates hash code according to all attributes.
|
|
321
543
|
# @return [Integer] Hash code
|
|
322
544
|
def hash
|
|
323
|
-
[
|
|
545
|
+
[organization_id, organization_type, creator, messages_cap, cost_cap, created_at, updated_at, anniversary_date, allow_overage, name, sms_cap, call_cap, stripe_customer_id, stripe_subscription_id, subscription_status, status, pending_downgrade_cost_cap, pending_downgrade_messages_cap, pending_downgrade_sms_cap, pending_downgrade_call_cap, pending_downgrade_effective_date, pending_downgrade_account_type, session_id, url].hash
|
|
324
546
|
end
|
|
325
547
|
|
|
326
548
|
# Builds the object from hash
|