-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(billing): Add protobuf definitions for the seats service #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
389c945
feat(billing): Add protobuf definitions for the seats service
volokluev 03a809a
chore: Regenerate Rust bindings
getsantry[bot] 98b2776
ref(billing): Move SeatObject proto to common billing package
volokluev 45cbaf9
chore: Regenerate Rust bindings
getsantry[bot] 5ab607d
ref(billing): Move SeatObject to common/v1, extract SeatOutcome to ow…
volokluev 5938b34
Merge branch 'main' into billing/seats-service-protos
volokluev eb72d28
chore: Regenerate Rust bindings
getsantry[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
proto/sentry_protos/billing/v1/common/v1/seat_object.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.common.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/seat_category.proto"; | ||
|
|
||
| // A seat object representing a billable product entity (monitor, uptime | ||
| // detector, seer contributor) within an organization. | ||
| message SeatObject { | ||
| uint64 organization_id = 1; | ||
| uint64 project_id = 2; | ||
| sentry_protos.billing.v1.SeatCategory seat_category = 3; | ||
| string external_product_display_name = 4; | ||
| string external_product_identifier = 5; | ||
| } |
14 changes: 14 additions & 0 deletions
14
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_assign_seat.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/seat_object.proto"; | ||
| import "sentry_protos/billing/v1/services/seats/v1/seat_outcome.proto"; | ||
|
|
||
| message AssignSeatRequest { | ||
| sentry_protos.billing.v1.common.v1.SeatObject seat_object = 1; | ||
| } | ||
|
|
||
| message AssignSeatResponse { | ||
| SeatOutcome outcome = 1; | ||
| } |
18 changes: 18 additions & 0 deletions
18
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_check_assign_seats.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/seat_object.proto"; | ||
| import "sentry_protos/billing/v1/services/seats/v1/seat_outcome.proto"; | ||
|
|
||
| message CheckAssignSeatsRequest { | ||
| repeated sentry_protos.billing.v1.common.v1.SeatObject seat_objects = 1; | ||
|
|
||
| // When omitted the service resolves the organization's current contract. | ||
| optional uint64 contract_id = 2; | ||
| } | ||
|
|
||
| message CheckAssignSeatsResponse { | ||
| SeatOutcome outcome = 1; | ||
| string reason = 2; | ||
| } |
12 changes: 12 additions & 0 deletions
12
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_disable_seat.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/seat_object.proto"; | ||
|
|
||
| message DisableSeatRequest { | ||
| sentry_protos.billing.v1.common.v1.SeatObject seat_object = 1; | ||
|
|
||
| // When omitted the service resolves the organization's current contract. | ||
| optional uint64 contract_id = 2; | ||
| } |
15 changes: 15 additions & 0 deletions
15
...sentry_protos/billing/v1/services/seats/v1/endpoint_get_daily_seat_usage_by_project.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/services/usage/v1/endpoint_usage.proto"; | ||
|
|
||
| // Seat usage for a single project. | ||
| message ProjectSeatUsage { | ||
| uint64 project_id = 1; | ||
| repeated sentry_protos.billing.v1.services.usage.v1.DailySeatUsage seat_days = 2; | ||
| } | ||
|
|
||
| message GetDailySeatUsageByProjectResponse { | ||
| repeated ProjectSeatUsage projects = 1; | ||
| } | ||
28 changes: 28 additions & 0 deletions
28
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_get_seat_status.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/seat_object.proto"; | ||
|
|
||
| // The status of a seat object from the perspective of the external product | ||
| // that owns it (monitor, uptime detector, seer contributor). | ||
| enum ExternalProductSeatStatus { | ||
| EXTERNAL_PRODUCT_SEAT_STATUS_UNSPECIFIED = 0; | ||
|
|
||
| // Does not exist, either because it was removed or it was never created. | ||
| EXTERNAL_PRODUCT_SEAT_STATUS_DNE = 1; | ||
|
|
||
| // Alive and well. | ||
| EXTERNAL_PRODUCT_SEAT_STATUS_ACTIVE = 2; | ||
|
|
||
| // The billing platform deems this seat object unusable for billing reasons. | ||
| EXTERNAL_PRODUCT_SEAT_STATUS_DISABLED = 3; | ||
| } | ||
|
|
||
| message GetSeatStatusForExternalProductRequest { | ||
| sentry_protos.billing.v1.common.v1.SeatObject seat_object = 1; | ||
| } | ||
|
|
||
| message GetSeatStatusForExternalProductResponse { | ||
| ExternalProductSeatStatus status = 1; | ||
| } |
12 changes: 12 additions & 0 deletions
12
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_remove_seat.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/seat_object.proto"; | ||
|
|
||
| message RemoveSeatRequest { | ||
| sentry_protos.billing.v1.common.v1.SeatObject seat_object = 1; | ||
|
|
||
| // When omitted the service resolves the organization's current contract. | ||
| optional uint64 contract_id = 2; | ||
| } |
8 changes: 8 additions & 0 deletions
8
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_rollover_seats.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| message RolloverSeatsToNewContractRequest { | ||
| uint64 prev_contract_id = 1; | ||
| uint64 new_contract_id = 2; | ||
| } |
13 changes: 13 additions & 0 deletions
13
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_update_seat_identifier.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/seat_object.proto"; | ||
|
|
||
| message UpdateSeatIdentifierRequest { | ||
| sentry_protos.billing.v1.common.v1.SeatObject seat_object = 1; | ||
| string new_identifier = 2; | ||
|
|
||
| // When omitted the service resolves the organization's current contract. | ||
| optional uint64 contract_id = 3; | ||
| } |
15 changes: 15 additions & 0 deletions
15
proto/sentry_protos/billing/v1/services/seats/v1/seat_outcome.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.seats.v1; | ||
|
|
||
| // The outcome of a seat assignment check. | ||
| enum SeatOutcome { | ||
| // Default / unspecified. | ||
| SEAT_OUTCOME_UNSPECIFIED = 0; | ||
| // The seat(s) can be assigned — budget is available. | ||
| SEAT_OUTCOME_ACCEPTED = 1; | ||
| // The seat category is not available on the current plan. | ||
| SEAT_OUTCOME_INVALID = 2; | ||
| // The plan includes the category but all budget is exhausted. | ||
| SEAT_OUTCOME_RATE_LIMITED = 3; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| // This file is @generated by prost-build. | ||
| /// The outcome of a seat assignment check. | ||
| #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] | ||
| #[repr(i32)] | ||
| pub enum SeatOutcome { | ||
| /// Default / unspecified. | ||
| Unspecified = 0, | ||
| /// The seat(s) can be assigned — budget is available. | ||
| Accepted = 1, | ||
| /// The seat category is not available on the current plan. | ||
| Invalid = 2, | ||
| /// The plan includes the category but all budget is exhausted. | ||
| RateLimited = 3, | ||
| } | ||
| impl SeatOutcome { | ||
| /// 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 => "SEAT_OUTCOME_UNSPECIFIED", | ||
| Self::Accepted => "SEAT_OUTCOME_ACCEPTED", | ||
| Self::Invalid => "SEAT_OUTCOME_INVALID", | ||
| Self::RateLimited => "SEAT_OUTCOME_RATE_LIMITED", | ||
| } | ||
| } | ||
| /// Creates an enum from field names used in the ProtoBuf definition. | ||
| pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { | ||
| match value { | ||
| "SEAT_OUTCOME_UNSPECIFIED" => Some(Self::Unspecified), | ||
| "SEAT_OUTCOME_ACCEPTED" => Some(Self::Accepted), | ||
| "SEAT_OUTCOME_INVALID" => Some(Self::Invalid), | ||
| "SEAT_OUTCOME_RATE_LIMITED" => Some(Self::RateLimited), | ||
| _ => None, | ||
| } | ||
| } | ||
| } | ||
| #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct AssignSeatRequest { | ||
| #[prost(message, optional, tag = "1")] | ||
| pub seat_object: ::core::option::Option<super::super::super::common::v1::SeatObject>, | ||
| } | ||
| #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct AssignSeatResponse { | ||
| #[prost(enumeration = "SeatOutcome", tag = "1")] | ||
| pub outcome: i32, | ||
| } | ||
| #[derive(Clone, PartialEq, ::prost::Message)] | ||
| pub struct CheckAssignSeatsRequest { | ||
| #[prost(message, repeated, tag = "1")] | ||
| pub seat_objects: ::prost::alloc::vec::Vec< | ||
| super::super::super::common::v1::SeatObject, | ||
| >, | ||
| /// When omitted the service resolves the organization's current contract. | ||
| #[prost(uint64, optional, tag = "2")] | ||
| pub contract_id: ::core::option::Option<u64>, | ||
| } | ||
| #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct CheckAssignSeatsResponse { | ||
| #[prost(enumeration = "SeatOutcome", tag = "1")] | ||
| pub outcome: i32, | ||
| #[prost(string, tag = "2")] | ||
| pub reason: ::prost::alloc::string::String, | ||
| } | ||
| #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct DisableSeatRequest { | ||
| #[prost(message, optional, tag = "1")] | ||
| pub seat_object: ::core::option::Option<super::super::super::common::v1::SeatObject>, | ||
| /// When omitted the service resolves the organization's current contract. | ||
| #[prost(uint64, optional, tag = "2")] | ||
| pub contract_id: ::core::option::Option<u64>, | ||
| } | ||
| /// Seat usage for a single project. | ||
| #[derive(Clone, PartialEq, ::prost::Message)] | ||
| pub struct ProjectSeatUsage { | ||
| #[prost(uint64, tag = "1")] | ||
| pub project_id: u64, | ||
| #[prost(message, repeated, tag = "2")] | ||
| pub seat_days: ::prost::alloc::vec::Vec<super::super::usage::v1::DailySeatUsage>, | ||
| } | ||
| #[derive(Clone, PartialEq, ::prost::Message)] | ||
| pub struct GetDailySeatUsageByProjectResponse { | ||
| #[prost(message, repeated, tag = "1")] | ||
| pub projects: ::prost::alloc::vec::Vec<ProjectSeatUsage>, | ||
| } | ||
| #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct GetSeatStatusForExternalProductRequest { | ||
| #[prost(message, optional, tag = "1")] | ||
| pub seat_object: ::core::option::Option<super::super::super::common::v1::SeatObject>, | ||
| } | ||
| #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct GetSeatStatusForExternalProductResponse { | ||
| #[prost(enumeration = "ExternalProductSeatStatus", tag = "1")] | ||
| pub status: i32, | ||
| } | ||
| /// The status of a seat object from the perspective of the external product | ||
| /// that owns it (monitor, uptime detector, seer contributor). | ||
| #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] | ||
| #[repr(i32)] | ||
| pub enum ExternalProductSeatStatus { | ||
| Unspecified = 0, | ||
| /// Does not exist, either because it was removed or it was never created. | ||
| Dne = 1, | ||
| /// Alive and well. | ||
| Active = 2, | ||
| /// The billing platform deems this seat object unusable for billing reasons. | ||
| Disabled = 3, | ||
| } | ||
| impl ExternalProductSeatStatus { | ||
| /// 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_PRODUCT_SEAT_STATUS_UNSPECIFIED", | ||
| Self::Dne => "EXTERNAL_PRODUCT_SEAT_STATUS_DNE", | ||
| Self::Active => "EXTERNAL_PRODUCT_SEAT_STATUS_ACTIVE", | ||
| Self::Disabled => "EXTERNAL_PRODUCT_SEAT_STATUS_DISABLED", | ||
| } | ||
| } | ||
| /// Creates an enum from field names used in the ProtoBuf definition. | ||
| pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { | ||
| match value { | ||
| "EXTERNAL_PRODUCT_SEAT_STATUS_UNSPECIFIED" => Some(Self::Unspecified), | ||
| "EXTERNAL_PRODUCT_SEAT_STATUS_DNE" => Some(Self::Dne), | ||
| "EXTERNAL_PRODUCT_SEAT_STATUS_ACTIVE" => Some(Self::Active), | ||
| "EXTERNAL_PRODUCT_SEAT_STATUS_DISABLED" => Some(Self::Disabled), | ||
| _ => None, | ||
| } | ||
| } | ||
| } | ||
| #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct RemoveSeatRequest { | ||
| #[prost(message, optional, tag = "1")] | ||
| pub seat_object: ::core::option::Option<super::super::super::common::v1::SeatObject>, | ||
| /// When omitted the service resolves the organization's current contract. | ||
| #[prost(uint64, optional, tag = "2")] | ||
| pub contract_id: ::core::option::Option<u64>, | ||
| } | ||
| #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct RolloverSeatsToNewContractRequest { | ||
| #[prost(uint64, tag = "1")] | ||
| pub prev_contract_id: u64, | ||
| #[prost(uint64, tag = "2")] | ||
| pub new_contract_id: u64, | ||
| } | ||
| #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] | ||
| pub struct UpdateSeatIdentifierRequest { | ||
| #[prost(message, optional, tag = "1")] | ||
| pub seat_object: ::core::option::Option<super::super::super::common::v1::SeatObject>, | ||
| #[prost(string, tag = "2")] | ||
| pub new_identifier: ::prost::alloc::string::String, | ||
| /// When omitted the service resolves the organization's current contract. | ||
| #[prost(uint64, optional, tag = "3")] | ||
| pub contract_id: ::core::option::Option<u64>, | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.