Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Oct 4, 2023
1 parent fa0345c commit 0cc3f59
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 97 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.28
0.2.29
2 changes: 1 addition & 1 deletion kittycad.rs.patch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"path": "/info/x-rust",
"value": {
"client": "// Authenticate via an API token.\nlet client = kittycad::Client::new(\"$TOKEN\");\n\n// - OR -\n\n// Authenticate with your token and host parsed from the environment variables:\n// `KITTYCAD_API_TOKEN`.\nlet client = kittycad::Client::new_from_env();",
"install": "[dependencies]\nkittycad = \"0.2.28\""
"install": "[dependencies]\nkittycad = \"0.2.29\""
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion kittycad/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kittycad"
description = "A fully generated & opinionated API client for the KittyCAD API."
version = "0.2.28"
version = "0.2.29"
documentation = "https://docs.rs/kittycad"
readme = "README.md"
repository = "https://github.com/KittyCAD/kittycad.rs/tree/main/kittycad"
Expand Down
2 changes: 1 addition & 1 deletion kittycad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To install the library, add the following to your `Cargo.toml` file.

```toml
[dependencies]
kittycad = "0.2.28"
kittycad = "0.2.29"
```

## Basic example
Expand Down
2 changes: 1 addition & 1 deletion kittycad/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//!
//! ```toml
//! [dependencies]
//! kittycad = "0.2.28"
//! kittycad = "0.2.29"
//! ```
//!
//! ## Basic example
Expand Down
98 changes: 80 additions & 18 deletions kittycad/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ pub struct ApiCallWithPrice {
pub origin: Option<String>,
#[doc = "The price of the API call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub price: Option<bigdecimal::BigDecimal>,
pub price: Option<f64>,
#[doc = "The request body sent by the API call."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request_body: Option<String>,
Expand Down Expand Up @@ -3034,7 +3034,7 @@ pub struct Coupon {
#[doc = "Amount (in the `currency` specified) that will be taken off the subtotal of any \
invoices for this customer."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_off: Option<bigdecimal::BigDecimal>,
pub amount_off: Option<f64>,
#[doc = "Always true for a deleted object."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deleted: Option<bool>,
Expand Down Expand Up @@ -3261,7 +3261,7 @@ pub struct Customer {
have yet to be successfully applied to any invoice. This balance is only taken into \
account as invoices are finalized."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub balance: Option<bigdecimal::BigDecimal>,
pub balance: Option<f64>,
#[doc = "Time at which the object was created."]
pub created_at: chrono::DateTime<chrono::Utc>,
#[doc = "Three-letter ISO code for the currency the customer can be charged in for recurring \
Expand Down Expand Up @@ -3380,7 +3380,7 @@ pub struct CustomerBalance {
#[doc = "The monthy credits remaining in the balance. This gets re-upped every month, but if \
the credits are not used for a month they do not carry over to the next month. It is \
a stable amount granted to the user per month."]
pub monthly_credits_remaining: bigdecimal::BigDecimal,
pub monthly_credits_remaining: f64,
#[doc = "The amount of pre-pay cash remaining in the balance. This number goes down as the \
user uses their pre-paid credits. The reason we track this amount is if a user ever \
wants to withdraw their pre-pay cash, we can use this amount to determine how much \
Expand All @@ -3390,15 +3390,15 @@ pub struct CustomerBalance {
`pre_pay_credits_remaining` will be subtracted by 50 to pay the bill. This way if \
they want to withdraw money after, they can only withdraw $50 since that is the \
amount of cash they have remaining."]
pub pre_pay_cash_remaining: bigdecimal::BigDecimal,
pub pre_pay_cash_remaining: f64,
#[doc = "The amount of credits remaining in the balance. This is typically the amount of cash \
* some multiplier they get for pre-paying their account. This number lowers every \
time a bill is paid with the balance. This number increases every time a user adds \
funds to their balance. This may be through a subscription or a one off payment."]
pub pre_pay_credits_remaining: bigdecimal::BigDecimal,
pub pre_pay_credits_remaining: f64,
#[doc = "This includes any outstanding, draft, or open invoices and any pending invoice \
items. This does not include any credits the user has on their account."]
pub total_due: bigdecimal::BigDecimal,
pub total_due: f64,
#[doc = "The date and time the balance was last updated."]
pub updated_at: chrono::DateTime<chrono::Utc>,
#[doc = "The user ID the balance belongs to."]
Expand Down Expand Up @@ -5233,6 +5233,45 @@ impl tabled::Tabled for GetEntityType {
}
}

#[doc = "The plane for sketch mode."]
#[derive(
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,

Check warning on line 5238 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L5238

Added line #L5238 was not covered by tests
)]
pub struct GetSketchModePlane {
#[doc = "The x axis."]
pub x_axis: Point3D,
#[doc = "The y axis."]
pub y_axis: Point3D,
#[doc = "The z axis (normal)."]
pub z_axis: Point3D,
}

impl std::fmt::Display for GetSketchModePlane {
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)?

Check warning on line 5254 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L5250-L5254

Added lines #L5250 - L5254 were not covered by tests
)
}

Check warning on line 5256 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L5256

Added line #L5256 was not covered by tests
}

#[cfg(feature = "tabled")]
impl tabled::Tabled for GetSketchModePlane {
const LENGTH: usize = 3;
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
vec![
format!("{:?}", self.x_axis).into(),
format!("{:?}", self.y_axis).into(),
format!("{:?}", self.z_axis).into(),
]
}

Check warning on line 5268 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L5262-L5268

Added lines #L5262 - L5268 were not covered by tests

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

Check warning on line 5272 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L5270-L5272

Added lines #L5270 - L5272 were not covered by tests
}

