Skip to content

Commit d1c9bff

Browse files
Update api spec (#685)
* YOYO NEW API SPEC! * I have generated the library! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 4c3294f commit d1c9bff

File tree

3 files changed

+204
-2
lines changed

3 files changed

+204
-2
lines changed

kittycad/src/types.rs

+66-1
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,9 @@ pub enum AsyncApiCallOutput {
19001900
feedback: Option<MlFeedback>,
19011901
#[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19021902
id: uuid::Uuid,
1903+
#[doc = "The version of kcl requested."]
1904+
#[serde(default, skip_serializing_if = "Option::is_none")]
1905+
kcl_version: Option<String>,
19031906
#[doc = "The model being used."]
19041907
model: TextToCadModel,
19051908
#[doc = "The version of the model."]
@@ -10933,6 +10936,23 @@ pub enum ModelingCmd {
1093310936
#[serde(default, skip_serializing_if = "Option::is_none")]
1093410937
padding: Option<f64>,
1093510938
},
10939+
#[doc = "Looks along the normal of the specified face (if it is planar!), and fits the view \
10940+
to it."]
10941+
#[serde(rename = "orient_to_face")]
10942+
OrientToFace {
10943+
#[doc = "Whether or not to animate the camera movement. (Animation is currently not \
10944+
supported.)"]
10945+
#[serde(default)]
10946+
animated: bool,
10947+
#[doc = "Which face to orient camera to. If the face is not planar, no action will occur."]
10948+
face_id: uuid::Uuid,
10949+
#[doc = "How much to pad the view frame by, as a fraction of the face bounding box size. \
10950+
Negative padding will crop the view of the face proportionally. e.g. padding = \
10951+
0.2 means the view will span 120% of the face bounding box, and padding = -0.2 \
10952+
means the view will span 80% of the face bounding box."]
10953+
#[serde(default, skip_serializing_if = "Option::is_none")]
10954+
padding: Option<f64>,
10955+
},
1093610956
#[doc = "Fit the view to the scene with an isometric view."]
1093710957
#[serde(rename = "view_isometric")]
1093810958
ViewIsometric {
@@ -11708,6 +11728,11 @@ pub enum OkModelingCmdResponse {
1170811728
#[doc = "The response from the `ZoomToFit` command."]
1170911729
data: ZoomToFit,
1171011730
},
11731+
#[serde(rename = "orient_to_face")]
11732+
OrientToFace {
11733+
#[doc = "The response from the `OrientToFace` command."]
11734+
data: OrientToFace,
11735+
},
1171111736
#[serde(rename = "view_isometric")]
1171211737
ViewIsometric {
1171311738
#[doc = "The response from the `ViewIsometric` command."]
@@ -12597,6 +12622,37 @@ pub enum OrgRole {
1259712622
ServiceAccount,
1259812623
}
1259912624

12625+
#[doc = "The response from the `OrientToFace` command."]
12626+
#[derive(
12627+
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12628+
)]
12629+
pub struct OrientToFace {
12630+
#[doc = "Camera settings"]
12631+
pub settings: CameraSettings,
12632+
}
12633+
12634+
impl std::fmt::Display for OrientToFace {
12635+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12636+
write!(
12637+
f,
12638+
"{}",
12639+
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12640+
)
12641+
}
12642+
}
12643+
12644+
#[cfg(feature = "tabled")]
12645+
impl tabled::Tabled for OrientToFace {
12646+
const LENGTH: usize = 1;
12647+
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12648+
vec![format!("{:?}", self.settings).into()]
12649+
}
12650+
12651+
fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12652+
vec!["settings".into()]
12653+
}
12654+
}
12655+
1260012656
#[doc = "The type of origin"]
1260112657
#[derive(
1260212658
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
@@ -16083,6 +16139,9 @@ pub struct TextToCad {
1608316139
pub feedback: Option<MlFeedback>,
1608416140
#[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1608516141
pub id: uuid::Uuid,
16142+
#[doc = "The version of kcl requested."]
16143+
#[serde(default, skip_serializing_if = "Option::is_none")]
16144+
pub kcl_version: Option<String>,
1608616145
#[doc = "The model being used."]
1608716146
pub model: TextToCadModel,
1608816147
#[doc = "The version of the model."]
@@ -16118,7 +16177,7 @@ impl std::fmt::Display for TextToCad {
1611816177

1611916178
#[cfg(feature = "tabled")]
1612016179
impl tabled::Tabled for TextToCad {
16121-
const LENGTH: usize = 15;
16180+
const LENGTH: usize = 16;
1612216181
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1612316182
vec![
1612416183
if let Some(code) = &self.code {
@@ -16143,6 +16202,11 @@ impl tabled::Tabled for TextToCad {
1614316202
String::new().into()
1614416203
},
1614516204
format!("{:?}", self.id).into(),
16205+
if let Some(kcl_version) = &self.kcl_version {
16206+
format!("{:?}", kcl_version).into()
16207+
} else {
16208+
String::new().into()
16209+
},
1614616210
format!("{:?}", self.model).into(),
1614716211
self.model_version.clone().into(),
1614816212
format!("{:?}", self.output_format).into(),
@@ -16171,6 +16235,7 @@ impl tabled::Tabled for TextToCad {
1617116235
"error".into(),
1617216236
"feedback".into(),
1617316237
"id".into(),
16238+
"kcl_version".into(),
1617416239
"model".into(),
1617516240
"model_version".into(),
1617616241
"output_format".into(),

openapitor/tests/types/kittycad.rs.gen

+61-1
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,9 @@ pub enum AsyncApiCallOutput {
18881888
feedback: Option<MlFeedback>,
18891889
#[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
18901890
id: uuid::Uuid,
1891+
#[doc = "The version of kcl requested."]
1892+
#[serde(default, skip_serializing_if = "Option::is_none")]
1893+
kcl_version: Option<String>,
18911894
#[doc = "The model being used."]
18921895
model: TextToCadModel,
18931896
#[doc = "The version of the model."]
@@ -10689,6 +10692,18 @@ pub enum ModelingCmd {
1068910692
#[serde(default, skip_serializing_if = "Option::is_none")]
1069010693
padding: Option<f64>,
1069110694
},
10695+
#[doc = "Looks along the normal of the specified face (if it is planar!), and fits the view to it."]
10696+
#[serde(rename = "orient_to_face")]
10697+
OrientToFace {
10698+
#[doc = "Whether or not to animate the camera movement. (Animation is currently not supported.)"]
10699+
#[serde(default)]
10700+
animated: bool,
10701+
#[doc = "Which face to orient camera to. If the face is not planar, no action will occur."]
10702+
face_id: uuid::Uuid,
10703+
#[doc = "How much to pad the view frame by, as a fraction of the face bounding box size. Negative padding will crop the view of the face proportionally. e.g. padding = 0.2 means the view will span 120% of the face bounding box, and padding = -0.2 means the view will span 80% of the face bounding box."]
10704+
#[serde(default, skip_serializing_if = "Option::is_none")]
10705+
padding: Option<f64>,
10706+
},
1069210707
#[doc = "Fit the view to the scene with an isometric view."]
1069310708
#[serde(rename = "view_isometric")]
1069410709
ViewIsometric {
@@ -11453,6 +11468,11 @@ pub enum OkModelingCmdResponse {
1145311468
#[doc = "The response from the `ZoomToFit` command."]
1145411469
data: ZoomToFit,
1145511470
},
11471+
#[serde(rename = "orient_to_face")]
11472+
OrientToFace {
11473+
#[doc = "The response from the `OrientToFace` command."]
11474+
data: OrientToFace,
11475+
},
1145611476
#[serde(rename = "view_isometric")]
1145711477
ViewIsometric {
1145811478
#[doc = "The response from the `ViewIsometric` command."]
@@ -12334,6 +12354,37 @@ pub enum OrgRole {
1233412354
ServiceAccount,
1233512355
}
1233612356

12357+
#[doc = "The response from the `OrientToFace` command."]
12358+
#[derive(
12359+
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12360+
)]
12361+
pub struct OrientToFace {
12362+
#[doc = "Camera settings"]
12363+
pub settings: CameraSettings,
12364+
}
12365+
12366+
impl std::fmt::Display for OrientToFace {
12367+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12368+
write!(
12369+
f,
12370+
"{}",
12371+
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12372+
)
12373+
}
12374+
}
12375+
12376+
#[cfg(feature = "tabled")]
12377+
impl tabled::Tabled for OrientToFace {
12378+
const LENGTH: usize = 1;
12379+
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12380+
vec![format!("{:?}", self.settings).into()]
12381+
}
12382+
12383+
fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12384+
vec!["settings".into()]
12385+
}
12386+
}
12387+
1233712388
#[doc = "The type of origin"]
1233812389
#[derive(
1233912390
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
@@ -15774,6 +15825,9 @@ pub struct TextToCad {
1577415825
pub feedback: Option<MlFeedback>,
1577515826
#[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1577615827
pub id: uuid::Uuid,
15828+
#[doc = "The version of kcl requested."]
15829+
#[serde(default, skip_serializing_if = "Option::is_none")]
15830+
pub kcl_version: Option<String>,
1577715831
#[doc = "The model being used."]
1577815832
pub model: TextToCadModel,
1577915833
#[doc = "The version of the model."]
@@ -15808,7 +15862,7 @@ impl std::fmt::Display for TextToCad {
1580815862

1580915863
#[cfg(feature = "tabled")]
1581015864
impl tabled::Tabled for TextToCad {
15811-
const LENGTH: usize = 15;
15865+
const LENGTH: usize = 16;
1581215866
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1581315867
vec![
1581415868
if let Some(code) = &self.code {
@@ -15833,6 +15887,11 @@ impl tabled::Tabled for TextToCad {
1583315887
String::new().into()
1583415888
},
1583515889
format!("{:?}", self.id).into(),
15890+
if let Some(kcl_version) = &self.kcl_version {
15891+
format!("{:?}", kcl_version).into()
15892+
} else {
15893+
String::new().into()
15894+
},
1583615895
format!("{:?}", self.model).into(),
1583715896
self.model_version.clone().into(),
1583815897
format!("{:?}", self.output_format).into(),
@@ -15861,6 +15920,7 @@ impl tabled::Tabled for TextToCad {
1586115920
"error".into(),
1586215921
"feedback".into(),
1586315922
"id".into(),
15923+
"kcl_version".into(),
1586415924
"model".into(),
1586515925
"model_version".into(),
1586615926
"output_format".into(),

spec.json

+77
Original file line numberDiff line numberDiff line change
@@ -16368,6 +16368,11 @@
1636816368
}
1636916369
]
1637016370
},
16371+
"kcl_version": {
16372+
"nullable": true,
16373+
"description": "The version of kcl requested.",
16374+
"type": "string"
16375+
},
1637116376
"model": {
1637216377
"description": "The model being used.",
1637316378
"allOf": [
@@ -25324,6 +25329,38 @@
2532425329
"type"
2532525330
]
2532625331
},
25332+
{
25333+
"description": "Looks along the normal of the specified face (if it is planar!), and fits the view to it.",
25334+
"type": "object",
25335+
"properties": {
25336+
"animated": {
25337+
"description": "Whether or not to animate the camera movement. (Animation is currently not supported.)",
25338+
"default": false,
25339+
"type": "boolean"
25340+
},
25341+
"face_id": {
25342+
"description": "Which face to orient camera to. If the face is not planar, no action will occur.",
25343+
"type": "string",
25344+
"format": "uuid"
25345+
},
25346+
"padding": {
25347+
"description": "How much to pad the view frame by, as a fraction of the face bounding box size. Negative padding will crop the view of the face proportionally. e.g. padding = 0.2 means the view will span 120% of the face bounding box, and padding = -0.2 means the view will span 80% of the face bounding box.",
25348+
"default": 0.0,
25349+
"type": "number",
25350+
"format": "float"
25351+
},
25352+
"type": {
25353+
"type": "string",
25354+
"enum": [
25355+
"orient_to_face"
25356+
]
25357+
}
25358+
},
25359+
"required": [
25360+
"face_id",
25361+
"type"
25362+
]
25363+
},
2532725364
{
2532825365
"description": "Fit the view to the scene with an isometric view.",
2532925366
"type": "object",
@@ -26899,6 +26936,24 @@
2689926936
"type"
2690026937
]
2690126938
},
26939+
{
26940+
"type": "object",
26941+
"properties": {
26942+
"data": {
26943+
"$ref": "#/components/schemas/OrientToFace"
26944+
},
26945+
"type": {
26946+
"type": "string",
26947+
"enum": [
26948+
"orient_to_face"
26949+
]
26950+
}
26951+
},
26952+
"required": [
26953+
"data",
26954+
"type"
26955+
]
26956+
},
2690226957
{
2690326958
"type": "object",
2690426959
"properties": {
@@ -28398,6 +28453,23 @@
2839828453
}
2839928454
]
2840028455
},
28456+
"OrientToFace": {
28457+
"description": "The response from the `OrientToFace` command.",
28458+
"type": "object",
28459+
"properties": {
28460+
"settings": {
28461+
"description": "Camera settings",
28462+
"allOf": [
28463+
{
28464+
"$ref": "#/components/schemas/CameraSettings"
28465+
}
28466+
]
28467+
}
28468+
},
28469+
"required": [
28470+
"settings"
28471+
]
28472+
},
2840128473
"OriginType": {
2840228474
"description": "The type of origin",
2840328475
"oneOf": [
@@ -30737,6 +30809,11 @@
3073730809
}
3073830810
]
3073930811
},
30812+
"kcl_version": {
30813+
"nullable": true,
30814+
"description": "The version of kcl requested.",
30815+
"type": "string"
30816+
},
3074030817
"model": {
3074130818
"description": "The model being used.",
3074230819
"allOf": [

0 commit comments

Comments
 (0)