@metronome/sdk 2.0.0 → 2.2.0

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 (175) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/package.json +1 -1
  7. package/resources/shared.d.mts +73 -20
  8. package/resources/shared.d.mts.map +1 -1
  9. package/resources/shared.d.ts +73 -20
  10. package/resources/shared.d.ts.map +1 -1
  11. package/resources/v1/alerts.d.mts +20 -1
  12. package/resources/v1/alerts.d.mts.map +1 -1
  13. package/resources/v1/alerts.d.ts +20 -1
  14. package/resources/v1/alerts.d.ts.map +1 -1
  15. package/resources/v1/contracts/contracts.d.mts +89 -12
  16. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  17. package/resources/v1/contracts/contracts.d.ts +89 -12
  18. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  19. package/resources/v1/contracts/contracts.js +1 -1
  20. package/resources/v1/contracts/contracts.js.map +1 -1
  21. package/resources/v1/contracts/contracts.mjs +1 -1
  22. package/resources/v1/contracts/contracts.mjs.map +1 -1
  23. package/resources/v1/credit-grants.d.mts +10 -5
  24. package/resources/v1/credit-grants.d.mts.map +1 -1
  25. package/resources/v1/credit-grants.d.ts +10 -5
  26. package/resources/v1/credit-grants.d.ts.map +1 -1
  27. package/resources/v1/credit-grants.js +10 -5
  28. package/resources/v1/credit-grants.js.map +1 -1
  29. package/resources/v1/credit-grants.mjs +10 -5
  30. package/resources/v1/credit-grants.mjs.map +1 -1
  31. package/resources/v1/customers/alerts.d.mts +39 -1
  32. package/resources/v1/customers/alerts.d.mts.map +1 -1
  33. package/resources/v1/customers/alerts.d.ts +39 -1
  34. package/resources/v1/customers/alerts.d.ts.map +1 -1
  35. package/resources/v1/customers/billing-config.d.mts +25 -7
  36. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  37. package/resources/v1/customers/billing-config.d.ts +25 -7
  38. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  39. package/resources/v1/customers/billing-config.js +6 -3
  40. package/resources/v1/customers/billing-config.js.map +1 -1
  41. package/resources/v1/customers/billing-config.mjs +6 -3
  42. package/resources/v1/customers/billing-config.mjs.map +1 -1
  43. package/resources/v1/customers/commits.d.mts +3 -2
  44. package/resources/v1/customers/commits.d.mts.map +1 -1
  45. package/resources/v1/customers/commits.d.ts +3 -2
  46. package/resources/v1/customers/commits.d.ts.map +1 -1
  47. package/resources/v1/customers/commits.js +2 -1
  48. package/resources/v1/customers/commits.js.map +1 -1
  49. package/resources/v1/customers/commits.mjs +2 -1
  50. package/resources/v1/customers/commits.mjs.map +1 -1
  51. package/resources/v1/customers/customers.d.mts +89 -14
  52. package/resources/v1/customers/customers.d.mts.map +1 -1
  53. package/resources/v1/customers/customers.d.ts +89 -14
  54. package/resources/v1/customers/customers.d.ts.map +1 -1
  55. package/resources/v1/customers/customers.js +13 -8
  56. package/resources/v1/customers/customers.js.map +1 -1
  57. package/resources/v1/customers/customers.mjs +13 -8
  58. package/resources/v1/customers/customers.mjs.map +1 -1
  59. package/resources/v1/customers/index.d.mts +1 -1
  60. package/resources/v1/customers/index.d.mts.map +1 -1
  61. package/resources/v1/customers/index.d.ts +1 -1
  62. package/resources/v1/customers/index.d.ts.map +1 -1
  63. package/resources/v1/customers/index.js.map +1 -1
  64. package/resources/v1/customers/index.mjs.map +1 -1
  65. package/resources/v1/customers/invoices.d.mts +62 -5
  66. package/resources/v1/customers/invoices.d.mts.map +1 -1
  67. package/resources/v1/customers/invoices.d.ts +62 -5
  68. package/resources/v1/customers/invoices.d.ts.map +1 -1
  69. package/resources/v1/customers/invoices.js +2 -1
  70. package/resources/v1/customers/invoices.js.map +1 -1
  71. package/resources/v1/customers/invoices.mjs +2 -1
  72. package/resources/v1/customers/invoices.mjs.map +1 -1
  73. package/resources/v1/customers/plans.d.mts +9 -4
  74. package/resources/v1/customers/plans.d.mts.map +1 -1
  75. package/resources/v1/customers/plans.d.ts +9 -4
  76. package/resources/v1/customers/plans.d.ts.map +1 -1
  77. package/resources/v1/customers/plans.js +8 -4
  78. package/resources/v1/customers/plans.js.map +1 -1
  79. package/resources/v1/customers/plans.mjs +8 -4
  80. package/resources/v1/customers/plans.mjs.map +1 -1
  81. package/resources/v1/index.d.mts +2 -1
  82. package/resources/v1/index.d.mts.map +1 -1
  83. package/resources/v1/index.d.ts +2 -1
  84. package/resources/v1/index.d.ts.map +1 -1
  85. package/resources/v1/index.js +3 -1
  86. package/resources/v1/index.js.map +1 -1
  87. package/resources/v1/index.mjs +1 -0
  88. package/resources/v1/index.mjs.map +1 -1
  89. package/resources/v1/payments.d.mts +1 -0
  90. package/resources/v1/payments.d.mts.map +1 -1
  91. package/resources/v1/payments.d.ts +1 -0
  92. package/resources/v1/payments.d.ts.map +1 -1
  93. package/resources/v1/plans.d.mts +8 -4
  94. package/resources/v1/plans.d.mts.map +1 -1
  95. package/resources/v1/plans.d.ts +8 -4
  96. package/resources/v1/plans.d.ts.map +1 -1
  97. package/resources/v1/plans.js +8 -4
  98. package/resources/v1/plans.js.map +1 -1
  99. package/resources/v1/plans.mjs +8 -4
  100. package/resources/v1/plans.mjs.map +1 -1
  101. package/resources/v1/settings/billing-providers.d.mts +103 -0
  102. package/resources/v1/settings/billing-providers.d.mts.map +1 -0
  103. package/resources/v1/settings/billing-providers.d.ts +103 -0
  104. package/resources/v1/settings/billing-providers.d.ts.map +1 -0
  105. package/resources/v1/settings/billing-providers.js +48 -0
  106. package/resources/v1/settings/billing-providers.js.map +1 -0
  107. package/resources/v1/settings/billing-providers.mjs +44 -0
  108. package/resources/v1/settings/billing-providers.mjs.map +1 -0
  109. package/resources/v1/settings/index.d.mts +3 -0
  110. package/resources/v1/settings/index.d.mts.map +1 -0
  111. package/resources/v1/settings/index.d.ts +3 -0
  112. package/resources/v1/settings/index.d.ts.map +1 -0
  113. package/resources/v1/settings/index.js +9 -0
  114. package/resources/v1/settings/index.js.map +1 -0
  115. package/resources/v1/settings/index.mjs +4 -0
  116. package/resources/v1/settings/index.mjs.map +1 -0
  117. package/resources/v1/settings/settings.d.mts +60 -0
  118. package/resources/v1/settings/settings.d.mts.map +1 -0
  119. package/resources/v1/settings/settings.d.ts +60 -0
  120. package/resources/v1/settings/settings.d.ts.map +1 -0
  121. package/resources/v1/settings/settings.js +40 -0
  122. package/resources/v1/settings/settings.js.map +1 -0
  123. package/resources/v1/settings/settings.mjs +35 -0
  124. package/resources/v1/settings/settings.mjs.map +1 -0
  125. package/resources/v1/settings.d.mts +2 -0
  126. package/resources/v1/settings.d.mts.map +1 -0
  127. package/resources/v1/settings.d.ts +2 -0
  128. package/resources/v1/settings.d.ts.map +1 -0
  129. package/resources/v1/settings.js +6 -0
  130. package/resources/v1/settings.js.map +1 -0
  131. package/resources/v1/settings.mjs +3 -0
  132. package/resources/v1/settings.mjs.map +1 -0
  133. package/resources/v1/usage.d.mts +3 -2
  134. package/resources/v1/usage.d.mts.map +1 -1
  135. package/resources/v1/usage.d.ts +3 -2
  136. package/resources/v1/usage.d.ts.map +1 -1
  137. package/resources/v1/v1.d.mts +6 -2
  138. package/resources/v1/v1.d.mts.map +1 -1
  139. package/resources/v1/v1.d.ts +6 -2
  140. package/resources/v1/v1.d.ts.map +1 -1
  141. package/resources/v1/v1.js +4 -0
  142. package/resources/v1/v1.js.map +1 -1
  143. package/resources/v1/v1.mjs +4 -0
  144. package/resources/v1/v1.mjs.map +1 -1
  145. package/resources/v2/contracts.d.mts +204 -3
  146. package/resources/v2/contracts.d.mts.map +1 -1
  147. package/resources/v2/contracts.d.ts +204 -3
  148. package/resources/v2/contracts.d.ts.map +1 -1
  149. package/src/client.ts +1 -1
  150. package/src/resources/shared.ts +80 -20
  151. package/src/resources/v1/alerts.ts +24 -1
  152. package/src/resources/v1/contracts/contracts.ts +97 -12
  153. package/src/resources/v1/credit-grants.ts +10 -5
  154. package/src/resources/v1/customers/alerts.ts +45 -0
  155. package/src/resources/v1/customers/billing-config.ts +32 -7
  156. package/src/resources/v1/customers/commits.ts +3 -2
  157. package/src/resources/v1/customers/customers.ts +112 -18
  158. package/src/resources/v1/customers/index.ts +1 -0
  159. package/src/resources/v1/customers/invoices.ts +80 -3
  160. package/src/resources/v1/customers/plans.ts +10 -4
  161. package/src/resources/v1/index.ts +6 -0
  162. package/src/resources/v1/payments.ts +2 -0
  163. package/src/resources/v1/plans.ts +8 -4
  164. package/src/resources/v1/settings/billing-providers.ts +139 -0
  165. package/src/resources/v1/settings/index.ts +14 -0
  166. package/src/resources/v1/settings/settings.ts +94 -0
  167. package/src/resources/v1/settings.ts +3 -0
  168. package/src/resources/v1/usage.ts +3 -2
  169. package/src/resources/v1/v1.ts +16 -0
  170. package/src/resources/v2/contracts.ts +249 -3
  171. package/src/version.ts +1 -1
  172. package/version.d.mts +1 -1
  173. package/version.d.ts +1 -1
  174. package/version.js +1 -1
  175. package/version.mjs +1 -1
