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
/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
*
* The version of the OpenAPI document: 1.0.4
* 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>,
/// Metronome `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 Metronome 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,
}
}
}