@openmeter/client 1.0.0-beta-75dd3b9ccc98 → 1.0.0-beta-471c6cd3d433

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.
@@ -2229,31 +2229,6 @@ export const rateCardProrationConfiguration = z
2229
2229
  mode: rateCardProrationMode,
2230
2230
  })
2231
2231
  .describe('The proration configuration of the rate card.');
2232
- export const subscriptionCreate = z
2233
- .object({
2234
- labels: labels.optional(),
2235
- settlementMode: settlementMode.optional(),
2236
- customer: z
2237
- .object({
2238
- id: ulid.optional(),
2239
- key: externalResourceKey.optional(),
2240
- })
2241
- .describe('The customer to create the subscription for.'),
2242
- plan: z
2243
- .object({
2244
- id: ulid.optional(),
2245
- key: resourceKey.optional(),
2246
- version: z
2247
- .number()
2248
- .int()
2249
- .optional()
2250
- .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
2251
- })
2252
- .describe('The plan reference of the subscription.'),
2253
- billingAnchor: dateTime.optional(),
2254
- costBasisMode: subscriptionCostBasisMode.optional().default('dynamic'),
2255
- })
2256
- .describe('Subscription create request.');
2257
2232
  export const unitConfig = z
2258
2233
  .object({
2259
2234
  operation: unitConfigOperation,
@@ -3214,32 +3189,6 @@ export const subscriptionCancel = z
3214
3189
  timing: subscriptionEditTiming.optional().default('immediate'),
3215
3190
  })
3216
3191
  .describe('Request for canceling a subscription.');
3217
- export const subscriptionChange = z
3218
- .object({
3219
- labels: labels.optional(),
3220
- settlementMode: settlementMode.optional(),
3221
- customer: z
3222
- .object({
3223
- id: ulid.optional(),
3224
- key: externalResourceKey.optional(),
3225
- })
3226
- .describe('The customer to create the subscription for.'),
3227
- plan: z
3228
- .object({
3229
- id: ulid.optional(),
3230
- key: resourceKey.optional(),
3231
- version: z
3232
- .number()
3233
- .int()
3234
- .optional()
3235
- .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
3236
- })
3237
- .describe('The plan reference of the subscription.'),
3238
- billingAnchor: dateTime.optional(),
3239
- costBasisMode: subscriptionCostBasisMode.optional().default('dynamic'),
3240
- timing: subscriptionEditTiming,
3241
- })
3242
- .describe('Request for changing a subscription.');
3243
3192
  export const createSubscriptionAddonRequest = z
3244
3193
  .object({
3245
3194
  labels: labels.optional(),
@@ -4271,23 +4220,6 @@ export const subscriptionItem = z
4271
4220
  rateCard: rateCard,
4272
4221
  })
4273
4222
  .describe('A subscription item pins a rate card to a cadence within a subscription phase.');
4274
- export const subscriptionEditAddItem = z
4275
- .object({
4276
- type: z
4277
- .literal('add_item')
4278
- .describe('Discriminator for the add-item operation.'),
4279
- phaseKey: z.string().describe('The key of the phase to add the item to.'),
4280
- rateCard: rateCard,
4281
- })
4282
- .describe('Add a new rate card to a phase. Adding an item to the current phase closes the active version of the same item key and appends a new version.');
4283
- export const subscriptionAddonRateCard = z
4284
- .object({
4285
- rateCard: rateCard,
4286
- affectedSubscriptionItemIds: z
4287
- .array(ulid)
4288
- .describe('The IDs of the subscription items that this rate card belongs to.'),
4289
- })
4290
- .describe('A rate card for a subscription add-on.');
4291
4223
  export const planPhase = z
4292
4224
  .object({
4293
4225
  name: z
@@ -4306,6 +4238,23 @@ export const planPhase = z
4306
4238
  rateCards: z.array(rateCard).describe('The rate cards of the plan.'),
4307
4239
  })
4308
4240
  .describe("The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses.");
