Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update api spec #575

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kittycad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async-trait = { version = "^0.1.53", optional = true }
base64 = "0.22"
bigdecimal = { version = "0.4", features = ["serde"] }
bytes = { version = "1", features = ["serde"] }
clap = { version = "4.5.20", features = ["cargo", "derive", "env", "unicode"], optional = true }
clap = { version = "4.2.4", features = ["cargo", "derive", "env", "unicode"], optional = true }
data-encoding = "^2.3.2"
dirs = { version = "^5.0.1", optional = true }
format_serde_error = { version = "^0.3.0", optional = true }
Expand Down
49 changes: 49 additions & 0 deletions kittycad/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9906,6 +9906,14 @@ pub enum ModelingCmd {
#[doc = "Which object is being queried."]
object_id: uuid::Uuid,
},
#[doc = "Gets the shared edge between these two faces if it exists"]
#[serde(rename = "solid3d_get_common_edge")]
Solid3DGetCommonEdge {
#[doc = "The faces being queried"]
face_ids: Vec<uuid::Uuid>,
#[doc = "Which object is being queried."]
object_id: uuid::Uuid,
},
#[doc = "Fillets the given edge with the specified radius."]
#[serde(rename = "solid3d_fillet_edge")]
Solid3DFilletEdge {
Expand Down Expand Up @@ -11121,6 +11129,11 @@ pub enum OkModelingCmdResponse {
#[doc = "The response from the `Solid3dGetPrevAdjacentEdge` command."]
data: Solid3DGetPrevAdjacentEdge,
},
#[serde(rename = "solid3d_get_common_edge")]
Solid3DGetCommonEdge {
#[doc = "The response from the `Solid3DGetCommonEdge` command."]
data: Solid3DGetCommonEdge,
},
#[serde(rename = "get_entity_type")]
GetEntityType {
#[doc = "The response from the `GetEntityType` command."]
Expand Down Expand Up @@ -14525,6 +14538,42 @@ impl tabled::Tabled for Solid3DGetAllOppositeEdges {
}
}

#[doc = "The response from the `Solid3DGetCommonEdge` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
)]
pub struct Solid3DGetCommonEdge {
#[doc = "The UUID of the common edge, if any."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub edge: Option<uuid::Uuid>,
}

impl std::fmt::Display for Solid3DGetCommonEdge {
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 Solid3DGetCommonEdge {
const LENGTH: usize = 1;
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
vec![if let Some(edge) = &self.edge {
format!("{:?}", edge).into()
} else {
String::new().into()
}]
}

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

#[doc = "Extrusion face info struct (useful for maintaining mappings between source path segment \
ids and extrusion faces)"]
#[derive(
Expand Down
49 changes: 49 additions & 0 deletions openapitor/tests/types/kittycad.rs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -9729,6 +9729,14 @@ pub enum ModelingCmd {
#[doc = "Which object is being queried."]
object_id: uuid::Uuid,
},
#[doc = "Gets the shared edge between these two faces if it exists"]
#[serde(rename = "solid3d_get_common_edge")]
Solid3DGetCommonEdge {
#[doc = "The faces being queried"]
face_ids: Vec<uuid::Uuid>,
#[doc = "Which object is being queried."]
object_id: uuid::Uuid,
},
#[doc = "Fillets the given edge with the specified radius."]
#[serde(rename = "solid3d_fillet_edge")]
Solid3DFilletEdge {
Expand Down Expand Up @@ -10903,6 +10911,11 @@ pub enum OkModelingCmdResponse {
#[doc = "The response from the `Solid3dGetPrevAdjacentEdge` command."]
data: Solid3DGetPrevAdjacentEdge,
},
#[serde(rename = "solid3d_get_common_edge")]
Solid3DGetCommonEdge {
#[doc = "The response from the `Solid3DGetCommonEdge` command."]
data: Solid3DGetCommonEdge,
},
#[serde(rename = "get_entity_type")]
GetEntityType {
#[doc = "The response from the `GetEntityType` command."]
Expand Down Expand Up @@ -14260,6 +14273,42 @@ impl tabled::Tabled for Solid3DGetAllOppositeEdges {
}
}

#[doc = "The response from the `Solid3DGetCommonEdge` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
)]
pub struct Solid3DGetCommonEdge {
#[doc = "The UUID of the common edge, if any."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub edge: Option<uuid::Uuid>,
}

impl std::fmt::Display for Solid3DGetCommonEdge {
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 Solid3DGetCommonEdge {
const LENGTH: usize = 1;
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
vec![if let Some(edge) = &self.edge {
format!("{:?}", edge).into()
} else {
String::new().into()
}]
}

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

#[doc = "Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)"]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down
62 changes: 62 additions & 0 deletions spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -22848,6 +22848,38 @@
"type"
]
},
{
"description": "Gets the shared edge between these two faces if it exists",
"type": "object",
"properties": {
"face_ids": {
"description": "The faces being queried",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"minItems": 2,
"maxItems": 2
},
"object_id": {
"description": "Which object is being queried.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"solid3d_get_common_edge"
]
}
},
"required": [
"face_ids",
"object_id",
"type"
]
},
{
"description": "Fillets the given edge with the specified radius.",
"type": "object",
Expand Down Expand Up @@ -25934,6 +25966,24 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Solid3dGetCommonEdge"
},
"type": {
"type": "string",
"enum": [
"solid3d_get_common_edge"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
Expand Down Expand Up @@ -28798,6 +28848,18 @@
"edges"
]
},
"Solid3dGetCommonEdge": {
"description": "The response from the `Solid3DGetCommonEdge` command.",
"type": "object",
"properties": {
"edge": {
"nullable": true,
"description": "The UUID of the common edge, if any.",
"type": "string",
"format": "uuid"
}
}
},
"Solid3dGetExtrusionFaceInfo": {
"description": "Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)",
"type": "object",
Expand Down