stigg 0.1.0.pre.alpha.1 → 0.1.0.pre.alpha.3
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/CHANGELOG.md +22 -0
- data/README.md +29 -1
- data/lib/stigg/internal/my_cursor_id_page.rb +32 -4
- data/lib/stigg/internal/type/base_model.rb +2 -2
- data/lib/stigg/models/v1/{coupon_create_response.rb → coupon.rb} +31 -26
- data/lib/stigg/models/v1/coupon_create_params.rb +2 -0
- data/lib/stigg/models/v1/coupon_list_params.rb +14 -14
- data/lib/stigg/models/v1/coupon_list_response.rb +262 -278
- data/lib/stigg/models/v1/customer_import_params.rb +75 -0
- data/lib/stigg/models/v1/customer_import_response.rb +35 -0
- data/lib/stigg/models/v1/customer_list_params.rb +14 -14
- data/lib/stigg/models/v1/customer_list_response.rb +160 -174
- data/lib/stigg/models/v1/{customer_create_params.rb → customer_provision_params.rb} +18 -16
- data/lib/stigg/models/v1/customer_response.rb +9 -2
- data/lib/stigg/models/v1/customer_update_params.rb +2 -0
- data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +3 -1
- data/lib/stigg/models/v1/customers/{promotional_create_params.rb → promotional_entitlement_grant_params.rb} +46 -44
- data/lib/stigg/models/v1/customers/{promotional_create_response.rb → promotional_entitlement_grant_response.rb} +105 -32
- data/lib/stigg/models/v1/customers/{promotional_revoke_params.rb → promotional_entitlement_revoke_params.rb} +2 -2
- data/lib/stigg/models/v1/customers/{promotional_revoke_response.rb → promotional_entitlement_revoke_response.rb} +107 -33
- data/lib/stigg/models/v1/event_report_params.rb +91 -0
- data/lib/stigg/models/v1/event_report_response.rb +25 -0
- data/lib/stigg/models/v1/{subscription_retrieve_response.rb → subscription.rb} +67 -26
- data/lib/stigg/models/v1/subscription_cancel_params.rb +75 -0
- data/lib/stigg/models/v1/subscription_delegate_params.rb +7 -2
- data/lib/stigg/models/v1/subscription_import_params.rb +92 -0
- data/lib/stigg/models/v1/subscription_import_response.rb +32 -0
- data/lib/stigg/models/v1/subscription_list_params.rb +20 -24
- data/lib/stigg/models/v1/subscription_list_response.rb +255 -236
- data/lib/stigg/models/v1/subscription_migrate_params.rb +3 -3
- data/lib/stigg/models/v1/subscription_preview_params.rb +139 -46
- data/lib/stigg/models/v1/subscription_preview_response.rb +164 -49
- data/lib/stigg/models/v1/subscription_provision_params.rb +1693 -0
- data/lib/stigg/models/v1/subscription_provision_response.rb +1038 -0
- data/lib/stigg/models/v1/subscription_transfer_params.rb +2 -6
- data/lib/stigg/models/v1/subscription_update_params.rb +1114 -0
- data/lib/stigg/models/v1/subscriptions/{future_update_cancel_pending_payment_response.rb → cancel_subscription.rb} +9 -5
- data/lib/stigg/models/v1/usage_history_params.rb +54 -0
- data/lib/stigg/models/v1/usage_history_response.rb +155 -0
- data/lib/stigg/models/v1/usage_report_params.rb +114 -0
- data/lib/stigg/models/v1/usage_report_response.rb +120 -0
- data/lib/stigg/models.rb +0 -4
- data/lib/stigg/resources/v1/coupons.rb +16 -14
- data/lib/stigg/resources/v1/customers/payment_method.rb +6 -5
- data/lib/stigg/resources/v1/customers/{promotional.rb → promotional_entitlements.rb} +17 -17
- data/lib/stigg/resources/v1/customers.rb +78 -56
- data/lib/stigg/resources/v1/events.rb +38 -0
- data/lib/stigg/resources/v1/subscriptions/future_update.rb +10 -8
- data/lib/stigg/resources/v1/subscriptions.rb +206 -79
- data/lib/stigg/resources/v1/usage.rb +79 -0
- data/lib/stigg/resources/v1.rb +6 -42
- data/lib/stigg/version.rb +1 -1
- data/lib/stigg.rb +25 -23
- data/rbi/stigg/internal/my_cursor_id_page.rbi +27 -0
- data/rbi/stigg/models/v1/coupon.rbi +891 -0
- data/rbi/stigg/models/v1/coupon_create_params.rbi +1 -0
- data/rbi/stigg/models/v1/coupon_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/coupon_list_response.rbi +812 -869
- data/rbi/stigg/models/v1/customer_import_params.rbi +130 -0
- data/rbi/stigg/models/v1/customer_import_response.rbi +76 -0
- data/rbi/stigg/models/v1/customer_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/customer_list_response.rbi +307 -347
- data/rbi/stigg/models/v1/{customer_create_params.rbi → customer_provision_params.rbi} +36 -35
- data/rbi/stigg/models/v1/customer_response.rbi +8 -1
- data/rbi/stigg/models/v1/customer_update_params.rbi +1 -0
- data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +3 -0
- data/rbi/stigg/models/v1/customers/{promotional_create_params.rbi → promotional_entitlement_grant_params.rbi} +78 -77
- data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_response.rbi +690 -0
- data/rbi/stigg/models/v1/customers/{promotional_revoke_params.rbi → promotional_entitlement_revoke_params.rbi} +2 -2
- data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbi +696 -0
- data/rbi/stigg/models/v1/event_report_params.rbi +168 -0
- data/rbi/stigg/models/v1/event_report_response.rbi +35 -0
- data/rbi/stigg/models/v1/{subscription_migrate_response.rbi → subscription.rbi} +130 -98
- data/rbi/stigg/models/v1/subscription_cancel_params.rbi +182 -0
- data/rbi/stigg/models/v1/subscription_delegate_params.rbi +6 -2
- data/rbi/stigg/models/v1/subscription_import_params.rbi +148 -0
- data/rbi/stigg/models/v1/subscription_import_response.rbi +69 -0
- data/rbi/stigg/models/v1/subscription_list_params.rbi +26 -28
- data/rbi/stigg/models/v1/subscription_list_response.rbi +460 -435
- data/rbi/stigg/models/v1/subscription_migrate_params.rbi +3 -3
- data/rbi/stigg/models/v1/subscription_preview_params.rbi +112 -14
- data/rbi/stigg/models/v1/subscription_preview_response.rbi +139 -6
- data/rbi/stigg/models/v1/subscription_provision_params.rbi +5306 -0
- data/rbi/stigg/models/v1/subscription_provision_response.rbi +3175 -0
- data/rbi/stigg/models/v1/subscription_transfer_params.rbi +2 -4
- data/rbi/stigg/models/v1/subscription_update_params.rbi +3578 -0
- data/rbi/stigg/models/v1/subscriptions/{future_update_cancel_schedule_response.rbi → cancel_subscription.rbi} +10 -16
- data/rbi/stigg/models/v1/usage_history_params.rbi +79 -0
- data/rbi/stigg/models/v1/usage_history_response.rbi +347 -0
- data/rbi/stigg/models/v1/usage_report_params.rbi +227 -0
- data/rbi/stigg/models/v1/usage_report_response.rbi +162 -0
- data/rbi/stigg/models.rbi +0 -4
- data/rbi/stigg/resources/v1/coupons.rbi +22 -14
- data/rbi/stigg/resources/v1/customers/payment_method.rbi +9 -3
- data/rbi/stigg/resources/v1/customers/{promotional.rbi → promotional_entitlements.rbi} +13 -9
- data/rbi/stigg/resources/v1/customers.rbi +84 -53
- data/rbi/stigg/resources/v1/events.rbi +28 -0
- data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +14 -10
- data/rbi/stigg/resources/v1/subscriptions.rbi +242 -58
- data/rbi/stigg/resources/v1/usage.rbi +57 -0
- data/rbi/stigg/resources/v1.rbi +4 -26
- data/sig/stigg/internal/my_cursor_id_page.rbs +17 -0
- data/sig/stigg/models/v1/{coupon_create_response.rbs → coupon.rbs} +29 -32
- data/sig/stigg/models/v1/coupon_list_params.rbs +11 -11
- data/sig/stigg/models/v1/coupon_list_response.rbs +331 -351
- data/sig/stigg/models/v1/customer_import_params.rbs +74 -0
- data/sig/stigg/models/v1/customer_import_response.rbs +30 -0
- data/sig/stigg/models/v1/customer_list_params.rbs +11 -11
- data/sig/stigg/models/v1/customer_list_response.rbs +133 -153
- data/sig/stigg/models/v1/{customer_create_params.rbs → customer_provision_params.rbs} +22 -22
- data/sig/stigg/models/v1/customers/{promotional_create_params.rbs → promotional_entitlement_grant_params.rbs} +43 -43
- data/sig/stigg/models/v1/customers/promotional_entitlement_grant_response.rbs +281 -0
- data/sig/stigg/models/v1/customers/{promotional_revoke_params.rbs → promotional_entitlement_revoke_params.rbs} +2 -2
- data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbs +281 -0
- data/sig/stigg/models/v1/event_report_params.rbs +82 -0
- data/sig/stigg/models/v1/event_report_response.rbs +15 -0
- data/sig/stigg/models/v1/{subscription_retrieve_response.rbs → subscription.rbs} +61 -35
- data/sig/stigg/models/v1/subscription_cancel_params.rbs +79 -0
- data/sig/stigg/models/v1/subscription_import_params.rbs +84 -0
- data/sig/stigg/models/v1/subscription_import_response.rbs +30 -0
- data/sig/stigg/models/v1/subscription_list_params.rbs +14 -14
- data/sig/stigg/models/v1/subscription_list_response.rbs +196 -189
- data/sig/stigg/models/v1/subscription_preview_params.rbs +2 -6
- data/sig/stigg/models/v1/subscription_provision_params.rbs +2223 -0
- data/sig/stigg/models/v1/subscription_provision_response.rbs +1305 -0
- data/sig/stigg/models/v1/subscription_update_params.rbs +1544 -0
- data/sig/stigg/models/v1/subscriptions/cancel_subscription.rbs +34 -0
- data/sig/stigg/models/v1/usage_history_params.rbs +52 -0
- data/sig/stigg/models/v1/usage_history_response.rbs +129 -0
- data/sig/stigg/models/v1/usage_report_params.rbs +102 -0
- data/sig/stigg/models/v1/usage_report_response.rbs +87 -0
- data/sig/stigg/models.rbs +0 -4
- data/sig/stigg/resources/v1/coupons.rbs +5 -5
- data/sig/stigg/resources/v1/customers/{promotional.rbs → promotional_entitlements.rbs} +5 -5
- data/sig/stigg/resources/v1/customers.rbs +20 -17
- data/sig/stigg/resources/v1/events.rbs +14 -0
- data/sig/stigg/resources/v1/subscriptions/future_update.rbs +2 -2
- data/sig/stigg/resources/v1/subscriptions.rbs +68 -20
- data/sig/stigg/resources/v1/usage.rbs +24 -0
- data/sig/stigg/resources/v1.rbs +2 -8
- metadata +77 -71
- data/lib/stigg/models/v1/coupon_retrieve_response.rb +0 -317
- data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +0 -56
- data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +0 -145
- data/lib/stigg/models/v1/subscription_create_params.rb +0 -214
- data/lib/stigg/models/v1/subscription_create_response.rb +0 -338
- data/lib/stigg/models/v1/subscription_delegate_response.rb +0 -274
- data/lib/stigg/models/v1/subscription_migrate_response.rb +0 -274
- data/lib/stigg/models/v1/subscription_transfer_response.rb +0 -274
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +0 -32
- data/lib/stigg/models/v1_create_event_params.rb +0 -87
- data/lib/stigg/models/v1_create_event_response.rb +0 -16
- data/lib/stigg/models/v1_create_usage_params.rb +0 -96
- data/lib/stigg/models/v1_create_usage_response.rb +0 -112
- data/lib/stigg/resources/v1/customers/usage.rb +0 -59
- data/rbi/stigg/models/v1/coupon_create_response.rbi +0 -986
- data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +0 -986
- data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +0 -495
- data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +0 -497
- data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +0 -84
- data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +0 -353
- data/rbi/stigg/models/v1/subscription_create_params.rbi +0 -394
- data/rbi/stigg/models/v1/subscription_create_response.rbi +0 -668
- data/rbi/stigg/models/v1/subscription_delegate_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscription_transfer_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +0 -79
- data/rbi/stigg/models/v1_create_event_params.rbi +0 -160
- data/rbi/stigg/models/v1_create_event_response.rbi +0 -23
- data/rbi/stigg/models/v1_create_usage_params.rbi +0 -177
- data/rbi/stigg/models/v1_create_usage_response.rbi +0 -150
- data/rbi/stigg/resources/v1/customers/usage.rbi +0 -45
- data/sig/stigg/models/v1/coupon_retrieve_response.rbs +0 -394
- data/sig/stigg/models/v1/customers/promotional_create_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +0 -54
- data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +0 -134
- data/sig/stigg/models/v1/subscription_create_params.rbs +0 -199
- data/sig/stigg/models/v1/subscription_create_response.rbs +0 -283
- data/sig/stigg/models/v1/subscription_delegate_response.rbs +0 -224
- data/sig/stigg/models/v1/subscription_migrate_response.rbs +0 -224
- data/sig/stigg/models/v1/subscription_transfer_response.rbs +0 -224
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +0 -34
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +0 -34
- data/sig/stigg/models/v1_create_event_params.rbs +0 -80
- data/sig/stigg/models/v1_create_event_response.rbs +0 -13
- data/sig/stigg/models/v1_create_usage_params.rbs +0 -90
- data/sig/stigg/models/v1_create_usage_response.rbs +0 -85
- data/sig/stigg/resources/v1/customers/usage.rbs +0 -21
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
class UsageReportResponse < Stigg::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Stigg::Models::V1::UsageReportResponse,
|
|
11
|
+
Stigg::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Array of usage measurements with current values and period info
|
|
16
|
+
sig { returns(T::Array[Stigg::Models::V1::UsageReportResponse::Data]) }
|
|
17
|
+
attr_accessor :data
|
|
18
|
+
|
|
19
|
+
# Response containing reported usage measurements with current usage values,
|
|
20
|
+
# period information, and reset dates for each measurement.
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
data: T::Array[Stigg::Models::V1::UsageReportResponse::Data::OrHash]
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# Array of usage measurements with current values and period info
|
|
28
|
+
data:
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
sig do
|
|
33
|
+
override.returns(
|
|
34
|
+
{ data: T::Array[Stigg::Models::V1::UsageReportResponse::Data] }
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
def to_hash
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
class Data < Stigg::Internal::Type::BaseModel
|
|
41
|
+
OrHash =
|
|
42
|
+
T.type_alias do
|
|
43
|
+
T.any(
|
|
44
|
+
Stigg::Models::V1::UsageReportResponse::Data,
|
|
45
|
+
Stigg::Internal::AnyHash
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Unique identifier for the entity
|
|
50
|
+
sig { returns(String) }
|
|
51
|
+
attr_accessor :id
|
|
52
|
+
|
|
53
|
+
# Timestamp of when the record was created
|
|
54
|
+
sig { returns(Time) }
|
|
55
|
+
attr_accessor :created_at
|
|
56
|
+
|
|
57
|
+
# Customer id
|
|
58
|
+
sig { returns(String) }
|
|
59
|
+
attr_accessor :customer_id
|
|
60
|
+
|
|
61
|
+
# Feature id
|
|
62
|
+
sig { returns(String) }
|
|
63
|
+
attr_accessor :feature_id
|
|
64
|
+
|
|
65
|
+
# Timestamp
|
|
66
|
+
sig { returns(Time) }
|
|
67
|
+
attr_accessor :timestamp
|
|
68
|
+
|
|
69
|
+
# The usage measurement record
|
|
70
|
+
sig { returns(Float) }
|
|
71
|
+
attr_accessor :value
|
|
72
|
+
|
|
73
|
+
# The current measured usage value
|
|
74
|
+
sig { returns(T.nilable(Float)) }
|
|
75
|
+
attr_accessor :current_usage
|
|
76
|
+
|
|
77
|
+
# The date when the next usage reset will occur
|
|
78
|
+
sig { returns(T.nilable(Time)) }
|
|
79
|
+
attr_accessor :next_reset_date
|
|
80
|
+
|
|
81
|
+
# Resource id
|
|
82
|
+
sig { returns(T.nilable(String)) }
|
|
83
|
+
attr_accessor :resource_id
|
|
84
|
+
|
|
85
|
+
# The end date of the usage period in which this measurement resides (for
|
|
86
|
+
# entitlements with a reset period)
|
|
87
|
+
sig { returns(T.nilable(Time)) }
|
|
88
|
+
attr_accessor :usage_period_end
|
|
89
|
+
|
|
90
|
+
# The start date of the usage period in which this measurement resides (for
|
|
91
|
+
# entitlements with a reset period)
|
|
92
|
+
sig { returns(T.nilable(Time)) }
|
|
93
|
+
attr_accessor :usage_period_start
|
|
94
|
+
|
|
95
|
+
# Recorded usage with period info
|
|
96
|
+
sig do
|
|
97
|
+
params(
|
|
98
|
+
id: String,
|
|
99
|
+
created_at: Time,
|
|
100
|
+
customer_id: String,
|
|
101
|
+
feature_id: String,
|
|
102
|
+
timestamp: Time,
|
|
103
|
+
value: Float,
|
|
104
|
+
current_usage: T.nilable(Float),
|
|
105
|
+
next_reset_date: T.nilable(Time),
|
|
106
|
+
resource_id: T.nilable(String),
|
|
107
|
+
usage_period_end: T.nilable(Time),
|
|
108
|
+
usage_period_start: T.nilable(Time)
|
|
109
|
+
).returns(T.attached_class)
|
|
110
|
+
end
|
|
111
|
+
def self.new(
|
|
112
|
+
# Unique identifier for the entity
|
|
113
|
+
id:,
|
|
114
|
+
# Timestamp of when the record was created
|
|
115
|
+
created_at:,
|
|
116
|
+
# Customer id
|
|
117
|
+
customer_id:,
|
|
118
|
+
# Feature id
|
|
119
|
+
feature_id:,
|
|
120
|
+
# Timestamp
|
|
121
|
+
timestamp:,
|
|
122
|
+
# The usage measurement record
|
|
123
|
+
value:,
|
|
124
|
+
# The current measured usage value
|
|
125
|
+
current_usage: nil,
|
|
126
|
+
# The date when the next usage reset will occur
|
|
127
|
+
next_reset_date: nil,
|
|
128
|
+
# Resource id
|
|
129
|
+
resource_id: nil,
|
|
130
|
+
# The end date of the usage period in which this measurement resides (for
|
|
131
|
+
# entitlements with a reset period)
|
|
132
|
+
usage_period_end: nil,
|
|
133
|
+
# The start date of the usage period in which this measurement resides (for
|
|
134
|
+
# entitlements with a reset period)
|
|
135
|
+
usage_period_start: nil
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
sig do
|
|
140
|
+
override.returns(
|
|
141
|
+
{
|
|
142
|
+
id: String,
|
|
143
|
+
created_at: Time,
|
|
144
|
+
customer_id: String,
|
|
145
|
+
feature_id: String,
|
|
146
|
+
timestamp: Time,
|
|
147
|
+
value: Float,
|
|
148
|
+
current_usage: T.nilable(Float),
|
|
149
|
+
next_reset_date: T.nilable(Time),
|
|
150
|
+
resource_id: T.nilable(String),
|
|
151
|
+
usage_period_end: T.nilable(Time),
|
|
152
|
+
usage_period_start: T.nilable(Time)
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
def to_hash
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
data/rbi/stigg/models.rbi
CHANGED
|
@@ -4,7 +4,7 @@ module Stigg
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Coupons
|
|
7
|
-
# Create
|
|
7
|
+
# Create coupon
|
|
8
8
|
sig do
|
|
9
9
|
params(
|
|
10
10
|
id: String,
|
|
@@ -18,7 +18,7 @@ module Stigg
|
|
|
18
18
|
percent_off: T.nilable(Float),
|
|
19
19
|
additional_meta_data: T.anything,
|
|
20
20
|
request_options: Stigg::RequestOptions::OrHash
|
|
21
|
-
).returns(Stigg::
|
|
21
|
+
).returns(Stigg::V1::Coupon)
|
|
22
22
|
end
|
|
23
23
|
def create(
|
|
24
24
|
# The unique identifier for the entity
|
|
@@ -39,32 +39,40 @@ module Stigg
|
|
|
39
39
|
)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
# Get a single
|
|
42
|
+
# Get a single coupon by ID
|
|
43
43
|
sig do
|
|
44
44
|
params(
|
|
45
45
|
id: String,
|
|
46
46
|
request_options: Stigg::RequestOptions::OrHash
|
|
47
|
-
).returns(Stigg::
|
|
47
|
+
).returns(Stigg::V1::Coupon)
|
|
48
48
|
end
|
|
49
|
-
def retrieve(
|
|
49
|
+
def retrieve(
|
|
50
|
+
# The unique identifier of the entity
|
|
51
|
+
id,
|
|
52
|
+
request_options: {}
|
|
53
|
+
)
|
|
50
54
|
end
|
|
51
55
|
|
|
52
|
-
# Get a list of
|
|
56
|
+
# Get a list of coupons
|
|
53
57
|
sig do
|
|
54
58
|
params(
|
|
55
|
-
|
|
59
|
+
after: String,
|
|
60
|
+
before: String,
|
|
56
61
|
limit: Integer,
|
|
57
|
-
starting_after: String,
|
|
58
62
|
request_options: Stigg::RequestOptions::OrHash
|
|
59
|
-
).returns(
|
|
63
|
+
).returns(
|
|
64
|
+
Stigg::Internal::MyCursorIDPage[
|
|
65
|
+
Stigg::Models::V1::CouponListResponse
|
|
66
|
+
]
|
|
67
|
+
)
|
|
60
68
|
end
|
|
61
69
|
def list(
|
|
62
|
-
#
|
|
63
|
-
|
|
64
|
-
#
|
|
70
|
+
# Return items that come after this cursor
|
|
71
|
+
after: nil,
|
|
72
|
+
# Return items that come before this cursor
|
|
73
|
+
before: nil,
|
|
74
|
+
# Maximum number of items to return
|
|
65
75
|
limit: nil,
|
|
66
|
-
# Starting after this UUID for pagination
|
|
67
|
-
starting_after: nil,
|
|
68
76
|
request_options: {}
|
|
69
77
|
)
|
|
70
78
|
end
|
|
@@ -5,7 +5,7 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class PaymentMethod
|
|
8
|
-
#
|
|
8
|
+
# Attach payment method
|
|
9
9
|
sig do
|
|
10
10
|
params(
|
|
11
11
|
id: String,
|
|
@@ -21,6 +21,7 @@ module Stigg
|
|
|
21
21
|
).returns(Stigg::V1::CustomerResponse)
|
|
22
22
|
end
|
|
23
23
|
def attach(
|
|
24
|
+
# The unique identifier of the entity
|
|
24
25
|
id,
|
|
25
26
|
# Integration details
|
|
26
27
|
integration_id:,
|
|
@@ -28,19 +29,24 @@ module Stigg
|
|
|
28
29
|
payment_method_id:,
|
|
29
30
|
# The vendor identifier of integration
|
|
30
31
|
vendor_identifier:,
|
|
32
|
+
# Customers selected currency
|
|
31
33
|
billing_currency: nil,
|
|
32
34
|
request_options: {}
|
|
33
35
|
)
|
|
34
36
|
end
|
|
35
37
|
|
|
36
|
-
#
|
|
38
|
+
# Detach payment method
|
|
37
39
|
sig do
|
|
38
40
|
params(
|
|
39
41
|
id: String,
|
|
40
42
|
request_options: Stigg::RequestOptions::OrHash
|
|
41
43
|
).returns(Stigg::V1::CustomerResponse)
|
|
42
44
|
end
|
|
43
|
-
def detach(
|
|
45
|
+
def detach(
|
|
46
|
+
# The unique identifier of the entity
|
|
47
|
+
id,
|
|
48
|
+
request_options: {}
|
|
49
|
+
)
|
|
44
50
|
end
|
|
45
51
|
|
|
46
52
|
# @api private
|
|
@@ -4,20 +4,22 @@ module Stigg
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
|
-
class
|
|
8
|
-
# Create a
|
|
7
|
+
class PromotionalEntitlements
|
|
8
|
+
# Create a promotional entitlements
|
|
9
9
|
sig do
|
|
10
10
|
params(
|
|
11
11
|
customer_id: String,
|
|
12
12
|
promotional_entitlements:
|
|
13
13
|
T::Array[
|
|
14
|
-
Stigg::V1::Customers::
|
|
14
|
+
Stigg::V1::Customers::PromotionalEntitlementGrantParams::PromotionalEntitlement::OrHash
|
|
15
15
|
],
|
|
16
16
|
request_options: Stigg::RequestOptions::OrHash
|
|
17
|
-
).returns(
|
|
17
|
+
).returns(
|
|
18
|
+
Stigg::Models::V1::Customers::PromotionalEntitlementGrantResponse
|
|
19
|
+
)
|
|
18
20
|
end
|
|
19
|
-
def
|
|
20
|
-
# The unique identifier of the
|
|
21
|
+
def grant(
|
|
22
|
+
# The unique identifier of the customer
|
|
21
23
|
customer_id,
|
|
22
24
|
# Promotional entitlements to grant
|
|
23
25
|
promotional_entitlements:,
|
|
@@ -25,18 +27,20 @@ module Stigg
|
|
|
25
27
|
)
|
|
26
28
|
end
|
|
27
29
|
|
|
28
|
-
#
|
|
30
|
+
# Revoke promotional entitlement
|
|
29
31
|
sig do
|
|
30
32
|
params(
|
|
31
33
|
feature_id: String,
|
|
32
34
|
customer_id: String,
|
|
33
35
|
request_options: Stigg::RequestOptions::OrHash
|
|
34
|
-
).returns(
|
|
36
|
+
).returns(
|
|
37
|
+
Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse
|
|
38
|
+
)
|
|
35
39
|
end
|
|
36
40
|
def revoke(
|
|
37
41
|
# The unique identifier of the entitlement feature
|
|
38
42
|
feature_id,
|
|
39
|
-
# The unique identifier of the
|
|
43
|
+
# The unique identifier of the customer
|
|
40
44
|
customer_id:,
|
|
41
45
|
request_options: {}
|
|
42
46
|
)
|
|
@@ -7,36 +7,43 @@ module Stigg
|
|
|
7
7
|
sig { returns(Stigg::Resources::V1::Customers::PaymentMethod) }
|
|
8
8
|
attr_reader :payment_method
|
|
9
9
|
|
|
10
|
-
sig
|
|
11
|
-
|
|
10
|
+
sig do
|
|
11
|
+
returns(Stigg::Resources::V1::Customers::PromotionalEntitlements)
|
|
12
|
+
end
|
|
13
|
+
attr_reader :promotional_entitlements
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
# Get a single customer by ID
|
|
16
|
+
sig do
|
|
17
|
+
params(
|
|
18
|
+
id: String,
|
|
19
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
20
|
+
).returns(Stigg::V1::CustomerResponse)
|
|
21
|
+
end
|
|
22
|
+
def retrieve(
|
|
23
|
+
# The unique identifier of the entity
|
|
24
|
+
id,
|
|
25
|
+
request_options: {}
|
|
26
|
+
)
|
|
27
|
+
end
|
|
15
28
|
|
|
16
|
-
#
|
|
29
|
+
# Update a customer
|
|
17
30
|
sig do
|
|
18
31
|
params(
|
|
19
32
|
id: String,
|
|
20
33
|
coupon_id: T.nilable(String),
|
|
21
|
-
default_payment_method:
|
|
22
|
-
T.nilable(
|
|
23
|
-
Stigg::V1::CustomerCreateParams::DefaultPaymentMethod::OrHash
|
|
24
|
-
),
|
|
25
34
|
email: T.nilable(String),
|
|
26
35
|
integrations:
|
|
27
|
-
T::Array[Stigg::V1::
|
|
36
|
+
T::Array[Stigg::V1::CustomerUpdateParams::Integration::OrHash],
|
|
28
37
|
metadata: T::Hash[Symbol, String],
|
|
29
38
|
name: T.nilable(String),
|
|
30
39
|
request_options: Stigg::RequestOptions::OrHash
|
|
31
40
|
).returns(Stigg::V1::CustomerResponse)
|
|
32
41
|
end
|
|
33
|
-
def
|
|
34
|
-
#
|
|
35
|
-
id
|
|
42
|
+
def update(
|
|
43
|
+
# The unique identifier of the entity
|
|
44
|
+
id,
|
|
36
45
|
# Customer level coupon
|
|
37
46
|
coupon_id: nil,
|
|
38
|
-
# The default payment method details
|
|
39
|
-
default_payment_method: nil,
|
|
40
47
|
# The email of the customer
|
|
41
48
|
email: nil,
|
|
42
49
|
# List of integrations
|
|
@@ -49,83 +56,107 @@ module Stigg
|
|
|
49
56
|
)
|
|
50
57
|
end
|
|
51
58
|
|
|
52
|
-
# Get a
|
|
59
|
+
# Get a list of customers
|
|
53
60
|
sig do
|
|
54
61
|
params(
|
|
55
|
-
|
|
62
|
+
after: String,
|
|
63
|
+
before: String,
|
|
64
|
+
limit: Integer,
|
|
56
65
|
request_options: Stigg::RequestOptions::OrHash
|
|
57
|
-
).returns(
|
|
66
|
+
).returns(
|
|
67
|
+
Stigg::Internal::MyCursorIDPage[
|
|
68
|
+
Stigg::Models::V1::CustomerListResponse
|
|
69
|
+
]
|
|
70
|
+
)
|
|
58
71
|
end
|
|
59
|
-
def
|
|
72
|
+
def list(
|
|
73
|
+
# Return items that come after this cursor
|
|
74
|
+
after: nil,
|
|
75
|
+
# Return items that come before this cursor
|
|
76
|
+
before: nil,
|
|
77
|
+
# Maximum number of items to return
|
|
78
|
+
limit: nil,
|
|
79
|
+
request_options: {}
|
|
80
|
+
)
|
|
60
81
|
end
|
|
61
82
|
|
|
62
|
-
#
|
|
83
|
+
# Archive customer
|
|
63
84
|
sig do
|
|
64
85
|
params(
|
|
65
86
|
id: String,
|
|
66
|
-
coupon_id: T.nilable(String),
|
|
67
|
-
email: T.nilable(String),
|
|
68
|
-
integrations:
|
|
69
|
-
T::Array[Stigg::V1::CustomerUpdateParams::Integration::OrHash],
|
|
70
|
-
metadata: T::Hash[Symbol, String],
|
|
71
|
-
name: T.nilable(String),
|
|
72
87
|
request_options: Stigg::RequestOptions::OrHash
|
|
73
88
|
).returns(Stigg::V1::CustomerResponse)
|
|
74
89
|
end
|
|
75
|
-
def
|
|
90
|
+
def archive(
|
|
91
|
+
# The unique identifier of the entity
|
|
76
92
|
id,
|
|
77
|
-
# Customer level coupon
|
|
78
|
-
coupon_id: nil,
|
|
79
|
-
# The email of the customer
|
|
80
|
-
email: nil,
|
|
81
|
-
# List of integrations
|
|
82
|
-
integrations: nil,
|
|
83
|
-
# Additional metadata
|
|
84
|
-
metadata: nil,
|
|
85
|
-
# The name of the customer
|
|
86
|
-
name: nil,
|
|
87
93
|
request_options: {}
|
|
88
94
|
)
|
|
89
95
|
end
|
|
90
96
|
|
|
91
|
-
#
|
|
97
|
+
# Bulk import customers
|
|
92
98
|
sig do
|
|
93
99
|
params(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
starting_after: String,
|
|
100
|
+
customers:
|
|
101
|
+
T::Array[Stigg::V1::CustomerImportParams::Customer::OrHash],
|
|
97
102
|
request_options: Stigg::RequestOptions::OrHash
|
|
98
|
-
).returns(Stigg::Models::V1::
|
|
103
|
+
).returns(Stigg::Models::V1::CustomerImportResponse)
|
|
99
104
|
end
|
|
100
|
-
def
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
# Items per page
|
|
104
|
-
limit: nil,
|
|
105
|
-
# Starting after this UUID for pagination
|
|
106
|
-
starting_after: nil,
|
|
105
|
+
def import(
|
|
106
|
+
# List of customer objects to import
|
|
107
|
+
customers:,
|
|
107
108
|
request_options: {}
|
|
108
109
|
)
|
|
109
110
|
end
|
|
110
111
|
|
|
111
|
-
#
|
|
112
|
+
# Provision customer
|
|
112
113
|
sig do
|
|
113
114
|
params(
|
|
114
115
|
id: String,
|
|
116
|
+
coupon_id: T.nilable(String),
|
|
117
|
+
default_payment_method:
|
|
118
|
+
T.nilable(
|
|
119
|
+
Stigg::V1::CustomerProvisionParams::DefaultPaymentMethod::OrHash
|
|
120
|
+
),
|
|
121
|
+
email: T.nilable(String),
|
|
122
|
+
integrations:
|
|
123
|
+
T::Array[Stigg::V1::CustomerProvisionParams::Integration::OrHash],
|
|
124
|
+
metadata: T::Hash[Symbol, String],
|
|
125
|
+
name: T.nilable(String),
|
|
115
126
|
request_options: Stigg::RequestOptions::OrHash
|
|
116
127
|
).returns(Stigg::V1::CustomerResponse)
|
|
117
128
|
end
|
|
118
|
-
def
|
|
129
|
+
def provision(
|
|
130
|
+
# Customer slug
|
|
131
|
+
id:,
|
|
132
|
+
# Customer level coupon
|
|
133
|
+
coupon_id: nil,
|
|
134
|
+
# The default payment method details
|
|
135
|
+
default_payment_method: nil,
|
|
136
|
+
# The email of the customer
|
|
137
|
+
email: nil,
|
|
138
|
+
# List of integrations
|
|
139
|
+
integrations: nil,
|
|
140
|
+
# Additional metadata
|
|
141
|
+
metadata: nil,
|
|
142
|
+
# The name of the customer
|
|
143
|
+
name: nil,
|
|
144
|
+
request_options: {}
|
|
145
|
+
)
|
|
119
146
|
end
|
|
120
147
|
|
|
121
|
-
#
|
|
148
|
+
# Unarchive customer
|
|
122
149
|
sig do
|
|
123
150
|
params(
|
|
124
151
|
id: String,
|
|
125
152
|
request_options: Stigg::RequestOptions::OrHash
|
|
126
153
|
).returns(Stigg::V1::CustomerResponse)
|
|
127
154
|
end
|
|
128
|
-
def unarchive(
|
|
155
|
+
def unarchive(
|
|
156
|
+
# The unique identifier of the entity
|
|
157
|
+
id,
|
|
158
|
+
request_options: {}
|
|
159
|
+
)
|
|
129
160
|
end
|
|
130
161
|
|
|
131
162
|
# @api private
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Events
|
|
7
|
+
# Report usage events
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
events: T::Array[Stigg::V1::EventReportParams::Event::OrHash],
|
|
11
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
12
|
+
).returns(Stigg::Models::V1::EventReportResponse)
|
|
13
|
+
end
|
|
14
|
+
def report(
|
|
15
|
+
# A list of usage events to report
|
|
16
|
+
events:,
|
|
17
|
+
request_options: {}
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @api private
|
|
22
|
+
sig { params(client: Stigg::Client).returns(T.attached_class) }
|
|
23
|
+
def self.new(client:)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -5,28 +5,32 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Subscriptions
|
|
7
7
|
class FutureUpdate
|
|
8
|
-
#
|
|
8
|
+
# Cancel pending payment update
|
|
9
9
|
sig do
|
|
10
10
|
params(
|
|
11
11
|
id: String,
|
|
12
12
|
request_options: Stigg::RequestOptions::OrHash
|
|
13
|
-
).returns(
|
|
14
|
-
Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse
|
|
15
|
-
)
|
|
13
|
+
).returns(Stigg::V1::Subscriptions::CancelSubscription)
|
|
16
14
|
end
|
|
17
|
-
def cancel_pending_payment(
|
|
15
|
+
def cancel_pending_payment(
|
|
16
|
+
# The unique identifier of the entity
|
|
17
|
+
id,
|
|
18
|
+
request_options: {}
|
|
19
|
+
)
|
|
18
20
|
end
|
|
19
21
|
|
|
20
|
-
#
|
|
22
|
+
# Cancel scheduled update
|
|
21
23
|
sig do
|
|
22
24
|
params(
|
|
23
25
|
id: String,
|
|
24
26
|
request_options: Stigg::RequestOptions::OrHash
|
|
25
|
-
).returns(
|
|
26
|
-
Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse
|
|
27
|
-
)
|
|
27
|
+
).returns(Stigg::V1::Subscriptions::CancelSubscription)
|
|
28
28
|
end
|
|
29
|
-
def cancel_schedule(
|
|
29
|
+
def cancel_schedule(
|
|
30
|
+
# The unique identifier of the entity
|
|
31
|
+
id,
|
|
32
|
+
request_options: {}
|
|
33
|
+
)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @api private
|