4241
+ export const subscriptionEditAddItem = z
4242
+ .object({
4243
+ type: z
4244
+ .literal('add_item')
4245
+ .describe('Discriminator for the add-item operation.'),
4246
+ phaseKey: z.string().describe('The key of the phase to add the item to.'),
4247
+ rateCard: rateCard,
4248
+ })
4249
+ .describe('Add a new rate card to a phase. Adding an item to the current phase closes the active version of the same item key and appends a new version.');
4250
+ export const subscriptionAddonRateCard = z
4251
+ .object({
4252
+ rateCard: rateCard,
4253
+ affectedSubscriptionItemIds: z
4254
+ .array(ulid)
4255
+ .describe('The IDs of the subscription items that this rate card belongs to.'),
4256
+ })
4257
+ .describe('A rate card for a subscription add-on.');
4309
4258
  export const addon = z
4310
4259
  .object({
4311
4260
  id: ulid,
@@ -4550,23 +4499,8 @@ export const subscriptionPhase = z
4550
4499
  .describe('The rate cards in effect for this phase, resolved to the version active at the queried time (the currently active version for the current phase, the first version for future phases, and the last version for past phases).'),
4551
4500
  })
4552
4501
  .describe("A subscription phase groups the rate cards in effect for a segment of the subscription's lifetime. Analogous to plan phases.");
4553
- export const subscriptionEditOperation = z
4554
- .discriminatedUnion('type', [
4555
- subscriptionEditAddItem,
4556
- subscriptionEditRemoveItem,
4557
- subscriptionEditAddPhase,
4558
- subscriptionEditRemovePhase,
4559
- subscriptionEditStretchPhase,
4560
- subscriptionEditUnscheduleEdit,
4561
- ])
4562
- .describe('A single customization to apply to a running subscription. The `type` field discriminates which operation is performed.');
4563
- export const subscriptionAddon = z
4502
+ export const subscriptionCustomPlan = z
4564
4503
  .object({
4565
- id: ulid,
4566
- labels: labels.optional(),
4567
- createdAt: dateTime,
4568
- updatedAt: dateTime,
4569
- deletedAt: dateTime.optional(),
4570
4504
  name: z
4571
4505
  .string()
4572
4506
  .min(1)
@@ -4577,23 +4511,20 @@ export const subscriptionAddon = z
4577
4511
  .max(1024)
4578
4512
  .optional()
4579
4513
  .describe('Optional description of the resource. Maximum 1024 characters.'),
4580
- addon: addonReference,
4581
- quantity: z
4582
- .number()
4583
- .int()
4584
- .gte(1)
4585
- .describe('The quantity of the add-on. Always 1 for single instance add-ons.'),
4586
- quantityAt: dateTime,
4587
- activeFrom: dateTime,
4588
- activeTo: dateTime.optional(),
4589
- timeline: z
4590
- .array(subscriptionAddonTimelineSegment)
4591
- .describe('The timeline of the add-on. The returned periods are sorted and continuous.'),
4592
- rateCards: z
4593
- .array(subscriptionAddonRateCard)
4594
- .describe('The rate cards of the add-on.'),
4514
+ labels: labels.optional(),
4515
+ currency: billingCurrencyCode,
4516
+ billingCadence: iso8601Duration,
4517
+ proRatingEnabled: z
4518
+ .boolean()
4519
+ .optional()
4520
+ .default(true)
4521
+ .describe('Whether pro-rating is enabled for this plan.'),
4522
+ phases: z
4523
+ .array(planPhase)
4524
+ .min(1)
4525
+ .describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
4595
4526
  })
4596
- .describe('Addon purchased with a subscription.');
4527
+ .describe('An inline (custom) plan definition used to create or change a subscription without referencing a published plan. Mirrors the plan create shape without a key or version, since a custom plan is not persisted or versioned on its own.');
4597
4528
  export const plan = z
4598
4529
  .object({
4599
4530
  id: ulid,
@@ -4690,6 +4621,50 @@ export const upsertPlanRequest = z
4690
4621
  .describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
4691
4622
  })
