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 20, 2023
1 parent e365307 commit ae9e383
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 242 deletions.
9 changes: 8 additions & 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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION = $(shell cat VERSION.txt)

generate: kittycad
cargo clippy --all
cargo nextest run --no-capture --all-features
cargo nextest run --no-capture --all-features --no-fail-fast

target/debug/openapitor: openapitor/src/*.rs openapitor/src/*/*.rs openapitor/Cargo.toml spec.json
cargo build --bin openapitor
Expand Down
24 changes: 20 additions & 4 deletions 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.35\""
"install": "[dependencies]\nkittycad = \"0.2.36\""
}
},
{
Expand Down Expand Up @@ -175,6 +175,14 @@
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/file/struct.File.html#method.create_volume"
}
},
{
"op": "add",
"path": "/paths/~1internal~1discord~1api-token~1{discord_id}/get/x-rust",
"value": {
"example": "/// Get an API token for a user by their discord id.\n/// \n/// This endpoint allows us to run API calls from our discord bot on behalf of a user. The user must have a discord account linked to their KittyCAD Account via oauth2 for this to work.\n/// You must be a KittyCAD employee to use this endpoint.\n/// \n/// **Parameters:**\n/// \n/// - `discord_id: &'astr`: The user's discord ID. (required)\nasync fn example_meta_internal_get_api_token_for_discord_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::ApiToken = client\n .meta()\n .internal_get_api_token_for_discord_user(\"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/meta/struct.Meta.html#method.internal_get_api_token_for_discord_user"
}
},
{
"op": "add",
"path": "/paths/~1logout/post/x-rust",
Expand Down Expand Up @@ -467,15 +475,15 @@
"op": "add",
"path": "/paths/~1user~1payment/post/x-rust",
"value": {
"example": "/// Create payment info for your user.\n/// \n/// This includes billing address, phone, and name.\n/// This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.\nuse std::str::FromStr;\nasync fn example_payments_create_information_for_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::Customer = client\n .payments()\n .create_information_for_user(&kittycad::types::BillingInfo {\n address: Some(kittycad::types::NewAddress {\n city: Some(\"some-string\".to_string()),\n country: \"some-string\".to_string(),\n state: Some(\"some-string\".to_string()),\n street_1: Some(\"some-string\".to_string()),\n street_2: Some(\"some-string\".to_string()),\n user_id: Some(\"some-string\".to_string()),\n zip: Some(\"some-string\".to_string()),\n }),\n name: Some(\"some-string\".to_string()),\n phone: kittycad::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"example": "/// Create payment info for your user.\n/// \n/// This includes billing address, phone, and name.\n/// This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.\nuse std::str::FromStr;\nasync fn example_payments_create_information_for_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::Customer = client\n .payments()\n .create_information_for_user(&kittycad::types::BillingInfo {\n address: Some(kittycad::types::NewAddress {\n city: Some(\"some-string\".to_string()),\n country: \"some-string\".to_string(),\n state: Some(\"some-string\".to_string()),\n street_1: Some(\"some-string\".to_string()),\n street_2: Some(\"some-string\".to_string()),\n user_id: uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n zip: Some(\"some-string\".to_string()),\n }),\n name: Some(\"some-string\".to_string()),\n phone: kittycad::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/payments/struct.Payments.html#method.create_information_for_user"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/put/x-rust",
"value": {
"example": "/// Update payment info for your user.\n/// \n/// This includes billing address, phone, and name.\n/// This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.\nuse std::str::FromStr;\nasync fn example_payments_update_information_for_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::Customer = client\n .payments()\n .update_information_for_user(&kittycad::types::BillingInfo {\n address: Some(kittycad::types::NewAddress {\n city: Some(\"some-string\".to_string()),\n country: \"some-string\".to_string(),\n state: Some(\"some-string\".to_string()),\n street_1: Some(\"some-string\".to_string()),\n street_2: Some(\"some-string\".to_string()),\n user_id: Some(\"some-string\".to_string()),\n zip: Some(\"some-string\".to_string()),\n }),\n name: Some(\"some-string\".to_string()),\n phone: kittycad::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"example": "/// Update payment info for your user.\n/// \n/// This includes billing address, phone, and name.\n/// This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.\nuse std::str::FromStr;\nasync fn example_payments_update_information_for_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::Customer = client\n .payments()\n .update_information_for_user(&kittycad::types::BillingInfo {\n address: Some(kittycad::types::NewAddress {\n city: Some(\"some-string\".to_string()),\n country: \"some-string\".to_string(),\n state: Some(\"some-string\".to_string()),\n street_1: Some(\"some-string\".to_string()),\n street_2: Some(\"some-string\".to_string()),\n user_id: uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n zip: Some(\"some-string\".to_string()),\n }),\n name: Some(\"some-string\".to_string()),\n phone: kittycad::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/payments/struct.Payments.html#method.update_information_for_user"
}
},
Expand Down Expand Up @@ -539,10 +547,18 @@
"op": "add",
"path": "/paths/~1user~1text-to-cad/get/x-rust",
"value": {
"example": "/// List text-to-CAD models you've generated.\n/// \n/// This will always return the STEP file contents as well as the format the user originally requested.\n/// This endpoint requires authentication by any KittyCAD user. It returns the text-to-CAD models for the authenticated user.\n/// The text-to-CAD models are returned in order of creation, with the most recently created text-to-CAD models first.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option<u32>`: Maximum number of items returned by a single call\n/// - `page_token: Option<String>`: Token returned by previous call to retrieve the subsequent page\n/// - `sort_by: Option<crate::types::CreatedAtSortMode>`\nasync fn example_ai_list_text_to_cad_models_for_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::TextToCadResultsPage = client\n .ai()\n .list_text_to_cad_models_for_user(\n Some(4 as u32),\n Some(\"some-string\".to_string()),\n Some(kittycad::types::CreatedAtSortMode::CreatedAtDescending),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n\n\n/// - OR -\n\n/// Get a stream of results.\n///\n/// This allows you to paginate through all the items.\nuse futures_util::TryStreamExt;\nasync fn example_ai_list_text_to_cad_models_for_user_stream() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let mut ai = client.ai();\n let mut stream = ai.list_text_to_cad_models_for_user_stream(\n Some(4 as u32),\n Some(kittycad::types::CreatedAtSortMode::CreatedAtDescending),\n );\n loop {\n match stream.try_next().await {\n Ok(Some(item)) => {\n println!(\"{:?}\", item);\n }\n Ok(None) => {\n break;\n }\n Err(err) => {\n return Err(err.into());\n }\n }\n }\n\n Ok(())\n}\n",
"example": "/// List text-to-CAD models you've generated.\n/// \n/// This will always return the STEP file contents as well as the format the user originally requested.\n/// This endpoint requires authentication by any KittyCAD user. It returns the text-to-CAD models for the authenticated user.\n/// The text-to-CAD models are returned in order of creation, with the most recently created text-to-CAD models first.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option<u32>`: Maximum number of items returned by a single call\n/// - `no_contents: Option<bool>`: Do not return the model contents only return the metadata. By default, the model contents are returned.\n/// - `page_token: Option<String>`: Token returned by previous call to retrieve the subsequent page\n/// - `sort_by: Option<crate::types::CreatedAtSortMode>`\nasync fn example_ai_list_text_to_cad_models_for_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::TextToCadResultsPage = client\n .ai()\n .list_text_to_cad_models_for_user(\n Some(4 as u32),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(kittycad::types::CreatedAtSortMode::CreatedAtDescending),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n\n\n/// - OR -\n\n/// Get a stream of results.\n///\n/// This allows you to paginate through all the items.\nuse futures_util::TryStreamExt;\nasync fn example_ai_list_text_to_cad_models_for_user_stream() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let mut ai = client.ai();\n let mut stream = ai.list_text_to_cad_models_for_user_stream(\n Some(4 as u32),\n Some(false),\n Some(kittycad::types::CreatedAtSortMode::CreatedAtDescending),\n );\n loop {\n match stream.try_next().await {\n Ok(Some(item)) => {\n println!(\"{:?}\", item);\n }\n Ok(None) => {\n break;\n }\n Err(err) => {\n return Err(err.into());\n }\n }\n }\n\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/ai/struct.Ai.html#method.list_text_to_cad_models_for_user"
}
},
{
"op": "add",
"path": "/paths/~1user~1text-to-cad~1{id}/get/x-rust",
"value": {
"example": "/// Get a text-to-CAD response.\n/// \n/// This endpoint requires authentication by any KittyCAD user. The user must be the owner of the text-to-CAD model.\n/// \n/// **Parameters:**\n/// \n/// - `id: uuid::Uuid`: The id of the model to give feedback to. (required)\nuse std::str::FromStr;\nasync fn example_ai_get_text_to_cad_model_for_user() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::TextToCad = client\n .ai()\n .get_text_to_cad_model_for_user(uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?)\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/ai/struct.Ai.html#method.get_text_to_cad_model_for_user"
}
},
{
"op": "add",
"path": "/paths/~1user~1text-to-cad~1{id}/post/x-rust",
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.2.35"
version = "0.2.36"
documentation = "https://docs.rs/kittycad"
readme = "README.md"
repository = "https://github.com/KittyCAD/kittycad.rs/tree/main/kittycad"
Expand Down Expand Up @@ -40,7 +40,7 @@ tabled = { version = "0.14.0", features = ["color"], optional = true }
thiserror = "1"
tracing = { version = "^0.1", optional = true }
url = { version = "2", features = ["serde"] }
uuid = { version = "1", features = ["serde", "v4"] }
uuid = { version = "1", features = ["serde", "v4", "v7"] }

[dev-dependencies]
expectorate = "1"
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.35"
kittycad = "0.2.36"
```

## Basic example
Expand Down
Loading

0 comments on commit ae9e383

Please sign in to comment.