Skip to content

Commit

Permalink
Update api spec (#437)
Browse files Browse the repository at this point in the history
* YOYO NEW API SPEC!

* I have generated the library!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent babe688 commit e1f5b89
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
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.7", features = ["cargo", "derive", "env", "unicode"], optional = true }
clap = { version = "4.2.4", features = ["cargo", "derive", "env", "unicode"], optional = true }
chrono = { version = "0.4", default-features = false, features = ["serde", "std"] }
data-encoding = "^2.3.2"
dirs = { version = "^5.0.1", optional = true }
Expand Down
37 changes: 37 additions & 0 deletions kittycad/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,37 @@ impl tabled::Tabled for ClientMetrics {
}
}

#[doc = "The response from the `ClosePath` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
)]
pub struct ClosePath {
#[doc = "The UUID of the lone face of the resulting solid2D."]
pub face_id: uuid::Uuid,
}

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

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

#[doc = "Cluster information."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -9500,6 +9531,12 @@ pub enum OkModelingCmdResponse {
#[doc = "The response from the `EntityGetAllChildUuids` command."]
data: EntityGetAllChildUuids,
},
#[doc = "The response to the 'ClosePath' endpoint"]
#[serde(rename = "close_path")]
ClosePath {
#[doc = "The response from the `ClosePath` command."]
data: ClosePath,
},
#[doc = "The response to the 'CameraDragMove' endpoint"]
#[serde(rename = "camera_drag_move")]
CameraDragMove {
Expand Down
37 changes: 37 additions & 0 deletions openapitor/tests/types/kittycad.rs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -2887,6 +2887,37 @@ impl tabled::Tabled for ClientMetrics {
}
}

#[doc = "The response from the `ClosePath` command."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
)]
pub struct ClosePath {
#[doc = "The UUID of the lone face of the resulting solid2D."]
pub face_id: uuid::Uuid,
}

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

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

#[doc = "Cluster information."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -9315,6 +9346,12 @@ pub enum OkModelingCmdResponse {
#[doc = "The response from the `EntityGetAllChildUuids` command."]
data: EntityGetAllChildUuids,
},
#[doc = "The response to the 'ClosePath' endpoint"]
#[serde(rename = "close_path")]
ClosePath {
#[doc = "The response from the `ClosePath` command."]
data: ClosePath,
},
#[doc = "The response to the 'CameraDragMove' endpoint"]
#[serde(rename = "camera_drag_move")]
CameraDragMove {
Expand Down
33 changes: 33 additions & 0 deletions spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -14609,6 +14609,20 @@
"rtc_total_freezes_duration_sec"
]
},
"ClosePath": {
"description": "The response from the `ClosePath` command.",
"type": "object",
"properties": {
"face_id": {
"description": "The UUID of the lone face of the resulting solid2D.",
"type": "string",
"format": "uuid"
}
},
"required": [
"face_id"
]
},
"Cluster": {
"description": "Cluster information.",
"type": "object",
Expand Down Expand Up @@ -21778,6 +21792,25 @@
"type"
]
},
{
"description": "The response to the 'ClosePath' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ClosePath"
},
"type": {
"type": "string",
"enum": [
"close_path"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'CameraDragMove' endpoint",
"type": "object",
Expand Down

0 comments on commit e1f5b89

Please sign in to comment.