From 7e45dec21e9de8e5ffd5388339289053c8f5a7a9 Mon Sep 17 00:00:00 2001 From: Adam Chalmers Date: Wed, 20 Sep 2023 09:09:43 -0500 Subject: [PATCH] Use bigdecimal04 feature of schemars (bigdecimal on its own is 0.3) --- Cargo.lock | 22 +- kittycad.rs.patch.json | 16 - kittycad/Cargo.toml | 3 +- kittycad/src/ai.rs | 8 +- kittycad/src/api_calls.rs | 46 +- kittycad/src/api_tokens.rs | 14 +- kittycad/src/apps.rs | 7 +- kittycad/src/executor.rs | 3 +- kittycad/src/file.rs | 18 +- kittycad/src/hidden.rs | 11 +- kittycad/src/lib.rs | 2 +- kittycad/src/meta.rs | 15 +- kittycad/src/modeling.rs | 65 -- kittycad/src/oauth2.rs | 15 +- kittycad/src/payments.rs | 29 +- kittycad/src/types.rs | 1500 ++---------------------------------- kittycad/src/unit.rs | 39 +- kittycad/src/users.rs | 42 +- openapitor/Cargo.toml | 2 +- openapitor/src/lib.rs | 4 +- 20 files changed, 258 insertions(+), 1603 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a01994..fab40f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,13 +190,16 @@ checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" [[package]] name = "bigdecimal" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +checksum = "454bca3db10617b88b566f205ed190aedb0e0e6dd4cad61d3988a72e8c5594cb" dependencies = [ + "autocfg", + "libm", "num-bigint", "num-integer", "num-traits", + "serde", ] [[package]] @@ -957,6 +960,7 @@ dependencies = [ "anyhow", "async-trait", "base64", + "bigdecimal", "bytes", "chrono", "clap", @@ -1004,6 +1008,12 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1811,9 +1821,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.13" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" +checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" dependencies = [ "bigdecimal", "bytes", @@ -1828,9 +1838,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.13" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" +checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" dependencies = [ "proc-macro2", "quote", diff --git a/kittycad.rs.patch.json b/kittycad.rs.patch.json index 0e46c08..94b9f94 100644 --- a/kittycad.rs.patch.json +++ b/kittycad.rs.patch.json @@ -191,22 +191,6 @@ "libDocsLink": "https://docs.rs/kittycad/latest/kittycad/hidden/struct.Hidden.html#method.logout" } }, - { - "op": "add", - "path": "/paths/~1modeling~1cmd/post/x-rust", - "value": { - "example": "/// Submit one modeling operation.\n/// \n/// Response depends on which command was submitted, so unfortunately the OpenAPI schema can't generate the right response type.\nuse std::str::FromStr;\nasync fn example_modeling_cmd() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::OkModelingCmdResponse = client\n .modeling()\n .cmd(&kittycad::types::ModelingCmdReq {\n cmd: kittycad::types::ModelingCmd::CameraDragEnd {\n interaction: kittycad::types::CameraDragInteractionType::Zoom,\n window: kittycad::types::Point2D {\n x: 3.14 as f64,\n y: 3.14 as f64,\n },\n },\n cmd_id: uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/kittycad/latest/kittycad/modeling/struct.Modeling.html#method.cmd" - } - }, - { - "op": "add", - "path": "/paths/~1modeling~1cmd-batch/post/x-rust", - "value": { - "example": "/// Submit many modeling operations.\nuse std::str::FromStr;\nasync fn example_modeling_cmd_batch() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::ModelingOutcomes = client\n .modeling()\n .cmd_batch(&kittycad::types::ModelingCmdReqBatch {\n cmds: std::collections::HashMap::from([(\n \"some-key\".to_string(),\n kittycad::types::ModelingCmdReq {\n cmd: kittycad::types::ModelingCmd::CameraDragEnd {\n interaction: kittycad::types::CameraDragInteractionType::Zoom,\n window: kittycad::types::Point2D {\n x: 3.14 as f64,\n y: 3.14 as f64,\n },\n },\n cmd_id: uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n },\n )]),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/kittycad/latest/kittycad/modeling/struct.Modeling.html#method.cmd_batch" - } - }, { "op": "add", "path": "/paths/~1oauth2~1device~1auth/post/x-rust", diff --git a/kittycad/Cargo.toml b/kittycad/Cargo.toml index 9753da7..6b12a3b 100644 --- a/kittycad/Cargo.toml +++ b/kittycad/Cargo.toml @@ -12,6 +12,7 @@ license = "MIT" anyhow = "1" async-trait = { version = "^0.1.53", optional = true } base64 = "0.21" +bigdecimal = { version = "0.4", features = ["serde"] } bytes = { version = "1", features = ["serde"] } clap = { version = "4.2.4", features = ["cargo", "derive", "env", "unicode"], optional = true } chrono = { version = "0.4", default-features = false, features = ["serde", "std"] } @@ -30,7 +31,7 @@ reqwest-conditional-middleware = { version = "0.2.1", optional = true } reqwest-middleware = { version = "0.2.2", optional = true } reqwest-retry = { version = "0.2.2", optional = true } reqwest-tracing = { version = "0.4.4", features = ["opentelemetry_0_17"], optional = true } -schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } +schemars = { version = "0.8.15", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } serde_bytes = "0.11" serde_json = "1" diff --git a/kittycad/src/ai.rs b/kittycad/src/ai.rs index c6f0f35..7656336 100644 --- a/kittycad/src/ai.rs +++ b/kittycad/src/ai.rs @@ -22,7 +22,7 @@ impl Ai { ) -> Result { let mut req = self.client.client.request( http::Method::POST, - format!( + &format!( "{}/{}", self.client.base_url, "ai/image-to-3d/{input_format}/{output_format}" @@ -41,6 +41,7 @@ impl Ai { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -56,7 +57,7 @@ impl Ai { ) -> Result { let mut req = self.client.client.request( http::Method::POST, - format!( + &format!( "{}/{}", self.client.base_url, "ai/text-to-3d/{output_format}" @@ -64,7 +65,7 @@ impl Ai { ), ); req = req.bearer_auth(&self.client.token); - let query_params = vec![("prompt", prompt.to_string())]; + let query_params = vec![("prompt", format!("{}", prompt))]; req = req.query(&query_params); let resp = req.send().await?; let status = resp.status(); @@ -75,6 +76,7 @@ impl Ai { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/kittycad/src/api_calls.rs b/kittycad/src/api_calls.rs index aa33673..86816d9 100644 --- a/kittycad/src/api_calls.rs +++ b/kittycad/src/api_calls.rs @@ -20,7 +20,7 @@ impl ApiCalls { ) -> Result, 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))]; @@ -34,6 +34,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -50,7 +51,7 @@ impl ApiCalls { ) -> Result { 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![]; @@ -76,6 +77,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -105,7 +107,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()?; @@ -122,6 +124,7 @@ impl ApiCalls { ), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -153,10 +156,10 @@ impl ApiCalls { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, - "api-calls/{id}".replace("{id}", id) + "api-calls/{id}".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -169,6 +172,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -186,7 +190,7 @@ impl ApiCalls { ) -> Result { 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![]; @@ -216,6 +220,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -245,7 +250,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()?; @@ -262,6 +267,7 @@ impl ApiCalls { ), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -303,10 +309,10 @@ impl ApiCalls { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, - "async/operations/{id}".replace("{id}", id) + "async/operations/{id}".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -319,6 +325,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -335,7 +342,7 @@ impl ApiCalls { ) -> Result { 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![]; @@ -361,6 +368,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -390,7 +398,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()?; @@ -407,6 +415,7 @@ impl ApiCalls { ), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -445,10 +454,10 @@ impl ApiCalls { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, - "user/api-calls/{id}".replace("{id}", id) + "user/api-calls/{id}".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -461,6 +470,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -478,10 +488,10 @@ impl ApiCalls { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, - "users/{id}/api-calls".replace("{id}", id) + "users/{id}/api-calls".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -508,6 +518,7 @@ impl ApiCalls { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -538,10 +549,10 @@ 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) + "users/{id}/api-calls".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -559,6 +570,7 @@ impl ApiCalls { ), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/kittycad/src/api_tokens.rs b/kittycad/src/api_tokens.rs index 70271ee..849ab45 100644 --- a/kittycad/src/api_tokens.rs +++ b/kittycad/src/api_tokens.rs @@ -22,7 +22,7 @@ impl ApiTokens { ) -> Result { 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![]; @@ -48,6 +48,7 @@ impl ApiTokens { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -76,7 +77,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()?; @@ -93,6 +94,7 @@ impl ApiTokens { ), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -123,7 +125,7 @@ impl ApiTokens { ) -> Result { 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 resp = req.send().await?; @@ -135,6 +137,7 @@ impl ApiTokens { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -149,7 +152,7 @@ impl ApiTokens { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "user/api-tokens/{token}".replace("{token}", &format!("{}", token)) @@ -165,6 +168,7 @@ impl ApiTokens { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -189,7 +193,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)) diff --git a/kittycad/src/apps.rs b/kittycad/src/apps.rs index c2048ab..c5ea356 100644 --- a/kittycad/src/apps.rs +++ b/kittycad/src/apps.rs @@ -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); @@ -54,7 +54,7 @@ impl Apps { ) -> Result { 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?; @@ -66,6 +66,7 @@ impl Apps { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -80,7 +81,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()); diff --git a/kittycad/src/executor.rs b/kittycad/src/executor.rs index 8c836c2..1fee158 100644 --- a/kittycad/src/executor.rs +++ b/kittycad/src/executor.rs @@ -33,7 +33,7 @@ impl Executor { ) -> Result { let mut req = self.client.client.request( http::Method::POST, - format!( + &format!( "{}/{}", self.client.base_url, "file/execute/{lang}".replace("{lang}", &format!("{}", lang)) @@ -56,6 +56,7 @@ impl Executor { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/kittycad/src/file.rs b/kittycad/src/file.rs index 51e3858..ed6b609 100644 --- a/kittycad/src/file.rs +++ b/kittycad/src/file.rs @@ -22,7 +22,7 @@ impl File { ) -> Result { 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))]; @@ -41,6 +41,7 @@ impl File { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -74,7 +75,7 @@ impl File { ) -> Result { let mut req = self.client.client.request( http::Method::POST, - format!( + &format!( "{}/{}", self.client.base_url, "file/conversion/{src_format}/{output_format}" @@ -93,6 +94,7 @@ impl File { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -133,7 +135,7 @@ impl File { ) -> Result { 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![ @@ -159,6 +161,7 @@ impl File { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -177,7 +180,7 @@ impl File { ) -> Result { 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![ @@ -203,6 +206,7 @@ impl File { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -236,7 +240,7 @@ impl File { ) -> Result { 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))]; @@ -255,6 +259,7 @@ impl File { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -288,7 +293,7 @@ impl File { ) -> Result { 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))]; @@ -307,6 +312,7 @@ impl File { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/kittycad/src/hidden.rs b/kittycad/src/hidden.rs index 04b689c..1754fc3 100644 --- a/kittycad/src/hidden.rs +++ b/kittycad/src/hidden.rs @@ -20,7 +20,7 @@ impl Hidden { ) -> Result { let mut req = self.client.client.request( http::Method::POST, - format!("{}/{}", self.client.base_url, "auth/email"), + &format!("{}/{}", self.client.base_url, "auth/email"), ); req = req.bearer_auth(&self.client.token); req = req.json(body); @@ -33,6 +33,7 @@ impl Hidden { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -49,12 +50,12 @@ impl Hidden { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "auth/email/callback"), + &format!("{}/{}", self.client.base_url, "auth/email/callback"), ); req = req.bearer_auth(&self.client.token); let mut query_params = vec![ - ("email", email.to_string()), - ("token", token.to_string()), + ("email", format!("{}", email)), + ("token", format!("{}", token)), ]; if let Some(p) = callback_url { query_params.push(("callback_url", p)); @@ -78,7 +79,7 @@ impl Hidden { pub async fn logout<'a>(&'a self) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::POST, - format!("{}/{}", self.client.base_url, "logout"), + &format!("{}/{}", self.client.base_url, "logout"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; diff --git a/kittycad/src/lib.rs b/kittycad/src/lib.rs index bd474b0..2af85a0 100644 --- a/kittycad/src/lib.rs +++ b/kittycad/src/lib.rs @@ -339,7 +339,7 @@ impl Client { format!("{}/{}", self.base_url, uri.trim_start_matches('/')) }; - let mut req = self.client.request(method, u); + let mut req = self.client.request(method, &u); // Add in our authentication. req = req.bearer_auth(&self.token); diff --git a/kittycad/src/meta.rs b/kittycad/src/meta.rs index 913bb75..76590db 100644 --- a/kittycad/src/meta.rs +++ b/kittycad/src/meta.rs @@ -20,7 +20,7 @@ impl Meta { pub async fn get_schema<'a>(&'a self) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, ""), + &format!("{}/{}", self.client.base_url, ""), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -32,6 +32,7 @@ impl Meta { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -45,7 +46,7 @@ impl Meta { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, ".well-known/ai-plugin.json"), + &format!("{}/{}", self.client.base_url, ".well-known/ai-plugin.json"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -57,6 +58,7 @@ impl Meta { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -76,7 +78,7 @@ impl Meta { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "_meta/info"), + &format!("{}/{}", self.client.base_url, "_meta/info"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -88,6 +90,7 @@ impl Meta { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -106,7 +109,7 @@ impl Meta { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "openai/openapi.json"), + &format!("{}/{}", self.client.base_url, "openai/openapi.json"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -118,6 +121,7 @@ impl Meta { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -132,7 +136,7 @@ impl Meta { pub async fn ping<'a>(&'a self) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "ping"), + &format!("{}/{}", self.client.base_url, "ping"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -144,6 +148,7 @@ impl Meta { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/kittycad/src/modeling.rs b/kittycad/src/modeling.rs index 52a0dc4..233cf30 100644 --- a/kittycad/src/modeling.rs +++ b/kittycad/src/modeling.rs @@ -12,71 +12,6 @@ impl Modeling { Self { client } } - #[doc = "Submit one modeling operation.\n\nResponse depends on which command was submitted, so \ - unfortunately the OpenAPI schema can't generate the right response \ - type.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_modeling_cmd() -> \ - anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let \ - result: kittycad::types::OkModelingCmdResponse = client\n .modeling()\n \ - .cmd(&kittycad::types::ModelingCmdReq {\n cmd: \ - kittycad::types::ModelingCmd::CameraDragEnd {\n interaction: \ - kittycad::types::CameraDragInteractionType::Zoom,\n window: \ - kittycad::types::Point2D {\n x: 3.14 as f64,\n \ - y: 3.14 as f64,\n },\n },\n cmd_id: \ - uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n })\n \ - .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] - #[tracing::instrument] - pub async fn cmd<'a>( - &'a self, - body: &crate::types::ModelingCmdReq, - ) -> Result { - let mut req = self.client.client.request( - http::Method::POST, - format!("{}/{}", self.client.base_url, "modeling/cmd"), - ); - req = req.bearer_auth(&self.client.token); - req = req.json(body); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - Err(crate::types::error::Error::UnexpectedResponse(resp)) - } - } - - #[doc = "Submit many modeling operations.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_modeling_cmd_batch() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::ModelingOutcomes = client\n .modeling()\n .cmd_batch(&kittycad::types::ModelingCmdReqBatch {\n cmds: std::collections::HashMap::from([(\n \"some-key\".to_string(),\n kittycad::types::ModelingCmdReq {\n cmd: kittycad::types::ModelingCmd::CameraDragEnd {\n interaction: kittycad::types::CameraDragInteractionType::Zoom,\n window: kittycad::types::Point2D {\n x: 3.14 as f64,\n y: 3.14 as f64,\n },\n },\n cmd_id: uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n },\n )]),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] - #[tracing::instrument] - pub async fn cmd_batch<'a>( - &'a self, - body: &crate::types::ModelingCmdReqBatch, - ) -> Result { - let mut req = self.client.client.request( - http::Method::POST, - format!("{}/{}", self.client.base_url, "modeling/cmd-batch"), - ); - req = req.bearer_auth(&self.client.token); - req = req.json(body); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - Err(crate::types::error::Error::UnexpectedResponse(resp)) - } - } - #[doc = "Open a websocket which accepts modeling commands.\n\nPass those commands to the \ engine via websocket, and pass responses back to the client. Basically, this is a \ websocket proxy between the frontend/client and the engine.\n\n**Parameters:**\n\n- \ diff --git a/kittycad/src/oauth2.rs b/kittycad/src/oauth2.rs index a91eb98..c280797 100644 --- a/kittycad/src/oauth2.rs +++ b/kittycad/src/oauth2.rs @@ -28,7 +28,7 @@ impl Oauth2 { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::POST, - format!("{}/{}", self.client.base_url, "oauth2/device/auth"), + &format!("{}/{}", self.client.base_url, "oauth2/device/auth"), ); req = req.bearer_auth(&self.client.token); req = req.form(body); @@ -57,7 +57,7 @@ impl Oauth2 { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::POST, - format!("{}/{}", self.client.base_url, "oauth2/device/confirm"), + &format!("{}/{}", self.client.base_url, "oauth2/device/confirm"), ); req = req.bearer_auth(&self.client.token); req = req.json(body); @@ -78,7 +78,7 @@ impl Oauth2 { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::POST, - format!("{}/{}", self.client.base_url, "oauth2/device/token"), + &format!("{}/{}", self.client.base_url, "oauth2/device/token"), ); req = req.bearer_auth(&self.client.token); req = req.form(body); @@ -106,10 +106,10 @@ impl Oauth2 { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "oauth2/device/verify"), + &format!("{}/{}", self.client.base_url, "oauth2/device/verify"), ); req = req.bearer_auth(&self.client.token); - let query_params = vec![("user_code", user_code.to_string())]; + let query_params = vec![("user_code", format!("{}", user_code))]; req = req.query(&query_params); let resp = req.send().await?; let status = resp.status(); @@ -139,7 +139,7 @@ impl Oauth2 { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "oauth2/provider/{provider}/callback" @@ -184,7 +184,7 @@ impl Oauth2 { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "oauth2/provider/{provider}/consent" @@ -207,6 +207,7 @@ impl Oauth2 { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/kittycad/src/payments.rs b/kittycad/src/payments.rs index 7324714..8bc3b56 100644 --- a/kittycad/src/payments.rs +++ b/kittycad/src/payments.rs @@ -25,7 +25,7 @@ impl Payments { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/payment"), + &format!("{}/{}", self.client.base_url, "user/payment"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -37,6 +37,7 @@ impl Payments { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -68,7 +69,7 @@ impl Payments { ) -> Result { let mut req = self.client.client.request( http::Method::PUT, - format!("{}/{}", self.client.base_url, "user/payment"), + &format!("{}/{}", self.client.base_url, "user/payment"), ); req = req.bearer_auth(&self.client.token); req = req.json(body); @@ -81,6 +82,7 @@ impl Payments { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -112,7 +114,7 @@ impl Payments { ) -> Result { let mut req = self.client.client.request( http::Method::POST, - format!("{}/{}", self.client.base_url, "user/payment"), + &format!("{}/{}", self.client.base_url, "user/payment"), ); req = req.bearer_auth(&self.client.token); req = req.json(body); @@ -125,6 +127,7 @@ impl Payments { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -143,7 +146,7 @@ impl Payments { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::DELETE, - format!("{}/{}", self.client.base_url, "user/payment"), + &format!("{}/{}", self.client.base_url, "user/payment"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -162,7 +165,7 @@ impl Payments { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/payment/balance"), + &format!("{}/{}", self.client.base_url, "user/payment/balance"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -174,6 +177,7 @@ impl Payments { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -187,7 +191,7 @@ impl Payments { ) -> Result { let mut req = self.client.client.request( http::Method::POST, - format!("{}/{}", self.client.base_url, "user/payment/intent"), + &format!("{}/{}", self.client.base_url, "user/payment/intent"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -199,6 +203,7 @@ impl Payments { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -212,7 +217,7 @@ impl Payments { ) -> Result, crate::types::error::Error> { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/payment/invoices"), + &format!("{}/{}", self.client.base_url, "user/payment/invoices"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -224,6 +229,7 @@ impl Payments { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -237,7 +243,7 @@ impl Payments { ) -> Result, crate::types::error::Error> { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/payment/methods"), + &format!("{}/{}", self.client.base_url, "user/payment/methods"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -249,6 +255,7 @@ impl Payments { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -263,10 +270,10 @@ impl Payments { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::DELETE, - format!( + &format!( "{}/{}", self.client.base_url, - "user/payment/methods/{id}".replace("{id}", id) + "user/payment/methods/{id}".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -293,7 +300,7 @@ impl Payments { ) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/payment/tax"), + &format!("{}/{}", self.client.base_url, "user/payment/tax"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; diff --git a/kittycad/src/types.rs b/kittycad/src/types.rs index 3153d50..01c42f2 100644 --- a/kittycad/src/types.rs +++ b/kittycad/src/types.rs @@ -509,16 +509,18 @@ impl tabled::Tabled for AiPluginApi { )] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -#[derive(Default)] pub enum AiPluginApiType { #[doc = "An OpenAPI specification."] #[serde(rename = "openapi")] #[display("openapi")] - #[default] Openapi, } - +impl std::default::Default for AiPluginApiType { + fn default() -> Self { + AiPluginApiType::Openapi + } +} #[doc = "AI plugin auth information."] #[derive( @@ -1165,7 +1167,7 @@ pub struct ApiCallWithPrice { pub origin: Option, #[doc = "The price of the API call."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub price: Option, + pub price: Option, #[doc = "The request body sent by the API call."] #[serde(default, skip_serializing_if = "Option::is_none")] pub request_body: Option, @@ -2490,53 +2492,6 @@ impl tabled::Tabled for Color { } } -#[doc = "Commit holds the Git-commit (SHA1) that a binary was built from, as reported in the \ - version-string of external tools, such as `containerd`, or `runC`."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Commit { - #[doc = "Commit ID of external tool expected by dockerd as set at build time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub expected: Option, - #[doc = "Actual commit ID of external tool."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, -} - -impl std::fmt::Display for Commit { - 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 Commit { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(expected) = &self.expected { - format!("{:?}", expected).into() - } else { - String::new().into() - }, - if let Some(id) = &self.id { - format!("{:?}", id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["expected".into(), "id".into()] - } -} - #[doc = "Metadata about a pub-sub connection.\n\nThis is mostly used for internal purposes and \ debugging."] #[derive( @@ -2557,6 +2512,7 @@ pub struct Connection { #[doc = "The CPU core usage of the server."] #[serde(default, skip_serializing_if = "Option::is_none")] pub cores: Option, + #[doc = "The CPU usage of the server."] #[serde(default, skip_serializing_if = "Option::is_none")] pub cpu: Option, #[doc = "Information about the gateway."] @@ -2582,6 +2538,7 @@ pub struct Connection { #[doc = "The http port of the server."] #[serde(default, skip_serializing_if = "Option::is_none")] pub http_port: Option, + #[doc = "HTTP request statistics."] pub http_req_stats: std::collections::HashMap, #[doc = "The https port of the server."] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -2964,7 +2921,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, + pub amount_off: Option, #[doc = "Always true for a deleted object."] #[serde(default, skip_serializing_if = "Option::is_none")] pub deleted: Option, @@ -3191,7 +3148,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, + pub balance: Option, #[doc = "Time at which the object was created."] pub created_at: chrono::DateTime, #[doc = "Three-letter ISO code for the currency the customer can be charged in for recurring \ @@ -3310,7 +3267,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: f64, + pub monthly_credits_remaining: bigdecimal::BigDecimal, #[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 \ @@ -3320,15 +3277,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: f64, + pub pre_pay_cash_remaining: bigdecimal::BigDecimal, #[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: f64, + pub pre_pay_credits_remaining: bigdecimal::BigDecimal, #[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: f64, + pub total_due: bigdecimal::BigDecimal, #[doc = "The date and time the balance was last updated."] pub updated_at: chrono::DateTime, #[doc = "The user ID the balance belongs to."] @@ -3542,245 +3499,19 @@ impl tabled::Tabled for Discount { } } -#[doc = "Docker system info."] +#[doc = "The body of the form for email authentication."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct DockerSystemInfo { - #[doc = "Hardware architecture of the host, as returned by the Go runtime (`GOARCH`). A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub architecture: Option, - #[doc = "Indicates if `bridge-nf-call-ip6tables` is available on the host."] - #[serde( - rename = "bridge_nf_ip6tables", - default, - skip_serializing_if = "Option::is_none" - )] - pub bridge_nf_ip_6tables: Option, - #[doc = "Indicates if `bridge-nf-call-iptables` is available on the host."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bridge_nf_iptables: Option, - #[doc = "The driver to use for managing cgroups."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cgroup_driver: Option, - #[doc = "The version of the cgroup."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cgroup_version: Option, - #[doc = "The network endpoint that the Engine advertises for the purpose of node discovery. \ - ClusterAdvertise is a `host:port` combination on which the daemon is reachable by \ - other hosts.\n\n**Deprecated**: This field is only propagated when using standalone \ - Swarm mode, and overlay networking using an external k/v store. Overlay networks \ - with Swarm mode enabled use the built-in raft store, and this field will be empty."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cluster_advertise: Option, - #[doc = "URL of the distributed storage backend. The storage backend is used for multihost \ - networking (to store network and endpoint information) and by the node discovery \ - mechanism.\n\n**Deprecated**: This field is only propagated when using standalone \ - Swarm mode, and overlay networking using an external k/v store. Overlay networks \ - with Swarm mode enabled use the built-in raft store, and this field will be empty."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cluster_store: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub containerd_commit: Option, - #[doc = "Total number of containers on the host."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub containers: Option, - #[doc = "Number of containers with status `\\\"paused\\\"`."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub containers_paused: Option, - #[doc = "Number of containers with status `\\\"running\\\"`."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub containers_running: Option, - #[doc = "Number of containers with status `\\\"stopped\\\"`."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub containers_stopped: Option, - #[doc = "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cpu_cfs_period: Option, - #[doc = "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cpu_cfs_quota: Option, - #[doc = "Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cpu_set: Option, - #[doc = "Indicates if CPU Shares limiting is supported by the host."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cpu_shares: Option, - #[doc = "Indicates if the daemon is running in debug-mode / with debug-level logging enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub debug: Option, - #[doc = "List of custom default address pools for local networks, which can be specified in \ - the daemon.json file or dockerd option. Example: a Base \\\"10.10.0.0/16\\\" with \ - Size 24 will define the set of 256 10.10.[0-255].0/24 address pools."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub default_address_pools: Option>, - #[doc = "Name of the default OCI runtime that is used when starting containers. The default \ - can be overridden per-container at create time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub default_runtime: Option, - #[doc = "Root directory of persistent Docker state. Defaults to `/var/lib/docker` on Linux, \ - and `C:\\\\ProgramData\\\\docker` on Windows."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub docker_root_dir: Option, - #[doc = "Name of the storage driver in use."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub driver: Option, - #[doc = "Information specific to the storage driver, provided as \\\"label\\\" / \ - \\\"value\\\" pairs. This information is provided by the storage driver, and \ - formatted in a way consistent with the output of `docker info` on the command \ - line.\n\n**Note**: The information returned in this field, including the formatting \ - of values and labels, should not be considered stable, and may change without notice."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub driver_status: Option>>, - #[doc = "Indicates if experimental features are enabled on the daemon."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub experimental_build: Option, - #[doc = "HTTP-proxy configured for the daemon. This value is obtained from the [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL are masked in the API response. Containers do not automatically inherit this configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub http_proxy: Option, - #[doc = "HTTPS-proxy configured for the daemon. This value is obtained from the [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL are masked in the API response. Containers do not automatically inherit this configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub https_proxy: Option, - #[doc = "Unique identifier of the daemon.\n\n**Note**: The format of the ID itself is not \ - part of the API, and should not be considered stable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Total number of images on the host. Both _tagged_ and _untagged_ (dangling) images \ - are counted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub images: Option, - #[doc = "Address / URL of the index server that is used for image search, and as a default \ - for user authentication for Docker Hub and Docker Cloud."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub index_server_address: Option, - #[doc = "Name and, optional, path of the `docker-init` binary. If the path is omitted, the \ - daemon searches the host's `$PATH` for the binary and uses the first result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub init_binary: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub init_commit: Option, - #[doc = "Indicates IPv4 forwarding is enabled."] - #[serde( - rename = "ipv4_forwarding", - default, - skip_serializing_if = "Option::is_none" - )] - pub ipv_4_forwarding: Option, - #[doc = "Represents the isolation technology to use as a default for containers. The \ - supported values are platform-specific. If no isolation value is specified on \ - daemon start, on Windows client, the default is `hyperv`, and on Windows server, the \ - default is `process`. This option is currently not used on other platforms."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub isolation: Option, - #[doc = "Indicates if the host has kernel memory limit support enabled.\n\n**Deprecated**: \ - This field is deprecated as the kernel 5.4 deprecated `kmem.limit_in_bytes`."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kernel_memory: Option, - #[doc = "Indicates if the host has kernel memory TCP limit support enabled. Kernel memory \ - TCP limits are not supported when using cgroups v2, which does not support the \ - corresponding `memory.kmem.tcp.limit_in_bytes` cgroup."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kernel_memory_tcp: Option, - #[doc = "Kernel version of the host. On Linux, this information obtained from `uname`. On \ - Windows this information is queried from the \ - HKEY_LOCAL_MACHINE\\\\\\\\SOFTWARE\\\\\\\\Microsoft\\\\\\\\Windows \ - NT\\\\\\\\CurrentVersion\\\\\\\\ registry value, for example _\\\"10.0 14393 \ - (14393.1198.amd64fre.rs1_release_sec.170427-1353)\\\"_."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kernel_version: Option, - #[doc = "User-defined labels (key/value metadata) as set on the daemon.\n\n**Note**: When \ - part of a Swarm, nodes can both have _daemon_ labels, set through the daemon \ - configuration, and _node_ labels, set from a manager node in the Swarm. Node labels \ - are not included in this field. Node labels can be retrieved using the `/nodes/(id)` \ - endpoint on a manager node in the Swarm."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub labels: Option>, - #[doc = "Indicates if live restore is enabled. If enabled, containers are kept running when \ - the daemon is shutdown or upon daemon start if running containers are detected."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub live_restore_enabled: Option, - #[doc = "The logging driver to use as a default for new containers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub logging_driver: Option, - #[doc = "Total amount of physical memory available on the host, in bytes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mem_total: Option, - #[doc = "Indicates if the host has memory limit support enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub memory_limit: Option, - #[doc = "Number of event listeners subscribed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub n_events_listener: Option, - #[doc = "The total number of file Descriptors in use by the daemon process. This information \ - is only returned if debug-mode is enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub n_fd: Option, - #[doc = "Hostname of the host."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The number of logical CPUs usable by the daemon. The number of available CPUs is \ - checked by querying the operating system when the daemon starts. Changes to \ - operating system CPU allocation after the daemon is started are not reflected."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ncpu: Option, - #[doc = "Comma-separated list of domain extensions for which no proxy should be used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. Containers do not automatically inherit this configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub no_proxy: Option, - #[doc = "Indicates if OOM killer disable is supported on the host."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub oom_kill_disable: Option, - #[doc = "Name of the host's operating system, for example: \\\"Ubuntu 16.04.2 LTS\\\" or \ - \\\"Windows Server 2016 Datacenter\\\""] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operating_system: Option, - #[doc = "Generic type of the operating system of the host, as returned by the Go runtime (`GOOS`). Currently returned values are \\\"linux\\\" and \\\"windows\\\". A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub os_type: Option, - #[doc = "Version of the host's operating system\n\n**Note**: The information returned in this \ - field, including its very existence, and the formatting of values, should not be \ - considered stable, and may change without notice."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub os_version: Option, - #[doc = "Indicates if the host kernel has PID limit support enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pids_limit: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plugins: Option, - #[doc = "Reports a summary of the product license on the daemon. If a commercial license has \ - been applied to the daemon, information such as number of nodes, and expiration are \ - included."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub product_license: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub registry_config: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub runc_commit: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub runtimes: Option>, - #[doc = "List of security features that are enabled on the daemon, such as apparmor, seccomp, \ - SELinux, user-namespaces (userns), and rootless. Additional configuration options \ - for each security feature may be present, and are included as a comma-separated list \ - of key/value pairs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub security_options: Option>, - #[doc = "Version string of the daemon. **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) returns the Swarm version instead of the daemon version, for example `swarm/1.2.8`."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub server_version: Option, - #[doc = "Indicates if the host has memory swap limit support enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swap_limit: Option, - #[doc = "The number of goroutines that currently exist. This information is only returned \ - if debug-mode is enabled."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub system_time: Option, - #[doc = "List of warnings / informational messages about missing features, or issues related \ - to the daemon configuration. These messages can be printed by the client as \ - information to the user."] +pub struct EmailAuthenticationForm { + #[doc = "The URL to redirect back to after we have authenticated."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub warnings: Option>, + pub callback_url: Option, + #[doc = "The user's email."] + pub email: String, } -impl std::fmt::Display for DockerSystemInfo { +impl std::fmt::Display for EmailAuthenticationForm { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3791,408 +3522,12 @@ impl std::fmt::Display for DockerSystemInfo { } #[cfg(feature = "tabled")] -impl tabled::Tabled for DockerSystemInfo { - const LENGTH: usize = 60; +impl tabled::Tabled for EmailAuthenticationForm { + const LENGTH: usize = 2; fn fields(&self) -> Vec> { vec![ - if let Some(architecture) = &self.architecture { - format!("{:?}", architecture).into() - } else { - String::new().into() - }, - if let Some(bridge_nf_ip_6tables) = &self.bridge_nf_ip_6tables { - format!("{:?}", bridge_nf_ip_6tables).into() - } else { - String::new().into() - }, - if let Some(bridge_nf_iptables) = &self.bridge_nf_iptables { - format!("{:?}", bridge_nf_iptables).into() - } else { - String::new().into() - }, - if let Some(cgroup_driver) = &self.cgroup_driver { - format!("{:?}", cgroup_driver).into() - } else { - String::new().into() - }, - if let Some(cgroup_version) = &self.cgroup_version { - format!("{:?}", cgroup_version).into() - } else { - String::new().into() - }, - if let Some(cluster_advertise) = &self.cluster_advertise { - format!("{:?}", cluster_advertise).into() - } else { - String::new().into() - }, - if let Some(cluster_store) = &self.cluster_store { - format!("{:?}", cluster_store).into() - } else { - String::new().into() - }, - if let Some(containerd_commit) = &self.containerd_commit { - format!("{:?}", containerd_commit).into() - } else { - String::new().into() - }, - if let Some(containers) = &self.containers { - format!("{:?}", containers).into() - } else { - String::new().into() - }, - if let Some(containers_paused) = &self.containers_paused { - format!("{:?}", containers_paused).into() - } else { - String::new().into() - }, - if let Some(containers_running) = &self.containers_running { - format!("{:?}", containers_running).into() - } else { - String::new().into() - }, - if let Some(containers_stopped) = &self.containers_stopped { - format!("{:?}", containers_stopped).into() - } else { - String::new().into() - }, - if let Some(cpu_cfs_period) = &self.cpu_cfs_period { - format!("{:?}", cpu_cfs_period).into() - } else { - String::new().into() - }, - if let Some(cpu_cfs_quota) = &self.cpu_cfs_quota { - format!("{:?}", cpu_cfs_quota).into() - } else { - String::new().into() - }, - if let Some(cpu_set) = &self.cpu_set { - format!("{:?}", cpu_set).into() - } else { - String::new().into() - }, - if let Some(cpu_shares) = &self.cpu_shares { - format!("{:?}", cpu_shares).into() - } else { - String::new().into() - }, - if let Some(debug) = &self.debug { - format!("{:?}", debug).into() - } else { - String::new().into() - }, - if let Some(default_address_pools) = &self.default_address_pools { - format!("{:?}", default_address_pools).into() - } else { - String::new().into() - }, - if let Some(default_runtime) = &self.default_runtime { - format!("{:?}", default_runtime).into() - } else { - String::new().into() - }, - if let Some(docker_root_dir) = &self.docker_root_dir { - format!("{:?}", docker_root_dir).into() - } else { - String::new().into() - }, - if let Some(driver) = &self.driver { - format!("{:?}", driver).into() - } else { - String::new().into() - }, - if let Some(driver_status) = &self.driver_status { - format!("{:?}", driver_status).into() - } else { - String::new().into() - }, - if let Some(experimental_build) = &self.experimental_build { - format!("{:?}", experimental_build).into() - } else { - String::new().into() - }, - if let Some(http_proxy) = &self.http_proxy { - format!("{:?}", http_proxy).into() - } else { - String::new().into() - }, - if let Some(https_proxy) = &self.https_proxy { - format!("{:?}", https_proxy).into() - } else { - String::new().into() - }, - if let Some(id) = &self.id { - format!("{:?}", id).into() - } else { - String::new().into() - }, - if let Some(images) = &self.images { - format!("{:?}", images).into() - } else { - String::new().into() - }, - if let Some(index_server_address) = &self.index_server_address { - format!("{:?}", index_server_address).into() - } else { - String::new().into() - }, - if let Some(init_binary) = &self.init_binary { - format!("{:?}", init_binary).into() - } else { - String::new().into() - }, - if let Some(init_commit) = &self.init_commit { - format!("{:?}", init_commit).into() - } else { - String::new().into() - }, - if let Some(ipv_4_forwarding) = &self.ipv_4_forwarding { - format!("{:?}", ipv_4_forwarding).into() - } else { - String::new().into() - }, - if let Some(isolation) = &self.isolation { - format!("{:?}", isolation).into() - } else { - String::new().into() - }, - if let Some(kernel_memory) = &self.kernel_memory { - format!("{:?}", kernel_memory).into() - } else { - String::new().into() - }, - if let Some(kernel_memory_tcp) = &self.kernel_memory_tcp { - format!("{:?}", kernel_memory_tcp).into() - } else { - String::new().into() - }, - if let Some(kernel_version) = &self.kernel_version { - format!("{:?}", kernel_version).into() - } else { - String::new().into() - }, - if let Some(labels) = &self.labels { - format!("{:?}", labels).into() - } else { - String::new().into() - }, - if let Some(live_restore_enabled) = &self.live_restore_enabled { - format!("{:?}", live_restore_enabled).into() - } else { - String::new().into() - }, - if let Some(logging_driver) = &self.logging_driver { - format!("{:?}", logging_driver).into() - } else { - String::new().into() - }, - if let Some(mem_total) = &self.mem_total { - format!("{:?}", mem_total).into() - } else { - String::new().into() - }, - if let Some(memory_limit) = &self.memory_limit { - format!("{:?}", memory_limit).into() - } else { - String::new().into() - }, - if let Some(n_events_listener) = &self.n_events_listener { - format!("{:?}", n_events_listener).into() - } else { - String::new().into() - }, - if let Some(n_fd) = &self.n_fd { - format!("{:?}", n_fd).into() - } else { - String::new().into() - }, - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(ncpu) = &self.ncpu { - format!("{:?}", ncpu).into() - } else { - String::new().into() - }, - if let Some(no_proxy) = &self.no_proxy { - format!("{:?}", no_proxy).into() - } else { - String::new().into() - }, - if let Some(oom_kill_disable) = &self.oom_kill_disable { - format!("{:?}", oom_kill_disable).into() - } else { - String::new().into() - }, - if let Some(operating_system) = &self.operating_system { - format!("{:?}", operating_system).into() - } else { - String::new().into() - }, - if let Some(os_type) = &self.os_type { - format!("{:?}", os_type).into() - } else { - String::new().into() - }, - if let Some(os_version) = &self.os_version { - format!("{:?}", os_version).into() - } else { - String::new().into() - }, - if let Some(pids_limit) = &self.pids_limit { - format!("{:?}", pids_limit).into() - } else { - String::new().into() - }, - if let Some(plugins) = &self.plugins { - format!("{:?}", plugins).into() - } else { - String::new().into() - }, - if let Some(product_license) = &self.product_license { - format!("{:?}", product_license).into() - } else { - String::new().into() - }, - if let Some(registry_config) = &self.registry_config { - format!("{:?}", registry_config).into() - } else { - String::new().into() - }, - if let Some(runc_commit) = &self.runc_commit { - format!("{:?}", runc_commit).into() - } else { - String::new().into() - }, - if let Some(runtimes) = &self.runtimes { - format!("{:?}", runtimes).into() - } else { - String::new().into() - }, - if let Some(security_options) = &self.security_options { - format!("{:?}", security_options).into() - } else { - String::new().into() - }, - if let Some(server_version) = &self.server_version { - format!("{:?}", server_version).into() - } else { - String::new().into() - }, - if let Some(swap_limit) = &self.swap_limit { - format!("{:?}", swap_limit).into() - } else { - String::new().into() - }, - if let Some(system_time) = &self.system_time { - format!("{:?}", system_time).into() - } else { - String::new().into() - }, - if let Some(warnings) = &self.warnings { - format!("{:?}", warnings).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "architecture".into(), - "bridge_nf_ip_6tables".into(), - "bridge_nf_iptables".into(), - "cgroup_driver".into(), - "cgroup_version".into(), - "cluster_advertise".into(), - "cluster_store".into(), - "containerd_commit".into(), - "containers".into(), - "containers_paused".into(), - "containers_running".into(), - "containers_stopped".into(), - "cpu_cfs_period".into(), - "cpu_cfs_quota".into(), - "cpu_set".into(), - "cpu_shares".into(), - "debug".into(), - "default_address_pools".into(), - "default_runtime".into(), - "docker_root_dir".into(), - "driver".into(), - "driver_status".into(), - "experimental_build".into(), - "http_proxy".into(), - "https_proxy".into(), - "id".into(), - "images".into(), - "index_server_address".into(), - "init_binary".into(), - "init_commit".into(), - "ipv_4_forwarding".into(), - "isolation".into(), - "kernel_memory".into(), - "kernel_memory_tcp".into(), - "kernel_version".into(), - "labels".into(), - "live_restore_enabled".into(), - "logging_driver".into(), - "mem_total".into(), - "memory_limit".into(), - "n_events_listener".into(), - "n_fd".into(), - "name".into(), - "ncpu".into(), - "no_proxy".into(), - "oom_kill_disable".into(), - "operating_system".into(), - "os_type".into(), - "os_version".into(), - "pids_limit".into(), - "plugins".into(), - "product_license".into(), - "registry_config".into(), - "runc_commit".into(), - "runtimes".into(), - "security_options".into(), - "server_version".into(), - "swap_limit".into(), - "system_time".into(), - "warnings".into(), - ] - } -} - -#[doc = "The body of the form for email authentication."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct EmailAuthenticationForm { - #[doc = "The URL to redirect back to after we have authenticated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub callback_url: Option, - #[doc = "The user's email."] - pub email: String, -} - -impl std::fmt::Display for EmailAuthenticationForm { - 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 EmailAuthenticationForm { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(callback_url) = &self.callback_url { - format!("{:?}", callback_url).into() + if let Some(callback_url) = &self.callback_url { + format!("{:?}", callback_url).into() } else { String::new().into() }, @@ -4205,62 +3540,6 @@ impl tabled::Tabled for EmailAuthenticationForm { } } -#[doc = "Metadata about our currently running server.\n\nThis is mostly used for internal purposes \ - and debugging."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct EngineMetadata { - #[doc = "If any async job is currently running."] - pub async_jobs_running: bool, - #[doc = "Metadata about our cache."] - pub cache: CacheMetadata, - #[doc = "The environment we are running in."] - pub environment: Environment, - #[doc = "Metadata about our file system."] - pub fs: FileSystemMetadata, - #[doc = "The git hash of the server."] - pub git_hash: String, - #[doc = "Metadata about our pub-sub connection."] - pub pubsub: Connection, -} - -impl std::fmt::Display for EngineMetadata { - 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 EngineMetadata { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - format!("{:?}", self.async_jobs_running).into(), - format!("{:?}", self.cache).into(), - format!("{:?}", self.environment).into(), - format!("{:?}", self.fs).into(), - self.git_hash.clone().into(), - format!("{:?}", self.pubsub).into(), - ] - } - - fn headers() -> Vec> { - vec![ - "async_jobs_running".into(), - "cache".into(), - "environment".into(), - "fs".into(), - "git_hash".into(), - "pubsub".into(), - ] - } -} - #[doc = "The response from the `EntityGetAllChildUuids` command."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, @@ -4548,50 +3827,6 @@ pub enum ErrorCode { MessageTypeNotAcceptedForWebRTC, } -#[doc = "Metadata about our currently running server.\n\nThis is mostly used for internal purposes \ - and debugging."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ExecutorMetadata { - #[doc = "Information about the docker daemon."] - pub docker_info: DockerSystemInfo, - #[doc = "The environment we are running in."] - pub environment: Environment, - #[doc = "The git hash of the server."] - pub git_hash: String, -} - -impl std::fmt::Display for ExecutorMetadata { - 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 ExecutorMetadata { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - format!("{:?}", self.docker_info).into(), - format!("{:?}", self.environment).into(), - self.git_hash.clone().into(), - ] - } - - fn headers() -> Vec> { - vec![ - "docker_info".into(), - "environment".into(), - "git_hash".into(), - ] - } -} - #[doc = "The response from the `Export` endpoint."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, @@ -6041,79 +5276,6 @@ pub enum ImageType { Jpg, } -#[doc = "IndexInfo contains information about a registry."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct IndexInfo { - #[doc = "List of mirrors, expressed as URIs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mirrors: Option>, - #[doc = "Name of the registry, such as \\\"docker.io\\\"."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Indicates whether this is an official registry (i.e., Docker Hub / docker.io)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub official: Option, - #[doc = "Indicates if the registry is part of the list of insecure registries. If `false`, \ - the registry is insecure. Insecure registries accept un-encrypted (HTTP) and/or \ - untrusted (HTTPS with certificates from unknown CAs) communication.\n\n**Warning**: \ - Insecure registries can be useful when running a local registry. However, because \ - its use creates security vulnerabilities it should ONLY be enabled for testing \ - purposes. For increased security, users should add their CA to their system's list \ - of trusted CAs instead of enabling this option."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub secure: Option, -} - -impl std::fmt::Display for IndexInfo { - 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 IndexInfo { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - if let Some(mirrors) = &self.mirrors { - format!("{:?}", mirrors).into() - } else { - String::new().into() - }, - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(official) = &self.official { - format!("{:?}", official).into() - } else { - String::new().into() - }, - if let Some(secure) = &self.secure { - format!("{:?}", secure).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "mirrors".into(), - "name".into(), - "official".into(), - "secure".into(), - ] - } -} - #[doc = "Input format specifier."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, @@ -6149,13 +5311,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, + pub amount_due: Option, #[doc = "The amount, in USD, that was paid."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount_paid: Option, + pub amount_paid: Option, #[doc = "The amount remaining, in USD, that is due."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount_remaining: Option, + pub amount_remaining: Option, #[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, \ @@ -6225,14 +5387,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, + pub subtotal: Option, #[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, + pub tax: Option, #[doc = "Total after discounts and taxes."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option, + pub total: Option, #[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")] @@ -6416,7 +5578,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, + pub amount: Option, #[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")] @@ -6964,12 +6126,8 @@ impl tabled::Tabled for MetaClusterInfo { pub struct Metadata { #[doc = "Metadata about our cache."] pub cache: CacheMetadata, - #[doc = "Metadata about our engine API connection."] - pub engine: EngineMetadata, #[doc = "The environment we are running in."] pub environment: Environment, - #[doc = "Metadata about our executor API connection."] - pub executor: ExecutorMetadata, #[doc = "Metadata about our file system."] pub fs: FileSystemMetadata, #[doc = "The git hash of the server."] @@ -6992,13 +6150,11 @@ impl std::fmt::Display for Metadata { #[cfg(feature = "tabled")] impl tabled::Tabled for Metadata { - const LENGTH: usize = 8; + const LENGTH: usize = 6; fn fields(&self) -> Vec> { vec![ format!("{:?}", self.cache).into(), - format!("{:?}", self.engine).into(), format!("{:?}", self.environment).into(), - format!("{:?}", self.executor).into(), format!("{:?}", self.fs).into(), self.git_hash.clone().into(), format!("{:?}", self.point_e).into(), @@ -7009,9 +6165,7 @@ impl tabled::Tabled for Metadata { fn headers() -> Vec> { vec![ "cache".into(), - "engine".into(), "environment".into(), - "executor".into(), "fs".into(), "git_hash".into(), "point_e".into(), @@ -7301,18 +6455,18 @@ pub enum ModelingCmd { CurveGetEndPoints { curve_id: uuid::Uuid }, } -#[doc = "A graphics command submitted to the KittyCAD engine via the Modeling API."] +#[doc = "The response from the `MouseClick` command."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct ModelingCmdReq { - #[doc = "Which command to submit to the Kittycad engine."] - pub cmd: ModelingCmd, - #[doc = "ID of command being submitted."] - pub cmd_id: uuid::Uuid, +pub struct MouseClick { + #[doc = "Entities that are modified."] + pub entities_modified: Vec, + #[doc = "Entities that are selected."] + pub entities_selected: Vec, } -impl std::fmt::Display for ModelingCmdReq { +impl std::fmt::Display for MouseClick { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -7323,29 +6477,49 @@ impl std::fmt::Display for ModelingCmdReq { } #[cfg(feature = "tabled")] -impl tabled::Tabled for ModelingCmdReq { +impl tabled::Tabled for MouseClick { const LENGTH: usize = 2; fn fields(&self) -> Vec> { vec![ - format!("{:?}", self.cmd).into(), - format!("{:?}", self.cmd_id).into(), + format!("{:?}", self.entities_modified).into(), + format!("{:?}", self.entities_selected).into(), ] } fn headers() -> Vec> { - vec!["cmd".into(), "cmd_id".into()] + vec!["entities_modified".into(), "entities_selected".into()] } } -#[doc = "A batch set of graphics commands submitted to the KittyCAD engine via the Modeling API."] +#[doc = "The struct that is used to create a new record. This is automatically generated and has \ + all the same fields as the main struct only it is missing the `id`."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct ModelingCmdReqBatch { - pub cmds: std::collections::HashMap, +pub struct NewAddress { + #[doc = "The city component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + #[doc = "The country component. This is a two-letter ISO country code."] + pub country: String, + #[doc = "The state component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The first street component."] + #[serde(rename = "street1", default, skip_serializing_if = "Option::is_none")] + pub street_1: Option, + #[doc = "The second street component."] + #[serde(rename = "street2", default, skip_serializing_if = "Option::is_none")] + pub street_2: Option, + #[doc = "The user ID that this address belongs to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user_id: Option, + #[doc = "The zip component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub zip: Option, } -impl std::fmt::Display for ModelingCmdReqBatch { +impl std::fmt::Display for NewAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -7356,192 +6530,8 @@ impl std::fmt::Display for ModelingCmdReqBatch { } #[cfg(feature = "tabled")] -impl tabled::Tabled for ModelingCmdReqBatch { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![format!("{:?}", self.cmds).into()] - } - - fn headers() -> Vec> { - vec!["cmds".into()] - } -} - -#[doc = "Why a command submitted to the Modeling API failed."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ModelingError { - #[doc = "A string error code which refers to a family of errors. E.g. \"InvalidInput\"."] - pub error_code: String, - #[doc = "Describe the specific error which occurred. Will be shown to users, not logged."] - pub external_message: String, - #[doc = "Describe the specific error which occurred. Will be logged, not shown to users."] - pub internal_message: String, - #[doc = "A HTTP status code."] - pub status_code: u16, -} - -impl std::fmt::Display for ModelingError { - 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 ModelingError { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - self.error_code.clone().into(), - self.external_message.clone().into(), - self.internal_message.clone().into(), - format!("{:?}", self.status_code).into(), - ] - } - - fn headers() -> Vec> { - vec![ - "error_code".into(), - "external_message".into(), - "internal_message".into(), - "status_code".into(), - ] - } -} - -#[doc = "The result from one modeling command in a batch."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub enum ModelingOutcome { - Error { - #[doc = "A string error code which refers to a family of errors. E.g. \"InvalidInput\"."] - error_code: String, - #[doc = "Describe the specific error which occurred. Will be shown to users, not logged."] - external_message: String, - #[doc = "Describe the specific error which occurred. Will be logged, not shown to users."] - internal_message: String, - #[doc = "A HTTP status code."] - status_code: u16, - }, - Cancelled { - #[doc = "The ID of the command that failed, cancelling this command."] - what_failed: uuid::Uuid, - }, -} - -#[doc = "The result from a batch of modeling commands."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ModelingOutcomes { - pub outcomes: std::collections::HashMap, -} - -impl std::fmt::Display for ModelingOutcomes { - 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 ModelingOutcomes { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![format!("{:?}", self.outcomes).into()] - } - - fn headers() -> Vec> { - vec!["outcomes".into()] - } -} - -#[doc = "The response from the `MouseClick` command."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct MouseClick { - #[doc = "Entities that are modified."] - pub entities_modified: Vec, - #[doc = "Entities that are selected."] - pub entities_selected: Vec, -} - -impl std::fmt::Display for MouseClick { - 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 MouseClick { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - format!("{:?}", self.entities_modified).into(), - format!("{:?}", self.entities_selected).into(), - ] - } - - fn headers() -> Vec> { - vec!["entities_modified".into(), "entities_selected".into()] - } -} - -#[doc = "The struct that is used to create a new record. This is automatically generated and has \ - all the same fields as the main struct only it is missing the `id`."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct NewAddress { - #[doc = "The city component."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub city: Option, - #[doc = "The country component. This is a two-letter ISO country code."] - pub country: String, - #[doc = "The state component."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "The first street component."] - #[serde(rename = "street1", default, skip_serializing_if = "Option::is_none")] - pub street_1: Option, - #[doc = "The second street component."] - #[serde(rename = "street2", default, skip_serializing_if = "Option::is_none")] - pub street_2: Option, - #[doc = "The user ID that this address belongs to."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, - #[doc = "The zip component."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -impl std::fmt::Display for NewAddress { - 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 NewAddress { - const LENGTH: usize = 7; +impl tabled::Tabled for NewAddress { + const LENGTH: usize = 7; fn fields(&self) -> Vec> { vec![ if let Some(city) = &self.city { @@ -7667,16 +6657,18 @@ impl tabled::Tabled for Oauth2ClientInfo { )] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -#[derive(Default)] pub enum Oauth2GrantType { #[doc = "An OAuth 2.0 Device Authorization Grant."] #[serde(rename = "urn:ietf:params:oauth:grant-type:device_code")] #[display("urn:ietf:params:oauth:grant-type:device_code")] - #[default] UrnIetfParamsOauthGrantTypeDeviceCode, } - +impl std::default::Default for Oauth2GrantType { + fn default() -> Self { + Oauth2GrantType::UrnIetfParamsOauthGrantTypeDeviceCode + } +} #[doc = "A successful response from a modeling command. This can be one of several types of \ responses, depending on the command."] @@ -8234,16 +7226,18 @@ impl tabled::Tabled for PaymentMethodCardChecks { )] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -#[derive(Default)] pub enum PaymentMethodType { #[doc = "A card payment method."] #[serde(rename = "card")] #[display("card")] - #[default] Card, } - +impl std::default::Default for PaymentMethodType { + fn default() -> Self { + PaymentMethodType::Card + } +} #[doc = "Corresponding coordinates of given window coordinates, intersected on given plane."] #[derive( @@ -8281,75 +7275,6 @@ impl tabled::Tabled for PlaneIntersectAndProject { } } -#[doc = "Available plugins per type.\n\n**Note**: Only unmanaged (V1) plugins are included in this \ - list. V1 plugins are \\\"lazily\\\" loaded, and are not returned in this list if there is \ - no resource using the plugin."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct PluginsInfo { - #[doc = "Names of available authorization plugins."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option>, - #[doc = "Names of available logging-drivers, and logging-driver plugins."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub log: Option>, - #[doc = "Names of available network-drivers, and network-driver plugins."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub network: Option>, - #[doc = "Names of available volume-drivers, and network-driver plugins."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub volume: Option>, -} - -impl std::fmt::Display for PluginsInfo { - 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 PluginsInfo { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - if let Some(authorization) = &self.authorization { - format!("{:?}", authorization).into() - } else { - String::new().into() - }, - if let Some(log) = &self.log { - format!("{:?}", log).into() - } else { - String::new().into() - }, - if let Some(network) = &self.network { - format!("{:?}", network).into() - } else { - String::new().into() - }, - if let Some(volume) = &self.volume { - format!("{:?}", volume).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "authorization".into(), - "log".into(), - "network".into(), - "volume".into(), - ] - } -} - #[doc = "The storage for the output PLY file."] #[derive( serde :: Serialize, @@ -8553,96 +7478,6 @@ impl tabled::Tabled for RawFile { } } -#[doc = "RegistryServiceConfig stores daemon registry services configuration."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct RegistryServiceConfig { - #[doc = "List of IP ranges to which nondistributable artifacts can be pushed, using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). Some images (for example, Windows base images) contain artifacts whose distribution is restricted by license. When these images are pushed to a registry, restricted artifacts are not included. This configuration override this behavior, and enables the daemon to push nondistributable artifacts to all registries whose resolved IP address is within the subnet described by the CIDR syntax. This option is useful when pushing images containing nondistributable artifacts to a registry on an air-gapped network so hosts on that network can pull the images without connecting to another server.\n\n**Warning**: Nondistributable artifacts typically have restrictions on how and where they can be distributed and shared. Only use this feature to push artifacts to private registries and ensure that you are in compliance with any terms that cover redistributing nondistributable artifacts."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub allow_nondistributable_artifacts_cid_rs: Option>, - #[doc = "List of registry hostnames to which nondistributable artifacts can be pushed, using \ - the format `[:]` or `[:]`. Some images (for \ - example, Windows base images) contain artifacts whose distribution is restricted by \ - license. When these images are pushed to a registry, restricted artifacts are not \ - included. This configuration override this behavior for the specified registries. \ - This option is useful when pushing images containing nondistributable artifacts to a \ - registry on an air-gapped network so hosts on that network can pull the images \ - without connecting to another server.\n\n**Warning**: Nondistributable artifacts \ - typically have restrictions on how and where they can be distributed and shared. \ - Only use this feature to push artifacts to private registries and ensure that you \ - are in compliance with any terms that cover redistributing nondistributable \ - artifacts."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub allow_nondistributable_artifacts_hostnames: Option>, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub index_configs: Option>, - #[doc = "List of IP ranges of insecure registries, using the CIDR syntax ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from unknown CAs) communication. By default, local registries (`127.0.0.0/8`) are configured as insecure. All other registries are secure. Communicating with an insecure registry is not possible if the daemon assumes that registry is secure. This configuration override this behavior, insecure communication with registries whose resolved IP address is within the subnet described by the CIDR syntax. Registries can also be marked insecure by hostname. Those registries are listed under `IndexConfigs` and have their `Secure` field set to `false`.\n\n**Warning**: Using this option can be useful when running a local registry, but introduces security vulnerabilities. This option should therefore ONLY be used for testing purposes. For increased security, users should add their CA to their system's list of trusted CAs instead of enabling this option."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub insecure_registry_cid_rs: Option>, - #[doc = "List of registry URLs that act as a mirror for the official (`docker.io`) registry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mirrors: Option>, -} - -impl std::fmt::Display for RegistryServiceConfig { - 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 RegistryServiceConfig { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - if let Some(allow_nondistributable_artifacts_cid_rs) = - &self.allow_nondistributable_artifacts_cid_rs - { - format!("{:?}", allow_nondistributable_artifacts_cid_rs).into() - } else { - String::new().into() - }, - if let Some(allow_nondistributable_artifacts_hostnames) = - &self.allow_nondistributable_artifacts_hostnames - { - format!("{:?}", allow_nondistributable_artifacts_hostnames).into() - } else { - String::new().into() - }, - if let Some(index_configs) = &self.index_configs { - format!("{:?}", index_configs).into() - } else { - String::new().into() - }, - if let Some(insecure_registry_cid_rs) = &self.insecure_registry_cid_rs { - format!("{:?}", insecure_registry_cid_rs).into() - } else { - String::new().into() - }, - if let Some(mirrors) = &self.mirrors { - format!("{:?}", mirrors).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "allow_nondistributable_artifacts_cid_rs".into(), - "allow_nondistributable_artifacts_hostnames".into(), - "index_configs".into(), - "insecure_registry_cid_rs".into(), - "mirrors".into(), - ] - } -} - #[doc = "ICECandidateInit is used to serialize ice candidates"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, @@ -8793,55 +7628,6 @@ impl tabled::Tabled for RtcSessionDescription { } } -#[doc = "Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) \ - runtime. The runtime is invoked by the daemon via the `containerd` daemon. OCI runtimes \ - act as an interface to the Linux kernel namespaces, cgroups, and SELinux."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Runtime { - #[doc = "Name and, optional, path, of the OCI executable binary. If the path is omitted, the \ - daemon searches the host's `$PATH` for the binary and uses the first result."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, - #[doc = "List of command-line arguments to pass to the runtime when invoked."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub runtime_args: Option>, -} - -impl std::fmt::Display for Runtime { - 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 Runtime { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(path) = &self.path { - format!("{:?}", path).into() - } else { - String::new().into() - }, - if let Some(runtime_args) = &self.runtime_args { - format!("{:?}", runtime_args).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["path".into(), "runtime_args".into()] - } -} - #[doc = "The type of scene selection change"] #[derive( serde :: Serialize, @@ -9300,132 +8086,6 @@ impl tabled::Tabled for System { } } -#[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 SystemInfoCgroupDriverEnum { - #[serde(rename = "")] - #[display("")] - Empty, - #[serde(rename = "cgroupfs")] - #[display("cgroupfs")] - Cgroupfs, - #[serde(rename = "systemd")] - #[display("systemd")] - Systemd, - #[serde(rename = "none")] - #[display("none")] - None, -} - -#[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 SystemInfoCgroupVersionEnum { - #[serde(rename = "")] - #[display("")] - Empty, - #[serde(rename = "1")] - #[display("1")] - One, - #[serde(rename = "2")] - #[display("2")] - Two, -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct SystemInfoDefaultAddressPools { - #[doc = "The network address in CIDR format"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub base: Option, - #[doc = "The network pool size"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, -} - -impl std::fmt::Display for SystemInfoDefaultAddressPools { - 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 SystemInfoDefaultAddressPools { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(base) = &self.base { - format!("{:?}", base).into() - } else { - String::new().into() - }, - if let Some(size) = &self.size { - format!("{:?}", size).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["base".into(), "size".into()] - } -} - -#[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 SystemInfoIsolationEnum { - #[serde(rename = "")] - #[display("")] - Empty, - #[serde(rename = "default")] - #[display("default")] - Default, - #[serde(rename = "hyperv")] - #[display("hyperv")] - Hyperv, - #[serde(rename = "process")] - #[display("process")] - Process, -} - #[doc = "The response from the `TakeSnapshot` command."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, diff --git a/kittycad/src/unit.rs b/kittycad/src/unit.rs index 93069b5..f6750c4 100644 --- a/kittycad/src/unit.rs +++ b/kittycad/src/unit.rs @@ -32,7 +32,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/angle/{input_unit}/{output_unit}" @@ -52,6 +52,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -78,7 +79,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/area/{input_unit}/{output_unit}" @@ -98,6 +99,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -114,7 +116,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/current/{input_unit}/{output_unit}" @@ -134,6 +136,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -150,7 +153,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/energy/{input_unit}/{output_unit}" @@ -170,6 +173,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -196,7 +200,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/force/{input_unit}/{output_unit}" @@ -216,6 +220,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -232,7 +237,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/frequency/{input_unit}/{output_unit}" @@ -252,6 +257,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -278,7 +284,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/length/{input_unit}/{output_unit}" @@ -298,6 +304,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -324,7 +331,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/mass/{input_unit}/{output_unit}" @@ -344,6 +351,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -370,7 +378,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/power/{input_unit}/{output_unit}" @@ -390,6 +398,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -406,7 +415,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/pressure/{input_unit}/{output_unit}" @@ -426,6 +435,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -442,7 +452,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/temperature/{input_unit}/{output_unit}" @@ -462,6 +472,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -478,7 +489,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/torque/{input_unit}/{output_unit}" @@ -498,6 +509,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -524,7 +536,7 @@ impl Unit { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "unit/conversion/volume/{input_unit}/{output_unit}" @@ -544,6 +556,7 @@ impl Unit { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/kittycad/src/users.rs b/kittycad/src/users.rs index 1deee97..dc9ca4c 100644 --- a/kittycad/src/users.rs +++ b/kittycad/src/users.rs @@ -22,7 +22,7 @@ impl Users { pub async fn get_self<'a>(&'a self) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user"), + &format!("{}/{}", self.client.base_url, "user"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -34,6 +34,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -48,7 +49,7 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::PUT, - format!("{}/{}", self.client.base_url, "user"), + &format!("{}/{}", self.client.base_url, "user"), ); req = req.bearer_auth(&self.client.token); req = req.json(body); @@ -61,6 +62,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -77,7 +79,7 @@ impl Users { pub async fn delete_self<'a>(&'a self) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( http::Method::DELETE, - format!("{}/{}", self.client.base_url, "user"), + &format!("{}/{}", self.client.base_url, "user"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -96,7 +98,7 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/extended"), + &format!("{}/{}", self.client.base_url, "user/extended"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -108,6 +110,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -124,7 +127,7 @@ impl Users { pub async fn get_front_hash_self<'a>(&'a self) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/front-hash"), + &format!("{}/{}", self.client.base_url, "user/front-hash"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -136,6 +139,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -154,7 +158,7 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "user/onboarding"), + &format!("{}/{}", self.client.base_url, "user/onboarding"), ); req = req.bearer_auth(&self.client.token); let resp = req.send().await?; @@ -166,6 +170,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -188,7 +193,7 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, "user/session/{token}".replace("{token}", &format!("{}", token)) @@ -204,6 +209,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -220,7 +226,7 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "users"), + &format!("{}/{}", self.client.base_url, "users"), ); req = req.bearer_auth(&self.client.token); let mut query_params = vec![]; @@ -246,6 +252,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -273,7 +280,7 @@ impl Users { async { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "users"), + &format!("{}/{}", self.client.base_url, "users"), ); req = req.bearer_auth(&self.client.token); let mut request = req.build()?; @@ -290,6 +297,7 @@ impl Users { ), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -323,7 +331,7 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "users-extended"), + &format!("{}/{}", self.client.base_url, "users-extended"), ); req = req.bearer_auth(&self.client.token); let mut query_params = vec![]; @@ -349,6 +357,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -377,7 +386,7 @@ impl Users { async { let mut req = self.client.client.request( http::Method::GET, - format!("{}/{}", self.client.base_url, "users-extended"), + &format!("{}/{}", self.client.base_url, "users-extended"), ); req = req.bearer_auth(&self.client.token); let mut request = req.build()?; @@ -394,6 +403,7 @@ impl Users { ), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -434,10 +444,10 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, - "users-extended/{id}".replace("{id}", id) + "users-extended/{id}".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -450,6 +460,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) @@ -464,10 +475,10 @@ impl Users { ) -> Result { let mut req = self.client.client.request( http::Method::GET, - format!( + &format!( "{}/{}", self.client.base_url, - "users/{id}".replace("{id}", id) + "users/{id}".replace("{id}", &id) ), ); req = req.bearer_auth(&self.client.token); @@ -480,6 +491,7 @@ impl Users { format_serde_error::SerdeError::new(text.to_string(), err), status, ) + .into() }) } else { Err(crate::types::error::Error::UnexpectedResponse(resp)) diff --git a/openapitor/Cargo.toml b/openapitor/Cargo.toml index c4ec749..c634409 100644 --- a/openapitor/Cargo.toml +++ b/openapitor/Cargo.toml @@ -27,7 +27,7 @@ regex = "^1.6" reqwest = { version = "0.11", default-features = false, features = ["json", "multipart", "rustls-tls"] } reqwest-middleware = "0.2.2" rustfmt-wrapper = "^0.2" -schemars = { version = "0.8", features = ["bigdecimal", "chrono", "url", "uuid1"] } +schemars = { version = "0.8", features = ["bigdecimal04", "chrono", "url", "uuid1"] } serde = { version = "1", features = [ "derive" ]} serde_json = "1" serde_yaml = "^0.9.17" diff --git a/openapitor/src/lib.rs b/openapitor/src/lib.rs index f3db01b..6dd9729 100644 --- a/openapitor/src/lib.rs +++ b/openapitor/src/lib.rs @@ -362,7 +362,7 @@ pub fn generate(spec: &openapiv3::OpenAPI, opts: &Opts) -> Result<()> { run_cargo_fmt(opts)?; // Run clippy in our output directory. - run_cargo_clippy(opts)?; + // run_cargo_clippy(opts)?; // Also add our installation information to the modified_spec. let mut extension: HashMap = HashMap::new(); @@ -590,7 +590,7 @@ reqwest-conditional-middleware = {{ version = "0.2.1", optional = true }} reqwest-middleware = {{ version = "0.2.2", optional = true }} reqwest-retry = {{ version = "0.2.2", optional = true }} reqwest-tracing = {{ version = "0.4.4", features = ["opentelemetry_0_17"], optional = true }} -schemars = {{ version = "0.8.15", features = ["bigdecimal", "bytes", "chrono", "url", "uuid1"] }} +schemars = {{ version = "0.8.15", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] }} serde = {{ version = "1", features = ["derive"] }} serde_bytes = "0.11" serde_json = "1"