/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.104.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// XApiOperation : A single X API operation with its per-call price and the Zernio platform methods that trigger it.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct XApiOperation {
/// Internal operation key. Matches keys in `xApiCallsByOperation`.
#[serde(rename = "operation", skip_serializing_if = "Option::is_none")]
pub operation: Option<String>,
/// Metering `event_type` emitted when this operation runs.
#[serde(rename = "eventType", skip_serializing_if = "Option::is_none")]
pub event_type: Option<String>,
/// Human-readable label shown on invoices.
#[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "pricePerCallUsd", skip_serializing_if = "Option::is_none")]
pub price_per_call_usd: Option<f64>,
/// Per-call price in cents. Fractional values are intentional.
#[serde(rename = "pricePerCallCents", skip_serializing_if = "Option::is_none")]
pub price_per_call_cents: Option<f64>,
/// Tier key derived from `pricePerCallUsd` (e.g. `x_api_005` for $0.005, `x_api_200` for $0.200). Useful for grouping operations by price in dashboards.
#[serde(rename = "tier", skip_serializing_if = "Option::is_none")]
pub tier: Option<String>,
/// Zernio platform methods that emit this operation, with their metering rule.
#[serde(rename = "triggeredBy", skip_serializing_if = "Option::is_none")]
pub triggered_by: Option<Vec<models::XApiOperationTriggeredByInner>>,
}
impl XApiOperation {
/// A single X API operation with its per-call price and the Zernio platform methods that trigger it.
pub fn new() -> XApiOperation {
XApiOperation {
operation: None,
event_type: None,
display_name: None,
price_per_call_usd: None,
price_per_call_cents: None,
tier: None,
triggered_by: None,
}
}
}