@@ -0,0 +1,94 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as BillingProvidersAPI from './billing-providers';
5
+ import {
6
+ BillingProviderCreateParams,
7
+ BillingProviderCreateResponse,
8
+ BillingProviderListParams,
9
+ BillingProviderListResponse,
10
+ BillingProviders,
11
+ } from './billing-providers';
12
+ import { APIPromise } from '../../../core/api-promise';
13
+ import { RequestOptions } from '../../../internal/request-options';
14
+
15
+ export class Settings extends APIResource {
16
+ billingProviders: BillingProvidersAPI.BillingProviders = new BillingProvidersAPI.BillingProviders(
17
+ this._client,
18
+ );
19
+
20
+ /**
21
+ * Set the Avalara credentials for some specified `delivery_method_ids`, which can
22
+ * be found in the `/listConfiguredBillingProviders` response. This maps the
23
+ * Avalara credentials to the appropriate billing entity. These credentials are
24
+ * only used for PLG Invoicing today.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const response =
29
+ * await client.v1.settings.upsertAvalaraCredentials({
30
+ * avalara_environment: 'PRODUCTION',
31
+ * avalara_password: 'my_password_123',
32
+ * avalara_username: 'test@metronome.com',
33
+ * delivery_method_ids: [
34
+ * '9a906ebb-fbc7-42e8-8e29-53bfd2db3aca',
35
+ * ],
36
+ * commit_transactions: true,
37
+ * });
38
+ * ```
39
+ */
40
+ upsertAvalaraCredentials(
41
+ body: SettingUpsertAvalaraCredentialsParams,
42
+ options?: RequestOptions,
43
+ ): APIPromise<SettingUpsertAvalaraCredentialsResponse> {
44
+ return this._client.post('/v1/upsertAvalaraCredentials', { body, ...options });
45
+ }
46
+ }
47
+
48
+ export interface SettingUpsertAvalaraCredentialsResponse {}
49
+
50
+ export interface SettingUpsertAvalaraCredentialsParams {
51
+ /**
52
+ * The Avalara environment to use (SANDBOX or PRODUCTION).
53
+ */
54
+ avalara_environment: 'PRODUCTION' | 'SANDBOX';
55
+
56
+ /**
57
+ * The password for the Avalara account.
58
+ */
59
+ avalara_password: string;
60
+
61
+ /**
62
+ * The username for the Avalara account.
63
+ */
64
+ avalara_username: string;
65
+
66
+ /**
67
+ * The delivery method IDs of the billing provider configurations to update, can be
68
+ * found in the response of the `/listConfiguredBillingProviders` endpoint.
69
+ */
70
+ delivery_method_ids: Array<string>;
71
+
72
+ /**
73
+ * Commit transactions if you want Metronome tax calculations used for reporting
74
+ * and tax filings.
75
+ */
76
+ commit_transactions?: boolean;
77
+ }
78
+
79
+ Settings.BillingProviders = BillingProviders;
80
+
81
+ export declare namespace Settings {
82
+ export {
83
+ type SettingUpsertAvalaraCredentialsResponse as SettingUpsertAvalaraCredentialsResponse,
84
+ type SettingUpsertAvalaraCredentialsParams as SettingUpsertAvalaraCredentialsParams,
85
+ };
86
+
87
+ export {
88
+ BillingProviders as BillingProviders,
89
+ type BillingProviderCreateResponse as BillingProviderCreateResponse,
90
+ type BillingProviderListResponse as BillingProviderListResponse,
91
+ type BillingProviderCreateParams as BillingProviderCreateParams,
92
+ type BillingProviderListParams as BillingProviderListParams,
93
+ };
94
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './settings/index';
@@ -388,9 +388,10 @@ export namespace UsageSearchResponse {
388
388
  aggregation_key?: string;
389
389
 
390
390
  /**
391
- * Specifies the type of aggregation performed on matching events.
391
+ * Specifies the type of aggregation performed on matching events. Includes
392
+ * "custom_sql" for events search endpoint responses.
392
393
  */
393
- aggregation_type?: 'COUNT' | 'LATEST' | 'MAX' | 'SUM' | 'UNIQUE';
394
+ aggregation_type?: 'COUNT' | 'LATEST' | 'MAX' | 'SUM' | 'UNIQUE' | 'custom_sql';
394
395
 
395
396
  /**
396
397
  * RFC 3339 timestamp indicating when the billable metric was archived. If not
@@ -171,12 +171,19 @@ import {
171
171
  CustomerRetrieveParams,
172
172
  CustomerRetrieveResponse,
173
173
  CustomerSetBillingConfigurationsParams,
174
+ CustomerSetBillingConfigurationsResponse,
174
175
  CustomerSetIngestAliasesParams,
175
176
  CustomerSetNameParams,
176
177
  CustomerSetNameResponse,
177
178
  CustomerUpdateConfigParams,
178
179
  Customers,
179
180
  } from './customers/customers';
181
+ import * as SettingsAPI from './settings/settings';
182
+ import {
183
+ SettingUpsertAvalaraCredentialsParams,
184
+ SettingUpsertAvalaraCredentialsResponse,
185
+ Settings,
186
+ } from './settings/settings';
180
187
 
181
188
  export class V1 extends APIResource {
182
189
  alerts: AlertsAPI.Alerts = new AlertsAPI.Alerts(this._client);
@@ -193,6 +200,7 @@ export class V1 extends APIResource {
193
200
  invoices: InvoicesAPI.Invoices = new InvoicesAPI.Invoices(this._client);
194
201
  contracts: ContractsAPI.Contracts = new ContractsAPI.Contracts(this._client);
195
202
  payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this._client);
203
+ settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client);
196
204
  }
197
205
 
198
206
  V1.Alerts = Alerts;
@@ -209,6 +217,7 @@ V1.Services = Services;
209
217
  V1.Invoices = Invoices;
210
218
  V1.Contracts = Contracts;
211
219
  V1.Payments = Payments;
220
+ V1.Settings = Settings;
212
221
 
213
222
  export declare namespace V1 {
214
223
  export {
@@ -272,6 +281,7 @@ export declare namespace V1 {
272
281
  type CustomerListCostsResponse as CustomerListCostsResponse,
273
282
  type CustomerPreviewEventsResponse as CustomerPreviewEventsResponse,
274
283
  type CustomerRetrieveBillingConfigurationsResponse as CustomerRetrieveBillingConfigurationsResponse,
284
+ type CustomerSetBillingConfigurationsResponse as CustomerSetBillingConfigurationsResponse,
275
285
  type CustomerSetNameResponse as CustomerSetNameResponse,
276
286
  type CustomerDetailsCursorPage as CustomerDetailsCursorPage,
277
287
  type CustomerListBillableMetricsResponsesCursorPage as CustomerListBillableMetricsResponsesCursorPage,
@@ -390,4 +400,10 @@ export declare namespace V1 {
390
400
  type PaymentAttemptParams as PaymentAttemptParams,
391
401
  type PaymentCancelParams as PaymentCancelParams,
392
402
  };
403
+
404
+ export {
405
+ Settings as Settings,
406
+ type SettingUpsertAvalaraCredentialsResponse as SettingUpsertAvalaraCredentialsResponse,
407
+ type SettingUpsertAvalaraCredentialsParams as SettingUpsertAvalaraCredentialsParams,
408
+ };
393
409
  }
@@ -987,6 +987,8 @@ export namespace ContractGetEditHistoryResponse {
987
987
  */
988
988
  applicable_product_tags?: Array<string> | null;
989
989
 
990
+ description?: string;
991
+
990
992
  /**
991
993
  * Optional configuration for commit hierarchy access control
992
994
  */
@@ -1111,6 +1113,8 @@ export namespace ContractGetEditHistoryResponse {
1111
1113
 
1112
1114
  access_schedule?: UpdateCredit.AccessSchedule;
1113
1115
 
1116
+ description?: string;
1117
+
1114
1118
  /**
1115
1119
  * Optional configuration for credit hierarchy access control
1116
1120
  */
@@ -1480,6 +1484,11 @@ export namespace ContractGetEditHistoryResponse {
1480
1484
  ending_before?: string;
1481
1485
 
1482
1486
  quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
1487
+
1488
+ /**
1489
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1490
+ */
1491
+ seat_updates?: UpdateSubscription.SeatUpdates;
1483
1492
  }
1484
1493
 
1485
1494
  export namespace UpdateSubscription {
@@ -1490,6 +1499,84 @@ export namespace ContractGetEditHistoryResponse {
1490
1499
 
1491
1500
  quantity_delta?: number;
1492
1501
  }
1502
+
1503
+ /**
1504
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1505
+ */
1506
+ export interface SeatUpdates {
1507
+ /**
1508
+ * Adds seat IDs to the subscription. If there are unassigned seats, the new seat
1509
+ * IDs will fill these unassigned seats and not increase the total subscription
1510
+ * quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
1511
+ * total subscription quantity will increase.
1512
+ */
1513
+ add_seat_ids?: Array<SeatUpdates.AddSeatID>;
1514
+
1515
+ /**
1516
+ * Adds unassigned seats to the subscription. This will increase the total
1517
+ * subscription quantity.
1518
+ */
1519
+ add_unassigned_seats?: Array<SeatUpdates.AddUnassignedSeat>;
1520
+
1521
+ /**
1522
+ * Removes seat IDs from the subscription, if possible. If a seat ID is removed,
1523
+ * the total subscription quantity will decrease. Otherwise, if the seat ID is not
1524
+ * found on the subscription, this is a no-op.
1525
+ */
1526
+ remove_seat_ids?: Array<SeatUpdates.RemoveSeatID>;
1527
+
1528
+ /**
1529
+ * Removes unassigned seats from the subscription. This will decrease the total
1530
+ * subscription quantity if there are are unassigned seats.
1531
+ */
1532
+ remove_unassigned_seats?: Array<SeatUpdates.RemoveUnassignedSeat>;
1533
+ }
1534
+
1535
+ export namespace SeatUpdates {
1536
+ export interface AddSeatID {
1537
+ seat_ids: Array<string>;
1538
+
1539
+ /**
1540
+ * Assigned seats will be added/removed starting at this date.
1541
+ */
1542
+ starting_at: string;
1543
+ }
1544
+
1545
+ export interface AddUnassignedSeat {
1546
+ /**
1547
+ * The number of unassigned seats on the subscription will increase/decrease by
1548
+ * this delta. Must be greater than 0.
1549
+ */
1550
+ quantity: number;
1551
+
1552
+ /**
1553
+ * Unassigned seats will be updated starting at this date.
1554
+ */
1555
+ starting_at: string;
1556
+ }
1557
+
1558
+ export interface RemoveSeatID {
1559
+ seat_ids: Array<string>;
1560
+
1561
+ /**
1562
+ * Assigned seats will be added/removed starting at this date.
1563
+ */
1564
+ starting_at: string;
1565
+ }
1566
+
1567
+ export interface RemoveUnassignedSeat {
1568
+ /**
1569
+ * The number of unassigned seats on the subscription will increase/decrease by
1570
+ * this delta. Must be greater than 0.
1571
+ */
1572
+ quantity: number;
1573
+
1574
+ /**
1575
+ * Unassigned seats will be updated starting at this date.
1576
+ */
1577
+ starting_at: string;
1578
+ }
1579
+ }
1493
1580
  }
1494
1581
  }
1495
1582
  }
@@ -1701,7 +1788,8 @@ export namespace ContractEditParams {
1701
1788
  | 'azure_marketplace'
1702
1789
  | 'quickbooks_online'
1703
1790
  | 'workday'
1704
- | 'gcp_marketplace';
1791
+ | 'gcp_marketplace'
1792
+ | 'metronome';
1705
1793
 
1706
1794
  billing_provider_configuration_id?: string;
1707
1795
 
@@ -2610,7 +2698,8 @@ export namespace ContractEditParams {
2610
2698
  subscription_id: string;
2611
2699
 
2612
2700
  /**
2613
- * If set to POOLED, allocation added per seat is pooled across the account.
2701
+ * If set to POOLED, allocation added per seat is pooled across the account. If set
2702
+ * to INDIVIDUAL, each seat in the subscription will have its own allocation.
2614
2703
  */
2615
2704
  allocation?: 'POOLED' | 'INDIVIDUAL';
2616
2705
  }
@@ -2773,7 +2862,8 @@ export namespace ContractEditParams {
2773
2862
  subscription_id: string;
2774
2863
 
2775
2864
  /**
2776
- * If set to POOLED, allocation added per seat is pooled across the account.
2865
+ * If set to POOLED, allocation added per seat is pooled across the account. If set
2866
+ * to INDIVIDUAL, each seat in the subscription will have its own allocation.
2777
2867
  */
2778
2868
  allocation?: 'POOLED' | 'INDIVIDUAL';
2779
2869
  }
@@ -2994,9 +3084,16 @@ export namespace ContractEditParams {
2994
3084
  * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2995
3085
  * directly on the subscription. `initial_quantity` must be provided with this
2996
3086
  * option. Compatible with recurring commits/credits that use POOLED allocation.
3087
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
3088
+ * user_123) to increment and decrement a subscription quantity, rather than
3089
+ * directly providing the quantity. You must use a **SEAT_BASED** subscription to
3090
+ * use a linked recurring credit with an allocation per seat. `seat_config` must be
3091
+ * provided with this option.
2997
3092
  */
2998
3093
  quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
2999
3094
 
3095
+ seat_config?: AddSubscription.SeatConfig;
3096
+
3000
3097
  /**
3001
3098
  * Inclusive start time for the subscription. If not provided, defaults to contract
3002
3099
  * start date
@@ -3039,6 +3136,28 @@ export namespace ContractEditParams {
3039
3136
  */
3040
3137
  product_id: string;
3041
3138
  }
3139
+
3140
+ export interface SeatConfig {
3141
+ /**
3142
+ * The initial assigned seats on this subscription.
3143
+ */
3144
+ initial_seat_ids: Array<string>;
3145
+
3146
+ /**
3147
+ * The property name, sent on usage events, that identifies the seat ID associated
3148
+ * with the usage event. For example, the property name might be seat_id or
3149
+ * user_id. The property must be set as a group key on billable metrics and a
3150
+ * presentation/pricing group key on contract products. This allows linked
3151
+ * recurring credits with an allocation per seat to be consumed by only one seat's
3152
+ * usage.
3153
+ */
3154
+ seat_group_key: string;
3155
+
3156
+ /**
3157
+ * The initial amount of unassigned seats on this subscription.
3158
+ */
3159
+ initial_unassigned_seats?: number;
3160
+ }
3042
3161
  }
