From 306626e7a4181b09ccec699cd75941823d43eff9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:34:50 +0000 Subject: [PATCH] feat(api): api update (#41) --- .stats.yml | 2 +- aliases.go | 9 +++++++ contract.go | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ contract_test.go | 36 +++++++++++++++++++++++++ shared/shared.go | 21 +++++++++++++++ 5 files changed, 137 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index af4b24d..0606e17 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-037e2c312f68e8c20a89b2be8e1745dd0e5dd3e43677349ea971233287c0e6cb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-b84ae14053713dcb9bed31b22b072ae44659936b582ca7c2bda56632f079445c.yml diff --git a/aliases.go b/aliases.go index f812c9c..3a47ea5 100644 --- a/aliases.go +++ b/aliases.go @@ -435,6 +435,15 @@ const OverrideRateTypeTiered = shared.OverrideRateTypeTiered // This is an alias to an internal value. const OverrideRateTypeCustom = shared.OverrideRateTypeCustom +// This is an alias to an internal type. +type OverrideTarget = shared.OverrideTarget + +// This is an alias to an internal value. +const OverrideTargetCommitRate = shared.OverrideTargetCommitRate + +// This is an alias to an internal value. +const OverrideTargetListRate = shared.OverrideTargetListRate + // This is an alias to an internal type. type OverrideType = shared.OverrideType diff --git a/contract.go b/contract.go index fd82a6c..f7bba54 100644 --- a/contract.go +++ b/contract.go @@ -1092,6 +1092,9 @@ type ContractNewParamsCommit struct { RateType param.Field[ContractNewParamsCommitsRateType] `json:"rate_type"` // Fraction of unused segments that will be rolled over. Must be between 0 and 1. RolloverFraction param.Field[float64] `json:"rollover_fraction"` + // A temporary ID for the commit that can be used to reference the commit for + // commit specific overrides. + TemporaryID param.Field[string] `json:"temporary_id"` } func (r ContractNewParamsCommit) MarshalJSON() (data []byte, err error) { @@ -1442,6 +1445,10 @@ type ContractNewParamsOverride struct { // RFC 3339 timestamp indicating when the override will stop applying (exclusive) EndingBefore param.Field[time.Time] `json:"ending_before" format:"date-time"` Entitled param.Field[bool] `json:"entitled"` + // 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`. + IsCommitSpecific param.Field[bool] `json:"is_commit_specific"` // Required for MULTIPLIER type. Must be >=0. Multiplier param.Field[float64] `json:"multiplier"` // Cannot be used in conjunction with product_id or applicable_product_tags. If @@ -1456,6 +1463,10 @@ type ContractNewParamsOverride struct { Priority param.Field[float64] `json:"priority"` // ID of the product whose rate is being overridden ProductID param.Field[string] `json:"product_id" format:"uuid"` + // 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 param.Field[ContractNewParamsOverridesTarget] `json:"target"` // Required for TIERED type. Must have at least one tier. Tiers param.Field[[]ContractNewParamsOverridesTier] `json:"tiers"` // Overwrites are prioritized over multipliers and tiered overrides. @@ -1467,6 +1478,10 @@ func (r ContractNewParamsOverride) MarshalJSON() (data []byte, err error) { } type ContractNewParamsOverridesOverrideSpecifier struct { + // 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. + CommitIDs param.Field[[]string] `json:"commit_ids"` // 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 // overrides. @@ -1525,6 +1540,26 @@ func (r ContractNewParamsOverridesOverwriteRateRateType) IsKnown() bool { return false } +// 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"`. +type ContractNewParamsOverridesTarget string + +const ( + ContractNewParamsOverridesTargetCommitRate ContractNewParamsOverridesTarget = "COMMIT_RATE" + ContractNewParamsOverridesTargetCommitRate ContractNewParamsOverridesTarget = "commit_rate" + ContractNewParamsOverridesTargetListRate ContractNewParamsOverridesTarget = "LIST_RATE" + ContractNewParamsOverridesTargetListRate ContractNewParamsOverridesTarget = "list_rate" +) + +func (r ContractNewParamsOverridesTarget) IsKnown() bool { + switch r { + case ContractNewParamsOverridesTargetCommitRate, ContractNewParamsOverridesTargetCommitRate, ContractNewParamsOverridesTargetListRate, ContractNewParamsOverridesTargetListRate: + return true + } + return false +} + type ContractNewParamsOverridesTier struct { Multiplier param.Field[float64] `json:"multiplier,required"` Size param.Field[float64] `json:"size"` @@ -1965,6 +2000,9 @@ type ContractAmendParamsCommit struct { RateType param.Field[ContractAmendParamsCommitsRateType] `json:"rate_type"` // Fraction of unused segments that will be rolled over. Must be between 0 and 1. RolloverFraction param.Field[float64] `json:"rollover_fraction"` + // A temporary ID for the commit that can be used to reference the commit for + // commit specific overrides. + TemporaryID param.Field[string] `json:"temporary_id"` } func (r ContractAmendParamsCommit) MarshalJSON() (data []byte, err error) { @@ -2296,6 +2334,10 @@ type ContractAmendParamsOverride struct { // RFC 3339 timestamp indicating when the override will stop applying (exclusive) EndingBefore param.Field[time.Time] `json:"ending_before" format:"date-time"` Entitled param.Field[bool] `json:"entitled"` + // 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`. + IsCommitSpecific param.Field[bool] `json:"is_commit_specific"` // Required for MULTIPLIER type. Must be >=0. Multiplier param.Field[float64] `json:"multiplier"` // Cannot be used in conjunction with product_id or applicable_product_tags. If @@ -2310,6 +2352,10 @@ type ContractAmendParamsOverride struct { Priority param.Field[float64] `json:"priority"` // ID of the product whose rate is being overridden ProductID param.Field[string] `json:"product_id" format:"uuid"` + // 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 param.Field[ContractAmendParamsOverridesTarget] `json:"target"` // Required for TIERED type. Must have at least one tier. Tiers param.Field[[]ContractAmendParamsOverridesTier] `json:"tiers"` // Overwrites are prioritized over multipliers and tiered overrides. @@ -2321,6 +2367,10 @@ func (r ContractAmendParamsOverride) MarshalJSON() (data []byte, err error) { } type ContractAmendParamsOverridesOverrideSpecifier struct { + // 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. + CommitIDs param.Field[[]string] `json:"commit_ids"` // 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 // overrides. @@ -2379,6 +2429,26 @@ func (r ContractAmendParamsOverridesOverwriteRateRateType) IsKnown() bool { return false } +// 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"`. +type ContractAmendParamsOverridesTarget string + +const ( + ContractAmendParamsOverridesTargetCommitRate ContractAmendParamsOverridesTarget = "COMMIT_RATE" + ContractAmendParamsOverridesTargetCommitRate ContractAmendParamsOverridesTarget = "commit_rate" + ContractAmendParamsOverridesTargetListRate ContractAmendParamsOverridesTarget = "LIST_RATE" + ContractAmendParamsOverridesTargetListRate ContractAmendParamsOverridesTarget = "list_rate" +) + +func (r ContractAmendParamsOverridesTarget) IsKnown() bool { + switch r { + case ContractAmendParamsOverridesTargetCommitRate, ContractAmendParamsOverridesTargetCommitRate, ContractAmendParamsOverridesTargetListRate, ContractAmendParamsOverridesTargetListRate: + return true + } + return false +} + type ContractAmendParamsOverridesTier struct { Multiplier param.Field[float64] `json:"multiplier,required"` Size param.Field[float64] `json:"size"` diff --git a/contract_test.go b/contract_test.go index bda81fc..9a08838 100644 --- a/contract_test.go +++ b/contract_test.go @@ -94,6 +94,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { Priority: metronome.F(0.000000), RateType: metronome.F(metronome.ContractNewParamsCommitsRateTypeCommitRate), RolloverFraction: metronome.F(0.000000), + TemporaryID: metronome.F("temporary_id"), }, { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), Type: metronome.F(metronome.ContractNewParamsCommitsTypePrepaid), @@ -153,6 +154,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { Priority: metronome.F(0.000000), RateType: metronome.F(metronome.ContractNewParamsCommitsRateTypeCommitRate), RolloverFraction: metronome.F(0.000000), + TemporaryID: metronome.F("temporary_id"), }, { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), Type: metronome.F(metronome.ContractNewParamsCommitsTypePrepaid), @@ -212,6 +214,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { Priority: metronome.F(0.000000), RateType: metronome.F(metronome.ContractNewParamsCommitsRateTypeCommitRate), RolloverFraction: metronome.F(0.000000), + TemporaryID: metronome.F("temporary_id"), }}), Credits: metronome.F([]metronome.ContractNewParamsCredit{{ AccessSchedule: metronome.F(metronome.ContractNewParamsCreditsAccessSchedule{ @@ -405,8 +408,10 @@ func TestContractNewWithOptionalParams(t *testing.T) { ApplicableProductTags: metronome.F([]string{"string", "string", "string"}), EndingBefore: metronome.F(time.Now()), Entitled: metronome.F(true), + IsCommitSpecific: metronome.F(true), Multiplier: metronome.F(0.000000), OverrideSpecifiers: metronome.F([]metronome.ContractNewParamsOverridesOverrideSpecifier{{ + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -416,6 +421,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -425,6 +431,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -456,6 +463,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { }), Priority: metronome.F(0.000000), ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Target: metronome.F(metronome.ContractNewParamsOverridesTargetCommitRate), Tiers: metronome.F([]metronome.ContractNewParamsOverridesTier{{ Multiplier: metronome.F(0.000000), Size: metronome.F(0.000000), @@ -472,8 +480,10 @@ func TestContractNewWithOptionalParams(t *testing.T) { ApplicableProductTags: metronome.F([]string{"string", "string", "string"}), EndingBefore: metronome.F(time.Now()), Entitled: metronome.F(true), + IsCommitSpecific: metronome.F(true), Multiplier: metronome.F(0.000000), OverrideSpecifiers: metronome.F([]metronome.ContractNewParamsOverridesOverrideSpecifier{{ + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -483,6 +493,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -492,6 +503,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -523,6 +535,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { }), Priority: metronome.F(0.000000), ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Target: metronome.F(metronome.ContractNewParamsOverridesTargetCommitRate), Tiers: metronome.F([]metronome.ContractNewParamsOverridesTier{{ Multiplier: metronome.F(0.000000), Size: metronome.F(0.000000), @@ -539,8 +552,10 @@ func TestContractNewWithOptionalParams(t *testing.T) { ApplicableProductTags: metronome.F([]string{"string", "string", "string"}), EndingBefore: metronome.F(time.Now()), Entitled: metronome.F(true), + IsCommitSpecific: metronome.F(true), Multiplier: metronome.F(0.000000), OverrideSpecifiers: metronome.F([]metronome.ContractNewParamsOverridesOverrideSpecifier{{ + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -550,6 +565,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -559,6 +575,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -590,6 +607,7 @@ func TestContractNewWithOptionalParams(t *testing.T) { }), Priority: metronome.F(0.000000), ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Target: metronome.F(metronome.ContractNewParamsOverridesTargetCommitRate), Tiers: metronome.F([]metronome.ContractNewParamsOverridesTier{{ Multiplier: metronome.F(0.000000), Size: metronome.F(0.000000), @@ -977,6 +995,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { Priority: metronome.F(0.000000), RateType: metronome.F(metronome.ContractAmendParamsCommitsRateTypeCommitRate), RolloverFraction: metronome.F(0.000000), + TemporaryID: metronome.F("temporary_id"), }, { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), Type: metronome.F(metronome.ContractAmendParamsCommitsTypePrepaid), @@ -1036,6 +1055,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { Priority: metronome.F(0.000000), RateType: metronome.F(metronome.ContractAmendParamsCommitsRateTypeCommitRate), RolloverFraction: metronome.F(0.000000), + TemporaryID: metronome.F("temporary_id"), }, { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), Type: metronome.F(metronome.ContractAmendParamsCommitsTypePrepaid), @@ -1095,6 +1115,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { Priority: metronome.F(0.000000), RateType: metronome.F(metronome.ContractAmendParamsCommitsRateTypeCommitRate), RolloverFraction: metronome.F(0.000000), + TemporaryID: metronome.F("temporary_id"), }}), Credits: metronome.F([]metronome.ContractAmendParamsCredit{{ AccessSchedule: metronome.F(metronome.ContractAmendParamsCreditsAccessSchedule{ @@ -1284,8 +1305,10 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ApplicableProductTags: metronome.F([]string{"string", "string", "string"}), EndingBefore: metronome.F(time.Now()), Entitled: metronome.F(true), + IsCommitSpecific: metronome.F(true), Multiplier: metronome.F(0.000000), OverrideSpecifiers: metronome.F([]metronome.ContractAmendParamsOverridesOverrideSpecifier{{ + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1295,6 +1318,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1304,6 +1328,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1335,6 +1360,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { }), Priority: metronome.F(0.000000), ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Target: metronome.F(metronome.ContractAmendParamsOverridesTargetCommitRate), Tiers: metronome.F([]metronome.ContractAmendParamsOverridesTier{{ Multiplier: metronome.F(0.000000), Size: metronome.F(0.000000), @@ -1351,8 +1377,10 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ApplicableProductTags: metronome.F([]string{"string", "string", "string"}), EndingBefore: metronome.F(time.Now()), Entitled: metronome.F(true), + IsCommitSpecific: metronome.F(true), Multiplier: metronome.F(0.000000), OverrideSpecifiers: metronome.F([]metronome.ContractAmendParamsOverridesOverrideSpecifier{{ + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1362,6 +1390,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1371,6 +1400,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1402,6 +1432,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { }), Priority: metronome.F(0.000000), ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Target: metronome.F(metronome.ContractAmendParamsOverridesTargetCommitRate), Tiers: metronome.F([]metronome.ContractAmendParamsOverridesTier{{ Multiplier: metronome.F(0.000000), Size: metronome.F(0.000000), @@ -1418,8 +1449,10 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ApplicableProductTags: metronome.F([]string{"string", "string", "string"}), EndingBefore: metronome.F(time.Now()), Entitled: metronome.F(true), + IsCommitSpecific: metronome.F(true), Multiplier: metronome.F(0.000000), OverrideSpecifiers: metronome.F([]metronome.ContractAmendParamsOverridesOverrideSpecifier{{ + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1429,6 +1462,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1438,6 +1472,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), ProductTags: metronome.F([]string{"string", "string", "string"}), }, { + CommitIDs: metronome.F([]string{"string", "string", "string"}), PresentationGroupValues: metronome.F(map[string]string{ "foo": "string", }), @@ -1469,6 +1504,7 @@ func TestContractAmendWithOptionalParams(t *testing.T) { }), Priority: metronome.F(0.000000), ProductID: metronome.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), + Target: metronome.F(metronome.ContractAmendParamsOverridesTargetCommitRate), Tiers: metronome.F([]metronome.ContractAmendParamsOverridesTier{{ Multiplier: metronome.F(0.000000), Size: metronome.F(0.000000), diff --git a/shared/shared.go b/shared/shared.go index 151e06f..df06f75 100644 --- a/shared/shared.go +++ b/shared/shared.go @@ -1864,6 +1864,7 @@ type Override struct { CreditType CreditTypeData `json:"credit_type"` EndingBefore time.Time `json:"ending_before" format:"date-time"` Entitled bool `json:"entitled"` + IsCommitSpecific bool `json:"is_commit_specific"` // Default proration configuration. Only valid for SUBSCRIPTION rate_type. IsProrated bool `json:"is_prorated"` Multiplier float64 `json:"multiplier"` @@ -1878,6 +1879,7 @@ type Override struct { // Default quantity. For SUBSCRIPTION rate_type, this must be >=0. Quantity float64 `json:"quantity"` RateType OverrideRateType `json:"rate_type"` + Target OverrideTarget `json:"target"` // Only set for TIERED rate_type. Tiers []Tier `json:"tiers"` Type OverrideType `json:"type"` @@ -1895,6 +1897,7 @@ type overrideJSON struct { CreditType apijson.Field EndingBefore apijson.Field Entitled apijson.Field + IsCommitSpecific apijson.Field IsProrated apijson.Field Multiplier apijson.Field OverrideSpecifiers apijson.Field @@ -1905,6 +1908,7 @@ type overrideJSON struct { Product apijson.Field Quantity apijson.Field RateType apijson.Field + Target apijson.Field Tiers apijson.Field Type apijson.Field Value apijson.Field @@ -1921,6 +1925,7 @@ func (r overrideJSON) RawJSON() string { } type OverrideOverrideSpecifier struct { + CommitIDs []string `json:"commit_ids"` PresentationGroupValues map[string]string `json:"presentation_group_values"` PricingGroupValues map[string]string `json:"pricing_group_values"` ProductID string `json:"product_id" format:"uuid"` @@ -1931,6 +1936,7 @@ type OverrideOverrideSpecifier struct { // overrideOverrideSpecifierJSON contains the JSON metadata for the struct // [OverrideOverrideSpecifier] type overrideOverrideSpecifierJSON struct { + CommitIDs apijson.Field PresentationGroupValues apijson.Field PricingGroupValues apijson.Field ProductID apijson.Field @@ -2068,6 +2074,21 @@ func (r OverrideRateType) IsKnown() bool { return false } +type OverrideTarget string + +const ( + OverrideTargetCommitRate OverrideTarget = "COMMIT_RATE" + OverrideTargetListRate OverrideTarget = "LIST_RATE" +) + +func (r OverrideTarget) IsKnown() bool { + switch r { + case OverrideTargetCommitRate, OverrideTargetListRate: + return true + } + return false +} + type OverrideType string const (