stigg 0.1.0.pre.alpha.2 → 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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/stigg/internal/type/base_model.rb +2 -2
  5. data/lib/stigg/models/v1/{coupon_create_response.rb → coupon.rb} +24 -24
  6. data/lib/stigg/models/v1/customer_import_params.rb +75 -0
  7. data/lib/stigg/models/v1/customer_import_response.rb +35 -0
  8. data/lib/stigg/models/v1/{customer_create_params.rb → customer_provision_params.rb} +16 -16
  9. data/lib/stigg/models/v1/customer_response.rb +1 -1
  10. data/lib/stigg/models/v1/customers/promotional_entitlement_grant_params.rb +296 -0
  11. data/lib/stigg/models/v1/customers/promotional_entitlement_grant_response.rb +341 -0
  12. data/lib/stigg/models/v1/customers/promotional_entitlement_revoke_params.rb +24 -0
  13. data/lib/stigg/models/v1/customers/promotional_entitlement_revoke_response.rb +342 -0
  14. data/lib/stigg/models/v1/event_report_params.rb +91 -0
  15. data/lib/stigg/models/v1/event_report_response.rb +25 -0
  16. data/lib/stigg/models/v1/{subscription_retrieve_response.rb → subscription.rb} +30 -29
  17. data/lib/stigg/models/v1/subscription_cancel_params.rb +75 -0
  18. data/lib/stigg/models/v1/subscription_import_params.rb +92 -0
  19. data/lib/stigg/models/v1/subscription_import_response.rb +32 -0
  20. data/lib/stigg/models/v1/{subscription_create_params.rb → subscription_provision_params.rb} +118 -118
  21. data/lib/stigg/models/v1/{subscription_create_response.rb → subscription_provision_response.rb} +76 -75
  22. data/lib/stigg/models/v1/subscription_update_params.rb +1114 -0
  23. data/lib/stigg/models/v1/subscriptions/{future_update_cancel_pending_payment_response.rb → cancel_subscription.rb} +7 -5
  24. data/lib/stigg/models/v1/usage_history_params.rb +54 -0
  25. data/lib/stigg/models/v1/usage_history_response.rb +155 -0
  26. data/lib/stigg/models/v1/usage_report_params.rb +114 -0
  27. data/lib/stigg/models/v1/usage_report_response.rb +120 -0
  28. data/lib/stigg/models.rb +0 -4
  29. data/lib/stigg/resources/v1/coupons.rb +4 -4
  30. data/lib/stigg/resources/v1/customers/promotional_entitlements.rb +69 -0
  31. data/lib/stigg/resources/v1/customers.rb +59 -37
  32. data/lib/stigg/resources/v1/events.rb +38 -0
  33. data/lib/stigg/resources/v1/subscriptions/future_update.rb +4 -4
  34. data/lib/stigg/resources/v1/subscriptions.rb +166 -64
  35. data/lib/stigg/resources/v1/usage.rb +79 -0
  36. data/lib/stigg/resources/v1.rb +6 -42
  37. data/lib/stigg/version.rb +1 -1
  38. data/lib/stigg.rb +25 -16
  39. data/rbi/stigg/models/v1/{coupon_create_response.rbi → coupon.rbi} +156 -252
  40. data/rbi/stigg/models/v1/customer_import_params.rbi +130 -0
  41. data/rbi/stigg/models/v1/customer_import_response.rbi +76 -0
  42. data/rbi/stigg/models/v1/{customer_create_params.rbi → customer_provision_params.rbi} +35 -35
  43. data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_params.rbi +640 -0
  44. data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_response.rbi +690 -0
  45. data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_params.rbi +42 -0
  46. data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbi +696 -0
  47. data/rbi/stigg/models/v1/event_report_params.rbi +168 -0
  48. data/rbi/stigg/models/v1/event_report_response.rbi +35 -0
  49. data/rbi/stigg/models/v1/{subscription_migrate_response.rbi → subscription.rbi} +66 -117
  50. data/rbi/stigg/models/v1/subscription_cancel_params.rbi +182 -0
  51. data/rbi/stigg/models/v1/subscription_import_params.rbi +148 -0
  52. data/rbi/stigg/models/v1/subscription_import_response.rbi +69 -0
  53. data/rbi/stigg/models/v1/{subscription_create_params.rbi → subscription_provision_params.rbi} +794 -773
  54. data/rbi/stigg/models/v1/{subscription_create_response.rbi → subscription_provision_response.rbi} +481 -481
  55. data/rbi/stigg/models/v1/subscription_update_params.rbi +3578 -0
  56. data/rbi/stigg/models/v1/subscriptions/{future_update_cancel_schedule_response.rbi → cancel_subscription.rbi} +9 -16
  57. data/rbi/stigg/models/v1/usage_history_params.rbi +79 -0
  58. data/rbi/stigg/models/v1/usage_history_response.rbi +347 -0
  59. data/rbi/stigg/models/v1/usage_report_params.rbi +227 -0
  60. data/rbi/stigg/models/v1/usage_report_response.rbi +162 -0
  61. data/rbi/stigg/models.rbi +0 -4
  62. data/rbi/stigg/resources/v1/coupons.rbi +2 -2
  63. data/rbi/stigg/resources/v1/customers/promotional_entitlements.rbi +57 -0
  64. data/rbi/stigg/resources/v1/customers.rbi +53 -36
  65. data/rbi/stigg/resources/v1/events.rbi +28 -0
  66. data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +2 -6
  67. data/rbi/stigg/resources/v1/subscriptions.rbi +179 -74
  68. data/rbi/stigg/resources/v1/usage.rbi +57 -0
  69. data/rbi/stigg/resources/v1.rbi +4 -26
  70. data/sig/stigg/models/v1/{coupon_create_response.rbs → coupon.rbs} +29 -32
  71. data/sig/stigg/models/v1/customer_import_params.rbs +74 -0
  72. data/sig/stigg/models/v1/customer_import_response.rbs +30 -0
  73. data/sig/stigg/models/v1/{customer_create_params.rbs → customer_provision_params.rbs} +22 -22
  74. data/sig/stigg/models/v1/customers/promotional_entitlement_grant_params.rbs +234 -0
  75. data/sig/stigg/models/v1/customers/promotional_entitlement_grant_response.rbs +281 -0
  76. data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_params.rbs +27 -0
  77. data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbs +281 -0
  78. data/sig/stigg/models/v1/event_report_params.rbs +82 -0
  79. data/sig/stigg/models/v1/event_report_response.rbs +15 -0
  80. data/sig/stigg/models/v1/{subscription_retrieve_response.rbs → subscription.rbs} +36 -41
  81. data/sig/stigg/models/v1/subscription_cancel_params.rbs +79 -0
  82. data/sig/stigg/models/v1/subscription_import_params.rbs +84 -0
  83. data/sig/stigg/models/v1/subscription_import_response.rbs +30 -0
  84. data/sig/stigg/models/v1/{subscription_create_params.rbs → subscription_provision_params.rbs} +200 -200
  85. data/sig/stigg/models/v1/{subscription_create_response.rbs → subscription_provision_response.rbs} +106 -106
  86. data/sig/stigg/models/v1/subscription_update_params.rbs +1544 -0
  87. data/sig/stigg/models/v1/subscriptions/cancel_subscription.rbs +34 -0
  88. data/sig/stigg/models/v1/usage_history_params.rbs +52 -0
  89. data/sig/stigg/models/v1/usage_history_response.rbs +129 -0
  90. data/sig/stigg/models/v1/usage_report_params.rbs +102 -0
  91. data/sig/stigg/models/v1/usage_report_response.rbs +87 -0
  92. data/sig/stigg/models.rbs +0 -4
  93. data/sig/stigg/resources/v1/coupons.rbs +2 -2
  94. data/sig/stigg/resources/v1/customers/promotional_entitlements.rbs +23 -0
  95. data/sig/stigg/resources/v1/customers.rbs +17 -12
  96. data/sig/stigg/resources/v1/events.rbs +14 -0
  97. data/sig/stigg/resources/v1/subscriptions/future_update.rbs +2 -2
  98. data/sig/stigg/resources/v1/subscriptions.rbs +65 -32
  99. data/sig/stigg/resources/v1/usage.rbs +24 -0
  100. data/sig/stigg/resources/v1.rbs +2 -8
  101. metadata +77 -50
  102. data/lib/stigg/models/v1/coupon_retrieve_response.rb +0 -322
  103. data/lib/stigg/models/v1/subscription_delegate_response.rb +0 -314
  104. data/lib/stigg/models/v1/subscription_migrate_response.rb +0 -314
  105. data/lib/stigg/models/v1/subscription_transfer_response.rb +0 -314
  106. data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +0 -34
  107. data/lib/stigg/models/v1_create_event_params.rb +0 -89
  108. data/lib/stigg/models/v1_create_event_response.rb +0 -23
  109. data/lib/stigg/models/v1_create_usage_params.rb +0 -112
  110. data/lib/stigg/models/v1_create_usage_response.rb +0 -118
  111. data/lib/stigg/resources/v1/customers/usage.rb +0 -18
  112. data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +0 -987
  113. data/rbi/stigg/models/v1/subscription_delegate_response.rbi +0 -618
  114. data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +0 -618
  115. data/rbi/stigg/models/v1/subscription_transfer_response.rbi +0 -618
  116. data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +0 -80
  117. data/rbi/stigg/models/v1_create_event_params.rbi +0 -161
  118. data/rbi/stigg/models/v1_create_event_response.rbi +0 -30
  119. data/rbi/stigg/models/v1_create_usage_params.rbi +0 -217
  120. data/rbi/stigg/models/v1_create_usage_response.rbi +0 -157
  121. data/rbi/stigg/resources/v1/customers/usage.rbi +0 -16
  122. data/sig/stigg/models/v1/coupon_retrieve_response.rbs +0 -394
  123. data/sig/stigg/models/v1/subscription_delegate_response.rbs +0 -255
  124. data/sig/stigg/models/v1/subscription_migrate_response.rbs +0 -255
  125. data/sig/stigg/models/v1/subscription_transfer_response.rbs +0 -255
  126. data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +0 -34
  127. data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +0 -34
  128. data/sig/stigg/models/v1_create_event_params.rbs +0 -80
  129. data/sig/stigg/models/v1_create_event_response.rbs +0 -13
  130. data/sig/stigg/models/v1_create_usage_params.rbs +0 -100
  131. data/sig/stigg/models/v1_create_usage_response.rbs +0 -85
  132. data/sig/stigg/resources/v1/customers/usage.rbs +0 -11
