pub struct RateLimitValueUsage {
pub operation_cents: u64,
pub pending_cents: u64,
pub type_: RateLimitValueUsageType,
pub window_cents: u64,
}Expand description
USD totals, in cents, for a maxValueCents criterion. The criterion is met when windowCents + pendingCents + operationCents <= maxValueCents and unmet when the sum exceeds maxValueCents.
JSON schema
{
"title": "RateLimitValueUsage",
"description": "USD totals, in cents, for a `maxValueCents` criterion. The criterion is met when `windowCents + pendingCents + operationCents <= maxValueCents` and unmet when the sum exceeds `maxValueCents`.",
"examples": [
{
"operationCents": 12550,
"pendingCents": 0,
"type": "value",
"windowCents": 95000
}
],
"type": "object",
"required": [
"operationCents",
"pendingCents",
"type",
"windowCents"
],
"properties": {
"operationCents": {
"description": "The absolute USD value, in cents, of this operation.",
"examples": [
12550
],
"type": "integer",
"minimum": 0.0
},
"pendingCents": {
"description": "USD value, in cents, added by earlier units of this simulation request. It is not persisted. Always `0` when `evaluatedUnit` is absent.",
"examples": [
0
],
"type": "integer",
"minimum": 0.0
},
"type": {
"description": "The usage type.",
"examples": [
"value"
],
"type": "string",
"enum": [
"value"
],
"x-go-type": "string"
},
"windowCents": {
"description": "USD value, in cents, counted in the current `window`.",
"examples": [
95000
],
"type": "integer",
"minimum": 0.0
}
},
"additionalProperties": false
}Fields§
§operation_cents: u64The absolute USD value, in cents, of this operation.
pending_cents: u64USD value, in cents, added by earlier units of this simulation request. It is not persisted. Always 0 when evaluatedUnit is absent.
type_: RateLimitValueUsageTypeThe usage type.
window_cents: u64USD value, in cents, counted in the current window.
Implementations§
Source§impl RateLimitValueUsage
impl RateLimitValueUsage
pub fn builder() -> RateLimitValueUsage
Trait Implementations§
Source§impl Clone for RateLimitValueUsage
impl Clone for RateLimitValueUsage
Source§impl Debug for RateLimitValueUsage
impl Debug for RateLimitValueUsage
Source§impl<'de> Deserialize<'de> for RateLimitValueUsage
impl<'de> Deserialize<'de> for RateLimitValueUsage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&RateLimitValueUsage> for RateLimitValueUsage
impl From<&RateLimitValueUsage> for RateLimitValueUsage
Source§fn from(value: &RateLimitValueUsage) -> Self
fn from(value: &RateLimitValueUsage) -> Self
Converts to this type from the input type.
Source§impl From<RateLimitValueUsage> for RateLimitUsage
impl From<RateLimitValueUsage> for RateLimitUsage
Source§fn from(value: RateLimitValueUsage) -> Self
fn from(value: RateLimitValueUsage) -> Self
Converts to this type from the input type.
Source§impl From<RateLimitValueUsage> for RateLimitValueUsage
impl From<RateLimitValueUsage> for RateLimitValueUsage
Source§fn from(value: RateLimitValueUsage) -> Self
fn from(value: RateLimitValueUsage) -> Self
Converts to this type from the input type.
Source§impl Serialize for RateLimitValueUsage
impl Serialize for RateLimitValueUsage
Source§impl TryFrom<RateLimitValueUsage> for RateLimitValueUsage
impl TryFrom<RateLimitValueUsage> for RateLimitValueUsage
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: RateLimitValueUsage) -> Result<Self, ConversionError>
fn try_from(value: RateLimitValueUsage) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for RateLimitValueUsage
impl RefUnwindSafe for RateLimitValueUsage
impl Send for RateLimitValueUsage
impl Sync for RateLimitValueUsage
impl Unpin for RateLimitValueUsage
impl UnsafeUnpin for RateLimitValueUsage
impl UnwindSafe for RateLimitValueUsage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more