diff --git a/CHANGELOG.md b/CHANGELOG.md index 99c25c49..55996e24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## Unreleased + +### Breaking Changes + +#### Billing + +- Remove deprecated fields, messages, and enums from billing v1 protos: + `SKUConfig`, `SharedSKUBudget`, `PricingTier`, and `TieredPricingRate` + in `services/contract/v1/pricing_config.proto`; `BillingChannel`, + `ExternalBillingProvider`, and `Address` in + `services/contract/v1/billing_config.proto`; `FeatureOption` and + `FeatureOptions` in `contract_metadata.proto`; `SKUUsageSummary` and + `SharedBudgetUsageSummary` in `endpoint_usage_pricer.proto`; the legacy + `Address` in `billing_details.proto`; and deprecated response fields + `seats` and `contracts`. All removed field numbers and names are now reserved. + ## 0.13.0 ### New Features ✨ diff --git a/Cargo.lock b/Cargo.lock index 1e240344..cf75f87c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.11.0" +version = "0.13.0" dependencies = [ "prost", "prost-types", diff --git a/proto/sentry_protos/billing/v1/services/billing_details/v1/billing_details.proto b/proto/sentry_protos/billing/v1/services/billing_details/v1/billing_details.proto index 864bef55..6c64af41 100644 --- a/proto/sentry_protos/billing/v1/services/billing_details/v1/billing_details.proto +++ b/proto/sentry_protos/billing/v1/services/billing_details/v1/billing_details.proto @@ -4,20 +4,9 @@ package sentry_protos.billing.v1.services.billing_details.v1; import "sentry_protos/billing/v1/common/v1/address.proto"; -message Address { - option deprecated = true; - - string city = 1; - string region = 2; - string country_code = 3; - string postal_code = 4; - string address_line_1 = 5; - string address_line_2 = 6; - string address_line_3 = 7; -} - message BillingDetails { - Address address = 1 [deprecated = true]; + reserved 1; + reserved "address"; string display_address = 2; optional string company_name = 3; optional string billing_email = 4; diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/billing_config.proto b/proto/sentry_protos/billing/v1/services/contract/v1/billing_config.proto index 9adb30fc..0f165438 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/billing_config.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/billing_config.proto @@ -16,45 +16,9 @@ enum BillingType { BILLING_TYPE_PARTNER = 3; } -// The channel through which the contract is billed. -enum BillingChannel { - option deprecated = true; - - BILLING_CHANNEL_UNSPECIFIED = 0; - BILLING_CHANNEL_SELF_SERVE = 1; - BILLING_CHANNEL_SALES = 2; - BILLING_CHANNEL_PARTNER = 3; -} - -// The external billing provider used to process payments for the contract. -enum ExternalBillingProvider { - option deprecated = true; - - EXTERNAL_BILLING_PROVIDER_UNSPECIFIED = 0; - EXTERNAL_BILLING_PROVIDER_STRIPE = 1; - EXTERNAL_BILLING_PROVIDER_VERCEL = 2; -} - -message Address { - option deprecated = true; - - string city = 1; - string region = 2; - string country_code = 3; - string postal_code = 4; - string address_line_1 = 5; - string address_line_2 = 6; - string address_line_3 = 7; -} - message BillingConfig { BillingType billing_type = 1; - // Remaining fields are deprecated - BillingChannel channel = 2 [deprecated = true]; - ExternalBillingProvider external_billing_provider = 3 [deprecated = true]; - Address address = 4 [deprecated = true]; - // Use PricingConfig.billing_period_start_date and PricingConfig.billing_period_end_date - Date contract_start_date = 5 [deprecated = true]; - Date contract_end_date = 6 [deprecated = true]; + reserved 2 to 6; + reserved "channel", "external_billing_provider", "address", "contract_start_date", "contract_end_date"; } diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/contract_metadata.proto b/proto/sentry_protos/billing/v1/services/contract/v1/contract_metadata.proto index 19a2be78..db5ceb2b 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/contract_metadata.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/contract_metadata.proto @@ -12,19 +12,6 @@ message OptionValue { } } -message FeatureOption { - option deprecated = true; - - string key = 1; - bool enabled = 2; -} - -message FeatureOptions { - option deprecated = true; - - repeated FeatureOption options = 1; -} - message MetadataOption { string key = 1; OptionValue value = 2; @@ -43,10 +30,6 @@ message ContractMetadata { MetadataOptions custom_options = 6; sentry_protos.billing.v1.FeatureOptions billing_features = 7; string package_uid = 9; - - uint64 package_id = 8 [deprecated = true]; - // Includes information like plan ID, tier, etc. - MetadataOptions package_metadata = 4 [deprecated = true]; - // Entitlements, used in frontend features or gating access to certain features. - FeatureOptions features = 5 [deprecated = true]; //DEPRECATED: use billing_features instead + reserved 4, 5, 8; + reserved "package_metadata", "features", "package_id"; } diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_get_uninvoiced_contracts.proto b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_get_uninvoiced_contracts.proto index e6a857aa..f2228145 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_get_uninvoiced_contracts.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_get_uninvoiced_contracts.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package sentry_protos.billing.v1.services.contract.v1; import "google/protobuf/timestamp.proto"; -import "sentry_protos/billing/v1/services/contract/v1/contract.proto"; message GetUninvoicedContractsRequest { // Returns Contracts whose current billing period ends before this time and @@ -19,7 +18,8 @@ message GetUninvoicedContractsRequest { } message GetUninvoicedContractsResponse { - repeated Contract contracts = 1 [deprecated = true]; //DEPRECATED: use contract_ids instead + reserved 1; + reserved "contracts"; // True if additional matching contracts existed beyond max_items and were // not included in this response. bool truncated = 2; diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto b/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto index 46a22bd3..27417ecf 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto @@ -5,52 +5,6 @@ package sentry_protos.billing.v1.services.contract.v1; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "sentry_protos/billing/v1/services/contract/v1/billing_config.proto"; -import "sentry_protos/billing/v1/services/contract/v1/sku.proto"; -import "sentry_protos/billing/v1/sku.proto"; - -message PricingTier { - option deprecated = true; - - int64 start = 1; - int64 end = 2; - int64 rate_per_unit_cpe = 3; -} - -message TieredPricingRate { - option deprecated = true; - - repeated PricingTier tiers = 1; -} - -message SKUConfig { - option deprecated = true; - - SKU sku = 1 [deprecated = true]; //DEPRECATED: use billing_sku instead - // Base price for the SKU (upgraded reserved volumes or add-on activation fees) - uint64 base_price_cents = 2; - optional uint64 payg_budget_cents = 3; - uint64 reserved_volume = 4 [deprecated = true]; //DEPRECATED: use signed reserved_units instead for support for unlimited/reserved budget categories - TieredPricingRate payg_rate = 5; - TieredPricingRate reserved_rate = 6; // for reserved budget SKUs - - oneof reserved_units { - bool is_unlimited = 7; - uint64 num_reserved_units = 8; // the type communicates whether the SKU is unlimited or not, additionally reserved budget SKUs have a non-zero reserved_rate in addition to 0 reserved_units - } - - sentry_protos.billing.v1.SKU billing_sku = 9; -} - -// Represents a budget that is collectively used by one or more SKUs, -// allowing multiple SKUs to draw from the same reserved budget. -message SharedSKUBudget { - option deprecated = true; - - repeated SKU skus = 1 [deprecated = true]; //DEPRECATED: use billing_skus instead - uint64 reserved_budget_cents = 2; - uint64 payg_budget_cents = 3; - repeated sentry_protos.billing.v1.SKU billing_skus = 4; -} message PAYGBudget { uint64 budget_cents = 1; @@ -88,9 +42,6 @@ message PricingConfig { optional google.protobuf.Timestamp usage_watermark_ts = 9; repeated UserConfig user_config = 10; - - uint64 base_price_cents = 6 [deprecated = true]; // DEPRECATED: use package instead. - repeated SKUConfig sku_configs = 1 [deprecated = true]; // DEPRECATED: use package/user_parameters instead. - repeated SharedSKUBudget shared_sku_budgets = 2 [deprecated = true]; // DEPRECATED: use package/user_parameters instead. - uint64 max_spend_cents = 5 [deprecated = true]; // DEPRECATED: use user_parameters instead + reserved 1, 2, 5, 6; + reserved "sku_configs", "shared_sku_budgets", "max_spend_cents", "base_price_cents"; } diff --git a/proto/sentry_protos/billing/v1/services/usage/v1/endpoint_usage.proto b/proto/sentry_protos/billing/v1/services/usage/v1/endpoint_usage.proto index 2a3c4673..b9e84667 100644 --- a/proto/sentry_protos/billing/v1/services/usage/v1/endpoint_usage.proto +++ b/proto/sentry_protos/billing/v1/services/usage/v1/endpoint_usage.proto @@ -34,8 +34,8 @@ message GetUsageResponse { // Usage broken down by day, each containing per-category usage. repeated DailyUsage days = 1; repeated DailySeatUsage seat_days = 3; - - repeated CategorySeatUsage seats = 2 [deprecated = true]; // DEPRECATED: use seat_days + reserved 2; + reserved "seats"; // The latest timestamp of usage data included in this response (inclusive // — there is at least one row at exactly this timestamp). Callers persist diff --git a/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto b/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto index dd4b1643..3079153a 100644 --- a/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto +++ b/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package sentry_protos.billing.v1.services.usage_pricer.v1; import "google/protobuf/timestamp.proto"; -import "sentry_protos/billing/v1/sku.proto"; message UsagePricerRequest { uint64 organization_id = 1; @@ -16,28 +15,6 @@ message GetPriceForContractRequest { google.protobuf.Timestamp usage_start_watermark_ts = 2; } -message SKUUsageSummary { - // use LineItemUsageSummary instead - option deprecated = true; - - sentry_protos.billing.v1.SKU sku = 1; - // Net cents consumed by this SKU in the billing period (after credits/trials applied). - uint64 payg_spend_cents = 2; - // Total units consumed by this SKU in the billing period. - uint64 usage_volume = 3; -} - -message SharedBudgetUsageSummary { - // use SharedLineItemUsageSummary instead - option deprecated = true; - - repeated sentry_protos.billing.v1.SKU skus = 1; - // Net cents consumed across all SKUs in this shared budget (after credits/trials applied). - uint64 payg_spend_cents = 2; - // Per-SKU breakdown within the shared budget. - repeated SKUUsageSummary sku_summaries = 3; -} - message LineItemUsageSummary { // Refers to uid in sentry_protos.billing.v1.common.v1.LineItemDetails string line_item_uid = 1; @@ -58,11 +35,8 @@ message SharedLineItemUsageSummary { } message UsagePricerResponse { - // use line_item_summaries - repeated SKUUsageSummary sku_summaries = 1 [deprecated = true]; - - // use shared_line_item_summaries - repeated SharedBudgetUsageSummary shared_budget_summaries = 2 [deprecated = true]; + reserved 1, 2; + reserved "sku_summaries", "shared_budget_summaries"; repeated LineItemUsageSummary line_item_summaries = 3; diff --git a/py/tests/test_billing_v1.py b/py/tests/test_billing_v1.py index 3abec556..27b16674 100644 --- a/py/tests/test_billing_v1.py +++ b/py/tests/test_billing_v1.py @@ -1,10 +1,7 @@ from sentry_protos.billing.v1.services.contract.v1.billing_config_pb2 import ( - Address, - BillingChannel, BillingConfig, BillingType, Date, - ExternalBillingProvider, ) from sentry_protos.billing.v1.services.contract.v1.contract_metadata_pb2 import ( ContractMetadata, @@ -22,11 +19,7 @@ LineItemUids, PAYGBudget, PricingConfig, - PricingTier, Reservation, - SharedSKUBudget, - SKUConfig, - TieredPricingRate, UserConfig, ) from sentry_protos.billing.v1 import feature_pb2 as billing_feature_pb2 @@ -74,55 +67,12 @@ def test_contract_with_all_sub_messages(): - payg_rate = TieredPricingRate( - tiers=[ - PricingTier(start=0, end=100_000, rate_per_unit_cpe=500), - PricingTier(start=100_001, end=-1, rate_per_unit_cpe=300), - ] - ) - reserved_rate = TieredPricingRate( - tiers=[ - PricingTier(start=0, end=-1, rate_per_unit_cpe=100), - ] - ) - - errors_config = SKUConfig( - billing_sku=SKU.SKU_ERRORS, - base_price_cents=2900, - payg_budget_cents=10000, - payg_rate=payg_rate, - reserved_rate=reserved_rate, - ) - assert errors_config.HasField("payg_budget_cents") - assert errors_config.billing_sku == SKU.SKU_ERRORS - - spans_config = SKUConfig( - billing_sku=SKU.SKU_SPANS, - base_price_cents=0, - payg_rate=payg_rate, - reserved_rate=reserved_rate, - ) - assert not spans_config.HasField("payg_budget_cents") - - shared_budget = SharedSKUBudget( - billing_skus=[SKU.SKU_SPANS], - reserved_budget_cents=50000, - payg_budget_cents=25000, - ) - contract = Contract( metadata=ContractMetadata( id=12345, organization_id=67890, ruleset_version="2024.1", - package_metadata=MetadataOptions( - options=[ - MetadataOption(key="plan", value=OptionValue(string_value="business")), - MetadataOption( - key="tier", value=OptionValue(string_value="enterprise") - ), - ], - ), + package_uid="business-plan", billing_features=FeatureOptions( options=[ FeatureOption(key="sso", enabled=True), @@ -141,43 +91,19 @@ def test_contract_with_all_sub_messages(): ), billing_config=BillingConfig( billing_type=BillingType.BILLING_TYPE_CREDIT_CARD, - channel=BillingChannel.BILLING_CHANNEL_SELF_SERVE, - external_billing_provider=ExternalBillingProvider.EXTERNAL_BILLING_PROVIDER_STRIPE, - contract_start_date=Date(year=2024, month=1, day=1), - contract_end_date=Date(year=2025, month=1, day=1), - address=Address( - city="San Francisco", - region="CA", - country_code="US", - postal_code="94107", - address_line_1="45 Fremont St", - ), ), pricing_config=PricingConfig( - sku_configs=[errors_config], - shared_sku_budgets=[shared_budget], billing_period_start_date=Date(year=2024, month=6, day=1), billing_period_end_date=Date(year=2024, month=7, day=1), - max_spend_cents=100000, - base_price_cents=8900, + ondemand_period_start_date=Date(year=2024, month=6, day=1), + ondemand_period_end_date=Date(year=2024, month=7, day=1), ), ) assert contract.metadata.id == 12345 assert contract.metadata.organization_id == 67890 - assert contract.billing_config.contract_start_date.year == 2024 - assert len(contract.pricing_config.sku_configs) == 1 - assert contract.pricing_config.sku_configs[0].billing_sku == SKU.SKU_ERRORS - assert len(contract.pricing_config.shared_sku_budgets) == 1 - assert list(contract.pricing_config.shared_sku_budgets[0].billing_skus) == [SKU.SKU_SPANS] - assert contract.billing_config.address.city == "San Francisco" - - package_metadata = { - option.key: option.value.string_value - for option in contract.metadata.package_metadata.options - } - assert package_metadata["plan"] == "business" - assert package_metadata["tier"] == "enterprise" + assert contract.metadata.package_uid == "business-plan" + assert contract.pricing_config.billing_period_start_date.year == 2024 billing_features = { option.key: option.enabled for option in contract.metadata.billing_features.options @@ -208,14 +134,14 @@ def test_get_contract_response(): billing_type=BillingType.BILLING_TYPE_CREDIT_CARD, ), pricing_config=PricingConfig( - base_price_cents=8900, + billing_period_start_date=Date(year=2024, month=6, day=1), ), ) response = GetContractResponse(contract=contract) assert response.contract.metadata.id == 12345 assert response.contract.metadata.organization_id == 67890 assert response.contract.billing_config.billing_type == BillingType.BILLING_TYPE_CREDIT_CARD - assert response.contract.pricing_config.base_price_cents == 8900 + assert response.contract.pricing_config.billing_period_start_date.year == 2024 def test_get_trials_request(): @@ -451,7 +377,7 @@ def test_create_contract(): id=12345, organization_id=67890, ruleset_version="1", - package_id=42, + package_uid="package-42", billing_features=billing_feature_pb2.FeatureOptions( options=[ billing_feature_pb2.FeatureOption(key="sso", enabled=True), @@ -487,7 +413,7 @@ def test_create_contract(): ), ) - assert contract.metadata.package_id == 42 + assert contract.metadata.package_uid == "package-42" assert contract.metadata.id == 12345 assert contract.metadata.organization_id == 67890 diff --git a/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs b/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs index 3a05b50b..c8f9c1f8 100644 --- a/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs @@ -1,26 +1,6 @@ // This file is @generated by prost-build. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct Address { - #[prost(string, tag = "1")] - pub city: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub region: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub country_code: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub postal_code: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub address_line_1: ::prost::alloc::string::String, - #[prost(string, tag = "6")] - pub address_line_2: ::prost::alloc::string::String, - #[prost(string, tag = "7")] - pub address_line_3: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct BillingDetails { - #[deprecated] - #[prost(message, optional, tag = "1")] - pub address: ::core::option::Option
, #[prost(string, tag = "2")] pub display_address: ::prost::alloc::string::String, #[prost(string, optional, tag = "3")] diff --git a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs index cf97129b..edcd0e3a 100644 --- a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs @@ -8,44 +8,10 @@ pub struct Date { #[prost(uint32, tag = "3")] pub day: u32, } -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct Address { - #[prost(string, tag = "1")] - pub city: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub region: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub country_code: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub postal_code: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub address_line_1: ::prost::alloc::string::String, - #[prost(string, tag = "6")] - pub address_line_2: ::prost::alloc::string::String, - #[prost(string, tag = "7")] - pub address_line_3: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct BillingConfig { #[prost(enumeration = "BillingType", tag = "1")] pub billing_type: i32, - /// Remaining fields are deprecated - #[deprecated] - #[prost(enumeration = "BillingChannel", tag = "2")] - pub channel: i32, - #[deprecated] - #[prost(enumeration = "ExternalBillingProvider", tag = "3")] - pub external_billing_provider: i32, - #[deprecated] - #[prost(message, optional, tag = "4")] - pub address: ::core::option::Option
, - /// Use PricingConfig.billing_period_start_date and PricingConfig.billing_period_end_date - #[deprecated] - #[prost(message, optional, tag = "5")] - pub contract_start_date: ::core::option::Option, - #[deprecated] - #[prost(message, optional, tag = "6")] - pub contract_end_date: ::core::option::Option, } /// Indicates how the account is billed. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -80,69 +46,6 @@ impl BillingType { } } } -/// The channel through which the contract is billed. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum BillingChannel { - Unspecified = 0, - SelfServe = 1, - Sales = 2, - Partner = 3, -} -impl BillingChannel { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "BILLING_CHANNEL_UNSPECIFIED", - Self::SelfServe => "BILLING_CHANNEL_SELF_SERVE", - Self::Sales => "BILLING_CHANNEL_SALES", - Self::Partner => "BILLING_CHANNEL_PARTNER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "BILLING_CHANNEL_UNSPECIFIED" => Some(Self::Unspecified), - "BILLING_CHANNEL_SELF_SERVE" => Some(Self::SelfServe), - "BILLING_CHANNEL_SALES" => Some(Self::Sales), - "BILLING_CHANNEL_PARTNER" => Some(Self::Partner), - _ => None, - } - } -} -/// The external billing provider used to process payments for the contract. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ExternalBillingProvider { - Unspecified = 0, - Stripe = 1, - Vercel = 2, -} -impl ExternalBillingProvider { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "EXTERNAL_BILLING_PROVIDER_UNSPECIFIED", - Self::Stripe => "EXTERNAL_BILLING_PROVIDER_STRIPE", - Self::Vercel => "EXTERNAL_BILLING_PROVIDER_VERCEL", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "EXTERNAL_BILLING_PROVIDER_UNSPECIFIED" => Some(Self::Unspecified), - "EXTERNAL_BILLING_PROVIDER_STRIPE" => Some(Self::Stripe), - "EXTERNAL_BILLING_PROVIDER_VERCEL" => Some(Self::Vercel), - _ => None, - } - } -} #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct OptionValue { #[prost(oneof = "option_value::Value", tags = "1, 2, 3")] @@ -161,18 +64,6 @@ pub mod option_value { } } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct FeatureOption { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub enabled: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FeatureOptions { - #[prost(message, repeated, tag = "1")] - pub options: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MetadataOption { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, @@ -200,152 +91,6 @@ pub struct ContractMetadata { pub billing_features: ::core::option::Option, #[prost(string, tag = "9")] pub package_uid: ::prost::alloc::string::String, - #[deprecated] - #[prost(uint64, tag = "8")] - pub package_id: u64, - /// Includes information like plan ID, tier, etc. - #[deprecated] - #[prost(message, optional, tag = "4")] - pub package_metadata: ::core::option::Option, - /// Entitlements, used in frontend features or gating access to certain features. - /// - /// DEPRECATED: use billing_features instead - #[deprecated] - #[prost(message, optional, tag = "5")] - pub features: ::core::option::Option, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum Sku { - Unspecified = 0, - Errors = 1, - Spans = 2, - Replays = 3, - PerformanceUnits = 4, - Cron = 5, - Uptime = 6, - Attachments = 7, - Profiling = 8, - ProfilingUi = 9, - Logs = 10, - Seer = 11, - SizeAnalysis = 12, - BuildDistribution = 13, - Autofix = 14, - Scanner = 15, -} -impl Sku { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "SKU_UNSPECIFIED", - Self::Errors => "SKU_ERRORS", - Self::Spans => "SKU_SPANS", - Self::Replays => "SKU_REPLAYS", - Self::PerformanceUnits => "SKU_PERFORMANCE_UNITS", - Self::Cron => "SKU_CRON", - Self::Uptime => "SKU_UPTIME", - Self::Attachments => "SKU_ATTACHMENTS", - Self::Profiling => "SKU_PROFILING", - Self::ProfilingUi => "SKU_PROFILING_UI", - Self::Logs => "SKU_LOGS", - Self::Seer => "SKU_SEER", - Self::SizeAnalysis => "SKU_SIZE_ANALYSIS", - Self::BuildDistribution => "SKU_BUILD_DISTRIBUTION", - Self::Autofix => "SKU_AUTOFIX", - Self::Scanner => "SKU_SCANNER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SKU_UNSPECIFIED" => Some(Self::Unspecified), - "SKU_ERRORS" => Some(Self::Errors), - "SKU_SPANS" => Some(Self::Spans), - "SKU_REPLAYS" => Some(Self::Replays), - "SKU_PERFORMANCE_UNITS" => Some(Self::PerformanceUnits), - "SKU_CRON" => Some(Self::Cron), - "SKU_UPTIME" => Some(Self::Uptime), - "SKU_ATTACHMENTS" => Some(Self::Attachments), - "SKU_PROFILING" => Some(Self::Profiling), - "SKU_PROFILING_UI" => Some(Self::ProfilingUi), - "SKU_LOGS" => Some(Self::Logs), - "SKU_SEER" => Some(Self::Seer), - "SKU_SIZE_ANALYSIS" => Some(Self::SizeAnalysis), - "SKU_BUILD_DISTRIBUTION" => Some(Self::BuildDistribution), - "SKU_AUTOFIX" => Some(Self::Autofix), - "SKU_SCANNER" => Some(Self::Scanner), - _ => None, - } - } -} -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] -pub struct PricingTier { - #[prost(int64, tag = "1")] - pub start: i64, - #[prost(int64, tag = "2")] - pub end: i64, - #[prost(int64, tag = "3")] - pub rate_per_unit_cpe: i64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TieredPricingRate { - #[prost(message, repeated, tag = "1")] - pub tiers: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SkuConfig { - /// DEPRECATED: use billing_sku instead - #[deprecated] - #[prost(enumeration = "Sku", tag = "1")] - pub sku: i32, - /// Base price for the SKU (upgraded reserved volumes or add-on activation fees) - #[prost(uint64, tag = "2")] - pub base_price_cents: u64, - #[prost(uint64, optional, tag = "3")] - pub payg_budget_cents: ::core::option::Option, - /// DEPRECATED: use signed reserved_units instead for support for unlimited/reserved budget categories - #[deprecated] - #[prost(uint64, tag = "4")] - pub reserved_volume: u64, - #[prost(message, optional, tag = "5")] - pub payg_rate: ::core::option::Option, - /// for reserved budget SKUs - #[prost(message, optional, tag = "6")] - pub reserved_rate: ::core::option::Option, - #[prost(enumeration = "super::super::super::Sku", tag = "9")] - pub billing_sku: i32, - #[prost(oneof = "sku_config::ReservedUnits", tags = "7, 8")] - pub reserved_units: ::core::option::Option, -} -/// Nested message and enum types in `SKUConfig`. -pub mod sku_config { - #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] - pub enum ReservedUnits { - #[prost(bool, tag = "7")] - IsUnlimited(bool), - /// the type communicates whether the SKU is unlimited or not, additionally reserved budget SKUs have a non-zero reserved_rate in addition to 0 reserved_units - #[prost(uint64, tag = "8")] - NumReservedUnits(u64), - } -} -/// Represents a budget that is collectively used by one or more SKUs, -/// allowing multiple SKUs to draw from the same reserved budget. -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct SharedSkuBudget { - /// DEPRECATED: use billing_skus instead - #[deprecated] - #[prost(enumeration = "Sku", repeated, packed = "false", tag = "1")] - pub skus: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub reserved_budget_cents: u64, - #[prost(uint64, tag = "3")] - pub payg_budget_cents: u64, - #[prost(enumeration = "super::super::super::Sku", repeated, tag = "4")] - pub billing_skus: ::prost::alloc::vec::Vec, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PaygBudget { @@ -409,22 +154,6 @@ pub struct PricingConfig { pub usage_watermark_ts: ::core::option::Option<::prost_types::Timestamp>, #[prost(message, repeated, tag = "10")] pub user_config: ::prost::alloc::vec::Vec, - /// DEPRECATED: use package instead. - #[deprecated] - #[prost(uint64, tag = "6")] - pub base_price_cents: u64, - /// DEPRECATED: use package/user_parameters instead. - #[deprecated] - #[prost(message, repeated, tag = "1")] - pub sku_configs: ::prost::alloc::vec::Vec, - /// DEPRECATED: use package/user_parameters instead. - #[deprecated] - #[prost(message, repeated, tag = "2")] - pub shared_sku_budgets: ::prost::alloc::vec::Vec, - /// DEPRECATED: use user_parameters instead - #[deprecated] - #[prost(uint64, tag = "5")] - pub max_spend_cents: u64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Contract { @@ -562,12 +291,8 @@ pub struct GetUninvoicedContractsRequest { #[prost(uint32, optional, tag = "3")] pub offset: ::core::option::Option, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetUninvoicedContractsResponse { - /// DEPRECATED: use contract_ids instead - #[deprecated] - #[prost(message, repeated, tag = "1")] - pub contracts: ::prost::alloc::vec::Vec, /// True if additional matching contracts existed beyond max_items and were /// not included in this response. #[prost(bool, tag = "2")] @@ -663,3 +388,71 @@ pub struct RolloverContractResponse { #[prost(uint64, tag = "3")] pub amount_billed: u64, } +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum Sku { + Unspecified = 0, + Errors = 1, + Spans = 2, + Replays = 3, + PerformanceUnits = 4, + Cron = 5, + Uptime = 6, + Attachments = 7, + Profiling = 8, + ProfilingUi = 9, + Logs = 10, + Seer = 11, + SizeAnalysis = 12, + BuildDistribution = 13, + Autofix = 14, + Scanner = 15, +} +impl Sku { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Unspecified => "SKU_UNSPECIFIED", + Self::Errors => "SKU_ERRORS", + Self::Spans => "SKU_SPANS", + Self::Replays => "SKU_REPLAYS", + Self::PerformanceUnits => "SKU_PERFORMANCE_UNITS", + Self::Cron => "SKU_CRON", + Self::Uptime => "SKU_UPTIME", + Self::Attachments => "SKU_ATTACHMENTS", + Self::Profiling => "SKU_PROFILING", + Self::ProfilingUi => "SKU_PROFILING_UI", + Self::Logs => "SKU_LOGS", + Self::Seer => "SKU_SEER", + Self::SizeAnalysis => "SKU_SIZE_ANALYSIS", + Self::BuildDistribution => "SKU_BUILD_DISTRIBUTION", + Self::Autofix => "SKU_AUTOFIX", + Self::Scanner => "SKU_SCANNER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SKU_UNSPECIFIED" => Some(Self::Unspecified), + "SKU_ERRORS" => Some(Self::Errors), + "SKU_SPANS" => Some(Self::Spans), + "SKU_REPLAYS" => Some(Self::Replays), + "SKU_PERFORMANCE_UNITS" => Some(Self::PerformanceUnits), + "SKU_CRON" => Some(Self::Cron), + "SKU_UPTIME" => Some(Self::Uptime), + "SKU_ATTACHMENTS" => Some(Self::Attachments), + "SKU_PROFILING" => Some(Self::Profiling), + "SKU_PROFILING_UI" => Some(Self::ProfilingUi), + "SKU_LOGS" => Some(Self::Logs), + "SKU_SEER" => Some(Self::Seer), + "SKU_SIZE_ANALYSIS" => Some(Self::SizeAnalysis), + "SKU_BUILD_DISTRIBUTION" => Some(Self::BuildDistribution), + "SKU_AUTOFIX" => Some(Self::Autofix), + "SKU_SCANNER" => Some(Self::Scanner), + _ => None, + } + } +} diff --git a/rust/src/sentry_protos.billing.v1.services.usage.v1.rs b/rust/src/sentry_protos.billing.v1.services.usage.v1.rs index 8611ba68..e15d58bc 100644 --- a/rust/src/sentry_protos.billing.v1.services.usage.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.usage.v1.rs @@ -74,10 +74,6 @@ pub struct GetUsageResponse { pub days: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] pub seat_days: ::prost::alloc::vec::Vec, - /// DEPRECATED: use seat_days - #[deprecated] - #[prost(message, repeated, tag = "2")] - pub seats: ::prost::alloc::vec::Vec, /// The latest timestamp of usage data included in this response (inclusive /// — there is at least one row at exactly this timestamp). Callers persist /// this as the contract's watermark; subsequent queries should resume diff --git a/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs b/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs index 7901199b..44eed938 100644 --- a/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs @@ -15,28 +15,6 @@ pub struct GetPriceForContractRequest { #[prost(message, optional, tag = "2")] pub usage_start_watermark_ts: ::core::option::Option<::prost_types::Timestamp>, } -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] -pub struct SkuUsageSummary { - #[prost(enumeration = "super::super::super::Sku", tag = "1")] - pub sku: i32, - /// Net cents consumed by this SKU in the billing period (after credits/trials applied). - #[prost(uint64, tag = "2")] - pub payg_spend_cents: u64, - /// Total units consumed by this SKU in the billing period. - #[prost(uint64, tag = "3")] - pub usage_volume: u64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SharedBudgetUsageSummary { - #[prost(enumeration = "super::super::super::Sku", repeated, tag = "1")] - pub skus: ::prost::alloc::vec::Vec, - /// Net cents consumed across all SKUs in this shared budget (after credits/trials applied). - #[prost(uint64, tag = "2")] - pub payg_spend_cents: u64, - /// Per-SKU breakdown within the shared budget. - #[prost(message, repeated, tag = "3")] - pub sku_summaries: ::prost::alloc::vec::Vec, -} #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LineItemUsageSummary { /// Refers to uid in sentry_protos.billing.v1.common.v1.LineItemDetails @@ -60,14 +38,6 @@ pub struct SharedLineItemUsageSummary { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct UsagePricerResponse { - /// use line_item_summaries - #[deprecated] - #[prost(message, repeated, tag = "1")] - pub sku_summaries: ::prost::alloc::vec::Vec, - /// use shared_line_item_summaries - #[deprecated] - #[prost(message, repeated, tag = "2")] - pub shared_budget_summaries: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] pub line_item_summaries: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "4")]