@@ -7,113 +7,76 @@ module Stigg
7
7
  sig { returns(Stigg::Resources::V1::Subscriptions::FutureUpdate) }
8
8
  attr_reader :future_update
9
9
 
10
- # Provision subscription
10
+ # Get a single subscription by ID
11
+ sig do
12
+ params(
13
+ id: String,
14
+ request_options: Stigg::RequestOptions::OrHash
15
+ ).returns(Stigg::V1::Subscription)
16
+ end
17
+ def retrieve(
18
+ # The unique identifier of the entity
19
+ id,
20
+ request_options: {}
21
+ )
22
+ end
23
+
24
+ # Update a subscription
11
25
  sig do
12
26
  params(
13
- customer_id: String,
14
- plan_id: String,
15
27
  id: String,
16
28
  addons:
17
- T::Array[Stigg::V1::SubscriptionCreateParams::Addon::OrHash],
29
+ T::Array[Stigg::V1::SubscriptionUpdateParams::Addon::OrHash],
18
30
  applied_coupon:
19
- Stigg::V1::SubscriptionCreateParams::AppliedCoupon::OrHash,
31
+ Stigg::V1::SubscriptionUpdateParams::AppliedCoupon::OrHash,
20
32
  await_payment_confirmation: T::Boolean,
21
- billing_country_code: T.nilable(String),
22
- billing_id: T.nilable(String),
23
33
  billing_information:
24
- Stigg::V1::SubscriptionCreateParams::BillingInformation::OrHash,
34
+ Stigg::V1::SubscriptionUpdateParams::BillingInformation::OrHash,
25
35
  billing_period:
26
- Stigg::V1::SubscriptionCreateParams::BillingPeriod::OrSymbol,
36
+ Stigg::V1::SubscriptionUpdateParams::BillingPeriod::OrSymbol,
27
37
  budget:
28
- T.nilable(Stigg::V1::SubscriptionCreateParams::Budget::OrHash),
38
+ T.nilable(Stigg::V1::SubscriptionUpdateParams::Budget::OrHash),
29
39
  charges:
30
- T::Array[Stigg::V1::SubscriptionCreateParams::Charge::OrHash],
31
- checkout_options:
32
- Stigg::V1::SubscriptionCreateParams::CheckoutOptions::OrHash,
40
+ T::Array[Stigg::V1::SubscriptionUpdateParams::Charge::OrHash],
33
41
  metadata: T::Hash[Symbol, String],
34
42
  minimum_spend:
35
43
  T.nilable(
36
- Stigg::V1::SubscriptionCreateParams::MinimumSpend::OrHash
44
+ Stigg::V1::SubscriptionUpdateParams::MinimumSpend::OrHash
37
45
  ),
38
- paying_customer_id: T.nilable(String),
39
- payment_collection_method:
40
- Stigg::V1::SubscriptionCreateParams::PaymentCollectionMethod::OrSymbol,
41
46
  price_overrides:
42
47
  T::Array[
43
- Stigg::V1::SubscriptionCreateParams::PriceOverride::OrHash
48
+ Stigg::V1::SubscriptionUpdateParams::PriceOverride::OrHash
44
49
  ],
45
- resource_id: T.nilable(String),
46
- salesforce_id: T.nilable(String),
50
+ promotion_code: String,
47
51
  schedule_strategy:
48
- Stigg::V1::SubscriptionCreateParams::ScheduleStrategy::OrSymbol,
49
- start_date: Time,
52
+ Stigg::V1::SubscriptionUpdateParams::ScheduleStrategy::OrSymbol,
50
53
  subscription_entitlements:
51
54
  T::Array[
52
- Stigg::V1::SubscriptionCreateParams::SubscriptionEntitlement::OrHash
55
+ Stigg::V1::SubscriptionUpdateParams::SubscriptionEntitlement::OrHash
53
56
  ],
54
- trial_override_configuration:
55
- Stigg::V1::SubscriptionCreateParams::TrialOverrideConfiguration::OrHash,
56
- unit_quantity: Float,
57
+ trial_end_date: Time,
57
58
  request_options: Stigg::RequestOptions::OrHash
58
- ).returns(Stigg::Models::V1::SubscriptionCreateResponse)
59
+ ).returns(Stigg::V1::Subscription)
59
60
  end
