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

use crate::models;
use serde::Deserialize;
use serde::Serialize;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RateLimitStatusPayload {
    #[serde(rename = "plan_type")]
    pub plan_type: PlanType,
    #[serde(
        rename = "rate_limit",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub rate_limit: Option<Option<Box<models::RateLimitStatusDetails>>>,
    #[serde(
        rename = "credits",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub credits: Option<Option<Box<models::CreditStatusDetails>>>,
    #[serde(
        rename = "additional_rate_limits",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub additional_rate_limits: Option<Option<Vec<models::AdditionalRateLimitDetails>>>,
}

impl RateLimitStatusPayload {
    pub fn new(plan_type: PlanType) -> RateLimitStatusPayload {
        RateLimitStatusPayload {
            plan_type,
            rate_limit: None,
            credits: None,
            additional_rate_limits: None,
        }
    }
}

#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum PlanType {
    #[serde(rename = "guest")]
    #[default]
    Guest,
    #[serde(rename = "free")]
    Free,
    #[serde(rename = "go")]
    Go,
    #[serde(rename = "plus")]
    Plus,
    #[serde(rename = "pro")]
    Pro,
    #[serde(rename = "free_workspace")]
    FreeWorkspace,
    #[serde(rename = "team")]
    Team,
    #[serde(rename = "business")]
    Business,
    #[serde(rename = "education")]
    Education,
    #[serde(rename = "quorum")]
    Quorum,
    #[serde(rename = "k12")]
    K12,
    #[serde(rename = "enterprise")]
    Enterprise,
    #[serde(rename = "edu")]
    Edu,
}
