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 #601

Merged
merged 2 commits into from
Oct 30, 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
89 changes: 88 additions & 1 deletion kittycad/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2464,6 +2464,31 @@ impl tabled::Tabled for CameraDragStart {
}
}

#[doc = "A type of camera movement applied after certain camera operations"]
#[derive(
serde :: Serialize,
serde :: Deserialize,
PartialEq,
Hash,
Debug,
Clone,
schemars :: JsonSchema,
parse_display :: FromStr,
parse_display :: Display,
)]
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
pub enum CameraMovement {
#[doc = "Adjusts the camera position during the camera operation"]
#[serde(rename = "vantage")]
#[display("vantage")]
Vantage,
#[doc = "Keeps the camera position in place"]
#[serde(rename = "none")]
#[display("none")]
None,
}

#[doc = "Camera settings including position, center, fov etc"]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -4015,6 +4040,34 @@ pub enum CutType {
Chamfer,
}

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

impl std::fmt::Display for DefaultCameraCenterToScene {
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 DefaultCameraCenterToScene {
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 `DefaultCameraCenterToSelection` endpoint."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -10341,6 +10394,9 @@ pub enum ModelingCmd {
#[doc = "Reconfigure the stream."]
#[serde(rename = "reconfigure_stream")]
ReconfigureStream {
#[doc = "Video feed's constant bitrate (CBR)"]
#[serde(default, skip_serializing_if = "Option::is_none")]
bitrate: Option<u32>,
#[doc = "Frames per second."]
fps: u32,
#[doc = "Height of the stream."]
Expand Down Expand Up @@ -10449,7 +10505,22 @@ pub enum ModelingCmd {
#[doc = "Updates the camera to center to the center of the current selection (or the origin \
if nothing is selected)"]
#[serde(rename = "default_camera_center_to_selection")]
DefaultCameraCenterToSelection {},
DefaultCameraCenterToSelection {
#[doc = "Dictates whether or not the camera position should be adjusted during this \
operation If no movement is requested, the camera will orbit around the new \
center from its current position"]
#[serde(default, skip_serializing_if = "Option::is_none")]
camera_movement: Option<CameraMovement>,
},
#[doc = "Updates the camera to center to the center of the current scene's bounds"]
#[serde(rename = "default_camera_center_to_scene")]
DefaultCameraCenterToScene {
#[doc = "Dictates whether or not the camera position should be adjusted during this \
operation If no movement is requested, the camera will orbit around the new \
center from its current position"]
#[serde(default, skip_serializing_if = "Option::is_none")]
camera_movement: Option<CameraMovement>,
},
#[doc = "Fit the view to the specified object(s)."]
#[serde(rename = "zoom_to_fit")]
ZoomToFit {
Expand Down Expand Up @@ -11135,6 +11206,11 @@ pub enum OkModelingCmdResponse {
#[doc = "The response from the `DefaultCameraCenterToSelection` endpoint."]
data: DefaultCameraCenterToSelection,
},
#[serde(rename = "default_camera_center_to_scene")]
DefaultCameraCenterToScene {
#[doc = "The response from the `DefaultCameraCenterToScene` endpoint."]
data: DefaultCameraCenterToScene,
},
#[serde(rename = "select_clear")]
SelectClear {
#[doc = "The response from the `SelectClear` endpoint."]
Expand Down Expand Up @@ -12510,6 +12586,17 @@ pub enum PathSegment {
position. Must not be colinear with current path pen position."]
to: Point3D,
},
#[doc = "Adds an arc from the current position that goes through the given interior point and \
ends at the given end position"]
#[serde(rename = "arc_to")]
ArcTo {
#[doc = "End point of the arc."]
end: Point3D,
#[doc = "Interior point of the arc."]
interior: Point3D,
#[doc = "Whether or not interior and end are relative to the previous path position"]
relative: bool,
},
}

#[doc = "Info about a path segment"]
Expand Down
84 changes: 83 additions & 1 deletion openapitor/tests/types/kittycad.rs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -2449,6 +2449,31 @@ impl tabled::Tabled for CameraDragStart {
}
}

#[doc = "A type of camera movement applied after certain camera operations"]
#[derive(
serde :: Serialize,
serde :: Deserialize,
PartialEq,
Hash,
Debug,
Clone,
schemars :: JsonSchema,
parse_display :: FromStr,
parse_display :: Display,
)]
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
pub enum CameraMovement {
#[doc = "Adjusts the camera position during the camera operation"]
#[serde(rename = "vantage")]
#[display("vantage")]
Vantage,
#[doc = "Keeps the camera position in place"]
#[serde(rename = "none")]
#[display("none")]
None,
}

#[doc = "Camera settings including position, center, fov etc"]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -3936,6 +3961,34 @@ pub enum CutType {
Chamfer,
}

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