60
- def create(
61
- # Customer ID to provision the subscription for
62
- customer_id:,
63
- # Plan ID to provision
64
- plan_id:,
65
- # Unique identifier for the subscription
66
- id: nil,
61
+ def update(
62
+ # The unique identifier of the entity
63
+ id,
67
64
  addons: nil,
68
- # Coupon configuration
69
65
  applied_coupon: nil,
70
- # Whether to wait for payment confirmation before returning the subscription
71
66
  await_payment_confirmation: nil,
72
- # The ISO 3166-1 alpha-2 country code for billing
73
- billing_country_code: nil,
74
- # External billing system identifier
75
- billing_id: nil,
76
67
  billing_information: nil,
77
- # Billing period (MONTHLY or ANNUALLY)
78
68
  billing_period: nil,
79
69
  budget: nil,
80
70
  charges: nil,
81
- # Checkout page configuration for payment collection
82
- checkout_options: nil,
83
71
  # Additional metadata for the subscription
84
72
  metadata: nil,
85
73
  minimum_spend: nil,
86
- # Optional paying customer ID for split billing scenarios
87
- paying_customer_id: nil,
88
- # How payments should be collected for this subscription
89
- payment_collection_method: nil,
90
74
  price_overrides: nil,
91
- # Optional resource ID for multi-instance subscriptions
92
- resource_id: nil,
93
- # Salesforce ID
94
- salesforce_id: nil,
95
- # Strategy for scheduling subscription changes
75
+ promotion_code: nil,
96
76
  schedule_strategy: nil,
97
- # Subscription start date
98
- start_date: nil,
99
77
  subscription_entitlements: nil,
100
- # Trial period override settings
101
- trial_override_configuration: nil,
102
- unit_quantity: nil,
103
- request_options: {}
104
- )
105
- end
106
-
107
- # Get a single subscription by ID
108
- sig do
109
- params(
110
- id: String,
111
- request_options: Stigg::RequestOptions::OrHash
112
- ).returns(Stigg::Models::V1::SubscriptionRetrieveResponse)
113
- end
114
- def retrieve(
115
- # The unique identifier of the entity
116
- id,
78
+ # Subscription trial end date
79
+ trial_end_date: nil,
117
80
  request_options: {}
118
81
  )
119
82
  end
@@ -148,13 +111,41 @@ module Stigg
148
111
  )