4692
4623
  .describe('Plan upsert request.');
4624
+ export const subscriptionEditOperation = z
4625
+ .discriminatedUnion('type', [
4626
+ subscriptionEditAddItem,
4627
+ subscriptionEditRemoveItem,
4628
+ subscriptionEditAddPhase,
4629
+ subscriptionEditRemovePhase,
4630
+ subscriptionEditStretchPhase,
4631
+ subscriptionEditUnscheduleEdit,
4632
+ ])
4633
+ .describe('A single customization to apply to a running subscription. The `type` field discriminates which operation is performed.');
4634
+ export const subscriptionAddon = z
4635
+ .object({
4636
+ id: ulid,
4637
+ labels: labels.optional(),
4638
+ createdAt: dateTime,
4639
+ updatedAt: dateTime,
4640
+ deletedAt: dateTime.optional(),
4641
+ name: z
4642
+ .string()
4643
+ .min(1)
4644
+ .max(256)
4645
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
4646
+ description: z
4647
+ .string()
4648
+ .max(1024)
4649
+ .optional()
4650
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
4651
+ addon: addonReference,
4652
+ quantity: z
4653
+ .number()
4654
+ .int()
4655
+ .gte(1)
4656
+ .describe('The quantity of the add-on. Always 1 for single instance add-ons.'),
4657
+ quantityAt: dateTime,
4658
+ activeFrom: dateTime,
4659
+ activeTo: dateTime.optional(),
4660
+ timeline: z
4661
+ .array(subscriptionAddonTimelineSegment)
4662
+ .describe('The timeline of the add-on. The returned periods are sorted and continuous.'),
4663
+ rateCards: z
4664
+ .array(subscriptionAddonRateCard)
4665
+ .describe('The rate cards of the add-on.'),
4666
+ })
4667
+ .describe('Addon purchased with a subscription.');
4693
4668
  export const addonPagePaginatedResponse = z
4694
4669
  .object({
4695
4670
  data: z.array(addon),
@@ -4746,6 +4721,65 @@ export const subscription = z
4746
4721
  .describe("The phases of the subscription in chronological order. A phase groups the rate cards that are in effect for a segment of the subscription's lifetime."),
4747
4722
  })
4748
4723
  .describe('Subscription.');
4724
+ export const subscriptionCreate = z.object({
4725
+ labels: labels.optional(),
4726
+ settlementMode: settlementMode.optional(),
4727
+ customer: z
4728
+ .object({
4729
+ id: ulid.optional(),
4730
+ key: externalResourceKey.optional(),
4731
+ })
4732
+ .describe('The customer to create the subscription for.'),
4733
+ plan: z
4734
+ .object({
4735
+ id: ulid.optional(),
4736
+ key: resourceKey.optional(),
4737
+ version: z
4738
+ .number()
4739
+ .int()
4740
+ .optional()
4741
+ .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
4742
+ })
4743
+ .optional()
4744
+ .describe('A reference to a published plan the subscription is created from. Exactly one of `plan` or `custom_plan` must be provided. Use `plan` to base the subscription on an existing published plan; use `custom_plan` to define the plan inline.'),
4745
+ customPlan: subscriptionCustomPlan.optional(),
4746
+ billingAnchor: dateTime.optional(),
4747
+ costBasisMode: subscriptionCostBasisMode.optional().default('dynamic'),
4748
+ });
4749
+ export const subscriptionChange = z
4750
+ .object({
4751
+ labels: labels.optional(),
4752
+ settlementMode: settlementMode.optional(),
4753
+ customer: z
4754
+ .object({
4755
+ id: ulid.optional(),
4756
+ key: externalResourceKey.optional(),
4757
+ })
4758
+ .describe('The customer to create the subscription for.'),
4759
+ plan: z
4760
+ .object({
4761
+ id: ulid.optional(),
4762
+ key: resourceKey.optional(),
4763
+ version: z
4764
+ .number()
4765
+ .int()
4766
+ .optional()
4767
+ .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
4768
+ })
4769
+ .optional()
4770
+ .describe('A reference to a published plan the subscription is created from. Exactly one of `plan` or `custom_plan` must be provided. Use `plan` to base the subscription on an existing published plan; use `custom_plan` to define the plan inline.'),
4771
+ customPlan: subscriptionCustomPlan.optional(),
4772
+ billingAnchor: dateTime.optional(),
4773
+ costBasisMode: subscriptionCostBasisMode.optional().default('dynamic'),
4774
+ timing: subscriptionEditTiming,
4775
+ })
4776
+ .describe('Request for changing a subscription.');
4777
+ export const planPagePaginatedResponse = z
4778
+ .object({
4779
+ data: z.array(plan),
4780
+ meta: paginatedMeta,
4781
+ })
4782
+ .describe('Page paginated response.');
4749
4783
  export const subscriptionEdit = z
