pingram 1.0.0 → 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/templates_api.rb +0 -73
- 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/get_templates_list_response_inner_any_of.rb +4 -13
- 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/models/template_patch_request.rb +1 -11
- data/lib/pingram/models/template_post_request.rb +1 -11
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +9 -2
- metadata +11 -4
|
@@ -14,29 +14,19 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Pingram
|
|
17
|
+
# GET /account response: basic account info (billing fields are on Organization).
|
|
17
18
|
class AccountGetResponse < ApiModelBase
|
|
18
19
|
attr_accessor :account_id
|
|
19
20
|
|
|
21
|
+
# Optional organization ID; legacy accounts may not have one.
|
|
22
|
+
attr_accessor :organization_id
|
|
23
|
+
|
|
20
24
|
attr_accessor :name
|
|
21
25
|
|
|
22
26
|
attr_accessor :account_type
|
|
23
27
|
|
|
24
28
|
attr_accessor :created_at
|
|
25
29
|
|
|
26
|
-
attr_accessor :stripe_customer_id
|
|
27
|
-
|
|
28
|
-
attr_accessor :stripe_subscription_id
|
|
29
|
-
|
|
30
|
-
attr_accessor :subscription_status
|
|
31
|
-
|
|
32
|
-
attr_accessor :anniversary_date
|
|
33
|
-
|
|
34
|
-
attr_accessor :pending_downgrade_effective_date
|
|
35
|
-
|
|
36
|
-
attr_accessor :pending_downgrade_account_type
|
|
37
|
-
|
|
38
|
-
attr_accessor :pending_downgrade_usage_limit
|
|
39
|
-
|
|
40
30
|
class EnumAttributeValidator
|
|
41
31
|
attr_reader :datatype
|
|
42
32
|
attr_reader :allowable_values
|
|
@@ -63,16 +53,10 @@ module Pingram
|
|
|
63
53
|
def self.attribute_map
|
|
64
54
|
{
|
|
65
55
|
:'account_id' => :'accountId',
|
|
56
|
+
:'organization_id' => :'organizationId',
|
|
66
57
|
:'name' => :'name',
|
|
67
58
|
:'account_type' => :'accountType',
|
|
68
|
-
:'created_at' => :'createdAt'
|
|
69
|
-
:'stripe_customer_id' => :'stripeCustomerId',
|
|
70
|
-
:'stripe_subscription_id' => :'stripeSubscriptionId',
|
|
71
|
-
:'subscription_status' => :'subscriptionStatus',
|
|
72
|
-
:'anniversary_date' => :'anniversaryDate',
|
|
73
|
-
:'pending_downgrade_effective_date' => :'pendingDowngradeEffectiveDate',
|
|
74
|
-
:'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
|
|
75
|
-
:'pending_downgrade_usage_limit' => :'pendingDowngradeUsageLimit'
|
|
59
|
+
:'created_at' => :'createdAt'
|
|
76
60
|
}
|
|
77
61
|
end
|
|
78
62
|
|
|
@@ -90,23 +74,16 @@ module Pingram
|
|
|
90
74
|
def self.openapi_types
|
|
91
75
|
{
|
|
92
76
|
:'account_id' => :'String',
|
|
77
|
+
:'organization_id' => :'String',
|
|
93
78
|
:'name' => :'String',
|
|
94
79
|
:'account_type' => :'String',
|
|
95
|
-
:'created_at' => :'String'
|
|
96
|
-
:'stripe_customer_id' => :'String',
|
|
97
|
-
:'stripe_subscription_id' => :'String',
|
|
98
|
-
:'subscription_status' => :'String',
|
|
99
|
-
:'anniversary_date' => :'String',
|
|
100
|
-
:'pending_downgrade_effective_date' => :'String',
|
|
101
|
-
:'pending_downgrade_account_type' => :'String',
|
|
102
|
-
:'pending_downgrade_usage_limit' => :'AccountGetResponsePendingDowngradeUsageLimit'
|
|
80
|
+
:'created_at' => :'String'
|
|
103
81
|
}
|
|
104
82
|
end
|
|
105
83
|
|
|
106
84
|
# List of attributes with nullable: true
|
|
107
85
|
def self.openapi_nullable
|
|
108
86
|
Set.new([
|
|
109
|
-
:'subscription_status',
|
|
110
87
|
])
|
|
111
88
|
end
|
|
112
89
|
|
|
@@ -132,6 +109,10 @@ module Pingram
|
|
|
132
109
|
self.account_id = nil
|
|
133
110
|
end
|
|
134
111
|
|
|
112
|
+
if attributes.key?(:'organization_id')
|
|
113
|
+
self.organization_id = attributes[:'organization_id']
|
|
114
|
+
end
|
|
115
|
+
|
|
135
116
|
if attributes.key?(:'name')
|
|
136
117
|
self.name = attributes[:'name']
|
|
137
118
|
else
|
|
@@ -149,34 +130,6 @@ module Pingram
|
|
|
149
130
|
else
|
|
150
131
|
self.created_at = nil
|
|
151
132
|
end
|
|
152
|
-
|
|
153
|
-
if attributes.key?(:'stripe_customer_id')
|
|
154
|
-
self.stripe_customer_id = attributes[:'stripe_customer_id']
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
if attributes.key?(:'stripe_subscription_id')
|
|
158
|
-
self.stripe_subscription_id = attributes[:'stripe_subscription_id']
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
if attributes.key?(:'subscription_status')
|
|
162
|
-
self.subscription_status = attributes[:'subscription_status']
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
if attributes.key?(:'anniversary_date')
|
|
166
|
-
self.anniversary_date = attributes[:'anniversary_date']
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
if attributes.key?(:'pending_downgrade_effective_date')
|
|
170
|
-
self.pending_downgrade_effective_date = attributes[:'pending_downgrade_effective_date']
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
if attributes.key?(:'pending_downgrade_account_type')
|
|
174
|
-
self.pending_downgrade_account_type = attributes[:'pending_downgrade_account_type']
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
if attributes.key?(:'pending_downgrade_usage_limit')
|
|
178
|
-
self.pending_downgrade_usage_limit = attributes[:'pending_downgrade_usage_limit']
|
|
179
|
-
end
|
|
180
133
|
end
|
|
181
134
|
|
|
182
135
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -213,10 +166,6 @@ module Pingram
|
|
|
213
166
|
account_type_validator = EnumAttributeValidator.new('String', ["free", "paid"])
|
|
214
167
|
return false unless account_type_validator.valid?(@account_type)
|
|
215
168
|
return false if @created_at.nil?
|
|
216
|
-
subscription_status_validator = EnumAttributeValidator.new('String', ["active", "canceled", "past_due", "paused"])
|
|
217
|
-
return false unless subscription_status_validator.valid?(@subscription_status)
|
|
218
|
-
pending_downgrade_account_type_validator = EnumAttributeValidator.new('String', ["free"])
|
|
219
|
-
return false unless pending_downgrade_account_type_validator.valid?(@pending_downgrade_account_type)
|
|
220
169
|
true
|
|
221
170
|
end
|
|
222
171
|
|
|
@@ -260,42 +209,16 @@ module Pingram
|
|
|
260
209
|
@created_at = created_at
|
|
261
210
|
end
|
|
262
211
|
|
|
263
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
264
|
-
# @param [Object] subscription_status Object to be assigned
|
|
265
|
-
def subscription_status=(subscription_status)
|
|
266
|
-
validator = EnumAttributeValidator.new('String', ["active", "canceled", "past_due", "paused"])
|
|
267
|
-
unless validator.valid?(subscription_status)
|
|
268
|
-
fail ArgumentError, "invalid value for \"subscription_status\", must be one of #{validator.allowable_values}."
|
|
269
|
-
end
|
|
270
|
-
@subscription_status = subscription_status
|
|
271
|
-
end
|
|
272
|
-
|
|
273
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
274
|
-
# @param [Object] pending_downgrade_account_type Object to be assigned
|
|
275
|
-
def pending_downgrade_account_type=(pending_downgrade_account_type)
|
|
276
|
-
validator = EnumAttributeValidator.new('String', ["free"])
|
|
277
|
-
unless validator.valid?(pending_downgrade_account_type)
|
|
278
|
-
fail ArgumentError, "invalid value for \"pending_downgrade_account_type\", must be one of #{validator.allowable_values}."
|
|
279
|
-
end
|
|
280
|
-
@pending_downgrade_account_type = pending_downgrade_account_type
|
|
281
|
-
end
|
|
282
|
-
|
|
283
212
|
# Checks equality by comparing each attribute.
|
|
284
213
|
# @param [Object] Object to be compared
|
|
285
214
|
def ==(o)
|
|
286
215
|
return true if self.equal?(o)
|
|
287
216
|
self.class == o.class &&
|
|
288
217
|
account_id == o.account_id &&
|
|
218
|
+
organization_id == o.organization_id &&
|
|
289
219
|
name == o.name &&
|
|
290
220
|
account_type == o.account_type &&
|
|
291
|
-
created_at == o.created_at
|
|
292
|
-
stripe_customer_id == o.stripe_customer_id &&
|
|
293
|
-
stripe_subscription_id == o.stripe_subscription_id &&
|
|
294
|
-
subscription_status == o.subscription_status &&
|
|
295
|
-
anniversary_date == o.anniversary_date &&
|
|
296
|
-
pending_downgrade_effective_date == o.pending_downgrade_effective_date &&
|
|
297
|
-
pending_downgrade_account_type == o.pending_downgrade_account_type &&
|
|
298
|
-
pending_downgrade_usage_limit == o.pending_downgrade_usage_limit
|
|
221
|
+
created_at == o.created_at
|
|
299
222
|
end
|
|
300
223
|
|
|
301
224
|
# @see the `==` method
|
|
@@ -307,7 +230,7 @@ module Pingram
|
|
|
307
230
|
# Calculates hash code according to all attributes.
|
|
308
231
|
# @return [Integer] Hash code
|
|
309
232
|
def hash
|
|
310
|
-
[account_id, name, account_type, created_at
|
|
233
|
+
[account_id, organization_id, name, account_type, created_at].hash
|
|
311
234
|
end
|
|
312
235
|
|
|
313
236
|
# Builds the object from hash
|
|
@@ -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
|