149
112
  end
150
113
 
114
+ # Cancel subscription
115
+ sig do
116
+ params(
117
+ id: String,
118
+ cancellation_action:
119
+ Stigg::V1::SubscriptionCancelParams::CancellationAction::OrSymbol,
120
+ cancellation_time:
121
+ Stigg::V1::SubscriptionCancelParams::CancellationTime::OrSymbol,
122
+ end_date: Time,
123
+ prorate: T::Boolean,
124
+ request_options: Stigg::RequestOptions::OrHash
125
+ ).returns(Stigg::V1::Subscription)
126
+ end
127
+ def cancel(
128
+ # The unique identifier of the entity
129
+ id,
130
+ # Action on cancellation (downgrade or revoke)
131
+ cancellation_action: nil,
132
+ # When to cancel (immediate, period end, or date)
133
+ cancellation_time: nil,
134
+ # Subscription end date
135
+ end_date: nil,
136
+ # If set, enables or disables prorating of credits on subscription cancellation.
137
+ prorate: nil,
138
+ request_options: {}
139
+ )
140
+ end
141
+
151
142
  # Delegate subscription payment to customer
152
143
  sig do
153
144
  params(
154
145
  id: String,
155
146
  target_customer_id: String,
156
147
  request_options: Stigg::RequestOptions::OrHash
157
- ).returns(Stigg::Models::V1::SubscriptionDelegateResponse)
148
+ ).returns(Stigg::V1::Subscription)
158
149
  end
