mirror of
https://github.com/openai/codex.git
synced 2026-05-03 21:01:55 +03:00
Added multi-limit support end-to-end by carrying limit_name in rate-limit snapshots and handling multiple buckets instead of only codex. Extended /usage client parsing to consume additional_rate_limits Updated TUI /status and in-memory state to store/render per-limit snapshots Extended app-server rate-limit read response: kept rate_limits and added rate_limits_by_name. Adjusted usage-limit error messaging for non-default codex limit buckets
39 lines
965 B
Rust
39 lines
965 B
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 AdditionalRateLimitDetails {
|
|
#[serde(rename = "limit_name")]
|
|
pub limit_name: String,
|
|
#[serde(rename = "metered_feature")]
|
|
pub metered_feature: String,
|
|
#[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>>>,
|
|
}
|
|
|
|
impl AdditionalRateLimitDetails {
|
|
pub fn new(limit_name: String, metered_feature: String) -> AdditionalRateLimitDetails {
|
|
AdditionalRateLimitDetails {
|
|
limit_name,
|
|
metered_feature,
|
|
rate_limit: None,
|
|
}
|
|
}
|
|
}
|