mirror of
https://github.com/openai/codex.git
synced 2026-11-14 14:49:31 +00:00
updating codex backend models (#6855)
This commit is contained in:
1 parent
c1391b9f94
commit
4fb714fb46
4 files changed
+67
-2
No files matched your search
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* 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 = "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(unlimited: bool) -> CreditStatusDetails {
|
||||||
|
CreditStatusDetails {
|
||||||
|
unlimited,
|
||||||
|
balance: None,
|
||||||
|
approx_local_messages: None,
|
||||||
|
approx_cloud_messages: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,3 +32,6 @@ pub use self::rate_limit_status_details::RateLimitStatusDetails;
|
|||||||
|
|
||||||
pub mod rate_limit_window_snapshot;
|
pub mod rate_limit_window_snapshot;
|
||||||
pub use self::rate_limit_window_snapshot::RateLimitWindowSnapshot;
|
pub use self::rate_limit_window_snapshot::RateLimitWindowSnapshot;
|
||||||
|
|
||||||
|
pub mod credit_status_details;
|
||||||
|
pub use self::credit_status_details::CreditStatusDetails;
|
||||||
@@ -23,6 +23,13 @@ pub struct RateLimitStatusPayload {
|
|||||||
skip_serializing_if = "Option::is_none"
|
skip_serializing_if = "Option::is_none"
|
||||||
)]
|
)]
|
||||||
pub rate_limit: Option<Option<Box<models::RateLimitStatusDetails>>>,
|
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>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RateLimitStatusPayload {
|
impl RateLimitStatusPayload {
|
||||||
@@ -30,12 +37,15 @@ impl RateLimitStatusPayload {
|
|||||||
RateLimitStatusPayload {
|
RateLimitStatusPayload {
|
||||||
plan_type,
|
plan_type,
|
||||||
rate_limit: None,
|
rate_limit: None,
|
||||||
|
credits: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||||
pub enum PlanType {
|
pub enum PlanType {
|
||||||
|
#[serde(rename = "guest")]
|
||||||
|
Guest,
|
||||||
#[serde(rename = "free")]
|
#[serde(rename = "free")]
|
||||||
Free,
|
Free,
|
||||||
#[serde(rename = "go")]
|
#[serde(rename = "go")]
|
||||||
@@ -44,6 +54,8 @@ pub enum PlanType {
|
|||||||
Plus,
|
Plus,
|
||||||
#[serde(rename = "pro")]
|
#[serde(rename = "pro")]
|
||||||
Pro,
|
Pro,
|
||||||
|
#[serde(rename = "free_workspace")]
|
||||||
|
FreeWorkspace,
|
||||||
#[serde(rename = "team")]
|
#[serde(rename = "team")]
|
||||||
Team,
|
Team,
|
||||||
#[serde(rename = "business")]
|
#[serde(rename = "business")]
|
||||||
@@ -52,6 +64,8 @@ pub enum PlanType {
|
|||||||
Education,
|
Education,
|
||||||
#[serde(rename = "quorum")]
|
#[serde(rename = "quorum")]
|
||||||
Quorum,
|
Quorum,
|
||||||
|
#[serde(rename = "k12")]
|
||||||
|
K12,
|
||||||
#[serde(rename = "enterprise")]
|
#[serde(rename = "enterprise")]
|
||||||
Enterprise,
|
Enterprise,
|
||||||
#[serde(rename = "edu")]
|
#[serde(rename = "edu")]
|
||||||
@@ -60,6 +74,6 @@ pub enum PlanType {
|
|||||||
|
|
||||||
impl Default for PlanType {
|
impl Default for PlanType {
|
||||||
fn default() -> PlanType {
|
fn default() -> PlanType {
|
||||||
Self::Free
|
Self::Guest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
*
|
*
|
||||||
* Generated by: https://openapi-generator.tech
|
* Generated by: https://openapi-generator.tech
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user