159
150
  def delegate(
160
151
  # The unique identifier of the entity
@@ -167,6 +158,23 @@ module Stigg
167
158
  )
168
159
  end
169
160
 
161
+ # Bulk import subscriptions
162
+ sig do
163
+ params(
164
+ subscriptions:
165
+ T::Array[
166
+ Stigg::V1::SubscriptionImportParams::Subscription::OrHash
167
+ ],
168
+ request_options: Stigg::RequestOptions::OrHash
169
+ ).returns(Stigg::Models::V1::SubscriptionImportResponse)
170
+ end
171
+ def import(
172
+ # List of subscription objects to import
173
+ subscriptions:,
174
+ request_options: {}
175
+ )
176
+ end
177
+
170
178
  # Migrate subscription to latest plan version
171
179
  sig do
172
180
  params(
@@ -174,7 +182,7 @@ module Stigg
174
182
  subscription_migration_time:
175
183
  Stigg::V1::SubscriptionMigrateParams::SubscriptionMigrationTime::OrSymbol,
176
184
  request_options: Stigg::RequestOptions::OrHash
177
- ).returns(Stigg::Models::V1::SubscriptionMigrateResponse)
185
+ ).returns(Stigg::V1::Subscription)
178
186
  end
179
187
  def migrate(
180
188
  # The unique identifier of the entity
@@ -251,13 +259,110 @@ module Stigg
251
259
  )
252
260
  end
253
261
 
262
+ # Provision subscription
263
+ sig do
264
+ params(
265
+ customer_id: String,
266
+ plan_id: String,
267
+ id: String,
268
+ addons:
269
+ T::Array[Stigg::V1::SubscriptionProvisionParams::Addon::OrHash],
270
+ applied_coupon:
271
+ Stigg::V1::SubscriptionProvisionParams::AppliedCoupon::OrHash,
272
+ await_payment_confirmation: T::Boolean,
273
+ billing_country_code: T.nilable(String),
274
+ billing_id: T.nilable(String),
275
+ billing_information:
276
+ Stigg::V1::SubscriptionProvisionParams::BillingInformation::OrHash,
277
+ billing_period:
278
+ Stigg::V1::SubscriptionProvisionParams::BillingPeriod::OrSymbol,
279
+ budget:
280
+ T.nilable(Stigg::V1::SubscriptionProvisionParams::Budget::OrHash),
281
+ charges:
282
+ T::Array[Stigg::V1::SubscriptionProvisionParams::Charge::OrHash],
283
+ checkout_options:
284
+ Stigg::V1::SubscriptionProvisionParams::CheckoutOptions::OrHash,
285
+ metadata: T::Hash[Symbol, String],
286
+ minimum_spend:
287
+ T.nilable(
288
+ Stigg::V1::SubscriptionProvisionParams::MinimumSpend::OrHash
289
+ ),
290
+ paying_customer_id: T.nilable(String),
291
+ payment_collection_method:
292
+ Stigg::V1::SubscriptionProvisionParams::PaymentCollectionMethod::OrSymbol,
293
+ price_overrides:
294
+ T::Array[
295
+ Stigg::V1::SubscriptionProvisionParams::PriceOverride::OrHash
296
+ ],
297
+ resource_id: T.nilable(String),
298
+ salesforce_id: T.nilable(String),
299
+ schedule_strategy:
300
+ Stigg::V1::SubscriptionProvisionParams::ScheduleStrategy::OrSymbol,
301
+ start_date: Time,
302
+ subscription_entitlements:
303
+ T::Array[
304
+ Stigg::V1::SubscriptionProvisionParams::SubscriptionEntitlement::OrHash
305
+ ],
306
+ trial_override_configuration:
307
+ Stigg::V1::SubscriptionProvisionParams::TrialOverrideConfiguration::OrHash,
308
+ unit_quantity: Float,
309
+ request_options: Stigg::RequestOptions::OrHash
310
+ ).returns(Stigg::Models::V1::SubscriptionProvisionResponse)
311
+ end
312
+ def provision(
313
+ # Customer ID to provision the subscription for
314
+ customer_id:,
315
+ # Plan ID to provision
316
+ plan_id:,
317
+ # Unique identifier for the subscription
318
+ id: nil,
319
+ addons: nil,
320
+ # Coupon configuration
321
+ applied_coupon: nil,
322
+ # Whether to wait for payment confirmation before returning the subscription
323
+ await_payment_confirmation: nil,
324
+ # The ISO 3166-1 alpha-2 country code for billing
325
+ billing_country_code: nil,
326
+ # External billing system identifier
327
+ billing_id: nil,
328
+ billing_information: nil,
329
+ # Billing period (MONTHLY or ANNUALLY)
330
+ billing_period: nil,
331
+ budget: nil,
332
+ charges: nil,
333
+ # Checkout page configuration for payment collection
334
+ checkout_options: nil,
335
+ # Additional metadata for the subscription
336
+ metadata: nil,
337
+ minimum_spend: nil,
338
+ # Optional paying customer ID for split billing scenarios
339
+ paying_customer_id: nil,
340
+ # How payments should be collected for this subscription
341
+ payment_collection_method: nil,
342
+ price_overrides: nil,
343
+ # Optional resource ID for multi-instance subscriptions
344
+ resource_id: nil,
345
+ # Salesforce ID
346
+ salesforce_id: nil,
347
+ # Strategy for scheduling subscription changes
348
+ schedule_strategy: nil,
349
+ # Subscription start date
350
+ start_date: nil,
351
+ subscription_entitlements: nil,
352
+ # Trial period override settings
353
+ trial_override_configuration: nil,
354
+ unit_quantity: nil,
355
+ request_options: {}
356
+ )
357
+ end
358
+
254
359
  # Transfer subscription to resource
