/*
 * codex-backend
 *
 * codex-backend
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

use serde::Deserialize;
use serde::Serialize;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SpendControlLimitDetails {
    #[serde(
        rename = "source",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub source: Option<Option<String>>,
    #[serde(rename = "limit")]
    pub limit: String,
    #[serde(rename = "used")]
    pub used: String,
    #[serde(rename = "remaining")]
    pub remaining: String,
    #[serde(rename = "used_percent")]
    pub used_percent: i32,
    #[serde(rename = "remaining_percent")]
    pub remaining_percent: i32,
    #[serde(rename = "reset_after_seconds")]
    pub reset_after_seconds: i32,
    #[serde(rename = "reset_at")]
    pub reset_at: i32,
}

impl SpendControlLimitDetails {
    pub fn new(
        limit: String,
        used: String,
        remaining: String,
        used_percent: i32,
        remaining_percent: i32,
        reset_after_seconds: i32,
        reset_at: i32,
    ) -> SpendControlLimitDetails {
        SpendControlLimitDetails {
            source: None,
            limit,
            used,
            remaining,
            used_percent,
            remaining_percent,
            reset_after_seconds,
            reset_at,
        }
    }
}