4750
4784
  .object({
4751
4785
  customizations: z
@@ -4761,12 +4795,6 @@ export const subscriptionAddonPagePaginatedResponse = z
4761
4795
  meta: paginatedMeta,
4762
4796
  })
4763
4797
  .describe('Page paginated response.');
4764
- export const planPagePaginatedResponse = z
4765
- .object({
4766
- data: z.array(plan),
4767
- meta: paginatedMeta,
4768
- })
4769
- .describe('Page paginated response.');
4770
4798
  export const invoiceStandard = z
4771
4799
  .object({
4772
4800
  id: ulid,
@@ -7887,31 +7915,6 @@ export const rateCardProrationConfigurationWire = z
7887
7915
  mode: rateCardProrationModeWire,
7888
7916
  })
7889
7917
  .describe('The proration configuration of the rate card.');
7890
- export const subscriptionCreateWire = z
7891
- .strictObject({
7892
- labels: labelsWire.optional(),
7893
- settlement_mode: settlementModeWire.optional(),
7894
- customer: z
7895
- .strictObject({
7896
- id: ulidWire.optional(),
7897
- key: externalResourceKeyWire.optional(),
7898
- })
7899
- .describe('The customer to create the subscription for.'),
7900
- plan: z
7901
- .strictObject({
7902
- id: ulidWire.optional(),
7903
- key: resourceKeyWire.optional(),
7904
- version: z
7905
- .number()
7906
- .int()
7907
- .optional()
7908
- .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
7909
- })
7910
- .describe('The plan reference of the subscription.'),
7911
- billing_anchor: dateTimeWire.optional(),
7912
- cost_basis_mode: subscriptionCostBasisModeWire.optional(),
7913
- })
7914
- .describe('Subscription create request.');
7915
7918
  export const unitConfigWire = z
7916
7919
  .strictObject({
7917
7920
  operation: unitConfigOperationWire,
@@ -8865,32 +8868,6 @@ export const subscriptionCancelWire = z
8865
8868
  timing: subscriptionEditTimingWire.optional(),
8866
8869
  })
8867
8870
  .describe('Request for canceling a subscription.');
8868
- export const subscriptionChangeWire = z
8869
- .strictObject({
8870
- labels: labelsWire.optional(),
8871
- settlement_mode: settlementModeWire.optional(),
8872
- customer: z
8873
- .strictObject({
8874
- id: ulidWire.optional(),
8875
- key: externalResourceKeyWire.optional(),
8876
- })
8877
- .describe('The customer to create the subscription for.'),
8878
- plan: z
8879
- .strictObject({
8880
- id: ulidWire.optional(),
8881
- key: resourceKeyWire.optional(),
8882
- version: z
8883
- .number()
8884
- .int()
8885
- .optional()
8886
- .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
8887
- })
8888
- .describe('The plan reference of the subscription.'),
8889
- billing_anchor: dateTimeWire.optional(),
8890
- cost_basis_mode: subscriptionCostBasisModeWire.optional(),
8891
- timing: subscriptionEditTimingWire,
8892
- })
8893
- .describe('Request for changing a subscription.');
8894
8871
  export const createSubscriptionAddonRequestWire = z