255
360
  sig do
256
361
  params(
257
362
  id: String,
258
363
  destination_resource_id: String,
259
364
  request_options: Stigg::RequestOptions::OrHash
260
- ).returns(Stigg::Models::V1::SubscriptionTransferResponse)
365
+ ).returns(Stigg::V1::Subscription)
261
366
  end
262
367
  def transfer(
263
368
  # The unique identifier of the entity
@@ -0,0 +1,57 @@
1
+ # typed: strong
2
+
3
+ module Stigg
4
+ module Resources
5
+ class V1
6
+ class Usage
7
+ # Get usage history
8
+ sig do
9
+ params(
10
+ feature_id: String,
11
+ customer_id: String,
12
+ start_date: Time,
13
+ end_date: Time,
14
+ group_by: String,
15
+ resource_id: T.nilable(String),
16
+ request_options: Stigg::RequestOptions::OrHash
17
+ ).returns(Stigg::Models::V1::UsageHistoryResponse)
18
+ end
19
+ def history(
20
+ # Path param: Feature id
21
+ feature_id,
22
+ # Path param: Customer id
23
+ customer_id:,
24
+ # Query param: The start date of the range
25
+ start_date:,
26
+ # Query param: The end date of the range
27
+ end_date: nil,
28
+ # Query param
29
+ group_by: nil,
30
+ # Query param: Resource id
31
+ resource_id: nil,
32
+ request_options: {}
33
+ )
34
+ end
35
+
36
+ # Report usage measurements
37
+ sig do
38
+ params(
39
+ usages: T::Array[Stigg::V1::UsageReportParams::Usage::OrHash],
40
+ request_options: Stigg::RequestOptions::OrHash
41
+ ).returns(Stigg::Models::V1::UsageReportResponse)
42
+ end
43
+ def report(
44
+ # A list of usage reports to be submitted in bulk
45
+ usages:,
46
+ request_options: {}
47
+ )
48
+ end
49
+
50
+ # @api private
51
+ sig { params(client: Stigg::Client).returns(T.attached_class) }
52
+ def self.new(client:)
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -12,33 +12,11 @@ module Stigg
12
12
  sig { returns(Stigg::Resources::V1::Coupons) }
13
13
  attr_reader :coupons
14
14
 
15
- # Report usage events
16
- sig do
17
- params(
18
- events: T::Array[Stigg::V1CreateEventParams::Event::OrHash],
19
- request_options: Stigg::RequestOptions::OrHash
20
- ).returns(Stigg::Models::V1CreateEventResponse)
21
- end
22
- def create_event(
23
- # A list of usage events to report
24
- events:,
25
- request_options: {}
26
- )
27
- end
15
+ sig { returns(Stigg::Resources::V1::Events) }
16
+ attr_reader :events
28
17
 
29
- # Report usage measurements
30
- sig do
31
- params(
32
- usages: T::Array[Stigg::V1CreateUsageParams::Usage::OrHash],
33
- request_options: Stigg::RequestOptions::OrHash
34
- ).returns(Stigg::Models::V1CreateUsageResponse)
35
- end
36
- def create_usage(
37
- # A list of usage reports to be submitted in bulk
38
- usages:,
39
- request_options: {}
40
- )
41
- end
18
+ sig { returns(Stigg::Resources::V1::Usage) }
19
+ attr_reader :usage
42
20
 
43
21
  # @api private
44
22
  sig { params(client: Stigg::Client).returns(T.attached_class) }
@@ -1,22 +1,19 @@
1
1
  module Stigg
2
2
  module Models
3
3
  module V1
4
- type coupon_create_response =
5
- { data: Stigg::Models::V1::CouponCreateResponse::Data }
4
+ type coupon = { data: Stigg::V1::Coupon::Data }
6
5
 
7
- class CouponCreateResponse < Stigg::Internal::Type::BaseModel
8
- attr_accessor data: Stigg::Models::V1::CouponCreateResponse::Data
6
+ class Coupon < Stigg::Internal::Type::BaseModel
7
+ attr_accessor data: Stigg::V1::Coupon::Data
9
8
 
10
- def initialize: (
11
- data: Stigg::Models::V1::CouponCreateResponse::Data
12
- ) -> void
9
+ def initialize: (data: Stigg::V1::Coupon::Data) -> void
13
10
 
14
- def to_hash: -> { data: Stigg::Models::V1::CouponCreateResponse::Data }
11
+ def to_hash: -> { data: Stigg::V1::Coupon::Data }
15
12
 
16
13
  type data =
17
14
  {
18
15
  id: String,
19
- amounts_off: ::Array[Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff]?,
16
+ amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?,
20
17
  billing_id: String?,
21
18
  billing_link_url: String?,
22
19
  created_at: Time,
@@ -24,16 +21,16 @@ module Stigg
24
21
  duration_in_months: Float?,
25
22
  name: String,
26
23
  percent_off: Float?,
27
- source: Stigg::Models::V1::CouponCreateResponse::Data::source?,
28
- status: Stigg::Models::V1::CouponCreateResponse::Data::status,
29
- type: Stigg::Models::V1::CouponCreateResponse::Data::type_,
24
+ source: Stigg::Models::V1::Coupon::Data::source?,
25
+ status: Stigg::Models::V1::Coupon::Data::status,
26
+ type: Stigg::Models::V1::Coupon::Data::type_,
30
27
  updated_at: Time
31
28
  }
32
29
 
33
30
  class Data < Stigg::Internal::Type::BaseModel
34
31
  attr_accessor id: String
35
32
 
36
- attr_accessor amounts_off: ::Array[Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff]?
33
+ attr_accessor amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?
37
34
 
38
35
  attr_accessor billing_id: String?
39
36
 
@@ -49,17 +46,17 @@ module Stigg
49
46
 
50
47
  attr_accessor percent_off: Float?
51
48
 
52
- attr_accessor source: Stigg::Models::V1::CouponCreateResponse::Data::source?
49
+ attr_accessor source: Stigg::Models::V1::Coupon::Data::source?
53
50
 
54
- attr_accessor status: Stigg::Models::V1::CouponCreateResponse::Data::status
51
+ attr_accessor status: Stigg::Models::V1::Coupon::Data::status
55
52
 
56
- attr_accessor type: Stigg::Models::V1::CouponCreateResponse::Data::type_
53
+ attr_accessor type: Stigg::Models::V1::Coupon::Data::type_
57
54
 
58
55
  attr_accessor updated_at: Time
59
56
 
60
57
  def initialize: (
61
58
  id: String,
62
- amounts_off: ::Array[Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff]?,
59
+ amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?,
63
60
  billing_id: String?,
64
61
  billing_link_url: String?,
65
62
  created_at: Time,
@@ -67,15 +64,15 @@ module Stigg
67
64
  duration_in_months: Float?,
68
65
  name: String,
69
66
  percent_off: Float?,
70
- source: Stigg::Models::V1::CouponCreateResponse::Data::source?,
71
- status: Stigg::Models::V1::CouponCreateResponse::Data::status,
72
- type: Stigg::Models::V1::CouponCreateResponse::Data::type_,
67
+ source: Stigg::Models::V1::Coupon::Data::source?,
68
+ status: Stigg::Models::V1::Coupon::Data::status,
69
+ type: Stigg::Models::V1::Coupon::Data::type_,
73
70
  updated_at: Time
74
71
  ) -> void
75
72
 
76
73
  def to_hash: -> {
77
74
  id: String,
78
- amounts_off: ::Array[Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff]?,
75
+ amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?,
79
76
  billing_id: String?,
80
77
  billing_link_url: String?,
81
78
  created_at: Time,
@@ -83,31 +80,31 @@ module Stigg
83
80
  duration_in_months: Float?,
84
81
  name: String,
85
82
  percent_off: Float?,
86
- source: Stigg::Models::V1::CouponCreateResponse::Data::source?,
87
- status: Stigg::Models::V1::CouponCreateResponse::Data::status,
88
- type: Stigg::Models::V1::CouponCreateResponse::Data::type_,
83
+ source: Stigg::Models::V1::Coupon::Data::source?,
84
+ status: Stigg::Models::V1::Coupon::Data::status,
85
+ type: Stigg::Models::V1::Coupon::Data::type_,
89
86
  updated_at: Time
90
87
  }
91
88
 
92
89
  type amounts_off =
93
90
  {
94
91
  amount: Float,
95
- currency: Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff::currency
92
+ currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
96
93
  }
97
94
 
98
95
  class AmountsOff < Stigg::Internal::Type::BaseModel
99
96
  attr_accessor amount: Float
100
97
 
101
- attr_accessor currency: Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff::currency
98
+ attr_accessor currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
102
99
 
103
100
  def initialize: (
104
101
  amount: Float,
105
- currency: Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff::currency
102
+ currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
106
103
  ) -> void
107
104
 
108
105
  def to_hash: -> {
109
106
  amount: Float,
110
- currency: Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff::currency
107
+ currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
111
108
  }
112
109
 
113
110
  type currency =
@@ -348,7 +345,7 @@ module Stigg
348
345
  XOF: :xof
349
346
  XPF: :xpf
350
347
 
351
- def self?.values: -> ::Array[Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff::currency]
348
+ def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::AmountsOff::currency]
352
349
  end
