mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
## What changed - Recognize `edu_plus` and `edu_pro` as distinct education workspace plans across authentication, backend rate-limit mapping, and app-server account schemas. - Include both plans in cloud configuration eligibility and use the education usage-limit behavior. - Display the plans as `Edu Plus` and `Edu Pro` in the TUI status view. ## Testing - Cover parsing, workspace classification, account and rate-limit responses, cloud configuration eligibility, usage-limit messages, and TUI display names for the new variants. GitOrigin-RevId: bf8add780ae03a3c6d10c4f4afa0da262c37928e
144 lines
4.0 KiB
Rust
144 lines
4.0 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 = "spend_control",
|
|
default,
|
|
with = "::serde_with::rust::double_option",
|
|
skip_serializing_if = "Option::is_none"
|
|
)]
|
|
pub spend_control: Option<Option<Box<models::SpendControlStatusDetails>>>,
|
|
#[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>>>,
|
|
#[serde(
|
|
rename = "rate_limit_reached_type",
|
|
default,
|
|
with = "::serde_with::rust::double_option",
|
|
skip_serializing_if = "Option::is_none"
|
|
)]
|
|
pub rate_limit_reached_type: Option<Option<RateLimitReachedType>>,
|
|
}
|
|
|
|
impl RateLimitStatusPayload {
|
|
pub fn new(plan_type: PlanType) -> RateLimitStatusPayload {
|
|
RateLimitStatusPayload {
|
|
plan_type,
|
|
rate_limit: None,
|
|
credits: None,
|
|
spend_control: None,
|
|
additional_rate_limits: None,
|
|
rate_limit_reached_type: None,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct RateLimitReachedType {
|
|
#[serde(rename = "type")]
|
|
pub kind: RateLimitReachedKind,
|
|
}
|
|
|
|
#[derive(
|
|
Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
|
|
)]
|
|
pub enum RateLimitReachedKind {
|
|
#[serde(rename = "rate_limit_reached")]
|
|
RateLimitReached,
|
|
#[serde(rename = "workspace_owner_credits_depleted")]
|
|
WorkspaceOwnerCreditsDepleted,
|
|
#[serde(rename = "workspace_member_credits_depleted")]
|
|
WorkspaceMemberCreditsDepleted,
|
|
#[serde(rename = "workspace_owner_usage_limit_reached")]
|
|
WorkspaceOwnerUsageLimitReached,
|
|
#[serde(rename = "workspace_member_usage_limit_reached")]
|
|
WorkspaceMemberUsageLimitReached,
|
|
#[serde(rename = "unknown", other)]
|
|
#[default]
|
|
Unknown,
|
|
}
|
|
|
|
#[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_prolite")]
|
|
SelfServeBusinessProLite,
|
|
#[serde(rename = "self_serve_business_usage_based")]
|
|
SelfServeBusinessUsageBased,
|
|
#[serde(rename = "business")]
|
|
Business,
|
|
#[serde(rename = "ent26")]
|
|
Ent26,
|
|
#[serde(rename = "enterprise_cbp_automation")]
|
|
EnterpriseCbpAutomation,
|
|
#[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 = "edu_plus")]
|
|
EduPlus,
|
|
#[serde(rename = "edu_pro")]
|
|
EduPro,
|
|
#[serde(rename = "unknown", other)]
|
|
Unknown,
|
|
}
|