3043
3162
 
3044
3163
  export interface ArchiveCommit {
@@ -3076,6 +3195,8 @@ export namespace ContractEditParams {
3076
3195
  */
3077
3196
  applicable_product_tags?: Array<string> | null;
3078
3197
 
3198
+ description?: string;
3199
+
3079
3200
  /**
3080
3201
  * Optional configuration for commit hierarchy access control
3081
3202
  */
@@ -3083,6 +3204,8 @@ export namespace ContractEditParams {
3083
3204
 
3084
3205
  invoice_schedule?: UpdateCommit.InvoiceSchedule;
3085
3206
 
3207
+ name?: string;
3208
+
3086
3209
  netsuite_sales_order_id?: string | null;
3087
3210
 
3088
3211
  priority?: number | null;
@@ -3188,11 +3311,15 @@ export namespace ContractEditParams {
3188
3311
  */
3189
3312
  applicable_product_tags?: Array<string> | null;
3190
3313
 
3314
+ description?: string;
3315
+
3191
3316
  /**
3192
3317
  * Optional configuration for commit hierarchy access control
3193
3318
  */
3194
3319
  hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3195
3320
 
3321
+ name?: string;
3322
+
3196
3323
  netsuite_sales_order_id?: string | null;
3197
3324
 
3198
3325
  priority?: number | null;
@@ -3420,15 +3547,39 @@ export namespace ContractEditParams {
3420
3547
 
3421
3548
  ending_before?: string | null;
3422
3549
 
3550
+ /**
3551
+ * Update the subscription's quantity management mode from QUANTITY_ONLY to
3552
+ * SEAT_BASED with the provided seat_group_key.
3553
+ */
3554
+ quantity_management_mode_update?: UpdateSubscription.QuantityManagementModeUpdate;
3555
+
3423
3556
  /**
3424
3557
  * Quantity changes are applied on the effective date based on the order which they
3425
3558
  * are sent. For example, if I scheduled the quantity to be 12 on May 21 and then
3426
3559
  * scheduled a quantity delta change of -1, the result from that day would be 11.
3427
3560
  */
3428
3561
  quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
3562
+
3563
+ seat_updates?: UpdateSubscription.SeatUpdates;
3429
3564
  }
3430
3565
 
3431
3566
  export namespace UpdateSubscription {
3567
+ /**
3568
+ * Update the subscription's quantity management mode from QUANTITY_ONLY to
3569
+ * SEAT_BASED with the provided seat_group_key.
3570
+ */
3571
+ export interface QuantityManagementModeUpdate {
3572
+ quantity_management_mode: 'SEAT_BASED';
3573
+
3574
+ seat_config: QuantityManagementModeUpdate.SeatConfig;
3575
+ }
3576
+
3577
+ export namespace QuantityManagementModeUpdate {
3578
+ export interface SeatConfig {
3579
+ seat_group_key: string;
3580
+ }
3581
+ }
3582
+
3432
3583
  export interface QuantityUpdate {
3433
3584
  starting_at: string;
3434
3585
 
@@ -3445,6 +3596,81 @@ export namespace ContractEditParams {
3445
3596
  */
3446
3597
  quantity_delta?: number;
3447
3598
  }
3599
+
3600
+ export interface SeatUpdates {
3601
+ /**
3602
+ * Adds seat IDs to the subscription. If there are unassigned seats, the new seat
3603
+ * IDs will fill these unassigned seats and not increase the total subscription
3604
+ * quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
3605
+ * total subscription quantity will increase.
3606
+ */
3607
+ add_seat_ids?: Array<SeatUpdates.AddSeatID>;
3608
+
3609
+ /**
3610
+ * Adds unassigned seats to the subscription. This will increase the total
3611
+ * subscription quantity.
3612
+ */
3613
+ add_unassigned_seats?: Array<SeatUpdates.AddUnassignedSeat>;
3614
+
3615
+ /**
3616
+ * Removes seat IDs from the subscription, if possible. If a seat ID is removed,
3617
+ * the total subscription quantity will decrease. Otherwise, if the seat ID is not
3618
+ * found on the subscription, this is a no-op.
3619
+ */
3620
+ remove_seat_ids?: Array<SeatUpdates.RemoveSeatID>;
3621
+
3622
+ /**
3623
+ * Removes unassigned seats from the subscription. This will decrease the total
3624
+ * subscription quantity if there are are unassigned seats.
3625
+ */
3626
+ remove_unassigned_seats?: Array<SeatUpdates.RemoveUnassignedSeat>;
3627
+ }
3628
+
3629
+ export namespace SeatUpdates {
3630
+ export interface AddSeatID {
3631
+ seat_ids: Array<string>;
3632
+
3633
+ /**
3634
+ * Assigned seats will be added/removed starting at this date.
3635
+ */
3636
+ starting_at: string;
3637
+ }
3638
+
3639
+ export interface AddUnassignedSeat {
3640
+ /**
3641
+ * The number of unassigned seats on the subscription will increase/decrease by
3642
+ * this delta. Must be greater than 0.
3643
+ */
3644
+ quantity: number;
3645
+
3646
+ /**
3647
+ * Unassigned seats will be updated starting at this date.
3648
+ */
3649
+ starting_at: string;
3650
+ }
3651
+
3652
+ export interface RemoveSeatID {
3653
+ seat_ids: Array<string>;
3654
+
3655
+ /**
3656
+ * Assigned seats will be added/removed starting at this date.
3657
+ */
3658
+ starting_at: string;
3659
+ }
3660
+
3661
+ export interface RemoveUnassignedSeat {
3662
+ /**
3663
+ * The number of unassigned seats on the subscription will increase/decrease by
3664
+ * this delta. Must be greater than 0.
3665
+ */
3666
+ quantity: number;
3667
+
3668
+ /**
3669
+ * Unassigned seats will be updated starting at this date.
3670
+ */
3671
+ starting_at: string;
3672
+ }
3673
+ }
3448
3674
  }
3449
3675
  }
3450
3676
 
@@ -3475,6 +3701,11 @@ export interface ContractEditCommitParams {
3475
3701
  */
3476
3702
  applicable_product_tags?: Array<string> | null;
3477
3703
 
3704
+ /**
3705
+ * Updated description for the commit
3706
+ */
3707
+ description?: string;
3708
+
3478
3709
  /**
3479
3710
  * Optional configuration for commit hierarchy access control
3480
3711
  */
@@ -3487,6 +3718,11 @@ export interface ContractEditCommitParams {
3487
3718
 
3488
3719
  invoice_schedule?: ContractEditCommitParams.InvoiceSchedule;
3489
3720
 
3721
+ /**
3722
+ * Updated name for the commit
3723
+ */
3724
+ name?: string;
3725
+
3490
3726
  /**
3491
3727
  * If multiple commits are applicable, the one with the lower priority will apply
3492
3728
  * first.
@@ -3608,11 +3844,21 @@ export interface ContractEditCreditParams {
3608
3844
  */
3609
3845
  applicable_product_tags?: Array<string> | null;
3610
3846
 
3847
+ /**
3848
+ * Updated description for the credit
3849
+ */
3850
+ description?: string;
3851
+
3611
3852
  /**
3612
3853
  * Optional configuration for credit hierarchy access control
3613
3854
  */
3614
3855
  hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3615
3856
 
3857
+ /**
3858
+ * Updated name for the credit
3859
+ */
3860
+ name?: string;
3861
+
3616
3862
  /**
3617
3863
  * If multiple commits are applicable, the one with the lower priority will apply
3618
3864
  * first.
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.0.0'; // x-release-please-version
1
+ export const VERSION = '2.2.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.0.0";
1
+ export declare const VERSION = "2.2.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.0.0";
1
+ export declare const VERSION = "2.2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.0.0'; // x-release-please-version
4
+ exports.VERSION = '2.2.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.0.0'; // x-release-please-version
1
+ export const VERSION = '2.2.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map