Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <github@jessfraz.com>
  • Loading branch information
jessfraz committed Jul 28, 2024
1 parent d7fc44f commit 557ab47
Show file tree
Hide file tree
Showing 22 changed files with 611 additions and 612 deletions.
830 changes: 369 additions & 461 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.8
0.3.9
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.3.8\""
"install": "[dependencies]\nkittycad = \"0.3.9\""
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions 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.3.8"
version = "0.3.9"
documentation = "https://docs.rs/kittycad"
readme = "README.md"
repository = "https://github.com/KittyCAD/kittycad.rs/tree/main/kittycad"
Expand All @@ -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.10", 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
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.3.8"
kittycad = "0.3.9"
```

## Basic example
Expand Down
18 changes: 9 additions & 9 deletions kittycad/src/ai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Ai {
) -> Result<crate::types::AiPromptResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "ai-prompts"),
&format!("{}/{}", self.client.base_url, "ai-prompts"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -84,7 +84,7 @@ impl Ai {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "ai-prompts"),
&format!("{}/{}", self.client.base_url, "ai-prompts"),
);
req = req.bearer_auth(&self.client.token);
let mut request = req.build()?;
Expand Down Expand Up @@ -144,7 +144,7 @@ impl Ai {
) -> Result<crate::types::AiPrompt, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"ai-prompts/{id}".replace("{id}", &format!("{}", id))
Expand Down Expand Up @@ -178,7 +178,7 @@ impl Ai {
) -> Result<crate::types::KclCodeCompletionResponse, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "ai/kcl/completions"),
&format!("{}/{}", self.client.base_url, "ai/kcl/completions"),
);
req = req.bearer_auth(&self.client.token);
req = req.json(body);
Expand Down Expand Up @@ -210,7 +210,7 @@ impl Ai {
) -> Result<crate::types::TextToCad, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!(
&format!(
"{}/{}",
self.client.base_url,
"ai/text-to-cad/{output_format}"
Expand Down Expand Up @@ -249,7 +249,7 @@ impl Ai {
) -> Result<crate::types::TextToCadResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "user/text-to-cad"),
&format!("{}/{}", self.client.base_url, "user/text-to-cad"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -316,7 +316,7 @@ impl Ai {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "user/text-to-cad"),
&format!("{}/{}", self.client.base_url, "user/text-to-cad"),
);
req = req.bearer_auth(&self.client.token);
let mut request = req.build()?;
Expand Down Expand Up @@ -378,7 +378,7 @@ impl Ai {
) -> Result<crate::types::TextToCad, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"user/text-to-cad/{id}".replace("{id}", &format!("{}", id))
Expand Down Expand Up @@ -423,7 +423,7 @@ impl Ai {
) -> Result<(), crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!(
&format!(
"{}/{}",
self.client.base_url,
"user/text-to-cad/{id}".replace("{id}", &format!("{}", id))
Expand Down
30 changes: 15 additions & 15 deletions kittycad/src/api_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl ApiCalls {
) -> Result<Vec<crate::types::ApiCallQueryGroup>, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "api-call-metrics"),
&format!("{}/{}", self.client.base_url, "api-call-metrics"),
);
req = req.bearer_auth(&self.client.token);
let query_params = vec![("group_by", format!("{}", group_by))];
Expand Down Expand Up @@ -54,7 +54,7 @@ impl ApiCalls {
) -> Result<crate::types::ApiCallWithPriceResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "api-calls"),
&format!("{}/{}", self.client.base_url, "api-calls"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -117,7 +117,7 @@ impl ApiCalls {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "api-calls"),
&format!("{}/{}", self.client.base_url, "api-calls"),
);
req = req.bearer_auth(&self.client.token);
let mut request = req.build()?;
Expand Down Expand Up @@ -170,7 +170,7 @@ impl ApiCalls {
) -> Result<crate::types::ApiCallWithPrice, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"api-calls/{id}".replace("{id}", &format!("{}", id))
Expand Down Expand Up @@ -207,7 +207,7 @@ impl ApiCalls {
) -> Result<crate::types::AsyncApiCallResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "async/operations"),
&format!("{}/{}", self.client.base_url, "async/operations"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -274,7 +274,7 @@ impl ApiCalls {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "async/operations"),
&format!("{}/{}", self.client.base_url, "async/operations"),
);
req = req.bearer_auth(&self.client.token);
let mut request = req.build()?;
Expand Down Expand Up @@ -338,7 +338,7 @@ impl ApiCalls {
) -> Result<crate::types::AsyncApiCallOutput, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"async/operations/{id}".replace("{id}", &format!("{}", id))
Expand Down Expand Up @@ -374,7 +374,7 @@ impl ApiCalls {
) -> Result<crate::types::ApiCallWithPriceResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "org/api-calls"),
&format!("{}/{}", self.client.base_url, "org/api-calls"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -437,7 +437,7 @@ impl ApiCalls {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "org/api-calls"),
&format!("{}/{}", self.client.base_url, "org/api-calls"),
);
req = req.bearer_auth(&self.client.token);
let mut request = req.build()?;
Expand Down Expand Up @@ -490,7 +490,7 @@ impl ApiCalls {
) -> Result<crate::types::ApiCallWithPrice, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"org/api-calls/{id}".replace("{id}", &format!("{}", id))
Expand Down Expand Up @@ -526,7 +526,7 @@ impl ApiCalls {
) -> Result<crate::types::ApiCallWithPriceResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "user/api-calls"),
&format!("{}/{}", self.client.base_url, "user/api-calls"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -589,7 +589,7 @@ impl ApiCalls {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "user/api-calls"),
&format!("{}/{}", self.client.base_url, "user/api-calls"),
);
req = req.bearer_auth(&self.client.token);
let mut request = req.build()?;
Expand Down Expand Up @@ -650,7 +650,7 @@ impl ApiCalls {
) -> Result<crate::types::ApiCallWithPrice, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"user/api-calls/{id}".replace("{id}", &format!("{}", id))
Expand Down Expand Up @@ -687,7 +687,7 @@ impl ApiCalls {
) -> Result<crate::types::ApiCallWithPriceResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"users/{id}/api-calls".replace("{id}", id)
Expand Down Expand Up @@ -755,7 +755,7 @@ impl ApiCalls {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"users/{id}/api-calls".replace("{id}", id)
Expand Down
10 changes: 5 additions & 5 deletions kittycad/src/api_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl ApiTokens {
) -> Result<crate::types::ApiTokenResultsPage, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "user/api-tokens"),
&format!("{}/{}", self.client.base_url, "user/api-tokens"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -84,7 +84,7 @@ impl ApiTokens {
async {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "user/api-tokens"),
&format!("{}/{}", self.client.base_url, "user/api-tokens"),
);
req = req.bearer_auth(&self.client.token);
let mut request = req.build()?;
Expand Down Expand Up @@ -144,7 +144,7 @@ impl ApiTokens {
) -> Result<crate::types::ApiToken, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "user/api-tokens"),
&format!("{}/{}", self.client.base_url, "user/api-tokens"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![];
Expand Down Expand Up @@ -180,7 +180,7 @@ impl ApiTokens {
) -> Result<crate::types::ApiToken, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!(
&format!(
"{}/{}",
self.client.base_url,
"user/api-tokens/{token}".replace("{token}", &format!("{}", token))
Expand Down Expand Up @@ -224,7 +224,7 @@ impl ApiTokens {
) -> Result<(), crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::DELETE,
format!(
&format!(
"{}/{}",
self.client.base_url,
"user/api-tokens/{token}".replace("{token}", &format!("{}", token))
Expand Down
6 changes: 3 additions & 3 deletions kittycad/src/apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Apps {
) -> Result<(), crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "apps/github/callback"),
&format!("{}/{}", self.client.base_url, "apps/github/callback"),
);
req = req.bearer_auth(&self.client.token);
req = req.json(body);
Expand Down Expand Up @@ -58,7 +58,7 @@ impl Apps {
) -> Result<crate::types::AppClientInfo, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
format!("{}/{}", self.client.base_url, "apps/github/consent"),
&format!("{}/{}", self.client.base_url, "apps/github/consent"),
);
req = req.bearer_auth(&self.client.token);
let resp = req.send().await?;
Expand Down Expand Up @@ -88,7 +88,7 @@ impl Apps {
) -> Result<(), crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "apps/github/webhook"),
&format!("{}/{}", self.client.base_url, "apps/github/webhook"),
);
req = req.bearer_auth(&self.client.token);
req = req.body(body.clone());
Expand Down
2 changes: 1 addition & 1 deletion kittycad/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Executor {
) -> Result<crate::types::CodeOutput, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!(
&format!(
"{}/{}",
self.client.base_url,
"file/execute/{lang}".replace("{lang}", &format!("{}", lang))
Expand Down
12 changes: 6 additions & 6 deletions kittycad/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl File {
) -> Result<crate::types::FileCenterOfMass, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "file/center-of-mass"),
&format!("{}/{}", self.client.base_url, "file/center-of-mass"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![("src_format", format!("{}", src_format))];
Expand Down Expand Up @@ -78,7 +78,7 @@ impl File {
) -> Result<crate::types::FileConversion, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!(
&format!(
"{}/{}",
self.client.base_url,
"file/conversion/{src_format}/{output_format}"
Expand Down Expand Up @@ -141,7 +141,7 @@ impl File {
) -> Result<crate::types::FileDensity, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "file/density"),
&format!("{}/{}", self.client.base_url, "file/density"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![
Expand Down Expand Up @@ -189,7 +189,7 @@ impl File {
) -> Result<crate::types::FileMass, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "file/mass"),
&format!("{}/{}", self.client.base_url, "file/mass"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![
Expand Down Expand Up @@ -252,7 +252,7 @@ impl File {
) -> Result<crate::types::FileSurfaceArea, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "file/surface-area"),
&format!("{}/{}", self.client.base_url, "file/surface-area"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![("src_format", format!("{}", src_format))];
Expand Down Expand Up @@ -308,7 +308,7 @@ impl File {
) -> Result<crate::types::FileVolume, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::POST,
format!("{}/{}", self.client.base_url, "file/volume"),
&format!("{}/{}", self.client.base_url, "file/volume"),
);
req = req.bearer_auth(&self.client.token);
let mut query_params = vec![("src_format", format!("{}", src_format))];
Expand Down
Loading

0 comments on commit 557ab47

Please sign in to comment.