mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Use From for app-server service tier ids
This commit is contained in:
@@ -160,8 +160,10 @@ impl TryFrom<&CoreServiceTier> for ServiceTier {
|
||||
#[ts(type = "string", export_to = "v2/")]
|
||||
pub struct ServiceTierId(pub String);
|
||||
|
||||
pub fn service_tier_id_into_core(service_tier_id: ServiceTierId) -> CoreServiceTier {
|
||||
CoreServiceTier::from(service_tier_id.0)
|
||||
impl From<ServiceTierId> for CoreServiceTier {
|
||||
fn from(value: ServiceTierId) -> Self {
|
||||
Self::from(value.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CoreServiceTier> for ServiceTierId {
|
||||
@@ -2586,7 +2588,7 @@ impl From<CoreModelServiceTier> for ModelServiceTier {
|
||||
impl From<ModelServiceTier> for CoreModelServiceTier {
|
||||
fn from(value: ModelServiceTier) -> Self {
|
||||
Self {
|
||||
id: service_tier_id_into_core(value.id),
|
||||
id: value.id.into(),
|
||||
name: value.name,
|
||||
description: value.description,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user