8895
8872
  .strictObject({
8896
8873
  labels: labelsWire.optional(),
@@ -9927,23 +9904,6 @@ export const subscriptionItemWire = z
9927
9904
  rate_card: rateCardWire,
9928
9905
  })
9929
9906
  .describe('A subscription item pins a rate card to a cadence within a subscription phase.');
9930
- export const subscriptionEditAddItemWire = z
9931
- .strictObject({
9932
- type: z
9933
- .literal('add_item')
9934
- .describe('Discriminator for the add-item operation.'),
9935
- phase_key: z.string().describe('The key of the phase to add the item to.'),
9936
- rate_card: rateCardWire,
9937
- })
9938
- .describe('Add a new rate card to a phase. Adding an item to the current phase closes the active version of the same item key and appends a new version.');
9939
- export const subscriptionAddonRateCardWire = z
9940
- .strictObject({
9941
- rate_card: rateCardWire,
9942
- affected_subscription_item_ids: z
9943
- .array(ulidWire)
9944
- .describe('The IDs of the subscription items that this rate card belongs to.'),
9945
- })
9946
- .describe('A rate card for a subscription add-on.');
9947
9907
  export const planPhaseWire = z
9948
9908
  .strictObject({
9949
9909
  name: z
@@ -9962,6 +9922,23 @@ export const planPhaseWire = z
9962
9922
  rate_cards: z.array(rateCardWire).describe('The rate cards of the plan.'),
9963
9923
  })
9964
9924
  .describe("The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses.");
9925
+ export const subscriptionEditAddItemWire = z
9926
+ .strictObject({
9927
+ type: z
9928
+ .literal('add_item')
9929
+ .describe('Discriminator for the add-item operation.'),
9930
+ phase_key: z.string().describe('The key of the phase to add the item to.'),
9931
+ rate_card: rateCardWire,
9932
+ })
9933
+ .describe('Add a new rate card to a phase. Adding an item to the current phase closes the active version of the same item key and appends a new version.');
9934
+ export const subscriptionAddonRateCardWire = z
9935
+ .strictObject({
9936
+ rate_card: rateCardWire,
9937
+ affected_subscription_item_ids: z
9938
+ .array(ulidWire)
9939
+ .describe('The IDs of the subscription items that this rate card belongs to.'),
9940
+ })
9941
+ .describe('A rate card for a subscription add-on.');
9965
9942
  export const addonWire = z
9966
9943
  .strictObject({
9967
9944
  id: ulidWire,
@@ -10205,23 +10182,8 @@ export const subscriptionPhaseWire = z
10205
10182
  .describe('The rate cards in effect for this phase, resolved to the version active at the queried time (the currently active version for the current phase, the first version for future phases, and the last version for past phases).'),
10206
10183
  })
10207
10184
  .describe("A subscription phase groups the rate cards in effect for a segment of the subscription's lifetime. Analogous to plan phases.");
