mirror of
https://github.com/openai/codex.git
synced 2026-10-29 19:08:43 +00:00
Addresses #17353 Problem: Codex rate-limit fetching failed when the backend returned the new `prolite` subscription plan type. Solution: Add `prolite` to the backend/account/auth plan mappings, keep unknown WHAM plan values decodable, and regenerate app-server plan schemas.
93 lines
2.3 KiB
Rust
93 lines
2.3 KiB
Rust
/*
|
|
* 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 = "prolite")]
|
|
ProLite,
|
|
#[serde(rename = "free_workspace")]
|
|
FreeWorkspace,
|
|
#[serde(rename = "team")]
|
|
Team,
|
|
#[serde(rename = "self_serve_business_usage_based")]
|
|
SelfServeBusinessUsageBased,
|
|
#[serde(rename = "business")]
|
|
Business,
|
|
#[serde(rename = "enterprise_cbp_usage_based")]
|
|
EnterpriseCbpUsageBased,
|
|
#[serde(rename = "education")]
|
|
Education,
|
|
#[serde(rename = "quorum")]
|
|
Quorum,
|
|
#[serde(rename = "k12")]
|
|
K12,
|
|
#[serde(rename = "enterprise")]
|
|
Enterprise,
|
|
#[serde(rename = "edu")]
|
|
Edu,
|
|
#[serde(rename = "unknown", other)]
|
|
Unknown,
|
|
}
|