diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bfaab56..0c0c0c3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.24.0" + ".": "1.25.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index fd40002..4b69c08 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-26020bd285825dac04bf642a414ea07c786fc6e42ee6bbcf795e11f8db426519.yml -openapi_spec_hash: 897fedec83f0960539b3aa4ec0e3308d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-297c7ce95bc0aa1ac6f324a487515f49b8a30b74eb9d39ca9dcd2d9cf065f0ef.yml +openapi_spec_hash: 29e9af981bc78379336079bb4208c54d config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index d8033a2..69b3d0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.25.0 (2025-10-06) + +Full Changelog: [v1.24.0...v1.25.0](https://github.com/orbcorp/orb-go/compare/v1.24.0...v1.25.0) + +### Features + +* **api:** api update ([1eff9e8](https://github.com/orbcorp/orb-go/commit/1eff9e808946eff43ec8a3df2d4acb2c7940f37f)) + ## 1.24.0 (2025-10-03) Full Changelog: [v1.23.0...v1.24.0](https://github.com/orbcorp/orb-go/compare/v1.23.0...v1.24.0) diff --git a/README.md b/README.md index ca009be..f409cb7 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Or to pin the version: ```sh -go get -u 'github.com/orbcorp/orb-go@v1.24.0' +go get -u 'github.com/orbcorp/orb-go@v1.25.0' ``` diff --git a/aliases.go b/aliases.go index 745c544..5afc6c8 100644 --- a/aliases.go +++ b/aliases.go @@ -1543,6 +1543,9 @@ const InvoiceLevelDiscountDiscountTypeTrial = shared.InvoiceLevelDiscountDiscoun // This is an alias to an internal type. type InvoiceTiny = shared.InvoiceTiny +// A minimal representation of an Item containing only the essential identifying +// information. +// // This is an alias to an internal type. type ItemSlim = shared.ItemSlim @@ -6618,6 +6621,76 @@ const PriceMinimumCompositePricePriceTypeFixedPrice = shared.PriceMinimumComposi // This is an alias to an internal value. const PriceMinimumCompositePricePriceTypeCompositePrice = shared.PriceMinimumCompositePricePriceTypeCompositePrice +// This is an alias to an internal type. +type PriceEventOutputPrice = shared.PriceEventOutputPrice + +// This is an alias to an internal type. +type PriceEventOutputPriceBillingMode = shared.PriceEventOutputPriceBillingMode + +// This is an alias to an internal value. +const PriceEventOutputPriceBillingModeInAdvance = shared.PriceEventOutputPriceBillingModeInAdvance + +// This is an alias to an internal value. +const PriceEventOutputPriceBillingModeInArrear = shared.PriceEventOutputPriceBillingModeInArrear + +// This is an alias to an internal type. +type PriceEventOutputPriceCadence = shared.PriceEventOutputPriceCadence + +// This is an alias to an internal value. +const PriceEventOutputPriceCadenceOneTime = shared.PriceEventOutputPriceCadenceOneTime + +// This is an alias to an internal value. +const PriceEventOutputPriceCadenceMonthly = shared.PriceEventOutputPriceCadenceMonthly + +// This is an alias to an internal value. +const PriceEventOutputPriceCadenceQuarterly = shared.PriceEventOutputPriceCadenceQuarterly + +// This is an alias to an internal value. +const PriceEventOutputPriceCadenceSemiAnnual = shared.PriceEventOutputPriceCadenceSemiAnnual + +// This is an alias to an internal value. +const PriceEventOutputPriceCadenceAnnual = shared.PriceEventOutputPriceCadenceAnnual + +// This is an alias to an internal value. +const PriceEventOutputPriceCadenceCustom = shared.PriceEventOutputPriceCadenceCustom + +// This is an alias to an internal type. +type PriceEventOutputPriceConversionRateConfig = shared.PriceEventOutputPriceConversionRateConfig + +// This is an alias to an internal type. +type PriceEventOutputPriceConversionRateConfigConversionRateType = shared.PriceEventOutputPriceConversionRateConfigConversionRateType + +// This is an alias to an internal value. +const PriceEventOutputPriceConversionRateConfigConversionRateTypeUnit = shared.PriceEventOutputPriceConversionRateConfigConversionRateTypeUnit + +// This is an alias to an internal value. +const PriceEventOutputPriceConversionRateConfigConversionRateTypeTiered = shared.PriceEventOutputPriceConversionRateConfigConversionRateTypeTiered + +// Configuration for event_output pricing +// +// This is an alias to an internal type. +type PriceEventOutputPriceEventOutputConfig = shared.PriceEventOutputPriceEventOutputConfig + +// The pricing model type +// +// This is an alias to an internal type. +type PriceEventOutputPriceModelType = shared.PriceEventOutputPriceModelType + +// This is an alias to an internal value. +const PriceEventOutputPriceModelTypeEventOutput = shared.PriceEventOutputPriceModelTypeEventOutput + +// This is an alias to an internal type. +type PriceEventOutputPricePriceType = shared.PriceEventOutputPricePriceType + +// This is an alias to an internal value. +const PriceEventOutputPricePriceTypeUsagePrice = shared.PriceEventOutputPricePriceTypeUsagePrice + +// This is an alias to an internal value. +const PriceEventOutputPricePriceTypeFixedPrice = shared.PriceEventOutputPricePriceTypeFixedPrice + +// This is an alias to an internal value. +const PriceEventOutputPricePriceTypeCompositePrice = shared.PriceEventOutputPricePriceTypeCompositePrice + // This is an alias to an internal type. type PriceBillingMode = shared.PriceBillingMode @@ -6734,6 +6807,9 @@ const PriceModelTypeCumulativeGroupedBulk = shared.PriceModelTypeCumulativeGroup // This is an alias to an internal value. const PriceModelTypeMinimum = shared.PriceModelTypeMinimum +// This is an alias to an internal value. +const PriceModelTypeEventOutput = shared.PriceModelTypeEventOutput + // This is an alias to an internal type. type PricePriceType = shared.PricePriceType diff --git a/beta.go b/beta.go index 8d5064c..b8c63a0 100644 --- a/beta.go +++ b/beta.go @@ -486,6 +486,7 @@ type BetaNewPlanVersionParamsAddPricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -565,6 +566,7 @@ func (r BetaNewPlanVersionParamsAddPricesPrice) ImplementsBetaNewPlanVersionPara // [shared.NewPlanScalableMatrixWithTieredPricingPriceParam], // [shared.NewPlanCumulativeGroupedBulkPriceParam], // [shared.NewPlanMinimumCompositePriceParam], +// [BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice], // [BetaNewPlanVersionParamsAddPricesPrice]. type BetaNewPlanVersionParamsAddPricesPriceUnion interface { ImplementsBetaNewPlanVersionParamsAddPricesPriceUnion() @@ -859,6 +861,144 @@ func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanGroupedWithMinMaxThresholds return false } +type BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice) ImplementsBetaNewPlanVersionParamsAddPricesPriceUnion() { +} + +// The cadence to bill for this price on. +type BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence string + +const ( + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceAnnual BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "annual" + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceSemiAnnual BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "semi_annual" + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceMonthly BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "monthly" + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceQuarterly BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "quarterly" + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceOneTime BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "one_time" + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceCustom BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "custom" +) + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence) IsKnown() bool { + switch r { + case BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceAnnual, BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceSemiAnnual, BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceMonthly, BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceQuarterly, BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceOneTime, BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType string + +const ( + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelTypeEventOutput BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType = "event_output" +) + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType) IsKnown() bool { + switch r { + case BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig) ImplementsBetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig]. +type BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion interface { + ImplementsBetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() +} + +type BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType string + +const ( + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "unit" + BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit, BetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type BetaNewPlanVersionParamsAddPricesPriceCadence string @@ -910,11 +1050,12 @@ const ( BetaNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing BetaNewPlanVersionParamsAddPricesPriceModelType = "scalable_matrix_with_tiered_pricing" BetaNewPlanVersionParamsAddPricesPriceModelTypeCumulativeGroupedBulk BetaNewPlanVersionParamsAddPricesPriceModelType = "cumulative_grouped_bulk" BetaNewPlanVersionParamsAddPricesPriceModelTypeMinimum BetaNewPlanVersionParamsAddPricesPriceModelType = "minimum" + BetaNewPlanVersionParamsAddPricesPriceModelTypeEventOutput BetaNewPlanVersionParamsAddPricesPriceModelType = "event_output" ) func (r BetaNewPlanVersionParamsAddPricesPriceModelType) IsKnown() bool { switch r { - case BetaNewPlanVersionParamsAddPricesPriceModelTypeUnit, BetaNewPlanVersionParamsAddPricesPriceModelTypeTiered, BetaNewPlanVersionParamsAddPricesPriceModelTypeBulk, BetaNewPlanVersionParamsAddPricesPriceModelTypePackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeMatrix, BetaNewPlanVersionParamsAddPricesPriceModelTypeThresholdTotalAmount, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredPackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredWithMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedTiered, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredPackageWithMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypePackageWithAllocation, BetaNewPlanVersionParamsAddPricesPriceModelTypeUnitWithPercent, BetaNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithAllocation, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredWithProration, BetaNewPlanVersionParamsAddPricesPriceModelTypeUnitWithProration, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedAllocation, BetaNewPlanVersionParamsAddPricesPriceModelTypeBulkWithProration, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, BetaNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithDisplayName, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedTieredPackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeMaxGroupTieredPackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, BetaNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, BetaNewPlanVersionParamsAddPricesPriceModelTypeCumulativeGroupedBulk, BetaNewPlanVersionParamsAddPricesPriceModelTypeMinimum: + case BetaNewPlanVersionParamsAddPricesPriceModelTypeUnit, BetaNewPlanVersionParamsAddPricesPriceModelTypeTiered, BetaNewPlanVersionParamsAddPricesPriceModelTypeBulk, BetaNewPlanVersionParamsAddPricesPriceModelTypePackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeMatrix, BetaNewPlanVersionParamsAddPricesPriceModelTypeThresholdTotalAmount, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredPackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredWithMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedTiered, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredPackageWithMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypePackageWithAllocation, BetaNewPlanVersionParamsAddPricesPriceModelTypeUnitWithPercent, BetaNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithAllocation, BetaNewPlanVersionParamsAddPricesPriceModelTypeTieredWithProration, BetaNewPlanVersionParamsAddPricesPriceModelTypeUnitWithProration, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedAllocation, BetaNewPlanVersionParamsAddPricesPriceModelTypeBulkWithProration, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, BetaNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithDisplayName, BetaNewPlanVersionParamsAddPricesPriceModelTypeGroupedTieredPackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeMaxGroupTieredPackage, BetaNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, BetaNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, BetaNewPlanVersionParamsAddPricesPriceModelTypeCumulativeGroupedBulk, BetaNewPlanVersionParamsAddPricesPriceModelTypeMinimum, BetaNewPlanVersionParamsAddPricesPriceModelTypeEventOutput: return true } return false @@ -1094,6 +1235,7 @@ type BetaNewPlanVersionParamsReplacePricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -1173,6 +1315,7 @@ func (r BetaNewPlanVersionParamsReplacePricesPrice) ImplementsBetaNewPlanVersion // [shared.NewPlanScalableMatrixWithTieredPricingPriceParam], // [shared.NewPlanCumulativeGroupedBulkPriceParam], // [shared.NewPlanMinimumCompositePriceParam], +// [BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice], // [BetaNewPlanVersionParamsReplacePricesPrice]. type BetaNewPlanVersionParamsReplacePricesPriceUnion interface { ImplementsBetaNewPlanVersionParamsReplacePricesPriceUnion() @@ -1467,6 +1610,144 @@ func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanGroupedWithMinMaxThresh return false } +type BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice) ImplementsBetaNewPlanVersionParamsReplacePricesPriceUnion() { +} + +// The cadence to bill for this price on. +type BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence string + +const ( + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceAnnual BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "annual" + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceSemiAnnual BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "semi_annual" + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceMonthly BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "monthly" + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceQuarterly BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "quarterly" + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceOneTime BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "one_time" + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceCustom BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "custom" +) + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence) IsKnown() bool { + switch r { + case BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceAnnual, BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceSemiAnnual, BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceMonthly, BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceQuarterly, BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceOneTime, BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType string + +const ( + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelTypeEventOutput BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType = "event_output" +) + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType) IsKnown() bool { + switch r { + case BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig) ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig]. +type BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion interface { + ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() +} + +type BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType string + +const ( + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "unit" + BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit, BetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type BetaNewPlanVersionParamsReplacePricesPriceCadence string @@ -1518,11 +1799,12 @@ const ( BetaNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing BetaNewPlanVersionParamsReplacePricesPriceModelType = "scalable_matrix_with_tiered_pricing" BetaNewPlanVersionParamsReplacePricesPriceModelTypeCumulativeGroupedBulk BetaNewPlanVersionParamsReplacePricesPriceModelType = "cumulative_grouped_bulk" BetaNewPlanVersionParamsReplacePricesPriceModelTypeMinimum BetaNewPlanVersionParamsReplacePricesPriceModelType = "minimum" + BetaNewPlanVersionParamsReplacePricesPriceModelTypeEventOutput BetaNewPlanVersionParamsReplacePricesPriceModelType = "event_output" ) func (r BetaNewPlanVersionParamsReplacePricesPriceModelType) IsKnown() bool { switch r { - case BetaNewPlanVersionParamsReplacePricesPriceModelTypeUnit, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTiered, BetaNewPlanVersionParamsReplacePricesPriceModelTypeBulk, BetaNewPlanVersionParamsReplacePricesPriceModelTypePackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMatrix, BetaNewPlanVersionParamsReplacePricesPriceModelTypeThresholdTotalAmount, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTiered, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypePackageWithAllocation, BetaNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithPercent, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithAllocation, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithProration, BetaNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithProration, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedAllocation, BetaNewPlanVersionParamsReplacePricesPriceModelTypeBulkWithProration, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithDisplayName, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTieredPackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, BetaNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, BetaNewPlanVersionParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMinimum: + case BetaNewPlanVersionParamsReplacePricesPriceModelTypeUnit, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTiered, BetaNewPlanVersionParamsReplacePricesPriceModelTypeBulk, BetaNewPlanVersionParamsReplacePricesPriceModelTypePackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMatrix, BetaNewPlanVersionParamsReplacePricesPriceModelTypeThresholdTotalAmount, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTiered, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypePackageWithAllocation, BetaNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithPercent, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithAllocation, BetaNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithProration, BetaNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithProration, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedAllocation, BetaNewPlanVersionParamsReplacePricesPriceModelTypeBulkWithProration, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithDisplayName, BetaNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTieredPackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, BetaNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, BetaNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, BetaNewPlanVersionParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, BetaNewPlanVersionParamsReplacePricesPriceModelTypeMinimum, BetaNewPlanVersionParamsReplacePricesPriceModelTypeEventOutput: return true } return false diff --git a/betaexternalplanid.go b/betaexternalplanid.go index 4ddaed6..804375a 100644 --- a/betaexternalplanid.go +++ b/betaexternalplanid.go @@ -253,6 +253,7 @@ type BetaExternalPlanIDNewPlanVersionParamsAddPricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -332,6 +333,7 @@ func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPrice) ImplementsBetaExte // [shared.NewPlanScalableMatrixWithTieredPricingPriceParam], // [shared.NewPlanCumulativeGroupedBulkPriceParam], // [shared.NewPlanMinimumCompositePriceParam], +// [BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice], // [BetaExternalPlanIDNewPlanVersionParamsAddPricesPrice]. type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceUnion interface { ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceUnion() @@ -626,6 +628,144 @@ func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanGroupedWithMi return false } +type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPrice) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceUnion() { +} + +// The cadence to bill for this price on. +type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence string + +const ( + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceAnnual BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "annual" + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceSemiAnnual BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "semi_annual" + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceMonthly BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "monthly" + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceQuarterly BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "quarterly" + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceOneTime BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "one_time" + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceCustom BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence = "custom" +) + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadence) IsKnown() bool { + switch r { + case BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceAnnual, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceSemiAnnual, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceMonthly, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceQuarterly, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceOneTime, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType string + +const ( + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelTypeEventOutput BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType = "event_output" +) + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelType) IsKnown() bool { + switch r { + case BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfig]. +type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion interface { + ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() +} + +type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType string + +const ( + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "unit" + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceCadence string @@ -677,11 +817,12 @@ const ( BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelType = "scalable_matrix_with_tiered_pricing" BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeCumulativeGroupedBulk BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelType = "cumulative_grouped_bulk" BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMinimum BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelType = "minimum" + BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeEventOutput BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelType = "event_output" ) func (r BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelType) IsKnown() bool { switch r { - case BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeUnit, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTiered, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeBulk, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypePackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMatrix, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeThresholdTotalAmount, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredPackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredWithMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedTiered, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredPackageWithMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypePackageWithAllocation, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeUnitWithPercent, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithAllocation, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredWithProration, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeUnitWithProration, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedAllocation, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeBulkWithProration, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithDisplayName, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedTieredPackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMaxGroupTieredPackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeCumulativeGroupedBulk, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMinimum: + case BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeUnit, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTiered, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeBulk, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypePackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMatrix, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeThresholdTotalAmount, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredPackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredWithMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedTiered, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredPackageWithMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypePackageWithAllocation, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeUnitWithPercent, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithAllocation, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeTieredWithProration, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeUnitWithProration, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedAllocation, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeBulkWithProration, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMatrixWithDisplayName, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeGroupedTieredPackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMaxGroupTieredPackage, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeCumulativeGroupedBulk, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeMinimum, BetaExternalPlanIDNewPlanVersionParamsAddPricesPriceModelTypeEventOutput: return true } return false @@ -861,6 +1002,7 @@ type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -940,6 +1082,7 @@ func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPrice) ImplementsBeta // [shared.NewPlanScalableMatrixWithTieredPricingPriceParam], // [shared.NewPlanCumulativeGroupedBulkPriceParam], // [shared.NewPlanMinimumCompositePriceParam], +// [BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice], // [BetaExternalPlanIDNewPlanVersionParamsReplacePricesPrice]. type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceUnion interface { ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceUnion() @@ -1234,6 +1377,144 @@ func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanGroupedWi return false } +type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPrice) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceUnion() { +} + +// The cadence to bill for this price on. +type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence string + +const ( + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceAnnual BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "annual" + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceSemiAnnual BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "semi_annual" + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceMonthly BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "monthly" + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceQuarterly BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "quarterly" + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceOneTime BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "one_time" + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceCustom BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence = "custom" +) + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadence) IsKnown() bool { + switch r { + case BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceAnnual, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceSemiAnnual, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceMonthly, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceQuarterly, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceOneTime, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType string + +const ( + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelTypeEventOutput BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType = "event_output" +) + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelType) IsKnown() bool { + switch r { + case BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfig]. +type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion interface { + ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() +} + +type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType string + +const ( + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "unit" + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceCadence string @@ -1285,11 +1566,12 @@ const ( BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelType = "scalable_matrix_with_tiered_pricing" BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeCumulativeGroupedBulk BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelType = "cumulative_grouped_bulk" BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMinimum BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelType = "minimum" + BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeEventOutput BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelType = "event_output" ) func (r BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelType) IsKnown() bool { switch r { - case BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeUnit, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTiered, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeBulk, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypePackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMatrix, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeThresholdTotalAmount, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTiered, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypePackageWithAllocation, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithPercent, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithAllocation, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithProration, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithProration, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedAllocation, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeBulkWithProration, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithDisplayName, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTieredPackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMinimum: + case BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeUnit, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTiered, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeBulk, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypePackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMatrix, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeThresholdTotalAmount, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTiered, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypePackageWithAllocation, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithPercent, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithAllocation, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeTieredWithProration, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeUnitWithProration, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedAllocation, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeBulkWithProration, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMatrixWithDisplayName, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeGroupedTieredPackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeMinimum, BetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceModelTypeEventOutput: return true } return false diff --git a/internal/version.go b/internal/version.go index d255624..25ddc61 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "1.24.0" // x-release-please-version +const PackageVersion = "1.25.0" // x-release-please-version diff --git a/item.go b/item.go index db50889..70e2490 100644 --- a/item.go +++ b/item.go @@ -111,16 +111,23 @@ func (r *ItemService) Fetch(ctx context.Context, itemID string, opts ...option.R // with all line items, billable metrics, and prices and are used for defining // external sync behavior for invoices and tax calculation purposes. type Item struct { - ID string `json:"id,required"` - CreatedAt time.Time `json:"created_at,required" format:"date-time"` + // The Orb-assigned unique identifier for the item. + ID string `json:"id,required"` + // The time at which the item was created. + CreatedAt time.Time `json:"created_at,required" format:"date-time"` + // A list of external connections for this item, used to sync with external + // invoicing and tax systems. ExternalConnections []ItemExternalConnection `json:"external_connections,required"` // User specified key-value pairs for the resource. If not present, this defaults // to an empty dictionary. Individual keys can be removed by setting the value to // `null`, and the entire metadata mapping can be cleared by setting `metadata` to // `null`. Metadata map[string]string `json:"metadata,required"` - Name string `json:"name,required"` - JSON itemJSON `json:"-"` + // The name of the item. + Name string `json:"name,required"` + // The time at which the item was archived. If null, the item is not archived. + ArchivedAt time.Time `json:"archived_at,nullable" format:"date-time"` + JSON itemJSON `json:"-"` } // itemJSON contains the JSON metadata for the struct [Item] @@ -130,6 +137,7 @@ type itemJSON struct { ExternalConnections apijson.Field Metadata apijson.Field Name apijson.Field + ArchivedAt apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -142,10 +150,14 @@ func (r itemJSON) RawJSON() string { return r.raw } +// Represents a connection between an Item and an external system for invoicing or +// tax calculation purposes. type ItemExternalConnection struct { + // The name of the external system this item is connected to. ExternalConnectionName ItemExternalConnectionsExternalConnectionName `json:"external_connection_name,required"` - ExternalEntityID string `json:"external_entity_id,required"` - JSON itemExternalConnectionJSON `json:"-"` + // The identifier of this item in the external system. + ExternalEntityID string `json:"external_entity_id,required"` + JSON itemExternalConnectionJSON `json:"-"` } // itemExternalConnectionJSON contains the JSON metadata for the struct @@ -165,6 +177,7 @@ func (r itemExternalConnectionJSON) RawJSON() string { return r.raw } +// The name of the external system this item is connected to. type ItemExternalConnectionsExternalConnectionName string const ( @@ -212,15 +225,20 @@ func (r ItemUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } +// Represents a connection between an Item and an external system for invoicing or +// tax calculation purposes. type ItemUpdateParamsExternalConnection struct { + // The name of the external system this item is connected to. ExternalConnectionName param.Field[ItemUpdateParamsExternalConnectionsExternalConnectionName] `json:"external_connection_name,required"` - ExternalEntityID param.Field[string] `json:"external_entity_id,required"` + // The identifier of this item in the external system. + ExternalEntityID param.Field[string] `json:"external_entity_id,required"` } func (r ItemUpdateParamsExternalConnection) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } +// The name of the external system this item is connected to. type ItemUpdateParamsExternalConnectionsExternalConnectionName string const ( diff --git a/plan.go b/plan.go index dbeb6ee..ab5185c 100644 --- a/plan.go +++ b/plan.go @@ -609,6 +609,7 @@ type PlanNewParamsPricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -686,7 +687,8 @@ func (r PlanNewParamsPricesPrice) ImplementsPlanNewParamsPricesPriceUnion() {} // [shared.NewPlanScalableMatrixWithUnitPricingPriceParam], // [shared.NewPlanScalableMatrixWithTieredPricingPriceParam], // [shared.NewPlanCumulativeGroupedBulkPriceParam], -// [shared.NewPlanMinimumCompositePriceParam], [PlanNewParamsPricesPrice]. +// [shared.NewPlanMinimumCompositePriceParam], +// [PlanNewParamsPricesPriceNewPlanEventOutputPrice], [PlanNewParamsPricesPrice]. type PlanNewParamsPricesPriceUnion interface { ImplementsPlanNewParamsPricesPriceUnion() } @@ -980,6 +982,143 @@ func (r PlanNewParamsPricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversio return false } +type PlanNewParamsPricesPriceNewPlanEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[PlanNewParamsPricesPriceNewPlanEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[PlanNewParamsPricesPriceNewPlanEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPrice) ImplementsPlanNewParamsPricesPriceUnion() {} + +// The cadence to bill for this price on. +type PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence string + +const ( + PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceAnnual PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence = "annual" + PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceSemiAnnual PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence = "semi_annual" + PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceMonthly PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence = "monthly" + PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceQuarterly PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence = "quarterly" + PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceOneTime PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence = "one_time" + PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceCustom PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence = "custom" +) + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPriceCadence) IsKnown() bool { + switch r { + case PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceAnnual, PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceSemiAnnual, PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceMonthly, PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceQuarterly, PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceOneTime, PlanNewParamsPricesPriceNewPlanEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type PlanNewParamsPricesPriceNewPlanEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type PlanNewParamsPricesPriceNewPlanEventOutputPriceModelType string + +const ( + PlanNewParamsPricesPriceNewPlanEventOutputPriceModelTypeEventOutput PlanNewParamsPricesPriceNewPlanEventOutputPriceModelType = "event_output" +) + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPriceModelType) IsKnown() bool { + switch r { + case PlanNewParamsPricesPriceNewPlanEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfig) ImplementsPlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfig]. +type PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion interface { + ImplementsPlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() +} + +type PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType string + +const ( + PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "unit" + PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeUnit, PlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type PlanNewParamsPricesPriceCadence string @@ -1031,11 +1170,12 @@ const ( PlanNewParamsPricesPriceModelTypeScalableMatrixWithTieredPricing PlanNewParamsPricesPriceModelType = "scalable_matrix_with_tiered_pricing" PlanNewParamsPricesPriceModelTypeCumulativeGroupedBulk PlanNewParamsPricesPriceModelType = "cumulative_grouped_bulk" PlanNewParamsPricesPriceModelTypeMinimum PlanNewParamsPricesPriceModelType = "minimum" + PlanNewParamsPricesPriceModelTypeEventOutput PlanNewParamsPricesPriceModelType = "event_output" ) func (r PlanNewParamsPricesPriceModelType) IsKnown() bool { switch r { - case PlanNewParamsPricesPriceModelTypeUnit, PlanNewParamsPricesPriceModelTypeTiered, PlanNewParamsPricesPriceModelTypeBulk, PlanNewParamsPricesPriceModelTypePackage, PlanNewParamsPricesPriceModelTypeMatrix, PlanNewParamsPricesPriceModelTypeThresholdTotalAmount, PlanNewParamsPricesPriceModelTypeTieredPackage, PlanNewParamsPricesPriceModelTypeTieredWithMinimum, PlanNewParamsPricesPriceModelTypeGroupedTiered, PlanNewParamsPricesPriceModelTypeTieredPackageWithMinimum, PlanNewParamsPricesPriceModelTypePackageWithAllocation, PlanNewParamsPricesPriceModelTypeUnitWithPercent, PlanNewParamsPricesPriceModelTypeMatrixWithAllocation, PlanNewParamsPricesPriceModelTypeTieredWithProration, PlanNewParamsPricesPriceModelTypeUnitWithProration, PlanNewParamsPricesPriceModelTypeGroupedAllocation, PlanNewParamsPricesPriceModelTypeBulkWithProration, PlanNewParamsPricesPriceModelTypeGroupedWithProratedMinimum, PlanNewParamsPricesPriceModelTypeGroupedWithMeteredMinimum, PlanNewParamsPricesPriceModelTypeGroupedWithMinMaxThresholds, PlanNewParamsPricesPriceModelTypeMatrixWithDisplayName, PlanNewParamsPricesPriceModelTypeGroupedTieredPackage, PlanNewParamsPricesPriceModelTypeMaxGroupTieredPackage, PlanNewParamsPricesPriceModelTypeScalableMatrixWithUnitPricing, PlanNewParamsPricesPriceModelTypeScalableMatrixWithTieredPricing, PlanNewParamsPricesPriceModelTypeCumulativeGroupedBulk, PlanNewParamsPricesPriceModelTypeMinimum: + case PlanNewParamsPricesPriceModelTypeUnit, PlanNewParamsPricesPriceModelTypeTiered, PlanNewParamsPricesPriceModelTypeBulk, PlanNewParamsPricesPriceModelTypePackage, PlanNewParamsPricesPriceModelTypeMatrix, PlanNewParamsPricesPriceModelTypeThresholdTotalAmount, PlanNewParamsPricesPriceModelTypeTieredPackage, PlanNewParamsPricesPriceModelTypeTieredWithMinimum, PlanNewParamsPricesPriceModelTypeGroupedTiered, PlanNewParamsPricesPriceModelTypeTieredPackageWithMinimum, PlanNewParamsPricesPriceModelTypePackageWithAllocation, PlanNewParamsPricesPriceModelTypeUnitWithPercent, PlanNewParamsPricesPriceModelTypeMatrixWithAllocation, PlanNewParamsPricesPriceModelTypeTieredWithProration, PlanNewParamsPricesPriceModelTypeUnitWithProration, PlanNewParamsPricesPriceModelTypeGroupedAllocation, PlanNewParamsPricesPriceModelTypeBulkWithProration, PlanNewParamsPricesPriceModelTypeGroupedWithProratedMinimum, PlanNewParamsPricesPriceModelTypeGroupedWithMeteredMinimum, PlanNewParamsPricesPriceModelTypeGroupedWithMinMaxThresholds, PlanNewParamsPricesPriceModelTypeMatrixWithDisplayName, PlanNewParamsPricesPriceModelTypeGroupedTieredPackage, PlanNewParamsPricesPriceModelTypeMaxGroupTieredPackage, PlanNewParamsPricesPriceModelTypeScalableMatrixWithUnitPricing, PlanNewParamsPricesPriceModelTypeScalableMatrixWithTieredPricing, PlanNewParamsPricesPriceModelTypeCumulativeGroupedBulk, PlanNewParamsPricesPriceModelTypeMinimum, PlanNewParamsPricesPriceModelTypeEventOutput: return true } return false diff --git a/price.go b/price.go index 6d47d96..5c1ccf7 100644 --- a/price.go +++ b/price.go @@ -421,7 +421,8 @@ func (r priceEvaluatePreviewEventsResponseDataJSON) RawJSON() string { // [PriceNewParamsNewFloatingScalableMatrixWithUnitPricingPrice], // [PriceNewParamsNewFloatingScalableMatrixWithTieredPricingPrice], // [PriceNewParamsNewFloatingCumulativeGroupedBulkPrice], -// [PriceNewParamsNewFloatingMinimumCompositePrice]. +// [PriceNewParamsNewFloatingMinimumCompositePrice], +// [PriceNewParamsNewFloatingEventOutputPrice]. type PriceNewParams interface { ImplementsPriceNewParams() } @@ -4215,6 +4216,141 @@ func (r PriceNewParamsNewFloatingMinimumCompositePriceConversionRateConfigConver return false } +type PriceNewParamsNewFloatingEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[PriceNewParamsNewFloatingEventOutputPriceCadence] `json:"cadence,required"` + // An ISO 4217 currency string for which this price is billed in. + Currency param.Field[string] `json:"currency,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[PriceNewParamsNewFloatingEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[PriceNewParamsNewFloatingEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` +} + +func (r PriceNewParamsNewFloatingEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (PriceNewParamsNewFloatingEventOutputPrice) ImplementsPriceNewParams() { + +} + +// The cadence to bill for this price on. +type PriceNewParamsNewFloatingEventOutputPriceCadence string + +const ( + PriceNewParamsNewFloatingEventOutputPriceCadenceAnnual PriceNewParamsNewFloatingEventOutputPriceCadence = "annual" + PriceNewParamsNewFloatingEventOutputPriceCadenceSemiAnnual PriceNewParamsNewFloatingEventOutputPriceCadence = "semi_annual" + PriceNewParamsNewFloatingEventOutputPriceCadenceMonthly PriceNewParamsNewFloatingEventOutputPriceCadence = "monthly" + PriceNewParamsNewFloatingEventOutputPriceCadenceQuarterly PriceNewParamsNewFloatingEventOutputPriceCadence = "quarterly" + PriceNewParamsNewFloatingEventOutputPriceCadenceOneTime PriceNewParamsNewFloatingEventOutputPriceCadence = "one_time" + PriceNewParamsNewFloatingEventOutputPriceCadenceCustom PriceNewParamsNewFloatingEventOutputPriceCadence = "custom" +) + +func (r PriceNewParamsNewFloatingEventOutputPriceCadence) IsKnown() bool { + switch r { + case PriceNewParamsNewFloatingEventOutputPriceCadenceAnnual, PriceNewParamsNewFloatingEventOutputPriceCadenceSemiAnnual, PriceNewParamsNewFloatingEventOutputPriceCadenceMonthly, PriceNewParamsNewFloatingEventOutputPriceCadenceQuarterly, PriceNewParamsNewFloatingEventOutputPriceCadenceOneTime, PriceNewParamsNewFloatingEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type PriceNewParamsNewFloatingEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r PriceNewParamsNewFloatingEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type PriceNewParamsNewFloatingEventOutputPriceModelType string + +const ( + PriceNewParamsNewFloatingEventOutputPriceModelTypeEventOutput PriceNewParamsNewFloatingEventOutputPriceModelType = "event_output" +) + +func (r PriceNewParamsNewFloatingEventOutputPriceModelType) IsKnown() bool { + switch r { + case PriceNewParamsNewFloatingEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type PriceNewParamsNewFloatingEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r PriceNewParamsNewFloatingEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r PriceNewParamsNewFloatingEventOutputPriceConversionRateConfig) ImplementsPriceNewParamsNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [PriceNewParamsNewFloatingEventOutputPriceConversionRateConfig]. +type PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigUnion interface { + ImplementsPriceNewParamsNewFloatingEventOutputPriceConversionRateConfigUnion() +} + +type PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateType string + +const ( + PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "unit" + PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit, PriceNewParamsNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + type PriceUpdateParams struct { // User-specified key/value pairs for the resource. Individual keys can be removed // by setting the value to `null`, and the entire metadata mapping can be cleared @@ -4333,6 +4469,7 @@ type PriceEvaluateMultipleParamsPriceEvaluationsPrice struct { CumulativeGroupedBulkConfig param.Field[interface{}] `json:"cumulative_grouped_bulk_config"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -4409,6 +4546,7 @@ func (r PriceEvaluateMultipleParamsPriceEvaluationsPrice) ImplementsPriceEvaluat // [shared.NewFloatingScalableMatrixWithTieredPricingPriceParam], // [shared.NewFloatingCumulativeGroupedBulkPriceParam], // [shared.NewFloatingMinimumCompositePriceParam], +// [PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPrice], // [PriceEvaluateMultipleParamsPriceEvaluationsPrice]. type PriceEvaluateMultipleParamsPriceEvaluationsPriceUnion interface { ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceUnion() @@ -4551,6 +4689,140 @@ func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingGroupedWithMi return false } +type PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence] `json:"cadence,required"` + // An ISO 4217 currency string for which this price is billed in. + Currency param.Field[string] `json:"currency,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` +} + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPrice) ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceUnion() { +} + +// The cadence to bill for this price on. +type PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence string + +const ( + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceAnnual PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "annual" + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceSemiAnnual PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "semi_annual" + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceMonthly PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "monthly" + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceQuarterly PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "quarterly" + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceOneTime PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "one_time" + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceCustom PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "custom" +) + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence) IsKnown() bool { + switch r { + case PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceAnnual, PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceSemiAnnual, PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceMonthly, PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceQuarterly, PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceOneTime, PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType string + +const ( + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelTypeEventOutput PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType = "event_output" +) + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType) IsKnown() bool { + switch r { + case PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig) ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig]. +type PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion interface { + ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() +} + +type PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType string + +const ( + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "unit" + PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit, PriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type PriceEvaluateMultipleParamsPriceEvaluationsPriceCadence string @@ -4602,11 +4874,12 @@ const ( PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeScalableMatrixWithTieredPricing PriceEvaluateMultipleParamsPriceEvaluationsPriceModelType = "scalable_matrix_with_tiered_pricing" PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeCumulativeGroupedBulk PriceEvaluateMultipleParamsPriceEvaluationsPriceModelType = "cumulative_grouped_bulk" PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMinimum PriceEvaluateMultipleParamsPriceEvaluationsPriceModelType = "minimum" + PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeEventOutput PriceEvaluateMultipleParamsPriceEvaluationsPriceModelType = "event_output" ) func (r PriceEvaluateMultipleParamsPriceEvaluationsPriceModelType) IsKnown() bool { switch r { - case PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeUnit, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTiered, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeBulk, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypePackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMatrix, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeThresholdTotalAmount, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredPackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredWithMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedTiered, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredPackageWithMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypePackageWithAllocation, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeUnitWithPercent, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMatrixWithAllocation, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredWithProration, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeUnitWithProration, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedAllocation, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeBulkWithProration, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedWithProratedMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedWithMeteredMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedWithMinMaxThresholds, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMatrixWithDisplayName, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedTieredPackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMaxGroupTieredPackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeScalableMatrixWithUnitPricing, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeScalableMatrixWithTieredPricing, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeCumulativeGroupedBulk, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMinimum: + case PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeUnit, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTiered, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeBulk, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypePackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMatrix, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeThresholdTotalAmount, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredPackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredWithMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedTiered, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredPackageWithMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypePackageWithAllocation, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeUnitWithPercent, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMatrixWithAllocation, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeTieredWithProration, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeUnitWithProration, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedAllocation, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeBulkWithProration, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedWithProratedMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedWithMeteredMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedWithMinMaxThresholds, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMatrixWithDisplayName, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeGroupedTieredPackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMaxGroupTieredPackage, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeScalableMatrixWithUnitPricing, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeScalableMatrixWithTieredPricing, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeCumulativeGroupedBulk, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeMinimum, PriceEvaluateMultipleParamsPriceEvaluationsPriceModelTypeEventOutput: return true } return false @@ -4703,6 +4976,7 @@ type PriceEvaluatePreviewEventsParamsPriceEvaluationsPrice struct { CumulativeGroupedBulkConfig param.Field[interface{}] `json:"cumulative_grouped_bulk_config"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -4779,6 +5053,7 @@ func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPrice) ImplementsPriceEv // [shared.NewFloatingScalableMatrixWithTieredPricingPriceParam], // [shared.NewFloatingCumulativeGroupedBulkPriceParam], // [shared.NewFloatingMinimumCompositePriceParam], +// [PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPrice], // [PriceEvaluatePreviewEventsParamsPriceEvaluationsPrice]. type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceUnion interface { ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceUnion() @@ -4921,6 +5196,140 @@ func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingGroupedW return false } +type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence] `json:"cadence,required"` + // An ISO 4217 currency string for which this price is billed in. + Currency param.Field[string] `json:"currency,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` +} + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPrice) ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceUnion() { +} + +// The cadence to bill for this price on. +type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence string + +const ( + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceAnnual PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "annual" + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceSemiAnnual PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "semi_annual" + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceMonthly PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "monthly" + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceQuarterly PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "quarterly" + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceOneTime PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "one_time" + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceCustom PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence = "custom" +) + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadence) IsKnown() bool { + switch r { + case PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceAnnual, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceSemiAnnual, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceMonthly, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceQuarterly, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceOneTime, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType string + +const ( + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelTypeEventOutput PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType = "event_output" +) + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelType) IsKnown() bool { + switch r { + case PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig) ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfig]. +type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion interface { + ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() +} + +type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType string + +const ( + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "unit" + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceCadence string @@ -4972,11 +5381,12 @@ const ( PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeScalableMatrixWithTieredPricing PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelType = "scalable_matrix_with_tiered_pricing" PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeCumulativeGroupedBulk PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelType = "cumulative_grouped_bulk" PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMinimum PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelType = "minimum" + PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeEventOutput PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelType = "event_output" ) func (r PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelType) IsKnown() bool { switch r { - case PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeUnit, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTiered, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeBulk, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypePackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMatrix, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeThresholdTotalAmount, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredPackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredWithMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedTiered, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredPackageWithMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypePackageWithAllocation, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeUnitWithPercent, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMatrixWithAllocation, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredWithProration, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeUnitWithProration, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedAllocation, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeBulkWithProration, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedWithProratedMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedWithMeteredMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedWithMinMaxThresholds, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMatrixWithDisplayName, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedTieredPackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMaxGroupTieredPackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeScalableMatrixWithUnitPricing, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeScalableMatrixWithTieredPricing, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeCumulativeGroupedBulk, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMinimum: + case PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeUnit, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTiered, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeBulk, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypePackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMatrix, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeThresholdTotalAmount, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredPackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredWithMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedTiered, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredPackageWithMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypePackageWithAllocation, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeUnitWithPercent, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMatrixWithAllocation, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeTieredWithProration, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeUnitWithProration, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedAllocation, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeBulkWithProration, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedWithProratedMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedWithMeteredMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedWithMinMaxThresholds, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMatrixWithDisplayName, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeGroupedTieredPackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMaxGroupTieredPackage, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeScalableMatrixWithUnitPricing, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeScalableMatrixWithTieredPricing, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeCumulativeGroupedBulk, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeMinimum, PriceEvaluatePreviewEventsParamsPriceEvaluationsPriceModelTypeEventOutput: return true } return false diff --git a/shared/shared.go b/shared/shared.go index a16babc..8ab1a1d 100644 --- a/shared/shared.go +++ b/shared/shared.go @@ -3887,8 +3887,12 @@ func (r invoiceTinyJSON) RawJSON() string { return r.raw } +// A minimal representation of an Item containing only the essential identifying +// information. type ItemSlim struct { - ID string `json:"id,required"` + // The Orb-assigned unique identifier for the item. + ID string `json:"id,required"` + // The name of the item. Name string `json:"name,required"` JSON itemSlimJSON `json:"-"` } @@ -13478,7 +13482,8 @@ type Price struct { // [PriceScalableMatrixWithUnitPricingPriceConversionRateConfig], // [PriceScalableMatrixWithTieredPricingPriceConversionRateConfig], // [PriceCumulativeGroupedBulkPriceConversionRateConfig], - // [PriceMinimumCompositePriceConversionRateConfig]. + // [PriceMinimumCompositePriceConversionRateConfig], + // [PriceEventOutputPriceConversionRateConfig]. ConversionRateConfig interface{} `json:"conversion_rate_config,required"` CreatedAt time.Time `json:"created_at,required" format:"date-time"` CreditAllocation Allocation `json:"credit_allocation,required,nullable"` @@ -13488,7 +13493,9 @@ type Price struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -13517,6 +13524,9 @@ type Price struct { CumulativeGroupedBulkConfig interface{} `json:"cumulative_grouped_bulk_config"` DimensionalPriceConfiguration DimensionalPriceConfiguration `json:"dimensional_price_configuration,nullable"` // This field can have the runtime type of + // [PriceEventOutputPriceEventOutputConfig]. + EventOutputConfig interface{} `json:"event_output_config"` + // This field can have the runtime type of // [PriceGroupedAllocationPriceGroupedAllocationConfig]. GroupedAllocationConfig interface{} `json:"grouped_allocation_config"` // This field can have the runtime type of @@ -13619,6 +13629,7 @@ type priceJSON struct { BulkWithProrationConfig apijson.Field CumulativeGroupedBulkConfig apijson.Field DimensionalPriceConfiguration apijson.Field + EventOutputConfig apijson.Field GroupedAllocationConfig apijson.Field GroupedTieredConfig apijson.Field GroupedTieredPackageConfig apijson.Field @@ -13676,7 +13687,7 @@ func (r *Price) UnmarshalJSON(data []byte) (err error) { // [PriceGroupedTieredPackagePrice], [PriceMaxGroupTieredPackagePrice], // [PriceScalableMatrixWithUnitPricingPrice], // [PriceScalableMatrixWithTieredPricingPrice], [PriceCumulativeGroupedBulkPrice], -// [PriceMinimumCompositePrice]. +// [PriceMinimumCompositePrice], [PriceEventOutputPrice]. func (r Price) AsUnion() PriceUnion { return r.union } @@ -13703,8 +13714,8 @@ func (r Price) AsUnion() PriceUnion { // [PriceGroupedWithMeteredMinimumPrice], [PriceGroupedWithMinMaxThresholdsPrice], // [PriceMatrixWithDisplayNamePrice], [PriceGroupedTieredPackagePrice], // [PriceMaxGroupTieredPackagePrice], [PriceScalableMatrixWithUnitPricingPrice], -// [PriceScalableMatrixWithTieredPricingPrice], [PriceCumulativeGroupedBulkPrice] -// or [PriceMinimumCompositePrice]. +// [PriceScalableMatrixWithTieredPricingPrice], [PriceCumulativeGroupedBulkPrice], +// [PriceMinimumCompositePrice] or [PriceEventOutputPrice]. type PriceUnion interface { implementsPrice() } @@ -13848,6 +13859,11 @@ func init() { Type: reflect.TypeOf(PriceMinimumCompositePrice{}), DiscriminatorValue: "minimum", }, + apijson.UnionVariant{ + TypeFilter: gjson.JSON, + Type: reflect.TypeOf(PriceEventOutputPrice{}), + DiscriminatorValue: "event_output", + }, ) } @@ -13868,7 +13884,9 @@ type PriceUnitPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -14099,7 +14117,9 @@ type PriceTieredPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -14333,7 +14353,9 @@ type PriceBulkPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -14562,7 +14584,9 @@ type PricePackagePrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -14794,7 +14818,9 @@ type PriceMatrixPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Configuration for matrix pricing MatrixConfig MatrixConfig `json:"matrix_config,required"` // Deprecated: deprecated @@ -15026,7 +15052,9 @@ type PriceThresholdTotalAmountPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -15313,7 +15341,9 @@ type PriceTieredPackagePrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -15600,7 +15630,9 @@ type PriceTieredWithMinimumPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -15893,7 +15925,9 @@ type PriceGroupedTieredPrice struct { // Configuration for grouped_tiered pricing GroupedTieredConfig PriceGroupedTieredPriceGroupedTieredConfig `json:"grouped_tiered_config,required"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -16176,7 +16210,9 @@ type PriceTieredPackageWithMinimumPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -16466,7 +16502,9 @@ type PricePackageWithAllocationPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -16728,7 +16766,9 @@ type PriceUnitWithPercentPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -16986,7 +17026,9 @@ type PriceMatrixWithAllocationPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Configuration for matrix_with_allocation pricing MatrixWithAllocationConfig MatrixWithAllocationConfig `json:"matrix_with_allocation_config,required"` // Deprecated: deprecated @@ -17218,7 +17260,9 @@ type PriceTieredWithProrationPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -17501,7 +17545,9 @@ type PriceUnitWithProrationPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -17758,7 +17804,9 @@ type PriceGroupedAllocationPrice struct { // Configuration for grouped_allocation pricing GroupedAllocationConfig PriceGroupedAllocationPriceGroupedAllocationConfig `json:"grouped_allocation_config,required"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -18019,7 +18067,9 @@ type PriceBulkWithProrationPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -18300,7 +18350,9 @@ type PriceGroupedWithProratedMinimumPrice struct { // Configuration for grouped_with_prorated_minimum pricing GroupedWithProratedMinimumConfig PriceGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig `json:"grouped_with_prorated_minimum_config,required"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -18564,7 +18616,9 @@ type PriceGroupedWithMeteredMinimumPrice struct { // Configuration for grouped_with_metered_minimum pricing GroupedWithMeteredMinimumConfig PriceGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig `json:"grouped_with_metered_minimum_config,required"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -18892,7 +18946,9 @@ type PriceGroupedWithMinMaxThresholdsPrice struct { // Configuration for grouped_with_min_max_thresholds pricing GroupedWithMinMaxThresholdsConfig PriceGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig `json:"grouped_with_min_max_thresholds_config,required"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -19157,7 +19213,9 @@ type PriceMatrixWithDisplayNamePrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Configuration for matrix_with_display_name pricing MatrixWithDisplayNameConfig PriceMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig `json:"matrix_with_display_name_config,required"` // Deprecated: deprecated @@ -19448,7 +19506,9 @@ type PriceGroupedTieredPackagePrice struct { // Configuration for grouped_tiered_package pricing GroupedTieredPackageConfig PriceGroupedTieredPackagePriceGroupedTieredPackageConfig `json:"grouped_tiered_package_config,required"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -19736,7 +19796,9 @@ type PriceMaxGroupTieredPackagePrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Configuration for max_group_tiered_package pricing MaxGroupTieredPackageConfig PriceMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig `json:"max_group_tiered_package_config,required"` // Deprecated: deprecated @@ -20025,7 +20087,9 @@ type PriceScalableMatrixWithUnitPricingPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -20325,7 +20389,9 @@ type PriceScalableMatrixWithTieredPricingPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -20651,7 +20717,9 @@ type PriceCumulativeGroupedBulkPrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -20938,7 +21006,9 @@ type PriceMinimumCompositePrice struct { ExternalPriceID string `json:"external_price_id,required,nullable"` FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` - Item ItemSlim `json:"item,required"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` // Deprecated: deprecated Maximum Maximum `json:"maximum,required,nullable"` // Deprecated: deprecated @@ -21179,6 +21249,267 @@ func (r PriceMinimumCompositePricePriceType) IsKnown() bool { return false } +type PriceEventOutputPrice struct { + ID string `json:"id,required"` + BillableMetric BillableMetricTiny `json:"billable_metric,required,nullable"` + BillingCycleConfiguration BillingCycleConfiguration `json:"billing_cycle_configuration,required"` + BillingMode PriceEventOutputPriceBillingMode `json:"billing_mode,required"` + Cadence PriceEventOutputPriceCadence `json:"cadence,required"` + CompositePriceFilters []TransformPriceFilter `json:"composite_price_filters,required,nullable"` + ConversionRate float64 `json:"conversion_rate,required,nullable"` + ConversionRateConfig PriceEventOutputPriceConversionRateConfig `json:"conversion_rate_config,required,nullable"` + CreatedAt time.Time `json:"created_at,required" format:"date-time"` + CreditAllocation Allocation `json:"credit_allocation,required,nullable"` + Currency string `json:"currency,required"` + // Deprecated: deprecated + Discount Discount `json:"discount,required,nullable"` + // Configuration for event_output pricing + EventOutputConfig PriceEventOutputPriceEventOutputConfig `json:"event_output_config,required"` + ExternalPriceID string `json:"external_price_id,required,nullable"` + FixedPriceQuantity float64 `json:"fixed_price_quantity,required,nullable"` + InvoicingCycleConfiguration BillingCycleConfiguration `json:"invoicing_cycle_configuration,required,nullable"` + // A minimal representation of an Item containing only the essential identifying + // information. + Item ItemSlim `json:"item,required"` + // Deprecated: deprecated + Maximum Maximum `json:"maximum,required,nullable"` + // Deprecated: deprecated + MaximumAmount string `json:"maximum_amount,required,nullable"` + // User specified key-value pairs for the resource. If not present, this defaults + // to an empty dictionary. Individual keys can be removed by setting the value to + // `null`, and the entire metadata mapping can be cleared by setting `metadata` to + // `null`. + Metadata map[string]string `json:"metadata,required"` + // Deprecated: deprecated + Minimum Minimum `json:"minimum,required,nullable"` + // Deprecated: deprecated + MinimumAmount string `json:"minimum_amount,required,nullable"` + // The pricing model type + ModelType PriceEventOutputPriceModelType `json:"model_type,required"` + Name string `json:"name,required"` + PlanPhaseOrder int64 `json:"plan_phase_order,required,nullable"` + PriceType PriceEventOutputPricePriceType `json:"price_type,required"` + // The price id this price replaces. This price will take the place of the replaced + // price in plan version migrations. + ReplacesPriceID string `json:"replaces_price_id,required,nullable"` + DimensionalPriceConfiguration DimensionalPriceConfiguration `json:"dimensional_price_configuration,nullable"` + JSON priceEventOutputPriceJSON `json:"-"` +} + +// priceEventOutputPriceJSON contains the JSON metadata for the struct +// [PriceEventOutputPrice] +type priceEventOutputPriceJSON struct { + ID apijson.Field + BillableMetric apijson.Field + BillingCycleConfiguration apijson.Field + BillingMode apijson.Field + Cadence apijson.Field + CompositePriceFilters apijson.Field + ConversionRate apijson.Field + ConversionRateConfig apijson.Field + CreatedAt apijson.Field + CreditAllocation apijson.Field + Currency apijson.Field + Discount apijson.Field + EventOutputConfig apijson.Field + ExternalPriceID apijson.Field + FixedPriceQuantity apijson.Field + InvoicingCycleConfiguration apijson.Field + Item apijson.Field + Maximum apijson.Field + MaximumAmount apijson.Field + Metadata apijson.Field + Minimum apijson.Field + MinimumAmount apijson.Field + ModelType apijson.Field + Name apijson.Field + PlanPhaseOrder apijson.Field + PriceType apijson.Field + ReplacesPriceID apijson.Field + DimensionalPriceConfiguration apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PriceEventOutputPrice) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r priceEventOutputPriceJSON) RawJSON() string { + return r.raw +} + +func (r PriceEventOutputPrice) implementsPrice() {} + +type PriceEventOutputPriceBillingMode string + +const ( + PriceEventOutputPriceBillingModeInAdvance PriceEventOutputPriceBillingMode = "in_advance" + PriceEventOutputPriceBillingModeInArrear PriceEventOutputPriceBillingMode = "in_arrear" +) + +func (r PriceEventOutputPriceBillingMode) IsKnown() bool { + switch r { + case PriceEventOutputPriceBillingModeInAdvance, PriceEventOutputPriceBillingModeInArrear: + return true + } + return false +} + +type PriceEventOutputPriceCadence string + +const ( + PriceEventOutputPriceCadenceOneTime PriceEventOutputPriceCadence = "one_time" + PriceEventOutputPriceCadenceMonthly PriceEventOutputPriceCadence = "monthly" + PriceEventOutputPriceCadenceQuarterly PriceEventOutputPriceCadence = "quarterly" + PriceEventOutputPriceCadenceSemiAnnual PriceEventOutputPriceCadence = "semi_annual" + PriceEventOutputPriceCadenceAnnual PriceEventOutputPriceCadence = "annual" + PriceEventOutputPriceCadenceCustom PriceEventOutputPriceCadence = "custom" +) + +func (r PriceEventOutputPriceCadence) IsKnown() bool { + switch r { + case PriceEventOutputPriceCadenceOneTime, PriceEventOutputPriceCadenceMonthly, PriceEventOutputPriceCadenceQuarterly, PriceEventOutputPriceCadenceSemiAnnual, PriceEventOutputPriceCadenceAnnual, PriceEventOutputPriceCadenceCustom: + return true + } + return false +} + +type PriceEventOutputPriceConversionRateConfig struct { + ConversionRateType PriceEventOutputPriceConversionRateConfigConversionRateType `json:"conversion_rate_type,required"` + TieredConfig ConversionRateTieredConfig `json:"tiered_config"` + UnitConfig ConversionRateUnitConfig `json:"unit_config"` + JSON priceEventOutputPriceConversionRateConfigJSON `json:"-"` + union PriceEventOutputPriceConversionRateConfigUnion +} + +// priceEventOutputPriceConversionRateConfigJSON contains the JSON metadata for the +// struct [PriceEventOutputPriceConversionRateConfig] +type priceEventOutputPriceConversionRateConfigJSON struct { + ConversionRateType apijson.Field + TieredConfig apijson.Field + UnitConfig apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r priceEventOutputPriceConversionRateConfigJSON) RawJSON() string { + return r.raw +} + +func (r *PriceEventOutputPriceConversionRateConfig) UnmarshalJSON(data []byte) (err error) { + *r = PriceEventOutputPriceConversionRateConfig{} + err = apijson.UnmarshalRoot(data, &r.union) + if err != nil { + return err + } + return apijson.Port(r.union, &r) +} + +// AsUnion returns a [PriceEventOutputPriceConversionRateConfigUnion] interface +// which you can cast to the specific types for more type safety. +// +// Possible runtime types of the union are [UnitConversionRateConfig], +// [TieredConversionRateConfig]. +func (r PriceEventOutputPriceConversionRateConfig) AsUnion() PriceEventOutputPriceConversionRateConfigUnion { + return r.union +} + +// Union satisfied by [UnitConversionRateConfig] or [TieredConversionRateConfig]. +type PriceEventOutputPriceConversionRateConfigUnion interface { + ImplementsPriceEventOutputPriceConversionRateConfig() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*PriceEventOutputPriceConversionRateConfigUnion)(nil)).Elem(), + "conversion_rate_type", + apijson.UnionVariant{ + TypeFilter: gjson.JSON, + Type: reflect.TypeOf(UnitConversionRateConfig{}), + DiscriminatorValue: "unit", + }, + apijson.UnionVariant{ + TypeFilter: gjson.JSON, + Type: reflect.TypeOf(TieredConversionRateConfig{}), + DiscriminatorValue: "tiered", + }, + ) +} + +type PriceEventOutputPriceConversionRateConfigConversionRateType string + +const ( + PriceEventOutputPriceConversionRateConfigConversionRateTypeUnit PriceEventOutputPriceConversionRateConfigConversionRateType = "unit" + PriceEventOutputPriceConversionRateConfigConversionRateTypeTiered PriceEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r PriceEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case PriceEventOutputPriceConversionRateConfigConversionRateTypeUnit, PriceEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + +// Configuration for event_output pricing +type PriceEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey string `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey string `json:"grouping_key,nullable"` + JSON priceEventOutputPriceEventOutputConfigJSON `json:"-"` +} + +// priceEventOutputPriceEventOutputConfigJSON contains the JSON metadata for the +// struct [PriceEventOutputPriceEventOutputConfig] +type priceEventOutputPriceEventOutputConfigJSON struct { + UnitRatingKey apijson.Field + GroupingKey apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PriceEventOutputPriceEventOutputConfig) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r priceEventOutputPriceEventOutputConfigJSON) RawJSON() string { + return r.raw +} + +// The pricing model type +type PriceEventOutputPriceModelType string + +const ( + PriceEventOutputPriceModelTypeEventOutput PriceEventOutputPriceModelType = "event_output" +) + +func (r PriceEventOutputPriceModelType) IsKnown() bool { + switch r { + case PriceEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type PriceEventOutputPricePriceType string + +const ( + PriceEventOutputPricePriceTypeUsagePrice PriceEventOutputPricePriceType = "usage_price" + PriceEventOutputPricePriceTypeFixedPrice PriceEventOutputPricePriceType = "fixed_price" + PriceEventOutputPricePriceTypeCompositePrice PriceEventOutputPricePriceType = "composite_price" +) + +func (r PriceEventOutputPricePriceType) IsKnown() bool { + switch r { + case PriceEventOutputPricePriceTypeUsagePrice, PriceEventOutputPricePriceTypeFixedPrice, PriceEventOutputPricePriceTypeCompositePrice: + return true + } + return false +} + type PriceBillingMode string const ( @@ -21244,11 +21575,12 @@ const ( PriceModelTypeScalableMatrixWithTieredPricing PriceModelType = "scalable_matrix_with_tiered_pricing" PriceModelTypeCumulativeGroupedBulk PriceModelType = "cumulative_grouped_bulk" PriceModelTypeMinimum PriceModelType = "minimum" + PriceModelTypeEventOutput PriceModelType = "event_output" ) func (r PriceModelType) IsKnown() bool { switch r { - case PriceModelTypeUnit, PriceModelTypeTiered, PriceModelTypeBulk, PriceModelTypePackage, PriceModelTypeMatrix, PriceModelTypeThresholdTotalAmount, PriceModelTypeTieredPackage, PriceModelTypeTieredWithMinimum, PriceModelTypeGroupedTiered, PriceModelTypeTieredPackageWithMinimum, PriceModelTypePackageWithAllocation, PriceModelTypeUnitWithPercent, PriceModelTypeMatrixWithAllocation, PriceModelTypeTieredWithProration, PriceModelTypeUnitWithProration, PriceModelTypeGroupedAllocation, PriceModelTypeBulkWithProration, PriceModelTypeGroupedWithProratedMinimum, PriceModelTypeGroupedWithMeteredMinimum, PriceModelTypeGroupedWithMinMaxThresholds, PriceModelTypeMatrixWithDisplayName, PriceModelTypeGroupedTieredPackage, PriceModelTypeMaxGroupTieredPackage, PriceModelTypeScalableMatrixWithUnitPricing, PriceModelTypeScalableMatrixWithTieredPricing, PriceModelTypeCumulativeGroupedBulk, PriceModelTypeMinimum: + case PriceModelTypeUnit, PriceModelTypeTiered, PriceModelTypeBulk, PriceModelTypePackage, PriceModelTypeMatrix, PriceModelTypeThresholdTotalAmount, PriceModelTypeTieredPackage, PriceModelTypeTieredWithMinimum, PriceModelTypeGroupedTiered, PriceModelTypeTieredPackageWithMinimum, PriceModelTypePackageWithAllocation, PriceModelTypeUnitWithPercent, PriceModelTypeMatrixWithAllocation, PriceModelTypeTieredWithProration, PriceModelTypeUnitWithProration, PriceModelTypeGroupedAllocation, PriceModelTypeBulkWithProration, PriceModelTypeGroupedWithProratedMinimum, PriceModelTypeGroupedWithMeteredMinimum, PriceModelTypeGroupedWithMinMaxThresholds, PriceModelTypeMatrixWithDisplayName, PriceModelTypeGroupedTieredPackage, PriceModelTypeMaxGroupTieredPackage, PriceModelTypeScalableMatrixWithUnitPricing, PriceModelTypeScalableMatrixWithTieredPricing, PriceModelTypeCumulativeGroupedBulk, PriceModelTypeMinimum, PriceModelTypeEventOutput: return true } return false @@ -21711,6 +22043,8 @@ func (r TieredConversionRateConfig) ImplementsPriceCumulativeGroupedBulkPriceCon func (r TieredConversionRateConfig) ImplementsPriceMinimumCompositePriceConversionRateConfig() {} +func (r TieredConversionRateConfig) ImplementsPriceEventOutputPriceConversionRateConfig() {} + type TieredConversionRateConfigConversionRateType string const ( @@ -21891,30 +22225,45 @@ func (r TieredConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsAddPr func (r TieredConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsAddPricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r TieredConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r TieredConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r TieredConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsPlanNewParamsPricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r TieredConversionRateConfigParam) ImplementsPlanNewParamsPricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsPlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingUnitPriceConversionRateConfigUnion() { } @@ -21996,12 +22345,21 @@ func (r TieredConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingCumu func (r TieredConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingMinimumCompositePriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsNewSubscriptionBulkPriceConversionRateConfigUnionParam() { } @@ -22083,27 +22441,42 @@ func (r TieredConversionRateConfigParam) ImplementsSubscriptionNewParamsAddPrice func (r TieredConversionRateConfigParam) ImplementsSubscriptionNewParamsAddPricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsSubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionTieredWithProrationPriceConversionRateConfigUnion() { } func (r TieredConversionRateConfigParam) ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsSubscriptionPriceIntervalsParamsAddPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsSubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionTieredWithProrationPriceConversionRateConfigUnion() { } func (r TieredConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + func (r TieredConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionTieredWithProrationPriceConversionRateConfigUnion() { } func (r TieredConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r TieredConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + type TransformPriceFilter struct { // The property of the price to filter on. Field TransformPriceFilterField `json:"field,required"` @@ -22368,6 +22741,8 @@ func (r UnitConversionRateConfig) ImplementsPriceCumulativeGroupedBulkPriceConve func (r UnitConversionRateConfig) ImplementsPriceMinimumCompositePriceConversionRateConfig() {} +func (r UnitConversionRateConfig) ImplementsPriceEventOutputPriceConversionRateConfig() {} + type UnitConversionRateConfigConversionRateType string const ( @@ -22546,30 +22921,45 @@ func (r UnitConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsAddPric func (r UnitConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsAddPricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r UnitConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsBetaNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r UnitConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsAddPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r UnitConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsBetaExternalPlanIDNewPlanVersionParamsReplacePricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsPlanNewParamsPricesPriceNewPlanTieredWithProrationPriceConversionRateConfigUnion() { } func (r UnitConversionRateConfigParam) ImplementsPlanNewParamsPricesPriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsPlanNewParamsPricesPriceNewPlanEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingUnitPriceConversionRateConfigUnion() { } @@ -22651,12 +23041,21 @@ func (r UnitConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingCumula func (r UnitConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingMinimumCompositePriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsPriceNewParamsNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsPriceEvaluateMultipleParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsPriceEvaluatePreviewEventsParamsPriceEvaluationsPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsNewSubscriptionBulkPriceConversionRateConfigUnionParam() { } @@ -22738,27 +23137,42 @@ func (r UnitConversionRateConfigParam) ImplementsSubscriptionNewParamsAddPricesP func (r UnitConversionRateConfigParam) ImplementsSubscriptionNewParamsAddPricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsSubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionTieredWithProrationPriceConversionRateConfigUnion() { } func (r UnitConversionRateConfigParam) ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsSubscriptionPriceIntervalsParamsAddPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsSubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionTieredWithProrationPriceConversionRateConfigUnion() { } func (r UnitConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + func (r UnitConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionTieredWithProrationPriceConversionRateConfigUnion() { } func (r UnitConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfigUnion() { } +func (r UnitConversionRateConfigParam) ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + type UsageDiscount struct { DiscountType UsageDiscountDiscountType `json:"discount_type,required"` // Only available if discount_type is `usage`. Number of usage units that this diff --git a/subscription.go b/subscription.go index ff29d56..08ee5b7 100644 --- a/subscription.go +++ b/subscription.go @@ -5927,6 +5927,7 @@ type SubscriptionNewParamsAddPricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -6005,6 +6006,7 @@ func (r SubscriptionNewParamsAddPricesPrice) implementsSubscriptionNewParamsAddP // [NewSubscriptionScalableMatrixWithTieredPricingPriceParam], // [NewSubscriptionCumulativeGroupedBulkPriceParam], // [NewSubscriptionMinimumCompositePriceParam], +// [SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPrice], // [SubscriptionNewParamsAddPricesPrice]. type SubscriptionNewParamsAddPricesPriceUnion interface { implementsSubscriptionNewParamsAddPricesPriceUnion() @@ -6299,6 +6301,144 @@ func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionGroupedWithMinMaxThres return false } +type SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPrice) implementsSubscriptionNewParamsAddPricesPriceUnion() { +} + +// The cadence to bill for this price on. +type SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence string + +const ( + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceAnnual SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "annual" + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "semi_annual" + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceMonthly SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "monthly" + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "quarterly" + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceOneTime SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "one_time" + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceCustom SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "custom" +) + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence) IsKnown() bool { + switch r { + case SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceAnnual, SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual, SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceMonthly, SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly, SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceOneTime, SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType string + +const ( + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType = "event_output" +) + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType) IsKnown() bool { + switch r { + case SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) ImplementsSubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig]. +type SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion interface { + ImplementsSubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() +} + +type SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType string + +const ( + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "unit" + SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit, SubscriptionNewParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type SubscriptionNewParamsAddPricesPriceCadence string @@ -6350,11 +6490,12 @@ const ( SubscriptionNewParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing SubscriptionNewParamsAddPricesPriceModelType = "scalable_matrix_with_tiered_pricing" SubscriptionNewParamsAddPricesPriceModelTypeCumulativeGroupedBulk SubscriptionNewParamsAddPricesPriceModelType = "cumulative_grouped_bulk" SubscriptionNewParamsAddPricesPriceModelTypeMinimum SubscriptionNewParamsAddPricesPriceModelType = "minimum" + SubscriptionNewParamsAddPricesPriceModelTypeEventOutput SubscriptionNewParamsAddPricesPriceModelType = "event_output" ) func (r SubscriptionNewParamsAddPricesPriceModelType) IsKnown() bool { switch r { - case SubscriptionNewParamsAddPricesPriceModelTypeUnit, SubscriptionNewParamsAddPricesPriceModelTypeTiered, SubscriptionNewParamsAddPricesPriceModelTypeBulk, SubscriptionNewParamsAddPricesPriceModelTypePackage, SubscriptionNewParamsAddPricesPriceModelTypeMatrix, SubscriptionNewParamsAddPricesPriceModelTypeThresholdTotalAmount, SubscriptionNewParamsAddPricesPriceModelTypeTieredPackage, SubscriptionNewParamsAddPricesPriceModelTypeTieredWithMinimum, SubscriptionNewParamsAddPricesPriceModelTypeGroupedTiered, SubscriptionNewParamsAddPricesPriceModelTypeTieredPackageWithMinimum, SubscriptionNewParamsAddPricesPriceModelTypePackageWithAllocation, SubscriptionNewParamsAddPricesPriceModelTypeUnitWithPercent, SubscriptionNewParamsAddPricesPriceModelTypeMatrixWithAllocation, SubscriptionNewParamsAddPricesPriceModelTypeTieredWithProration, SubscriptionNewParamsAddPricesPriceModelTypeUnitWithProration, SubscriptionNewParamsAddPricesPriceModelTypeGroupedAllocation, SubscriptionNewParamsAddPricesPriceModelTypeBulkWithProration, SubscriptionNewParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionNewParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionNewParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionNewParamsAddPricesPriceModelTypeMatrixWithDisplayName, SubscriptionNewParamsAddPricesPriceModelTypeGroupedTieredPackage, SubscriptionNewParamsAddPricesPriceModelTypeMaxGroupTieredPackage, SubscriptionNewParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionNewParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionNewParamsAddPricesPriceModelTypeCumulativeGroupedBulk, SubscriptionNewParamsAddPricesPriceModelTypeMinimum: + case SubscriptionNewParamsAddPricesPriceModelTypeUnit, SubscriptionNewParamsAddPricesPriceModelTypeTiered, SubscriptionNewParamsAddPricesPriceModelTypeBulk, SubscriptionNewParamsAddPricesPriceModelTypePackage, SubscriptionNewParamsAddPricesPriceModelTypeMatrix, SubscriptionNewParamsAddPricesPriceModelTypeThresholdTotalAmount, SubscriptionNewParamsAddPricesPriceModelTypeTieredPackage, SubscriptionNewParamsAddPricesPriceModelTypeTieredWithMinimum, SubscriptionNewParamsAddPricesPriceModelTypeGroupedTiered, SubscriptionNewParamsAddPricesPriceModelTypeTieredPackageWithMinimum, SubscriptionNewParamsAddPricesPriceModelTypePackageWithAllocation, SubscriptionNewParamsAddPricesPriceModelTypeUnitWithPercent, SubscriptionNewParamsAddPricesPriceModelTypeMatrixWithAllocation, SubscriptionNewParamsAddPricesPriceModelTypeTieredWithProration, SubscriptionNewParamsAddPricesPriceModelTypeUnitWithProration, SubscriptionNewParamsAddPricesPriceModelTypeGroupedAllocation, SubscriptionNewParamsAddPricesPriceModelTypeBulkWithProration, SubscriptionNewParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionNewParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionNewParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionNewParamsAddPricesPriceModelTypeMatrixWithDisplayName, SubscriptionNewParamsAddPricesPriceModelTypeGroupedTieredPackage, SubscriptionNewParamsAddPricesPriceModelTypeMaxGroupTieredPackage, SubscriptionNewParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionNewParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionNewParamsAddPricesPriceModelTypeCumulativeGroupedBulk, SubscriptionNewParamsAddPricesPriceModelTypeMinimum, SubscriptionNewParamsAddPricesPriceModelTypeEventOutput: return true } return false @@ -6565,6 +6706,7 @@ type SubscriptionNewParamsReplacePricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -6644,6 +6786,7 @@ func (r SubscriptionNewParamsReplacePricesPrice) implementsSubscriptionNewParams // [NewSubscriptionScalableMatrixWithTieredPricingPriceParam], // [NewSubscriptionCumulativeGroupedBulkPriceParam], // [NewSubscriptionMinimumCompositePriceParam], +// [SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPrice], // [SubscriptionNewParamsReplacePricesPrice]. type SubscriptionNewParamsReplacePricesPriceUnion interface { implementsSubscriptionNewParamsReplacePricesPriceUnion() @@ -6938,6 +7081,144 @@ func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionGroupedWithMinMaxT return false } +type SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPrice) implementsSubscriptionNewParamsReplacePricesPriceUnion() { +} + +// The cadence to bill for this price on. +type SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence string + +const ( + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceAnnual SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "annual" + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "semi_annual" + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceMonthly SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "monthly" + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "quarterly" + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceOneTime SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "one_time" + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceCustom SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "custom" +) + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence) IsKnown() bool { + switch r { + case SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceAnnual, SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual, SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceMonthly, SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly, SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceOneTime, SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType string + +const ( + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType = "event_output" +) + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType) IsKnown() bool { + switch r { + case SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig]. +type SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion interface { + ImplementsSubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() +} + +type SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType string + +const ( + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "unit" + SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit, SubscriptionNewParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type SubscriptionNewParamsReplacePricesPriceCadence string @@ -6989,11 +7270,12 @@ const ( SubscriptionNewParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing SubscriptionNewParamsReplacePricesPriceModelType = "scalable_matrix_with_tiered_pricing" SubscriptionNewParamsReplacePricesPriceModelTypeCumulativeGroupedBulk SubscriptionNewParamsReplacePricesPriceModelType = "cumulative_grouped_bulk" SubscriptionNewParamsReplacePricesPriceModelTypeMinimum SubscriptionNewParamsReplacePricesPriceModelType = "minimum" + SubscriptionNewParamsReplacePricesPriceModelTypeEventOutput SubscriptionNewParamsReplacePricesPriceModelType = "event_output" ) func (r SubscriptionNewParamsReplacePricesPriceModelType) IsKnown() bool { switch r { - case SubscriptionNewParamsReplacePricesPriceModelTypeUnit, SubscriptionNewParamsReplacePricesPriceModelTypeTiered, SubscriptionNewParamsReplacePricesPriceModelTypeBulk, SubscriptionNewParamsReplacePricesPriceModelTypePackage, SubscriptionNewParamsReplacePricesPriceModelTypeMatrix, SubscriptionNewParamsReplacePricesPriceModelTypeThresholdTotalAmount, SubscriptionNewParamsReplacePricesPriceModelTypeTieredPackage, SubscriptionNewParamsReplacePricesPriceModelTypeTieredWithMinimum, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedTiered, SubscriptionNewParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, SubscriptionNewParamsReplacePricesPriceModelTypePackageWithAllocation, SubscriptionNewParamsReplacePricesPriceModelTypeUnitWithPercent, SubscriptionNewParamsReplacePricesPriceModelTypeMatrixWithAllocation, SubscriptionNewParamsReplacePricesPriceModelTypeTieredWithProration, SubscriptionNewParamsReplacePricesPriceModelTypeUnitWithProration, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedAllocation, SubscriptionNewParamsReplacePricesPriceModelTypeBulkWithProration, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionNewParamsReplacePricesPriceModelTypeMatrixWithDisplayName, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedTieredPackage, SubscriptionNewParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, SubscriptionNewParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionNewParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionNewParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, SubscriptionNewParamsReplacePricesPriceModelTypeMinimum: + case SubscriptionNewParamsReplacePricesPriceModelTypeUnit, SubscriptionNewParamsReplacePricesPriceModelTypeTiered, SubscriptionNewParamsReplacePricesPriceModelTypeBulk, SubscriptionNewParamsReplacePricesPriceModelTypePackage, SubscriptionNewParamsReplacePricesPriceModelTypeMatrix, SubscriptionNewParamsReplacePricesPriceModelTypeThresholdTotalAmount, SubscriptionNewParamsReplacePricesPriceModelTypeTieredPackage, SubscriptionNewParamsReplacePricesPriceModelTypeTieredWithMinimum, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedTiered, SubscriptionNewParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, SubscriptionNewParamsReplacePricesPriceModelTypePackageWithAllocation, SubscriptionNewParamsReplacePricesPriceModelTypeUnitWithPercent, SubscriptionNewParamsReplacePricesPriceModelTypeMatrixWithAllocation, SubscriptionNewParamsReplacePricesPriceModelTypeTieredWithProration, SubscriptionNewParamsReplacePricesPriceModelTypeUnitWithProration, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedAllocation, SubscriptionNewParamsReplacePricesPriceModelTypeBulkWithProration, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionNewParamsReplacePricesPriceModelTypeMatrixWithDisplayName, SubscriptionNewParamsReplacePricesPriceModelTypeGroupedTieredPackage, SubscriptionNewParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, SubscriptionNewParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionNewParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionNewParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, SubscriptionNewParamsReplacePricesPriceModelTypeMinimum, SubscriptionNewParamsReplacePricesPriceModelTypeEventOutput: return true } return false @@ -7476,6 +7758,7 @@ type SubscriptionPriceIntervalsParamsAddPrice struct { CumulativeGroupedBulkConfig param.Field[interface{}] `json:"cumulative_grouped_bulk_config"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -7552,6 +7835,7 @@ func (r SubscriptionPriceIntervalsParamsAddPrice) ImplementsSubscriptionPriceInt // [shared.NewFloatingScalableMatrixWithTieredPricingPriceParam], // [shared.NewFloatingCumulativeGroupedBulkPriceParam], // [shared.NewFloatingMinimumCompositePriceParam], +// [SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPrice], // [SubscriptionPriceIntervalsParamsAddPrice]. type SubscriptionPriceIntervalsParamsAddPriceUnion interface { ImplementsSubscriptionPriceIntervalsParamsAddPriceUnion() @@ -7694,6 +7978,140 @@ func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingGroupedWithMinMaxThre return false } +type SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence] `json:"cadence,required"` + // An ISO 4217 currency string for which this price is billed in. + Currency param.Field[string] `json:"currency,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` +} + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPrice) ImplementsSubscriptionPriceIntervalsParamsAddPriceUnion() { +} + +// The cadence to bill for this price on. +type SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence string + +const ( + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceAnnual SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence = "annual" + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceSemiAnnual SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence = "semi_annual" + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceMonthly SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence = "monthly" + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence = "quarterly" + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceOneTime SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence = "one_time" + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceCustom SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence = "custom" +) + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadence) IsKnown() bool { + switch r { + case SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceAnnual, SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceSemiAnnual, SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceMonthly, SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceQuarterly, SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceOneTime, SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceModelType string + +const ( + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceModelTypeEventOutput SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceModelType = "event_output" +) + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceModelType) IsKnown() bool { + switch r { + case SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfig) ImplementsSubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfig]. +type SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigUnion interface { + ImplementsSubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigUnion() +} + +type SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType string + +const ( + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "unit" + SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeUnit, SubscriptionPriceIntervalsParamsAddPriceNewFloatingEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type SubscriptionPriceIntervalsParamsAddPriceCadence string @@ -7745,11 +8163,12 @@ const ( SubscriptionPriceIntervalsParamsAddPriceModelTypeScalableMatrixWithTieredPricing SubscriptionPriceIntervalsParamsAddPriceModelType = "scalable_matrix_with_tiered_pricing" SubscriptionPriceIntervalsParamsAddPriceModelTypeCumulativeGroupedBulk SubscriptionPriceIntervalsParamsAddPriceModelType = "cumulative_grouped_bulk" SubscriptionPriceIntervalsParamsAddPriceModelTypeMinimum SubscriptionPriceIntervalsParamsAddPriceModelType = "minimum" + SubscriptionPriceIntervalsParamsAddPriceModelTypeEventOutput SubscriptionPriceIntervalsParamsAddPriceModelType = "event_output" ) func (r SubscriptionPriceIntervalsParamsAddPriceModelType) IsKnown() bool { switch r { - case SubscriptionPriceIntervalsParamsAddPriceModelTypeUnit, SubscriptionPriceIntervalsParamsAddPriceModelTypeTiered, SubscriptionPriceIntervalsParamsAddPriceModelTypeBulk, SubscriptionPriceIntervalsParamsAddPriceModelTypePackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeMatrix, SubscriptionPriceIntervalsParamsAddPriceModelTypeThresholdTotalAmount, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredPackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredWithMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedTiered, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredPackageWithMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypePackageWithAllocation, SubscriptionPriceIntervalsParamsAddPriceModelTypeUnitWithPercent, SubscriptionPriceIntervalsParamsAddPriceModelTypeMatrixWithAllocation, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredWithProration, SubscriptionPriceIntervalsParamsAddPriceModelTypeUnitWithProration, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedAllocation, SubscriptionPriceIntervalsParamsAddPriceModelTypeBulkWithProration, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedWithProratedMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedWithMeteredMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionPriceIntervalsParamsAddPriceModelTypeMatrixWithDisplayName, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedTieredPackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeMaxGroupTieredPackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionPriceIntervalsParamsAddPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionPriceIntervalsParamsAddPriceModelTypeCumulativeGroupedBulk, SubscriptionPriceIntervalsParamsAddPriceModelTypeMinimum: + case SubscriptionPriceIntervalsParamsAddPriceModelTypeUnit, SubscriptionPriceIntervalsParamsAddPriceModelTypeTiered, SubscriptionPriceIntervalsParamsAddPriceModelTypeBulk, SubscriptionPriceIntervalsParamsAddPriceModelTypePackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeMatrix, SubscriptionPriceIntervalsParamsAddPriceModelTypeThresholdTotalAmount, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredPackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredWithMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedTiered, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredPackageWithMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypePackageWithAllocation, SubscriptionPriceIntervalsParamsAddPriceModelTypeUnitWithPercent, SubscriptionPriceIntervalsParamsAddPriceModelTypeMatrixWithAllocation, SubscriptionPriceIntervalsParamsAddPriceModelTypeTieredWithProration, SubscriptionPriceIntervalsParamsAddPriceModelTypeUnitWithProration, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedAllocation, SubscriptionPriceIntervalsParamsAddPriceModelTypeBulkWithProration, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedWithProratedMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedWithMeteredMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionPriceIntervalsParamsAddPriceModelTypeMatrixWithDisplayName, SubscriptionPriceIntervalsParamsAddPriceModelTypeGroupedTieredPackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeMaxGroupTieredPackage, SubscriptionPriceIntervalsParamsAddPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionPriceIntervalsParamsAddPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionPriceIntervalsParamsAddPriceModelTypeCumulativeGroupedBulk, SubscriptionPriceIntervalsParamsAddPriceModelTypeMinimum, SubscriptionPriceIntervalsParamsAddPriceModelTypeEventOutput: return true } return false @@ -8306,6 +8725,7 @@ type SubscriptionSchedulePlanChangeParamsAddPricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -8385,6 +8805,7 @@ func (r SubscriptionSchedulePlanChangeParamsAddPricesPrice) implementsSubscripti // [NewSubscriptionScalableMatrixWithTieredPricingPriceParam], // [NewSubscriptionCumulativeGroupedBulkPriceParam], // [NewSubscriptionMinimumCompositePriceParam], +// [SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPrice], // [SubscriptionSchedulePlanChangeParamsAddPricesPrice]. type SubscriptionSchedulePlanChangeParamsAddPricesPriceUnion interface { implementsSubscriptionSchedulePlanChangeParamsAddPricesPriceUnion() @@ -8679,6 +9100,144 @@ func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionGrouped return false } +type SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPrice) implementsSubscriptionSchedulePlanChangeParamsAddPricesPriceUnion() { +} + +// The cadence to bill for this price on. +type SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence string + +const ( + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceAnnual SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "annual" + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "semi_annual" + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceMonthly SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "monthly" + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "quarterly" + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceOneTime SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "one_time" + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceCustom SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence = "custom" +) + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadence) IsKnown() bool { + switch r { + case SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceAnnual, SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual, SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceMonthly, SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly, SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceOneTime, SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType string + +const ( + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType = "event_output" +) + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceModelType) IsKnown() bool { + switch r { + case SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfig]. +type SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion interface { + ImplementsSubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() +} + +type SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType string + +const ( + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "unit" + SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit, SubscriptionSchedulePlanChangeParamsAddPricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type SubscriptionSchedulePlanChangeParamsAddPricesPriceCadence string @@ -8730,11 +9289,12 @@ const ( SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing SubscriptionSchedulePlanChangeParamsAddPricesPriceModelType = "scalable_matrix_with_tiered_pricing" SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeCumulativeGroupedBulk SubscriptionSchedulePlanChangeParamsAddPricesPriceModelType = "cumulative_grouped_bulk" SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMinimum SubscriptionSchedulePlanChangeParamsAddPricesPriceModelType = "minimum" + SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeEventOutput SubscriptionSchedulePlanChangeParamsAddPricesPriceModelType = "event_output" ) func (r SubscriptionSchedulePlanChangeParamsAddPricesPriceModelType) IsKnown() bool { switch r { - case SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeUnit, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTiered, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeBulk, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypePackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMatrix, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeThresholdTotalAmount, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredPackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredWithMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedTiered, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredPackageWithMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypePackageWithAllocation, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeUnitWithPercent, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMatrixWithAllocation, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredWithProration, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeUnitWithProration, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedAllocation, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeBulkWithProration, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMatrixWithDisplayName, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedTieredPackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMaxGroupTieredPackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeCumulativeGroupedBulk, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMinimum: + case SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeUnit, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTiered, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeBulk, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypePackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMatrix, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeThresholdTotalAmount, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredPackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredWithMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedTiered, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredPackageWithMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypePackageWithAllocation, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeUnitWithPercent, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMatrixWithAllocation, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeTieredWithProration, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeUnitWithProration, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedAllocation, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeBulkWithProration, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMatrixWithDisplayName, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeGroupedTieredPackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMaxGroupTieredPackage, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeCumulativeGroupedBulk, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeMinimum, SubscriptionSchedulePlanChangeParamsAddPricesPriceModelTypeEventOutput: return true } return false @@ -8948,6 +9508,7 @@ type SubscriptionSchedulePlanChangeParamsReplacePricesPrice struct { Currency param.Field[string] `json:"currency"` // For dimensional price: specifies a price group and dimension values DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + EventOutputConfig param.Field[interface{}] `json:"event_output_config"` // An alias for the price. ExternalPriceID param.Field[string] `json:"external_price_id"` // If the Price represents a fixed cost, this represents the quantity of units @@ -9027,6 +9588,7 @@ func (r SubscriptionSchedulePlanChangeParamsReplacePricesPrice) implementsSubscr // [NewSubscriptionScalableMatrixWithTieredPricingPriceParam], // [NewSubscriptionCumulativeGroupedBulkPriceParam], // [NewSubscriptionMinimumCompositePriceParam], +// [SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPrice], // [SubscriptionSchedulePlanChangeParamsReplacePricesPrice]. type SubscriptionSchedulePlanChangeParamsReplacePricesPriceUnion interface { implementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceUnion() @@ -9321,6 +9883,144 @@ func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionGro return false } +type SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPrice struct { + // The cadence to bill for this price on. + Cadence param.Field[SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence] `json:"cadence,required"` + // Configuration for event_output pricing + EventOutputConfig param.Field[SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceEventOutputConfig] `json:"event_output_config,required"` + // The id of the item the price will be associated with. + ItemID param.Field[string] `json:"item_id,required"` + // The pricing model type + ModelType param.Field[SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType] `json:"model_type,required"` + // The name of the price. + Name param.Field[string] `json:"name,required"` + // The id of the billable metric for the price. Only needed if the price is + // usage-based. + BillableMetricID param.Field[string] `json:"billable_metric_id"` + // If the Price represents a fixed cost, the price will be billed in-advance if + // this is true, and in-arrears if this is false. + BilledInAdvance param.Field[bool] `json:"billed_in_advance"` + // For custom cadence: specifies the duration of the billing period in days or + // months. + BillingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"billing_cycle_configuration"` + // The per unit conversion rate of the price currency to the invoicing currency. + ConversionRate param.Field[float64] `json:"conversion_rate"` + // The configuration for the rate of the price currency to the invoicing currency. + ConversionRateConfig param.Field[SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion] `json:"conversion_rate_config"` + // An ISO 4217 currency string, or custom pricing unit identifier, in which this + // price is billed. + Currency param.Field[string] `json:"currency"` + // For dimensional price: specifies a price group and dimension values + DimensionalPriceConfiguration param.Field[shared.NewDimensionalPriceConfigurationParam] `json:"dimensional_price_configuration"` + // An alias for the price. + ExternalPriceID param.Field[string] `json:"external_price_id"` + // If the Price represents a fixed cost, this represents the quantity of units + // applied. + FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"` + // The property used to group this price on an invoice + InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"` + // Within each billing cycle, specifies the cadence at which invoices are produced. + // If unspecified, a single invoice is produced per billing cycle. + InvoicingCycleConfiguration param.Field[shared.NewBillingCycleConfigurationParam] `json:"invoicing_cycle_configuration"` + // User-specified key/value pairs for the resource. Individual keys can be removed + // by setting the value to `null`, and the entire metadata mapping can be cleared + // by setting `metadata` to `null`. + Metadata param.Field[map[string]string] `json:"metadata"` + // A transient ID that can be used to reference this price when adding adjustments + // in the same API call. + ReferenceID param.Field[string] `json:"reference_id"` +} + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPrice) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPrice) implementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceUnion() { +} + +// The cadence to bill for this price on. +type SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence string + +const ( + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceAnnual SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "annual" + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "semi_annual" + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceMonthly SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "monthly" + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "quarterly" + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceOneTime SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "one_time" + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceCustom SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence = "custom" +) + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadence) IsKnown() bool { + switch r { + case SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceAnnual, SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceSemiAnnual, SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceMonthly, SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceQuarterly, SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceOneTime, SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceCadenceCustom: + return true + } + return false +} + +// Configuration for event_output pricing +type SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceEventOutputConfig struct { + // The key in the event data to extract the unit rate from. + UnitRatingKey param.Field[string] `json:"unit_rating_key,required"` + // An optional key in the event data to group by (e.g., event ID). All events will + // also be grouped by their unit rate. + GroupingKey param.Field[string] `json:"grouping_key"` +} + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceEventOutputConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The pricing model type +type SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType string + +const ( + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType = "event_output" +) + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelType) IsKnown() bool { + switch r { + case SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceModelTypeEventOutput: + return true + } + return false +} + +type SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig struct { + ConversionRateType param.Field[SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType] `json:"conversion_rate_type,required"` + TieredConfig param.Field[shared.ConversionRateTieredConfigParam] `json:"tiered_config"` + UnitConfig param.Field[shared.ConversionRateUnitConfigParam] `json:"unit_config"` +} + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig) ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() { +} + +// Satisfied by [shared.UnitConversionRateConfigParam], +// [shared.TieredConversionRateConfigParam], +// [SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfig]. +type SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion interface { + ImplementsSubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigUnion() +} + +type SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType string + +const ( + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "unit" + SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType = "tiered" +) + +func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateType) IsKnown() bool { + switch r { + case SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeUnit, SubscriptionSchedulePlanChangeParamsReplacePricesPriceNewSubscriptionEventOutputPriceConversionRateConfigConversionRateTypeTiered: + return true + } + return false +} + // The cadence to bill for this price on. type SubscriptionSchedulePlanChangeParamsReplacePricesPriceCadence string @@ -9372,11 +10072,12 @@ const ( SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelType = "scalable_matrix_with_tiered_pricing" SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeCumulativeGroupedBulk SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelType = "cumulative_grouped_bulk" SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMinimum SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelType = "minimum" + SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeEventOutput SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelType = "event_output" ) func (r SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelType) IsKnown() bool { switch r { - case SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeUnit, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTiered, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeBulk, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypePackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMatrix, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeThresholdTotalAmount, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredPackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredWithMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedTiered, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypePackageWithAllocation, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeUnitWithPercent, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMatrixWithAllocation, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredWithProration, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeUnitWithProration, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedAllocation, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeBulkWithProration, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMatrixWithDisplayName, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedTieredPackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMinimum: + case SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeUnit, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTiered, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeBulk, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypePackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMatrix, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeThresholdTotalAmount, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredPackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredWithMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedTiered, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredPackageWithMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypePackageWithAllocation, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeUnitWithPercent, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMatrixWithAllocation, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeTieredWithProration, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeUnitWithProration, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedAllocation, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeBulkWithProration, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedWithProratedMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedWithMeteredMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedWithMinMaxThresholds, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMatrixWithDisplayName, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeGroupedTieredPackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMaxGroupTieredPackage, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeScalableMatrixWithUnitPricing, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeScalableMatrixWithTieredPricing, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeCumulativeGroupedBulk, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeMinimum, SubscriptionSchedulePlanChangeParamsReplacePricesPriceModelTypeEventOutput: return true } return false