-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsentry_protos.billing.v1.common.v1.rs
More file actions
230 lines (230 loc) · 8.73 KB
/
sentry_protos.billing.v1.common.v1.rs
File metadata and controls
230 lines (230 loc) · 8.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// This file is @generated by prost-build.
/// Defines how usage data is transformed into a billable line item through arithmetic operations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BillableMetric {
/// Unique identifier for the billable metric.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Name of the billable metric (e.g., "performance_units").
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// Expression defining how to calculate this metric from usage data.
#[prost(message, optional, tag = "3")]
pub expression: ::core::option::Option<Expression>,
}
/// Represents an arithmetic expression that can reference usage data categories or constants.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Expression {
#[prost(oneof = "expression::ExpressionType", tags = "1, 2, 3")]
pub expression_type: ::core::option::Option<expression::ExpressionType>,
}
/// Nested message and enum types in `Expression`.
pub mod expression {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ExpressionType {
/// Reference to a data category's usage count.
#[prost(message, tag = "1")]
CategoryRef(super::CategoryReference),
/// A constant numeric value.
#[prost(double, tag = "2")]
Constant(f64),
/// A binary arithmetic operation.
#[prost(message, tag = "3")]
BinaryOp(::prost::alloc::boxed::Box<super::BinaryOperation>),
}
}
/// Reference to a usage data category.
#[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>,
}
/// Nested message and enum types in `CategoryReference`.
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),
}
}
/// A binary arithmetic operation between two expressions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BinaryOperation {
/// The operator to apply.
#[prost(enumeration = "Operator", tag = "1")]
pub operator: i32,
/// Left operand.
#[prost(message, optional, boxed, tag = "2")]
pub left: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
/// Right operand.
#[prost(message, optional, boxed, tag = "3")]
pub right: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
}
/// Supported arithmetic operators.
#[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 {
/// 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 => "OPERATOR_UNSPECIFIED",
Self::Add => "OPERATOR_ADD",
Self::Subtract => "OPERATOR_SUBTRACT",
Self::Multiply => "OPERATOR_MULTIPLY",
Self::Divide => "OPERATOR_DIVIDE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
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,
}
}
}
/// Billing interval for packages and contracts.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BillingInterval {
Unspecified = 0,
Monthly = 1,
AnnualBaseMonthlyPayg = 2,
}
impl BillingInterval {
/// 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_INTERVAL_UNSPECIFIED",
Self::Monthly => "BILLING_INTERVAL_MONTHLY",
Self::AnnualBaseMonthlyPayg => "BILLING_INTERVAL_ANNUAL_BASE_MONTHLY_PAYG",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
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,
}
}
}
/// Unit information for measurement and conversion.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnitInfo {
/// Short name for the unit (e.g., "GB", "cm", "count").
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Full descriptive name (e.g., "gigabytes", "centimeters", "count").
#[prost(string, tag = "2")]
pub full_name: ::prost::alloc::string::String,
/// Base unit for conversion.
#[prost(enumeration = "BaseUnit", tag = "3")]
pub base_unit: i32,
/// Multiplier to convert to base unit (e.g., 1e9 for GB to bytes).
#[prost(double, tag = "4")]
pub multiplier: f64,
}
/// Base unit types for measurement and conversion.
#[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 {
/// 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 => "BASE_UNIT_UNSPECIFIED",
Self::Byte => "BASE_UNIT_BYTE",
Self::Count => "BASE_UNIT_COUNT",
Self::Second => "BASE_UNIT_SECOND",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
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,
}
}
}
/// Details of a SKU line item in the billing system.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LineItemDetails {
/// Unique identifier for the line item.
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
/// Customer-facing display name for the line item.
#[prost(string, tag = "3")]
pub customer_facing_name: ::prost::alloc::string::String,
/// Plural form of the customer-facing name.
#[prost(string, tag = "4")]
pub plural: ::prost::alloc::string::String,
/// Unit information for measurement.
#[prost(message, optional, tag = "5")]
pub units: ::core::option::Option<UnitInfo>,
/// Defines how usage data is transformed into this line item.
#[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>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FixedPricingTier {
#[prost(int64, tag = "1")]
pub value: i64,
#[prost(uint64, tag = "2")]
pub base_price_cents: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FixedTierList {
#[prost(message, repeated, tag = "1")]
pub tiers: ::prost::alloc::vec::Vec<FixedPricingTier>,
}