10208
- export const subscriptionEditOperationWire = z
10209
- .discriminatedUnion('type', [
10210
- subscriptionEditAddItemWire,
10211
- subscriptionEditRemoveItemWire,
10212
- subscriptionEditAddPhaseWire,
10213
- subscriptionEditRemovePhaseWire,
10214
- subscriptionEditStretchPhaseWire,
10215
- subscriptionEditUnscheduleEditWire,
10216
- ])
10217
- .describe('A single customization to apply to a running subscription. The `type` field discriminates which operation is performed.');
10218
- export const subscriptionAddonWire = z
10185
+ export const subscriptionCustomPlanWire = z
10219
10186
  .strictObject({
10220
- id: ulidWire,
10221
- labels: labelsWire.optional(),
10222
- created_at: dateTimeWire,
10223
- updated_at: dateTimeWire,
10224
- deleted_at: dateTimeWire.optional(),
10225
10187
  name: z
10226
10188
  .string()
10227
10189
  .min(1)
@@ -10232,23 +10194,19 @@ export const subscriptionAddonWire = z
10232
10194
  .max(1024)
10233
10195
  .optional()
10234
10196
  .describe('Optional description of the resource. Maximum 1024 characters.'),
10235
- addon: addonReferenceWire,
10236
- quantity: z
10237
- .number()
10238
- .int()
10239
- .gte(1)
10240
- .describe('The quantity of the add-on. Always 1 for single instance add-ons.'),
10241
- quantity_at: dateTimeWire,
10242
- active_from: dateTimeWire,
10243
- active_to: dateTimeWire.optional(),
10244
- timeline: z
10245
- .array(subscriptionAddonTimelineSegmentWire)
10246
- .describe('The timeline of the add-on. The returned periods are sorted and continuous.'),
10247
- rate_cards: z
10248
- .array(subscriptionAddonRateCardWire)
10249
- .describe('The rate cards of the add-on.'),
10197
+ labels: labelsWire.optional(),
10198
+ currency: billingCurrencyCodeWire,
10199
+ billing_cadence: iso8601DurationWire,
10200
+ pro_rating_enabled: z
10201
+ .boolean()
10202
+ .optional()
10203
+ .describe('Whether pro-rating is enabled for this plan.'),
10204
+ phases: z
10205
+ .array(planPhaseWire)
10206
+ .min(1)
10207
+ .describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
10250
10208
  })
10251
- .describe('Addon purchased with a subscription.');
10209
+ .describe('An inline (custom) plan definition used to create or change a subscription without referencing a published plan. Mirrors the plan create shape without a key or version, since a custom plan is not persisted or versioned on its own.');
10252
10210
  export const planWire = z
10253
10211
  .strictObject({
10254
10212
  id: ulidWire,
@@ -10341,6 +10299,50 @@ export const upsertPlanRequestWire = z
10341
10299
  .describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
10342
10300
  })
10343
10301
  .describe('Plan upsert request.');
10302
+ export const subscriptionEditOperationWire = z
10303
+ .discriminatedUnion('type', [
10304
+ subscriptionEditAddItemWire,
10305
+ subscriptionEditRemoveItemWire,
10306
+ subscriptionEditAddPhaseWire,
10307
+ subscriptionEditRemovePhaseWire,
10308
+ subscriptionEditStretchPhaseWire,
10309
+ subscriptionEditUnscheduleEditWire,
10310
+ ])
10311
+ .describe('A single customization to apply to a running subscription. The `type` field discriminates which operation is performed.');
10312
+ export const subscriptionAddonWire = z
10313
+ .strictObject({
10314
+ id: ulidWire,
10315
+ labels: labelsWire.optional(),
10316
+ created_at: dateTimeWire,
10317
+ updated_at: dateTimeWire,
10318
+ deleted_at: dateTimeWire.optional(),
10319
+ name: z
10320
+ .string()
10321
+ .min(1)
10322
+ .max(256)
10323
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
10324
+ description: z
10325
+ .string()
10326
+ .max(1024)
10327
+ .optional()
10328
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
10329
+ addon: addonReferenceWire,
10330
+ quantity: z
10331
+ .number()
10332
+ .int()
10333
+ .gte(1)
10334
+ .describe('The quantity of the add-on. Always 1 for single instance add-ons.'),
10335
+ quantity_at: dateTimeWire,
10336
+ active_from: dateTimeWire,
10337
+ active_to: dateTimeWire.optional(),
10338
+ timeline: z
10339
+ .array(subscriptionAddonTimelineSegmentWire)
10340
+ .describe('The timeline of the add-on. The returned periods are sorted and continuous.'),
10341
+ rate_cards: z
10342
+ .array(subscriptionAddonRateCardWire)
10343
+ .describe('The rate cards of the add-on.'),
10344
+ })
10345
+ .describe('Addon purchased with a subscription.');
10344
10346
  export const addonPagePaginatedResponseWire = z