#[doc = "Describes the presentation style of the glTF JSON."]
#[derive(
serde :: Serialize,
Expand Down Expand Up @@ -5565,13 +5604,13 @@ pub struct Invoice {
also take that into account. The charge that gets generated for the invoice will be \
for the amount specified in `amount_due`."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_due: Option<bigdecimal::BigDecimal>,
pub amount_due: Option<f64>,
#[doc = "The amount, in USD, that was paid."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_paid: Option<bigdecimal::BigDecimal>,
pub amount_paid: Option<f64>,
#[doc = "The amount remaining, in USD, that is due."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount_remaining: Option<bigdecimal::BigDecimal>,
pub amount_remaining: Option<f64>,
#[doc = "Number of payment attempts made for this invoice, from the perspective of the \
payment retry schedule.\n\nAny payment attempt counts as the first attempt, and \
subsequently only automatic retries increment the attempt count. In other words, \
Expand Down Expand Up @@ -5641,14 +5680,14 @@ pub struct Invoice {
#[doc = "Total of all subscriptions, invoice items, and prorations on the invoice before any \
invoice level discount or tax is applied.\n\nItem discounts are already incorporated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub subtotal: Option<bigdecimal::BigDecimal>,
pub subtotal: Option<f64>,
#[doc = "The amount of tax on this invoice.\n\nThis is the sum of all the tax amounts on this \
invoice."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tax: Option<bigdecimal::BigDecimal>,
pub tax: Option<f64>,
#[doc = "Total after discounts and taxes."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<bigdecimal::BigDecimal>,
pub total: Option<f64>,
#[doc = "The URL for the hosted invoice page, which allows customers to view and pay an \
invoice."]
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -5832,7 +5871,7 @@ impl tabled::Tabled for Invoice {
pub struct InvoiceLineItem {
#[doc = "The amount, in USD."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount: Option<bigdecimal::BigDecimal>,
pub amount: Option<f64>,
#[doc = "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), \
in lowercase."]
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -6893,6 +6932,9 @@ pub enum ModelingCmd {
SketchModeEnable {
#[doc = "Animate the transition to sketch mode."]
animated: bool,
#[doc = "Disable the camera entirely for sketch mode and sketch on a plane (this would be \
the normal of that plane)."]
disable_camera_with_plane: Option<Point3D>,
#[doc = "Use an orthographic camera."]
ortho: bool,
#[doc = "Sketch on this plane."]
Expand Down Expand Up @@ -7065,6 +7107,10 @@ pub enum ModelingCmd {
#[doc = "Select the unit interpretation of distances in the scene."]
source_unit: UnitLength,
},
#[doc = "Get the plane of the sketch mode. This is useful for getting the normal of the plane \
after a user selects a plane."]
#[serde(rename = "get_sketch_mode_plane")]
GetSketchModePlane {},
}

#[doc = "The response from the `MouseClick` command."]
Expand Down Expand Up @@ -7463,6 +7509,12 @@ pub enum OkModelingCmdResponse {
#[doc = "The center of mass response."]
data: CenterOfMass,
},
#[doc = "The response from the `GetSketchModePlane` command."]
#[serde(rename = "get_sketch_mode_plane")]
GetSketchModePlane {
#[doc = "The plane for sketch mode."]
data: GetSketchModePlane,
},
}

#[doc = "The websocket messages this server sends."]
Expand Down Expand Up @@ -8725,7 +8777,8 @@ impl tabled::Tabled for Solid3DGetAllOppositeEdges {
)]
pub struct Solid3DGetNextAdjacentEdge {
#[doc = "The UUID of the edge."]
pub edge: uuid::Uuid,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub edge: Option<uuid::Uuid>,
}

impl std::fmt::Display for Solid3DGetNextAdjacentEdge {
Expand All @@ -8742,7 +8795,11 @@ impl std::fmt::Display for Solid3DGetNextAdjacentEdge {
impl tabled::Tabled for Solid3DGetNextAdjacentEdge {
const LENGTH: usize = 1;
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
vec![format!("{:?}", self.edge).into()]
vec![if let Some(edge) = &self.edge {
format!("{:?}", edge).into()

Check warning on line 8799 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L8798-L8799

Added lines #L8798 - L8799 were not covered by tests
} else {
String::new().into()

Check warning on line 8801 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L8801

Added line #L8801 was not covered by tests
}]
}

fn headers() -> Vec<std::borrow::Cow<'static, str>> {
Expand Down Expand Up @@ -8787,7 +8844,8 @@ impl tabled::Tabled for Solid3DGetOppositeEdge {
)]
pub struct Solid3DGetPrevAdjacentEdge {
#[doc = "The UUID of the edge."]
pub edge: uuid::Uuid,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub edge: Option<uuid::Uuid>,
}

impl std::fmt::Display for Solid3DGetPrevAdjacentEdge {
Expand All @@ -8804,7 +8862,11 @@ impl std::fmt::Display for Solid3DGetPrevAdjacentEdge {
impl tabled::Tabled for Solid3DGetPrevAdjacentEdge {
const LENGTH: usize = 1;
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
vec![format!("{:?}", self.edge).into()]
vec![if let Some(edge) = &self.edge {
format!("{:?}", edge).into()

Check warning on line 8866 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L8865-L8866

Added lines #L8865 - L8866 were not covered by tests
} else {
String::new().into()

Check warning on line 8868 in kittycad/src/types.rs

View check run for this annotation

Codecov / codecov/patch

kittycad/src/types.rs#L8868

Added line #L8868 was not covered by tests
}]
}

fn headers() -> Vec<std::borrow::Cow<'static, str>> {
Expand Down
Loading

0 comments on commit 0cc3f59

Please sign in to comment.