Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Sep 20, 2024
1 parent 0d092e3 commit 303e99a
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 18 deletions.
2 changes: 1 addition & 1 deletion kittycad.rs.patch.json
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@
"op": "add",
"path": "/paths/~1orgs~1{id}~1enterprise~1pricing/put/x-rust",
"value": {
"example": "/// Set the enterprise price for an organization.\n/// \n/// You must be a Zoo employee to perform this request.\n/// \n/// **Parameters:**\n/// \n/// - `id: uuid::Uuid`: The organization ID. (required)\nuse std::str::FromStr;\nasync fn example_orgs_update_enterprise_pricing_for() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::ZooProductSubscriptions = client\n .orgs()\n .update_enterprise_pricing_for(\n uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n &kittycad::types::SubscriptionTierPrice::serde_json::Value {},\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"example": "/// Set the enterprise price for an organization.\n/// \n/// You must be a Zoo employee to perform this request.\n/// \n/// **Parameters:**\n/// \n/// - `id: uuid::Uuid`: The organization ID. (required)\nuse std::str::FromStr;\nasync fn example_orgs_update_enterprise_pricing_for() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::ZooProductSubscriptions = client\n .orgs()\n .update_enterprise_pricing_for(\n uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n &kittycad::types::SubscriptionTierPrice::Enterprise {},\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/orgs/struct.Orgs.html#method.update_enterprise_pricing_for"
}
},
Expand Down
2 changes: 1 addition & 1 deletion kittycad/src/orgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ impl Orgs {
kittycad::types::ZooProductSubscriptions = client\n .orgs()\n \
.update_enterprise_pricing_for(\n \
uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n \
&kittycad::types::SubscriptionTierPrice::serde_json::Value {},\n )\n \
&kittycad::types::SubscriptionTierPrice::Enterprise {},\n )\n \
.await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn update_enterprise_pricing_for<'a>(
Expand Down
30 changes: 29 additions & 1 deletion kittycad/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3875,6 +3875,34 @@ pub enum CutType {
Chamfer,
}

#[doc = "The response from the `DefaultCameraFocusOn` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
)]
pub struct DefaultCameraFocusOn {}

impl std::fmt::Display for DefaultCameraFocusOn {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(
f,
"{}",
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
)
}
}

#[cfg(feature = "tabled")]
impl tabled::Tabled for DefaultCameraFocusOn {
const LENGTH: usize = 0;
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
vec![]
}

fn headers() -> Vec<std::borrow::Cow<'static, str>> {
vec![]
}
}

#[doc = "The response from the `DefaultCameraGetSettings` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -9901,7 +9929,7 @@ pub enum OkModelingCmdResponse {
#[serde(rename = "default_camera_focus_on")]
DefaultCameraFocusOn {
#[doc = "The response from the `DefaultCameraFocusOn` command."]
data: serde_json::Value,
data: DefaultCameraFocusOn,
},
#[doc = "The response to the 'SelectGet' endpoint"]
#[serde(rename = "select_get")]
Expand Down
14 changes: 0 additions & 14 deletions openapitor/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,16 +629,6 @@ impl TypeSpace {
},
}
}

// We have no properties, and no additional properties.
// Return a serde_json::Value.
return self.render_schema(
name,
&openapiv3::Schema {
schema_data: data.clone(),
schema_kind: openapiv3::SchemaKind::Any(openapiv3::AnySchema::default()),
},
);
}

let values = self.get_object_values(&struct_name, o, true, None)?;
Expand Down Expand Up @@ -1772,10 +1762,6 @@ fn get_type_name_for_object(
}
}
}

// We have no properties and no additional properties.
// Make it a serde_json::Value.
return Ok(quote!(serde_json::Value));
}

if o == &openapiv3::ObjectType::default()
Expand Down
30 changes: 29 additions & 1 deletion openapitor/tests/types/kittycad.rs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -3802,6 +3802,34 @@ pub enum CutType {
Chamfer,
}

#[doc = "The response from the `DefaultCameraFocusOn` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
)]
pub struct DefaultCameraFocusOn {}

impl std::fmt::Display for DefaultCameraFocusOn {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(
f,
"{}",
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
)
}
}

#[cfg(feature = "tabled")]
impl tabled::Tabled for DefaultCameraFocusOn {
const LENGTH: usize = 0;
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
vec![]
}

fn headers() -> Vec<std::borrow::Cow<'static, str>> {
vec![]
}
}

#[doc = "The response from the `DefaultCameraGetSettings` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -9691,7 +9719,7 @@ pub enum OkModelingCmdResponse {
#[serde(rename = "default_camera_focus_on")]
DefaultCameraFocusOn {
#[doc = "The response from the `DefaultCameraFocusOn` command."]
data: serde_json::Value,
data: DefaultCameraFocusOn,
},
#[doc = "The response to the 'SelectGet' endpoint"]
#[serde(rename = "select_get")]
Expand Down

0 comments on commit 303e99a

Please sign in to comment.