10345
10347
  .strictObject({
10346
10348
  data: z.array(addonWire),
@@ -10397,6 +10399,65 @@ export const subscriptionWire = z
10397
10399
  .describe("The phases of the subscription in chronological order. A phase groups the rate cards that are in effect for a segment of the subscription's lifetime."),
10398
10400
  })
10399
10401
  .describe('Subscription.');
10402
+ export const subscriptionCreateWire = z.strictObject({
10403
+ labels: labelsWire.optional(),
10404
+ settlement_mode: settlementModeWire.optional(),
10405
+ customer: z
10406
+ .strictObject({
10407
+ id: ulidWire.optional(),
10408
+ key: externalResourceKeyWire.optional(),
10409
+ })
10410
+ .describe('The customer to create the subscription for.'),
10411
+ plan: z
10412
+ .strictObject({
10413
+ id: ulidWire.optional(),
10414
+ key: resourceKeyWire.optional(),
10415
+ version: z
10416
+ .number()
10417
+ .int()
10418
+ .optional()
10419
+ .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
10420
+ })
10421
+ .optional()
10422
+ .describe('A reference to a published plan the subscription is created from. Exactly one of `plan` or `custom_plan` must be provided. Use `plan` to base the subscription on an existing published plan; use `custom_plan` to define the plan inline.'),
10423
+ custom_plan: subscriptionCustomPlanWire.optional(),
10424
+ billing_anchor: dateTimeWire.optional(),
10425
+ cost_basis_mode: subscriptionCostBasisModeWire.optional(),
10426
+ });
10427
+ export const subscriptionChangeWire = z
10428
+ .strictObject({
10429
+ labels: labelsWire.optional(),
10430
+ settlement_mode: settlementModeWire.optional(),
10431
+ customer: z
10432
+ .strictObject({
10433
+ id: ulidWire.optional(),
10434
+ key: externalResourceKeyWire.optional(),
10435
+ })
10436
+ .describe('The customer to create the subscription for.'),
10437
+ plan: z
10438
+ .strictObject({
10439
+ id: ulidWire.optional(),
10440
+ key: resourceKeyWire.optional(),
10441
+ version: z
10442
+ .number()
10443
+ .int()
10444
+ .optional()
10445
+ .describe('The plan version of the subscription, if any. If not provided, the latest version of the plan will be used.'),
10446
+ })
10447
+ .optional()
10448
+ .describe('A reference to a published plan the subscription is created from. Exactly one of `plan` or `custom_plan` must be provided. Use `plan` to base the subscription on an existing published plan; use `custom_plan` to define the plan inline.'),
10449
+ custom_plan: subscriptionCustomPlanWire.optional(),
10450
+ billing_anchor: dateTimeWire.optional(),
10451
+ cost_basis_mode: subscriptionCostBasisModeWire.optional(),
10452
+ timing: subscriptionEditTimingWire,
10453
+ })
10454
+ .describe('Request for changing a subscription.');
10455
+ export const planPagePaginatedResponseWire = z
10456
+ .strictObject({
10457
+ data: z.array(planWire),
10458
+ meta: paginatedMetaWire,
10459
+ })
10460
+ .describe('Page paginated response.');
10400
10461
  export const subscriptionEditWire = z
10401
10462
  .strictObject({
10402
10463
  customizations: z
@@ -10412,12 +10473,6 @@ export const subscriptionAddonPagePaginatedResponseWire = z
10412
10473
  meta: paginatedMetaWire,
10413
10474
  })
10414
10475
  .describe('Page paginated response.');
10415
- export const planPagePaginatedResponseWire = z
10416
- .strictObject({
10417
- data: z.array(planWire),
10418
- meta: paginatedMetaWire,
10419
- })
10420
- .describe('Page paginated response.');
10421
10476
  export const invoiceStandardWire = z
10422
10477
  .strictObject({
10423
10478
  id: ulidWire,