/*
 * 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 CreditStatusDetails {
    #[serde(rename = "has_credits")]
    pub has_credits: bool,
    #[serde(rename = "unlimited")]
    pub unlimited: bool,
    #[serde(
        rename = "balance",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub balance: Option<Option<String>>,
    #[serde(
        rename = "approx_local_messages",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub approx_local_messages: Option<Option<Vec<serde_json::Value>>>,
    #[serde(
        rename = "approx_cloud_messages",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub approx_cloud_messages: Option<Option<Vec<serde_json::Value>>>,
}

impl CreditStatusDetails {
    pub fn new(has_credits: bool, unlimited: bool) -> CreditStatusDetails {
        CreditStatusDetails {
            has_credits,
            unlimited,
            balance: None,
            approx_local_messages: None,
            approx_cloud_messages: None,
        }
    }
}
