@metronome/sdk 0.1.0-beta.9 → 0.1.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.
- package/CHANGELOG.md +179 -0
- package/README.md +30 -46
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +23 -14
- package/core.js.map +1 -1
- package/core.mjs +24 -15
- package/core.mjs.map +1 -1
- package/index.d.mts +3 -2
- package/index.d.ts +3 -2
- package/index.d.ts.map +1 -1
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -0
- package/pagination.js.map +1 -1
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/shared.d.ts +473 -37
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.ts +26 -2
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +19 -0
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +19 -0
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.ts +8 -0
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.ts +58 -3
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +41 -0
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +41 -0
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +1478 -102
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +180 -3
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +180 -3
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.ts +2 -2
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts +21 -0
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +21 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +21 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.ts +51 -3
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +33 -0
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +33 -0
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +107 -10
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +102 -14
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +68 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +68 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/credit-grants.d.ts +77 -2
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +39 -2
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +39 -2
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.ts +51 -7
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +35 -0
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +35 -0
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.ts +28 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +23 -0
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +23 -0
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +31 -0
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +27 -0
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +27 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.ts +94 -7
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +56 -1
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +56 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.ts +73 -3
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +41 -1
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +41 -1
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.ts +186 -9
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +106 -1
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +106 -1
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.ts +144 -52
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +49 -0
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +49 -0
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts +21 -0
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +21 -0
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +21 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.ts +46 -1
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +43 -0
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +43 -0
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/dashboards.d.ts +30 -2
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +26 -0
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +26 -0
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.ts +3 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.ts +14 -0
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +14 -0
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +14 -0
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/plans.d.ts +47 -4
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +27 -0
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +27 -0
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.ts +8 -0
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.ts +5 -0
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +5 -0
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +5 -0
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.ts +161 -3
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +46 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +46 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.ts +6 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.ts +2923 -207
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +90 -2
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +90 -2
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/webhooks.js +5 -5
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -5
- package/resources/webhooks.mjs.map +1 -1
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/bun-runtime.ts +2 -2
- package/src/_shims/index.d.ts +5 -3
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +6 -2
- package/src/_shims/node-runtime.ts +3 -3
- package/src/_shims/registry.ts +1 -1
- package/src/_shims/web-runtime.ts +3 -3
- package/src/core.ts +46 -18
- package/src/error.ts +1 -1
- package/src/index.ts +22 -16
- package/src/internal/qs/formats.ts +1 -1
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +3 -3
- package/src/internal/qs/utils.ts +2 -2
- package/src/pagination.ts +5 -1
- package/src/resource.ts +2 -2
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +539 -40
- package/src/resources/v1/alerts.ts +29 -5
- package/src/resources/v1/audit-logs.ts +12 -4
- package/src/resources/v1/billable-metrics.ts +57 -8
- package/src/resources/v1/contracts/contracts.ts +1643 -124
- package/src/resources/v1/contracts/index.ts +8 -4
- package/src/resources/v1/contracts/named-schedules.ts +23 -2
- package/src/resources/v1/contracts/products.ts +53 -9
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -4
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +27 -2
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +33 -3
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +113 -20
- package/src/resources/v1/contracts/rate-cards/rates.ts +86 -18
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +82 -10
- package/src/resources/v1/custom-fields.ts +57 -9
- package/src/resources/v1/customers/alerts.ts +32 -3
- package/src/resources/v1/customers/billing-config.ts +34 -2
- package/src/resources/v1/customers/commits.ts +97 -10
- package/src/resources/v1/customers/credits.ts +76 -6
- package/src/resources/v1/customers/customers.ts +208 -27
- package/src/resources/v1/customers/index.ts +10 -8
- package/src/resources/v1/customers/invoices.ts +123 -57
- package/src/resources/v1/customers/named-schedules.ts +23 -2
- package/src/resources/v1/customers/plans.ts +48 -5
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +30 -4
- package/src/resources/v1/index.ts +20 -14
- package/src/resources/v1/invoices.ts +16 -2
- package/src/resources/v1/plans.ts +45 -10
- package/src/resources/v1/pricing-units.ts +12 -4
- package/src/resources/v1/services.ts +7 -2
- package/src/resources/v1/usage.ts +187 -6
- package/src/resources/v1/v1.ts +39 -27
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +3397 -235
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +7 -7
- package/src/resources.ts +1 -1
- package/src/shims/node.ts +3 -3
- package/src/shims/web.ts +3 -3
- package/src/uploads.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -43,6 +43,26 @@ class RateCards extends resource_1.APIResource {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Create a new rate card
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const rateCard = await client.v1.contracts.rateCards.create(
|
|
50
|
+
* {
|
|
51
|
+
* name: 'My Rate Card',
|
|
52
|
+
* aliases: [{ name: 'my-rate-card' }],
|
|
53
|
+
* credit_type_conversions: [
|
|
54
|
+
* {
|
|
55
|
+
* custom_credit_type_id:
|
|
56
|
+
* '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
57
|
+
* fiat_per_custom_credit: 2,
|
|
58
|
+
* },
|
|
59
|
+
* ],
|
|
60
|
+
* description: 'My Rate Card Description',
|
|
61
|
+
* fiat_credit_type_id:
|
|
62
|
+
* '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
63
|
+
* },
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
46
66
|
*/
|
|
47
67
|
create(body, options) {
|
|
48
68
|
return this._client.post('/v1/contract-pricing/rate-cards/create', { body, ...options });
|
|
@@ -50,12 +70,31 @@ class RateCards extends resource_1.APIResource {
|
|
|
50
70
|
/**
|
|
51
71
|
* Get a specific rate card NOTE: Use `/contract-pricing/rate-cards/getRates` to
|
|
52
72
|
* retrieve rate card rates.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const rateCard =
|
|
77
|
+
* await client.v1.contracts.rateCards.retrieve({
|
|
78
|
+
* id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
53
81
|
*/
|
|
54
82
|
retrieve(body, options) {
|
|
55
83
|
return this._client.post('/v1/contract-pricing/rate-cards/get', { body, ...options });
|
|
56
84
|
}
|
|
57
85
|
/**
|
|
58
86
|
* Update a rate card
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const rateCard = await client.v1.contracts.rateCards.update(
|
|
91
|
+
* {
|
|
92
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
93
|
+
* description: 'My Updated Rate Card Description',
|
|
94
|
+
* name: 'My Updated Rate Card',
|
|
95
|
+
* },
|
|
96
|
+
* );
|
|
97
|
+
* ```
|
|
59
98
|
*/
|
|
60
99
|
update(body, options) {
|
|
61
100
|
return this._client.post('/v1/contract-pricing/rate-cards/update', { body, ...options });
|
|
@@ -72,9 +111,41 @@ class RateCards extends resource_1.APIResource {
|
|
|
72
111
|
...options,
|
|
73
112
|
});
|
|
74
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Archive a rate card
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* const response =
|
|
120
|
+
* await client.v1.contracts.rateCards.archive({
|
|
121
|
+
* id: '12b21470-4570-40df-8998-449d0b0bc52f',
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
archive(body, options) {
|
|
126
|
+
return this._client.post('/v1/contract-pricing/rate-cards/archive', { body, ...options });
|
|
127
|
+
}
|
|
75
128
|
/**
|
|
76
129
|
* Get all rates for a rate card from starting_at (either in perpetuity or until
|
|
77
130
|
* ending_before, if provided)
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* const response =
|
|
135
|
+
* await client.v1.contracts.rateCards.retrieveRateSchedule({
|
|
136
|
+
* rate_card_id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
|
|
137
|
+
* starting_at: '2024-01-01T00:00:00.000Z',
|
|
138
|
+
* selectors: [
|
|
139
|
+
* {
|
|
140
|
+
* product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
|
|
141
|
+
* partial_pricing_group_values: {
|
|
142
|
+
* region: 'us-west-2',
|
|
143
|
+
* cloud: 'aws',
|
|
144
|
+
* },
|
|
145
|
+
* },
|
|
146
|
+
* ],
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
78
149
|
*/
|
|
79
150
|
retrieveRateSchedule(params, options) {
|
|
80
151
|
const { limit, next_page, ...body } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-cards.js","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rate-cards.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;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AE;YAC1E,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC3B,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA3JD,8BA2JC;AAED,MAAa,+BAAgC,SAAQ,uBAAgC;CAAG;AAAxF,0EAAwF;AA6SxF,SAAS,CAAC,+BAA+B,GAAG,+BAA+B,CAAC;AAC5E,SAAS,CAAC,aAAa,GAAG,8BAAa,CAAC;AACxC,SAAS,CAAC,KAAK,GAAG,aAAK,CAAC;AACxB,SAAS,CAAC,2BAA2B,GAAG,mCAA2B,CAAC;AACpE,SAAS,CAAC,cAAc,GAAG,gCAAc,CAAC"}
|
|
@@ -17,6 +17,26 @@ export class RateCards extends APIResource {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Create a new rate card
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const rateCard = await client.v1.contracts.rateCards.create(
|
|
24
|
+
* {
|
|
25
|
+
* name: 'My Rate Card',
|
|
26
|
+
* aliases: [{ name: 'my-rate-card' }],
|
|
27
|
+
* credit_type_conversions: [
|
|
28
|
+
* {
|
|
29
|
+
* custom_credit_type_id:
|
|
30
|
+
* '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
31
|
+
* fiat_per_custom_credit: 2,
|
|
32
|
+
* },
|
|
33
|
+
* ],
|
|
34
|
+
* description: 'My Rate Card Description',
|
|
35
|
+
* fiat_credit_type_id:
|
|
36
|
+
* '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
37
|
+
* },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
20
40
|
*/
|
|
21
41
|
create(body, options) {
|
|
22
42
|
return this._client.post('/v1/contract-pricing/rate-cards/create', { body, ...options });
|
|
@@ -24,12 +44,31 @@ export class RateCards extends APIResource {
|
|
|
24
44
|
/**
|
|
25
45
|
* Get a specific rate card NOTE: Use `/contract-pricing/rate-cards/getRates` to
|
|
26
46
|
* retrieve rate card rates.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const rateCard =
|
|
51
|
+
* await client.v1.contracts.rateCards.retrieve({
|
|
52
|
+
* id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
27
55
|
*/
|
|
28
56
|
retrieve(body, options) {
|
|
29
57
|
return this._client.post('/v1/contract-pricing/rate-cards/get', { body, ...options });
|
|
30
58
|
}
|
|
31
59
|
/**
|
|
32
60
|
* Update a rate card
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const rateCard = await client.v1.contracts.rateCards.update(
|
|
65
|
+
* {
|
|
66
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
67
|
+
* description: 'My Updated Rate Card Description',
|
|
68
|
+
* name: 'My Updated Rate Card',
|
|
69
|
+
* },
|
|
70
|
+
* );
|
|
71
|
+
* ```
|
|
33
72
|
*/
|
|
34
73
|
update(body, options) {
|
|
35
74
|
return this._client.post('/v1/contract-pricing/rate-cards/update', { body, ...options });
|
|
@@ -46,9 +85,41 @@ export class RateCards extends APIResource {
|
|
|
46
85
|
...options,
|
|
47
86
|
});
|
|
48
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Archive a rate card
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const response =
|
|
94
|
+
* await client.v1.contracts.rateCards.archive({
|
|
95
|
+
* id: '12b21470-4570-40df-8998-449d0b0bc52f',
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
archive(body, options) {
|
|
100
|
+
return this._client.post('/v1/contract-pricing/rate-cards/archive', { body, ...options });
|
|
101
|
+
}
|
|
49
102
|
/**
|
|
50
103
|
* Get all rates for a rate card from starting_at (either in perpetuity or until
|
|
51
104
|
* ending_before, if provided)
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* const response =
|
|
109
|
+
* await client.v1.contracts.rateCards.retrieveRateSchedule({
|
|
110
|
+
* rate_card_id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
|
|
111
|
+
* starting_at: '2024-01-01T00:00:00.000Z',
|
|
112
|
+
* selectors: [
|
|
113
|
+
* {
|
|
114
|
+
* product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
|
|
115
|
+
* partial_pricing_group_values: {
|
|
116
|
+
* region: 'us-west-2',
|
|
117
|
+
* cloud: 'aws',
|
|
118
|
+
* },
|
|
119
|
+
* },
|
|
120
|
+
* ],
|
|
121
|
+
* });
|
|
122
|
+
* ```
|
|
52
123
|
*/
|
|
53
124
|
retrieveRateSchedule(params, options) {
|
|
54
125
|
const { limit, next_page, ...body } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-cards.mjs","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rate-cards.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAGpB,KAAK,iBAAiB;OACtB,EAIL,cAAc,GACf;OACM,KAAK,gBAAgB;OACrB,EAKL,aAAa,GACd;OACM,KAAK,QAAQ;OACb,EAOL,2BAA2B,EAC3B,KAAK,GACN;OACM,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
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14 +5,82 @@ import { CursorPage, type CursorPageParams } from "../../../../pagination.js";
|
|
|
5
5
|
export declare class Rates extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Get all rates for a rate card at a point in time
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Automatically fetches more pages as needed.
|
|
12
|
+
* for await (const rateListResponse of client.v1.contracts.rateCards.rates.list(
|
|
13
|
+
* {
|
|
14
|
+
* at: '2024-01-01T00:00:00.000Z',
|
|
15
|
+
* rate_card_id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
|
|
16
|
+
* selectors: [
|
|
17
|
+
* {
|
|
18
|
+
* product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
|
|
19
|
+
* partial_pricing_group_values: {
|
|
20
|
+
* region: 'us-west-2',
|
|
21
|
+
* cloud: 'aws',
|
|
22
|
+
* },
|
|
23
|
+
* },
|
|
24
|
+
* ],
|
|
25
|
+
* },
|
|
26
|
+
* )) {
|
|
27
|
+
* // ...
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
8
30
|
*/
|
|
9
31
|
list(params: RateListParams, options?: Core.RequestOptions): Core.PagePromise<RateListResponsesCursorPage, RateListResponse>;
|
|
10
32
|
/**
|
|
11
33
|
* Add a new rate
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const response =
|
|
38
|
+
* await client.v1.contracts.rateCards.rates.add({
|
|
39
|
+
* entitled: true,
|
|
40
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
41
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
42
|
+
* rate_type: 'FLAT',
|
|
43
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
44
|
+
* credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
45
|
+
* price: 100,
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
12
48
|
*/
|
|
13
49
|
add(body: RateAddParams, options?: Core.RequestOptions): Core.APIPromise<RateAddResponse>;
|
|
14
50
|
/**
|
|
15
51
|
* Add new rates
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const response =
|
|
56
|
+
* await client.v1.contracts.rateCards.rates.addMany({
|
|
57
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
58
|
+
* rates: [
|
|
59
|
+
* {
|
|
60
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
61
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
62
|
+
* entitled: true,
|
|
63
|
+
* rate_type: 'FLAT',
|
|
64
|
+
* price: 100,
|
|
65
|
+
* pricing_group_values: {
|
|
66
|
+
* region: 'us-west-2',
|
|
67
|
+
* cloud: 'aws',
|
|
68
|
+
* },
|
|
69
|
+
* },
|
|
70
|
+
* {
|
|
71
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
72
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
73
|
+
* entitled: true,
|
|
74
|
+
* rate_type: 'FLAT',
|
|
75
|
+
* price: 120,
|
|
76
|
+
* pricing_group_values: {
|
|
77
|
+
* region: 'us-east-2',
|
|
78
|
+
* cloud: 'aws',
|
|
79
|
+
* },
|
|
80
|
+
* },
|
|
81
|
+
* ],
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
16
84
|
*/
|
|
17
85
|
addMany(body: RateAddManyParams, options?: Core.RequestOptions): Core.APIPromise<RateAddManyResponse>;
|
|
18
86
|
}
|
|
@@ -20,20 +88,24 @@ export declare class RateListResponsesCursorPage extends CursorPage<RateListResp
|
|
|
20
88
|
}
|
|
21
89
|
export interface RateListResponse {
|
|
22
90
|
entitled: boolean;
|
|
23
|
-
product_custom_fields:
|
|
91
|
+
product_custom_fields: {
|
|
92
|
+
[key: string]: string;
|
|
93
|
+
};
|
|
24
94
|
product_id: string;
|
|
25
95
|
product_name: string;
|
|
26
96
|
product_tags: Array<string>;
|
|
27
97
|
rate: Shared.Rate;
|
|
28
98
|
starting_at: string;
|
|
29
|
-
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
99
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
30
100
|
/**
|
|
31
101
|
* A distinct rate on the rate card. You can choose to use this rate rather than
|
|
32
102
|
* list rate when consuming a credit or commit.
|
|
33
103
|
*/
|
|
34
104
|
commit_rate?: RateListResponse.CommitRate;
|
|
35
105
|
ending_before?: string;
|
|
36
|
-
pricing_group_values?:
|
|
106
|
+
pricing_group_values?: {
|
|
107
|
+
[key: string]: string;
|
|
108
|
+
};
|
|
37
109
|
}
|
|
38
110
|
export declare namespace RateListResponse {
|
|
39
111
|
/**
|
|
@@ -68,7 +140,9 @@ export declare namespace RateAddResponse {
|
|
|
68
140
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
69
141
|
* processors.
|
|
70
142
|
*/
|
|
71
|
-
custom_rate?:
|
|
143
|
+
custom_rate?: {
|
|
144
|
+
[key: string]: unknown;
|
|
145
|
+
};
|
|
72
146
|
/**
|
|
73
147
|
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
74
148
|
* set to true.
|
|
@@ -83,7 +157,9 @@ export declare namespace RateAddResponse {
|
|
|
83
157
|
* if pricing groups are used, this will contain the values used to calculate the
|
|
84
158
|
* price
|
|
85
159
|
*/
|
|
86
|
-
pricing_group_values?:
|
|
160
|
+
pricing_group_values?: {
|
|
161
|
+
[key: string]: string;
|
|
162
|
+
};
|
|
87
163
|
/**
|
|
88
164
|
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
89
165
|
*/
|
|
@@ -145,17 +221,21 @@ export declare namespace RateListParams {
|
|
|
145
221
|
* Subscription rates matching the billing frequency will be included in the
|
|
146
222
|
* response.
|
|
147
223
|
*/
|
|
148
|
-
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
224
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
149
225
|
/**
|
|
150
226
|
* List of pricing group key value pairs, rates containing the matching key / value
|
|
151
227
|
* pairs will be included in the response.
|
|
152
228
|
*/
|
|
153
|
-
partial_pricing_group_values?:
|
|
229
|
+
partial_pricing_group_values?: {
|
|
230
|
+
[key: string]: string;
|
|
231
|
+
};
|
|
154
232
|
/**
|
|
155
233
|
* List of pricing group key value pairs, rates matching all of the key / value
|
|
156
234
|
* pairs will be included in the response.
|
|
157
235
|
*/
|
|
158
|
-
pricing_group_values?:
|
|
236
|
+
pricing_group_values?: {
|
|
237
|
+
[key: string]: string;
|
|
238
|
+
};
|
|
159
239
|
/**
|
|
160
240
|
* Rates matching the product id will be included in the response.
|
|
161
241
|
*/
|
|
@@ -186,7 +266,7 @@ export interface RateAddParams {
|
|
|
186
266
|
* Optional. Frequency to bill subscriptions with. Required for subscription type
|
|
187
267
|
* products with Flat rate.
|
|
188
268
|
*/
|
|
189
|
-
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
269
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
190
270
|
/**
|
|
191
271
|
* A distinct rate on the rate card. You can choose to use this rate rather than
|
|
192
272
|
* list rate when consuming a credit or commit.
|
|
@@ -202,7 +282,9 @@ export interface RateAddParams {
|
|
|
202
282
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
203
283
|
* processors.
|
|
204
284
|
*/
|
|
205
|
-
custom_rate?:
|
|
285
|
+
custom_rate?: {
|
|
286
|
+
[key: string]: unknown;
|
|
287
|
+
};
|
|
206
288
|
/**
|
|
207
289
|
* exclusive end date
|
|
208
290
|
*/
|
|
@@ -222,7 +304,9 @@ export interface RateAddParams {
|
|
|
222
304
|
* Optional. List of pricing group key value pairs which will be used to calculate
|
|
223
305
|
* the price.
|
|
224
306
|
*/
|
|
225
|
-
pricing_group_values?:
|
|
307
|
+
pricing_group_values?: {
|
|
308
|
+
[key: string]: string;
|
|
309
|
+
};
|
|
226
310
|
/**
|
|
227
311
|
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
228
312
|
*/
|
|
@@ -275,7 +359,7 @@ export declare namespace RateAddManyParams {
|
|
|
275
359
|
* Optional. Frequency to bill subscriptions with. Required for subscription type
|
|
276
360
|
* products with Flat rate.
|
|
277
361
|
*/
|
|
278
|
-
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
362
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
279
363
|
/**
|
|
280
364
|
* A distinct rate on the rate card. You can choose to use this rate rather than
|
|
281
365
|
* list rate when consuming a credit or commit.
|
|
@@ -291,7 +375,9 @@ export declare namespace RateAddManyParams {
|
|
|
291
375
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
292
376
|
* processors.
|
|
293
377
|
*/
|
|
294
|
-
custom_rate?:
|
|
378
|
+
custom_rate?: {
|
|
379
|
+
[key: string]: unknown;
|
|
380
|
+
};
|
|
295
381
|
/**
|
|
296
382
|
* exclusive end date
|
|
297
383
|
*/
|
|
@@ -311,7 +397,9 @@ export declare namespace RateAddManyParams {
|
|
|
311
397
|
* Optional. List of pricing group key value pairs which will be used to calculate
|
|
312
398
|
* the price.
|
|
313
399
|
*/
|
|
314
|
-
pricing_group_values?:
|
|
400
|
+
pricing_group_values?: {
|
|
401
|
+
[key: string]: string;
|
|
402
|
+
};
|
|
315
403
|
/**
|
|
316
404
|
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
317
405
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rates.d.ts","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"rates.d.ts","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,IAAI,CACF,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,2BAA2B,EAAE,gBAAgB,CAAC;IAUlE;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IAIzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAGtG;AAED,qBAAa,2BAA4B,SAAQ,UAAU,CAAC,gBAAgB,CAAC;CAAG;AAEhF,MAAM,WAA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AAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE3B;;;;WAIG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B;IAED,UAAiB,IAAI,CAAC;QACpB;;;WAGG;QACH,UAAiB,UAAU;YACzB,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;YAExE;;eAEG;YACH,KAAK,CAAC,EAAE,MAAM,CAAC;YAEf;;eAEG;YACH,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC5B;KACF;CACF;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,2BAA2B,IAAI,2BAA2B,EAC1D,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -7,6 +7,28 @@ const pagination_1 = require("../../../../pagination.js");
|
|
|
7
7
|
class Rates extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Get all rates for a rate card at a point in time
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Automatically fetches more pages as needed.
|
|
14
|
+
* for await (const rateListResponse of client.v1.contracts.rateCards.rates.list(
|
|
15
|
+
* {
|
|
16
|
+
* at: '2024-01-01T00:00:00.000Z',
|
|
17
|
+
* rate_card_id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
|
|
18
|
+
* selectors: [
|
|
19
|
+
* {
|
|
20
|
+
* product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
|
|
21
|
+
* partial_pricing_group_values: {
|
|
22
|
+
* region: 'us-west-2',
|
|
23
|
+
* cloud: 'aws',
|
|
24
|
+
* },
|
|
25
|
+
* },
|
|
26
|
+
* ],
|
|
27
|
+
* },
|
|
28
|
+
* )) {
|
|
29
|
+
* // ...
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
10
32
|
*/
|
|
11
33
|
list(params, options) {
|
|
12
34
|
const { limit, next_page, ...body } = params;
|
|
@@ -19,12 +41,58 @@ class Rates extends resource_1.APIResource {
|
|
|
19
41
|
}
|
|
20
42
|
/**
|
|
21
43
|
* Add a new rate
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const response =
|
|
48
|
+
* await client.v1.contracts.rateCards.rates.add({
|
|
49
|
+
* entitled: true,
|
|
50
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
51
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
52
|
+
* rate_type: 'FLAT',
|
|
53
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
54
|
+
* credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
55
|
+
* price: 100,
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
22
58
|
*/
|
|
23
59
|
add(body, options) {
|
|
24
60
|
return this._client.post('/v1/contract-pricing/rate-cards/addRate', { body, ...options });
|
|
25
61
|
}
|
|
26
62
|
/**
|
|
27
63
|
* Add new rates
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const response =
|
|
68
|
+
* await client.v1.contracts.rateCards.rates.addMany({
|
|
69
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
70
|
+
* rates: [
|
|
71
|
+
* {
|
|
72
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
73
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
74
|
+
* entitled: true,
|
|
75
|
+
* rate_type: 'FLAT',
|
|
76
|
+
* price: 100,
|
|
77
|
+
* pricing_group_values: {
|
|
78
|
+
* region: 'us-west-2',
|
|
79
|
+
* cloud: 'aws',
|
|
80
|
+
* },
|
|
81
|
+
* },
|
|
82
|
+
* {
|
|
83
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
84
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
85
|
+
* entitled: true,
|
|
86
|
+
* rate_type: 'FLAT',
|
|
87
|
+
* price: 120,
|
|
88
|
+
* pricing_group_values: {
|
|
89
|
+
* region: 'us-east-2',
|
|
90
|
+
* cloud: 'aws',
|
|
91
|
+
* },
|
|
92
|
+
* },
|
|
93
|
+
* ],
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
28
96
|
*/
|
|
29
97
|
addMany(body, options) {
|
|
30
98
|
return this._client.post('/v1/contract-pricing/rate-cards/addRates', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rates.js","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAAmD;AAGnD,0DAA2E;AAE3E,MAAa,KAAM,SAAQ,sBAAW;IACpC
|
|
1
|
+
{"version":3,"file":"rates.js","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAAmD;AAGnD,0DAA2E;AAE3E,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,IAAI,CACF,MAAsB,EACtB,OAA6B;QAE7B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,0CAA0C,EAAE,2BAA2B,EAAE;YACtG,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC3B,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,IAAmB,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,OAAO,CAAC,IAAuB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AAlGD,sBAkGC;AAED,MAAa,2BAA4B,SAAQ,uBAA4B;CAAG;AAAhF,kEAAgF;AAqZhF,KAAK,CAAC,2BAA2B,GAAG,2BAA2B,CAAC"}
|
|
@@ -4,6 +4,28 @@ import { CursorPage } from "../../../../pagination.mjs";
|
|
|
4
4
|
export class Rates extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Get all rates for a rate card at a point in time
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Automatically fetches more pages as needed.
|
|
11
|
+
* for await (const rateListResponse of client.v1.contracts.rateCards.rates.list(
|
|
12
|
+
* {
|
|
13
|
+
* at: '2024-01-01T00:00:00.000Z',
|
|
14
|
+
* rate_card_id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
|
|
15
|
+
* selectors: [
|
|
16
|
+
* {
|
|
17
|
+
* product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
|
|
18
|
+
* partial_pricing_group_values: {
|
|
19
|
+
* region: 'us-west-2',
|
|
20
|
+
* cloud: 'aws',
|
|
21
|
+
* },
|
|
22
|
+
* },
|
|
23
|
+
* ],
|
|
24
|
+
* },
|
|
25
|
+
* )) {
|
|
26
|
+
* // ...
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
7
29
|
*/
|
|
8
30
|
list(params, options) {
|
|
9
31
|
const { limit, next_page, ...body } = params;
|
|
@@ -16,12 +38,58 @@ export class Rates extends APIResource {
|
|
|
16
38
|
}
|
|
17
39
|
/**
|
|
18
40
|
* Add a new rate
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response =
|
|
45
|
+
* await client.v1.contracts.rateCards.rates.add({
|
|
46
|
+
* entitled: true,
|
|
47
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
48
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
49
|
+
* rate_type: 'FLAT',
|
|
50
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
51
|
+
* credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
52
|
+
* price: 100,
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
19
55
|
*/
|
|
20
56
|
add(body, options) {
|
|
21
57
|
return this._client.post('/v1/contract-pricing/rate-cards/addRate', { body, ...options });
|
|
22
58
|
}
|
|
23
59
|
/**
|
|
24
60
|
* Add new rates
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const response =
|
|
65
|
+
* await client.v1.contracts.rateCards.rates.addMany({
|
|
66
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
67
|
+
* rates: [
|
|
68
|
+
* {
|
|
69
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
70
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
71
|
+
* entitled: true,
|
|
72
|
+
* rate_type: 'FLAT',
|
|
73
|
+
* price: 100,
|
|
74
|
+
* pricing_group_values: {
|
|
75
|
+
* region: 'us-west-2',
|
|
76
|
+
* cloud: 'aws',
|
|
77
|
+
* },
|
|
78
|
+
* },
|
|
79
|
+
* {
|
|
80
|
+
* product_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
81
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
82
|
+
* entitled: true,
|
|
83
|
+
* rate_type: 'FLAT',
|
|
84
|
+
* price: 120,
|
|
85
|
+
* pricing_group_values: {
|
|
86
|
+
* region: 'us-east-2',
|
|
87
|
+
* cloud: 'aws',
|
|
88
|
+
* },
|
|
89
|
+
* },
|
|
90
|
+
* ],
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
25
93
|
*/
|
|
26
94
|
addMany(body, options) {
|
|
27
95
|
return this._client.post('/v1/contract-pricing/rate-cards/addRates', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rates.mjs","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rates.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"rates.mjs","sourceRoot":"","sources":["../../../../src/resources/v1/contracts/rate-cards/rates.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,IAAI,CACF,MAAsB,EACtB,OAA6B;QAE7B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,0CAA0C,EAAE,2BAA2B,EAAE;YACtG,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC3B,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,IAAmB,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,OAAO,CAAC,IAAuB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,UAA4B;CAAG;AAqZhF,KAAK,CAAC,2BAA2B,GAAG,2BAA2B,CAAC"}
|