From fc1cab593d4f7e2a8c7f229cc61478662a539ce4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 1 Nov 2024 18:01:19 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 2 +- src/resources/contracts/contracts.ts | 58 ------------------- src/resources/shared.ts | 8 --- .../api-resources/contracts/contracts.test.ts | 42 -------------- 4 files changed, 1 insertion(+), 109 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0606e17..7491bf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-b84ae14053713dcb9bed31b22b072ae44659936b582ca7c2bda56632f079445c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-2364d37901fa069d859d9d2e0f75c0ef5453b38cb06e59d7f7cc7c185ec1f8c9.yml diff --git a/src/resources/contracts/contracts.ts b/src/resources/contracts/contracts.ts index 72d3d0d..39860cc 100644 --- a/src/resources/contracts/contracts.ts +++ b/src/resources/contracts/contracts.ts @@ -642,18 +642,10 @@ export namespace ContractCreateParams { */ priority?: number; - rate_type?: 'COMMIT_RATE' | 'commit_rate' | 'LIST_RATE' | 'list_rate'; - /** * Fraction of unused segments that will be rolled over. Must be between 0 and 1. */ rollover_fraction?: number; - - /** - * A temporary ID for the commit that can be used to reference the commit for - * commit specific overrides. - */ - temporary_id?: string; } export namespace Commit { @@ -986,13 +978,6 @@ export namespace ContractCreateParams { entitled?: boolean; - /** - * Indicates whether the override should only apply to commits. Defaults to - * `false`. If `true`, you can specify relevant commits in `override_specifiers` by - * passing `commit_ids`. - */ - is_commit_specific?: boolean; - /** * Required for MULTIPLIER type. Must be >=0. */ @@ -1022,13 +1007,6 @@ export namespace ContractCreateParams { */ product_id?: string; - /** - * Indicates whether the override applies to commit rates or list rates. Can only - * be used for overrides that have `is_commit_specific` set to `true`. Defaults to - * `"LIST_RATE"`. - */ - target?: 'COMMIT_RATE' | 'commit_rate' | 'LIST_RATE' | 'list_rate'; - /** * Required for TIERED type. Must have at least one tier. */ @@ -1042,13 +1020,6 @@ export namespace ContractCreateParams { export namespace Override { export interface OverrideSpecifier { - /** - * If provided, the override will only apply to the specified commits. Can only be - * used for commit specific overrides. If not provided, the override will apply to - * all commits. - */ - commit_ids?: Array; - /** * A map of group names to values. The override will only apply to line items with * the specified presentation group values. Can only be used for multiplier @@ -1551,18 +1522,10 @@ export namespace ContractAmendParams { */ priority?: number; - rate_type?: 'COMMIT_RATE' | 'commit_rate' | 'LIST_RATE' | 'list_rate'; - /** * Fraction of unused segments that will be rolled over. Must be between 0 and 1. */ rollover_fraction?: number; - - /** - * A temporary ID for the commit that can be used to reference the commit for - * commit specific overrides. - */ - temporary_id?: string; } export namespace Commit { @@ -1895,13 +1858,6 @@ export namespace ContractAmendParams { entitled?: boolean; - /** - * Indicates whether the override should only apply to commits. Defaults to - * `false`. If `true`, you can specify relevant commits in `override_specifiers` by - * passing `commit_ids`. - */ - is_commit_specific?: boolean; - /** * Required for MULTIPLIER type. Must be >=0. */ @@ -1931,13 +1887,6 @@ export namespace ContractAmendParams { */ product_id?: string; - /** - * Indicates whether the override applies to commit rates or list rates. Can only - * be used for overrides that have `is_commit_specific` set to `true`. Defaults to - * `"LIST_RATE"`. - */ - target?: 'COMMIT_RATE' | 'commit_rate' | 'LIST_RATE' | 'list_rate'; - /** * Required for TIERED type. Must have at least one tier. */ @@ -1951,13 +1900,6 @@ export namespace ContractAmendParams { export namespace Override { export interface OverrideSpecifier { - /** - * If provided, the override will only apply to the specified commits. Can only be - * used for commit specific overrides. If not provided, the override will apply to - * all commits. - */ - commit_ids?: Array; - /** * A map of group names to values. The override will only apply to line items with * the specified presentation group values. Can only be used for multiplier diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 445ff94..f6e3280 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -83,8 +83,6 @@ export interface Commit { */ priority?: number; - rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; - rolled_over_from?: Commit.RolledOverFrom; rollover_fraction?: number; @@ -582,8 +580,6 @@ export interface Override { entitled?: boolean; - is_commit_specific?: boolean; - /** * Default proration configuration. Only valid for SUBSCRIPTION rate_type. */ @@ -614,8 +610,6 @@ export interface Override { rate_type?: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM'; - target?: 'COMMIT_RATE' | 'LIST_RATE'; - /** * Only set for TIERED rate_type. */ @@ -632,8 +626,6 @@ export interface Override { export namespace Override { export interface OverrideSpecifier { - commit_ids?: Array; - presentation_group_values?: Record; pricing_group_values?: Record; diff --git a/tests/api-resources/contracts/contracts.test.ts b/tests/api-resources/contracts/contracts.test.ts index 9303ff9..c197706 100644 --- a/tests/api-resources/contracts/contracts.test.ts +++ b/tests/api-resources/contracts/contracts.test.ts @@ -85,9 +85,7 @@ describe('resource contracts', () => { name: 'x', netsuite_sales_order_id: 'netsuite_sales_order_id', priority: 0, - rate_type: 'COMMIT_RATE', rollover_fraction: 0, - temporary_id: 'temporary_id', }, { product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -141,9 +139,7 @@ describe('resource contracts', () => { name: 'x', netsuite_sales_order_id: 'netsuite_sales_order_id', priority: 0, - rate_type: 'COMMIT_RATE', rollover_fraction: 0, - temporary_id: 'temporary_id', }, { product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -197,9 +193,7 @@ describe('resource contracts', () => { name: 'x', netsuite_sales_order_id: 'netsuite_sales_order_id', priority: 0, - rate_type: 'COMMIT_RATE', rollover_fraction: 0, - temporary_id: 'temporary_id', }, ], credits: [ @@ -386,25 +380,21 @@ describe('resource contracts', () => { applicable_product_tags: ['string', 'string', 'string'], ending_before: '2019-12-27T18:11:19.117Z', entitled: true, - is_commit_specific: true, multiplier: 0, override_specifiers: [ { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -426,7 +416,6 @@ describe('resource contracts', () => { }, priority: 0, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - target: 'COMMIT_RATE', tiers: [ { multiplier: 0, size: 0 }, { multiplier: 0, size: 0 }, @@ -439,25 +428,21 @@ describe('resource contracts', () => { applicable_product_tags: ['string', 'string', 'string'], ending_before: '2019-12-27T18:11:19.117Z', entitled: true, - is_commit_specific: true, multiplier: 0, override_specifiers: [ { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -479,7 +464,6 @@ describe('resource contracts', () => { }, priority: 0, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - target: 'COMMIT_RATE', tiers: [ { multiplier: 0, size: 0 }, { multiplier: 0, size: 0 }, @@ -492,25 +476,21 @@ describe('resource contracts', () => { applicable_product_tags: ['string', 'string', 'string'], ending_before: '2019-12-27T18:11:19.117Z', entitled: true, - is_commit_specific: true, multiplier: 0, override_specifiers: [ { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -532,7 +512,6 @@ describe('resource contracts', () => { }, priority: 0, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - target: 'COMMIT_RATE', tiers: [ { multiplier: 0, size: 0 }, { multiplier: 0, size: 0 }, @@ -869,9 +848,7 @@ describe('resource contracts', () => { name: 'x', netsuite_sales_order_id: 'netsuite_sales_order_id', priority: 0, - rate_type: 'COMMIT_RATE', rollover_fraction: 0, - temporary_id: 'temporary_id', }, { product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -925,9 +902,7 @@ describe('resource contracts', () => { name: 'x', netsuite_sales_order_id: 'netsuite_sales_order_id', priority: 0, - rate_type: 'COMMIT_RATE', rollover_fraction: 0, - temporary_id: 'temporary_id', }, { product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -981,9 +956,7 @@ describe('resource contracts', () => { name: 'x', netsuite_sales_order_id: 'netsuite_sales_order_id', priority: 0, - rate_type: 'COMMIT_RATE', rollover_fraction: 0, - temporary_id: 'temporary_id', }, ], credits: [ @@ -1166,25 +1139,21 @@ describe('resource contracts', () => { applicable_product_tags: ['string', 'string', 'string'], ending_before: '2019-12-27T18:11:19.117Z', entitled: true, - is_commit_specific: true, multiplier: 0, override_specifiers: [ { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -1206,7 +1175,6 @@ describe('resource contracts', () => { }, priority: 0, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - target: 'COMMIT_RATE', tiers: [ { multiplier: 0, size: 0 }, { multiplier: 0, size: 0 }, @@ -1219,25 +1187,21 @@ describe('resource contracts', () => { applicable_product_tags: ['string', 'string', 'string'], ending_before: '2019-12-27T18:11:19.117Z', entitled: true, - is_commit_specific: true, multiplier: 0, override_specifiers: [ { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -1259,7 +1223,6 @@ describe('resource contracts', () => { }, priority: 0, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - target: 'COMMIT_RATE', tiers: [ { multiplier: 0, size: 0 }, { multiplier: 0, size: 0 }, @@ -1272,25 +1235,21 @@ describe('resource contracts', () => { applicable_product_tags: ['string', 'string', 'string'], ending_before: '2019-12-27T18:11:19.117Z', entitled: true, - is_commit_specific: true, multiplier: 0, override_specifiers: [ { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', product_tags: ['string', 'string', 'string'], }, { - commit_ids: ['string', 'string', 'string'], presentation_group_values: { foo: 'string' }, pricing_group_values: { foo: 'string' }, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -1312,7 +1271,6 @@ describe('resource contracts', () => { }, priority: 0, product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - target: 'COMMIT_RATE', tiers: [ { multiplier: 0, size: 0 }, { multiplier: 0, size: 0 },