pub struct PricingSection {
pub model: String,
pub costs: Vec<CostEntry>,
pub currencies_accepted: Vec<String>,
pub billing_endpoint: Option<String>,
pub free_tier_limits: Option<String>,
pub billing_visibility: Visibility,
}Expand description
Pricing and economics section of an OAS Identity Document.
§Examples
use oas_document::pricing::{PricingSection, CostEntry};
use oas_document::visibility::Visibility;
let pricing = PricingSection {
model: "per_request".to_string(),
costs: vec![CostEntry {
unit: "request".to_string(),
amount: "0.001".to_string(),
currency: "USD".to_string(),
}],
currencies_accepted: vec!["USD".to_string(), "ETH".to_string()],
billing_endpoint: Some("https://api.acme.com/billing".to_string()),
free_tier_limits: Some("100 requests/day".to_string()),
billing_visibility: Visibility::Authenticated,
};
assert_eq!(pricing.model, "per_request");Fields§
§model: StringPricing model: "free", "per_request", "per_token",
"subscription", "negotiated", "custom".
costs: Vec<CostEntry>Individual cost entries.
currencies_accepted: Vec<String>Currencies accepted (ISO 4217 or crypto ticker).
billing_endpoint: Option<String>Billing/payment endpoint URL.
free_tier_limits: Option<String>Free tier description (e.g., “100 requests/day”, “1000 tokens/month”).
billing_visibility: VisibilityVisibility of billing details.
Trait Implementations§
Source§impl Clone for PricingSection
impl Clone for PricingSection
Source§fn clone(&self) -> PricingSection
fn clone(&self) -> PricingSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PricingSection
impl Debug for PricingSection
Source§impl<'de> Deserialize<'de> for PricingSection
impl<'de> Deserialize<'de> for PricingSection
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
impl Eq for PricingSection
Source§impl PartialEq for PricingSection
impl PartialEq for PricingSection
Source§impl Serialize for PricingSection
impl Serialize for PricingSection
impl StructuralPartialEq for PricingSection
Auto Trait Implementations§
impl Freeze for PricingSection
impl RefUnwindSafe for PricingSection
impl Send for PricingSection
impl Sync for PricingSection
impl Unpin for PricingSection
impl UnsafeUnpin for PricingSection
impl UnwindSafe for PricingSection
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