impl std::fmt::Display for DefaultCameraCenterToScene {
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 DefaultCameraCenterToScene {
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 `DefaultCameraCenterToSelection` endpoint."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
Expand Down Expand Up @@ -10137,6 +10190,9 @@ pub enum ModelingCmd {
#[doc = "Reconfigure the stream."]
#[serde(rename = "reconfigure_stream")]
ReconfigureStream {
#[doc = "Video feed's constant bitrate (CBR)"]
#[serde(default, skip_serializing_if = "Option::is_none")]
bitrate: Option<u32>,
#[doc = "Frames per second."]
fps: u32,
#[doc = "Height of the stream."]
Expand Down Expand Up @@ -10236,7 +10292,18 @@ pub enum ModelingCmd {
},
#[doc = "Updates the camera to center to the center of the current selection (or the origin if nothing is selected)"]
#[serde(rename = "default_camera_center_to_selection")]
DefaultCameraCenterToSelection {},
DefaultCameraCenterToSelection {
#[doc = "Dictates whether or not the camera position should be adjusted during this operation If no movement is requested, the camera will orbit around the new center from its current position"]
#[serde(default, skip_serializing_if = "Option::is_none")]
camera_movement: Option<CameraMovement>,
},
#[doc = "Updates the camera to center to the center of the current scene's bounds"]
#[serde(rename = "default_camera_center_to_scene")]
DefaultCameraCenterToScene {
#[doc = "Dictates whether or not the camera position should be adjusted during this operation If no movement is requested, the camera will orbit around the new center from its current position"]
#[serde(default, skip_serializing_if = "Option::is_none")]
camera_movement: Option<CameraMovement>,
},
#[doc = "Fit the view to the specified object(s)."]
#[serde(rename = "zoom_to_fit")]
ZoomToFit {
Expand Down Expand Up @@ -10912,6 +10979,11 @@ pub enum OkModelingCmdResponse {
#[doc = "The response from the `DefaultCameraCenterToSelection` endpoint."]
data: DefaultCameraCenterToSelection,
},
#[serde(rename = "default_camera_center_to_scene")]
DefaultCameraCenterToScene {
#[doc = "The response from the `DefaultCameraCenterToScene` endpoint."]
data: DefaultCameraCenterToScene,
},
#[serde(rename = "select_clear")]
SelectClear {
#[doc = "The response from the `SelectClear` endpoint."]
Expand Down Expand Up @@ -12264,6 +12336,16 @@ pub enum PathSegment {
#[doc = "Where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position."]
to: Point3D,
},
#[doc = "Adds an arc from the current position that goes through the given interior point and ends at the given end position"]
#[serde(rename = "arc_to")]
ArcTo {
#[doc = "End point of the arc."]
end: Point3D,
#[doc = "Interior point of the arc."]
interior: Point3D,
#[doc = "Whether or not interior and end are relative to the previous path position"]
relative: bool,
},
}

#[doc = "Info about a path segment"]
Expand Down
Loading