#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BillableMetric {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub expression: ::core::option::Option<Expression>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Expression {
#[prost(oneof = "expression::ExpressionType", tags = "1, 2, 3")]
pub expression_type: ::core::option::Option<expression::ExpressionType>,
}
pub mod expression {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ExpressionType {
#[prost(message, tag = "1")]
CategoryRef(super::CategoryReference),
#[prost(double, tag = "2")]
Constant(f64),
#[prost(message, tag = "3")]
BinaryOp(::prost::alloc::boxed::Box<super::BinaryOperation>),
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CategoryReference {
#[prost(oneof = "category_reference::CategoryType", tags = "1, 2")]
pub category_type: ::core::option::Option<category_reference::CategoryType>,
}
pub mod category_reference {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum CategoryType {
#[prost(enumeration = "super::super::super::DataCategory", tag = "1")]
DataCategory(i32),
#[prost(enumeration = "super::super::super::SeatCategory", tag = "2")]
SeatCategory(i32),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BinaryOperation {
#[prost(enumeration = "Operator", tag = "1")]
pub operator: i32,
#[prost(message, optional, boxed, tag = "2")]
pub left: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
#[prost(message, optional, boxed, tag = "3")]
pub right: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Operator {
Unspecified = 0,
Add = 1,
Subtract = 2,
Multiply = 3,
Divide = 4,
}
impl Operator {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "OPERATOR_UNSPECIFIED",
Self::Add => "OPERATOR_ADD",
Self::Subtract => "OPERATOR_SUBTRACT",
Self::Multiply => "OPERATOR_MULTIPLY",
Self::Divide => "OPERATOR_DIVIDE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
"OPERATOR_ADD" => Some(Self::Add),
"OPERATOR_SUBTRACT" => Some(Self::Subtract),
"OPERATOR_MULTIPLY" => Some(Self::Multiply),
"OPERATOR_DIVIDE" => Some(Self::Divide),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BillingInterval {
Unspecified = 0,
Monthly = 1,
AnnualBaseMonthlyPayg = 2,
}
impl BillingInterval {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "BILLING_INTERVAL_UNSPECIFIED",
Self::Monthly => "BILLING_INTERVAL_MONTHLY",
Self::AnnualBaseMonthlyPayg => "BILLING_INTERVAL_ANNUAL_BASE_MONTHLY_PAYG",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BILLING_INTERVAL_UNSPECIFIED" => Some(Self::Unspecified),
"BILLING_INTERVAL_MONTHLY" => Some(Self::Monthly),
"BILLING_INTERVAL_ANNUAL_BASE_MONTHLY_PAYG" => {
Some(Self::AnnualBaseMonthlyPayg)
}
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnitInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub full_name: ::prost::alloc::string::String,
#[prost(enumeration = "BaseUnit", tag = "3")]
pub base_unit: i32,
#[prost(double, tag = "4")]
pub multiplier: f64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BaseUnit {
Unspecified = 0,
Byte = 1,
Count = 2,
Second = 3,
}
impl BaseUnit {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "BASE_UNIT_UNSPECIFIED",
Self::Byte => "BASE_UNIT_BYTE",
Self::Count => "BASE_UNIT_COUNT",
Self::Second => "BASE_UNIT_SECOND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BASE_UNIT_UNSPECIFIED" => Some(Self::Unspecified),
"BASE_UNIT_BYTE" => Some(Self::Byte),
"BASE_UNIT_COUNT" => Some(Self::Count),
"BASE_UNIT_SECOND" => Some(Self::Second),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LineItemDetails {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub customer_facing_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub plural: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub units: ::core::option::Option<UnitInfo>,
#[prost(message, optional, tag = "6")]
pub billable_metric: ::core::option::Option<BillableMetric>,
}
#[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<PricingTier>,
}