late 0.0.1055

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.
Documentation
/*
 * 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};

/// UsageStatsUsage : Per-period usage counts. Fields present depend on `billingSystem`: Stripe returns `uploads` / `profiles` / `lastReset`; usage-based billing returns `connectedAccounts` / `xApiCalls` / `xApiCallsByOperation`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UsageStatsUsage {
    /// Stripe users only. Uploads consumed in the current period.
    #[serde(rename = "uploads", skip_serializing_if = "Option::is_none")]
    pub uploads: Option<i32>,
    /// Stripe users only. Profiles currently owned.
    #[serde(rename = "profiles", skip_serializing_if = "Option::is_none")]
    pub profiles: Option<i32>,
    /// Stripe users only.
    #[serde(rename = "lastReset", skip_serializing_if = "Option::is_none")]
    pub last_reset: Option<String>,
    /// Usage-based billing only. Accounts currently connected across the team.
    #[serde(rename = "connectedAccounts", skip_serializing_if = "Option::is_none")]
    pub connected_accounts: Option<i32>,
    #[serde(rename = "xApiCalls", skip_serializing_if = "Option::is_none")]
    pub x_api_calls: Option<Box<models::UsageStatsUsageXApiCalls>>,
    /// Usage-based billing only. Per-operation X API call counts keyed by operation (e.g. `posts_read`, `content_create`, `content_create_with_url`). Resolve each key to price and metadata via `GET /v1/billing/x-pricing`. This is the canonical source: it covers every price tier including the $0.200 URL tier that `xApiCalls` excludes.
    #[serde(
        rename = "xApiCallsByOperation",
        skip_serializing_if = "Option::is_none"
    )]
    pub x_api_calls_by_operation: Option<std::collections::HashMap<String, i32>>,
}

impl UsageStatsUsage {
    /// Per-period usage counts. Fields present depend on `billingSystem`: Stripe returns `uploads` / `profiles` / `lastReset`; usage-based billing returns `connectedAccounts` / `xApiCalls` / `xApiCallsByOperation`.
    pub fn new() -> UsageStatsUsage {
        UsageStatsUsage {
            uploads: None,
            profiles: None,
            last_reset: None,
            connected_accounts: None,
            x_api_calls: None,
            x_api_calls_by_operation: None,
        }
    }
}