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 0aa33ae commit c2454cd
Show file tree
Hide file tree
Showing 21 changed files with 447 additions and 90 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.36
0.2.37
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.36\""
"install": "[dependencies]\nkittycad = \"0.2.37\""
}
},
{
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.36"
version = "0.2.37"
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.36"
kittycad = "0.2.37"
```

## Basic example
Expand Down
30 changes: 25 additions & 5 deletions kittycad/src/ai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ impl Ai {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -88,7 +92,11 @@ impl Ai {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -134,7 +142,11 @@ impl Ai {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
})
}
}
.map_ok(|result: crate::types::TextToCadResultsPage| {
Expand Down Expand Up @@ -190,7 +202,11 @@ impl Ai {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -227,7 +243,11 @@ impl Ai {
if status.is_success() {
Ok(())
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}
}
72 changes: 60 additions & 12 deletions kittycad/src/api_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -78,7 +82,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -124,7 +132,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
})
}
}
.map_ok(|result: crate::types::ApiCallWithPriceResultsPage| {
Expand Down Expand Up @@ -171,7 +183,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -218,7 +234,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -264,7 +284,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
})
}
}
.map_ok(|result: crate::types::AsyncApiCallResultsPage| {
Expand Down Expand Up @@ -321,7 +345,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -363,7 +391,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -409,7 +441,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
})
}
}
.map_ok(|result: crate::types::ApiCallWithPriceResultsPage| {
Expand Down Expand Up @@ -463,7 +499,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -510,7 +550,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -561,7 +605,11 @@ impl ApiCalls {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
})
}
}
.map_ok(|result: crate::types::ApiCallWithPriceResultsPage| {
Expand Down
30 changes: 25 additions & 5 deletions kittycad/src/api_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ impl ApiTokens {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -95,7 +99,11 @@ impl ApiTokens {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
})
}
}
.map_ok(|result: crate::types::ApiTokenResultsPage| {
Expand Down Expand Up @@ -137,7 +145,11 @@ impl ApiTokens {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -167,7 +179,11 @@ impl ApiTokens {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -201,7 +217,11 @@ impl ApiTokens {
if status.is_success() {
Ok(())
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}
}
18 changes: 15 additions & 3 deletions kittycad/src/apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ impl Apps {
if status.is_success() {
Ok(())
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down Expand Up @@ -68,7 +72,11 @@ impl Apps {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand All @@ -89,7 +97,11 @@ impl Apps {
if status.is_success() {
Ok(())
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}
}
6 changes: 5 additions & 1 deletion kittycad/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ impl Executor {
)
})
} else {
Err(crate::types::error::Error::UnexpectedResponse(resp))
let text = resp.text().await.unwrap_or_default();
return Err(crate::types::error::Error::Server {
body: text.to_string(),
status,
});
}
}

Expand Down
Loading

0 comments on commit c2454cd

Please sign in to comment.