353
350
  end
354
351
 
@@ -361,7 +358,7 @@ module Stigg
361
358
  STIGG_ADHOC: :STIGG_ADHOC
362
359
  STRIPE: :STRIPE
363
360
 
364
- def self?.values: -> ::Array[Stigg::Models::V1::CouponCreateResponse::Data::source]
361
+ def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::source]
365
362
  end
366
363
 
367
364
  type status = :ACTIVE | :ARCHIVED
@@ -372,7 +369,7 @@ module Stigg
372
369
  ACTIVE: :ACTIVE
373
370
  ARCHIVED: :ARCHIVED
374
371
 
375
- def self?.values: -> ::Array[Stigg::Models::V1::CouponCreateResponse::Data::status]
372
+ def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::status]
376
373
  end
377
374
 
378
375
  type type_ = :FIXED | :PERCENTAGE
@@ -383,7 +380,7 @@ module Stigg
383
380
  FIXED: :FIXED
384
381
  PERCENTAGE: :PERCENTAGE
385
382
 
386
- def self?.values: -> ::Array[Stigg::Models::V1::CouponCreateResponse::Data::type_]
383
+ def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::type_]
387
384
  end
388
385
  end
389
386
  end
@@ -0,0 +1,74 @@
1
+ module Stigg
2
+ module Models
3
+ module V1
4
+ type customer_import_params =
5
+ { customers: ::Array[Stigg::V1::CustomerImportParams::Customer] }
6
+ & Stigg::Internal::Type::request_parameters
7
+
8
+ class CustomerImportParams < Stigg::Internal::Type::BaseModel
9
+ extend Stigg::Internal::Type::RequestParameters::Converter
10
+ include Stigg::Internal::Type::RequestParameters
11
+
12
+ attr_accessor customers: ::Array[Stigg::V1::CustomerImportParams::Customer]
13
+
14
+ def initialize: (
15
+ customers: ::Array[Stigg::V1::CustomerImportParams::Customer],
16
+ ?request_options: Stigg::request_opts
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ customers: ::Array[Stigg::V1::CustomerImportParams::Customer],
21
+ request_options: Stigg::RequestOptions
22
+ }
23
+
24
+ type customer =
25
+ {
26
+ id: String,
27
+ email: String?,
28
+ name: String?,
29
+ metadata: ::Hash[Symbol, String],
30
+ payment_method_id: String,
31
+ updated_at: Time
32
+ }
33
+
34
+ class Customer < Stigg::Internal::Type::BaseModel
35
+ attr_accessor id: String
36
+
37
+ attr_accessor email: String?
38
+
39
+ attr_accessor name: String?
40
+
41
+ attr_reader metadata: ::Hash[Symbol, String]?
42
+
43
+ def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String]
44
+
45
+ attr_reader payment_method_id: String?
46
+
47
+ def payment_method_id=: (String) -> String
48
+
49
+ attr_reader updated_at: Time?
50
+
51
+ def updated_at=: (Time) -> Time
52
+
53
+ def initialize: (
54
+ id: String,
55
+ email: String?,
56
+ name: String?,
57
+ ?metadata: ::Hash[Symbol, String],
58
+ ?payment_method_id: String,
59
+ ?updated_at: Time
60
+ ) -> void
61
+
62
+ def to_hash: -> {
63
+ id: String,
64
+ email: String?,
65
+ name: String?,
66
+ metadata: ::Hash[Symbol, String],
67
+ payment_method_id: String,
68
+ updated_at: Time
69
+ }
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end