diff --git a/cargo-progenitor/src/main.rs b/cargo-progenitor/src/main.rs index b87909a4..b89de230 100644 --- a/cargo-progenitor/src/main.rs +++ b/cargo-progenitor/src/main.rs @@ -12,7 +12,7 @@ use openapiv3::OpenAPI; use progenitor::{GenerationSettings, Generator, InterfaceStyle, TagStyle}; use progenitor_impl::space_out_items; -fn is_non_release() -> bool { +const fn is_non_release() -> bool { cfg!(debug_assertions) } @@ -23,10 +23,10 @@ enum CargoCli { Progenitor(Args), } -/// Generate a stand-alone crate from an OpenAPI document +/// Generate a stand-alone crate from an `OpenAPI` document #[derive(Parser)] struct Args { - /// OpenAPI definition document (JSON or YAML) + /// `OpenAPI` definition document (JSON or YAML) #[clap(short = 'i', long)] input: String, /// Output directory for Rust crate @@ -65,8 +65,8 @@ enum InterfaceArg { impl From for InterfaceStyle { fn from(arg: InterfaceArg) -> Self { match arg { - InterfaceArg::Positional => InterfaceStyle::Positional, - InterfaceArg::Builder => InterfaceStyle::Builder, + InterfaceArg::Positional => Self::Positional, + InterfaceArg::Builder => Self::Builder, } } } @@ -80,8 +80,8 @@ enum TagArg { impl From for TagStyle { fn from(arg: TagArg) -> Self { match arg { - TagArg::Merged => TagStyle::Merged, - TagArg::Separate => TagStyle::Separate, + TagArg::Merged => Self::Merged, + TagArg::Separate => Self::Separate, } } } @@ -92,7 +92,7 @@ fn reformat_code(input: String) -> String { wrap_comments: Some(true), ..Default::default() }; - space_out_items(rustfmt_wrapper::rustfmt_config(config, input).unwrap()).unwrap() + space_out_items(&rustfmt_wrapper::rustfmt_config(config, input).unwrap()).unwrap() } fn save

(p: P, data: &str) -> Result<()> @@ -131,7 +131,7 @@ fn main() -> Result<()> { println!("-----------------------------------------------------"); for (idx, type_entry) in type_space.iter_types().enumerate() { let n = type_entry.describe(); - println!("{:>4} {}", idx, n); + println!("{idx:>4} {n}"); } println!("-----------------------------------------------------"); println!(); @@ -153,10 +153,10 @@ fn main() -> Result<()> { version = \"{}\"\n\ edition = \"2024\"\n\ license = \"{}\"\n", - name, version, &args.license_name, + name, version, args.license_name, ); if let Some(registry_name) = args.registry_name { - tomlout.extend(format!("publish = [\"{}\"]\n", registry_name).chars()); + tomlout.extend(format!("publish = [\"{registry_name}\"]\n").chars()); } tomlout.extend( format!( @@ -164,7 +164,7 @@ fn main() -> Result<()> { [dependencies]\n\ {}\n\ \n", - dependencies(builder, args.include_client).join("\n"), + dependencies(&builder, args.include_client).join("\n"), ) .chars(), ); @@ -178,7 +178,7 @@ fn main() -> Result<()> { // Create the Rust source file containing the generated client: let lib_code = if args.include_client { - format!("mod progenitor_client;\n\n{}", api_code) + format!("mod progenitor_client;\n\n{api_code}") } else { api_code.to_string() }; @@ -198,7 +198,7 @@ fn main() -> Result<()> { } Err(e) => { - println!("gen fail: {:?}", e); + println!("gen fail: {e:?}"); bail!("generation experienced errors"); } } @@ -239,7 +239,8 @@ static DEPENDENCIES: Dependencies = Dependencies { uuid: "1.0", }; -pub fn dependencies(builder: Generator, include_client: bool) -> Vec { +#[must_use] +pub fn dependencies(builder: &Generator, include_client: bool) -> Vec { let mut deps = vec![ format!("bytes = \"{}\"", DEPENDENCIES.bytes), format!("futures-core = \"{}\"", DEPENDENCIES.futures), @@ -255,15 +256,13 @@ pub fn dependencies(builder: Generator, include_client: bool) -> Vec { ]; let type_space = builder.get_type_space(); - let mut needs_serde_json = false; - - if include_client { + let needs_serde_json = if include_client { // code included from progenitor-client needs extra dependencies deps.push(format!( "percent-encoding = \"{}\"", DEPENDENCIES.percent_encoding )); - needs_serde_json = true; + true } else { let crate_version = if let (false, Some(value)) = (is_non_release(), option_env!("CARGO_PKG_VERSION")) { @@ -271,9 +270,10 @@ pub fn dependencies(builder: Generator, include_client: bool) -> Vec { } else { "*" }; - let client_version_dep = format!("progenitor-client = \"{}\"", crate_version); + let client_version_dep = format!("progenitor-client = \"{crate_version}\""); deps.push(client_version_dep); - } + false + }; if type_space.uses_regress() { deps.push(format!("regress = \"{}\"", DEPENDENCIES.regress)); @@ -309,12 +309,11 @@ where P: AsRef + std::clone::Clone + std::fmt::Debug, { let mut f = File::open(p.clone())?; - let api = match serde_json::from_reader(f) { - Ok(json_value) => json_value, - _ => { - f = File::open(p)?; - serde_yaml::from_reader(f)? - } + let api = if let Ok(json_value) = serde_json::from_reader(f) { + json_value + } else { + f = File::open(p)?; + serde_yaml::from_reader(f)? }; Ok(api) } diff --git a/cargo-progenitor/tests/data/test_help.stdout b/cargo-progenitor/tests/data/test_help.stdout index eeacbb65..57ea28cb 100644 --- a/cargo-progenitor/tests/data/test_help.stdout +++ b/cargo-progenitor/tests/data/test_help.stdout @@ -1,10 +1,10 @@ -Generate a stand-alone crate from an OpenAPI document +Generate a stand-alone crate from an `OpenAPI` document Usage: cargo progenitor [OPTIONS] --input --output --name --version Options: -i, --input - OpenAPI definition document (JSON or YAML) + `OpenAPI` definition document (JSON or YAML) -o, --output Output directory for Rust crate -n, --name diff --git a/example-build/build.rs b/example-build/build.rs index 2119be59..7fd75973 100644 --- a/example-build/build.rs +++ b/example-build/build.rs @@ -8,7 +8,7 @@ use std::{ fn main() { let src = "../sample_openapi/keeper.json"; - println!("cargo:rerun-if-changed={}", src); + println!("cargo:rerun-if-changed={src}"); let file = File::open(src).unwrap(); let spec = serde_json::from_reader(file).unwrap(); let mut generator = progenitor::Generator::default(); diff --git a/example-build/src/main.rs b/example-build/src/main.rs index c0fa53a8..fa106769 100644 --- a/example-build/src/main.rs +++ b/example-build/src/main.rs @@ -5,11 +5,9 @@ include!(concat!(env!("OUT_DIR"), "/codegen.rs")); fn main() { let client = Client::new("https://foo/bar"); - let _ = client.enrol( - "auth-token", - &types::EnrolBody { - host: "".to_string(), - key: "".to_string(), - }, - ); + let body = types::EnrolBody { + host: String::new(), + key: String::new(), + }; + let _future = client.enrol("auth-token", &body); } diff --git a/example-macro/src/main.rs b/example-macro/src/main.rs index 5ace903b..4b05970a 100644 --- a/example-macro/src/main.rs +++ b/example-macro/src/main.rs @@ -5,7 +5,7 @@ use progenitor::generate_api; generate_api!( spec = "../sample_openapi/keeper.json", pre_hook = (|request| { - println!("doing this {:?}", request); + println!("doing this {request:?}"); }), pre_hook_async = crate::add_auth_headers, post_hook = crate::all_done, @@ -27,7 +27,7 @@ async fn add_auth_headers( Ok(()) } -fn all_done(_result: &reqwest::Result) {} +const fn all_done(_result: &reqwest::Result) {} mod buildomat { use progenitor::generate_api; @@ -35,4 +35,4 @@ mod buildomat { generate_api!("../sample_openapi/buildomat.json"); } -fn main() {} +const fn main() {} diff --git a/example-out-dir/build.rs b/example-out-dir/build.rs index b1fe23a5..b05109b3 100644 --- a/example-out-dir/build.rs +++ b/example-out-dir/build.rs @@ -9,7 +9,7 @@ fn main() { // complex build script might, for example, extract the OpenAPI document // from a non-file source, writing it out to OUT_DIR. let src = "../sample_openapi/keeper.json"; - println!("cargo:rerun-if-changed={}", src); + println!("cargo:rerun-if-changed={src}"); let out_dir = env::var("OUT_DIR").unwrap(); let dest = Path::new(&out_dir).join("keeper.json"); diff --git a/example-out-dir/src/main.rs b/example-out-dir/src/main.rs index b8950e18..cf00b61b 100644 --- a/example-out-dir/src/main.rs +++ b/example-out-dir/src/main.rs @@ -11,11 +11,9 @@ generate_api!( fn main() { let client = Client::new("https://example.com"); - std::mem::drop(client.enrol( - "auth-token", - &types::EnrolBody { - host: "".to_string(), - key: "".to_string(), - }, - )); + let body = types::EnrolBody { + host: String::new(), + key: String::new(), + }; + let _future = client.enrol("auth-token", &body); } diff --git a/example-wasm/build.rs b/example-wasm/build.rs index 2119be59..7fd75973 100644 --- a/example-wasm/build.rs +++ b/example-wasm/build.rs @@ -8,7 +8,7 @@ use std::{ fn main() { let src = "../sample_openapi/keeper.json"; - println!("cargo:rerun-if-changed={}", src); + println!("cargo:rerun-if-changed={src}"); let file = File::open(src).unwrap(); let spec = serde_json::from_reader(file).unwrap(); let mut generator = progenitor::Generator::default(); diff --git a/example-wasm/src/main.rs b/example-wasm/src/main.rs index c0fa53a8..fa106769 100644 --- a/example-wasm/src/main.rs +++ b/example-wasm/src/main.rs @@ -5,11 +5,9 @@ include!(concat!(env!("OUT_DIR"), "/codegen.rs")); fn main() { let client = Client::new("https://foo/bar"); - let _ = client.enrol( - "auth-token", - &types::EnrolBody { - host: "".to_string(), - key: "".to_string(), - }, - ); + let body = types::EnrolBody { + host: String::new(), + key: String::new(), + }; + let _future = client.enrol("auth-token", &body); } diff --git a/example-wasm/tests/client.rs b/example-wasm/tests/client.rs index 2c483792..cc609438 100644 --- a/example-wasm/tests/client.rs +++ b/example-wasm/tests/client.rs @@ -8,5 +8,5 @@ include!(concat!(env!("OUT_DIR"), "/codegen.rs")); #[wasm_bindgen_test::wasm_bindgen_test] fn test_client_new() { let client = Client::new("http://foo/bar"); - assert!(client.baseurl == "http://foo/bar"); + assert_eq!(client.baseurl, "http://foo/bar"); } diff --git a/progenitor-client/src/lib.rs b/progenitor-client/src/lib.rs index f7ca0f66..1f0ad8f4 100644 --- a/progenitor-client/src/lib.rs +++ b/progenitor-client/src/lib.rs @@ -13,6 +13,7 @@ pub use crate::progenitor_client::*; // need to determine the provenance of progenitor (crates.io, github, etc.) // when generating the stand-alone crate. #[doc(hidden)] -pub fn code() -> &'static str { +#[must_use] +pub const fn code() -> &'static str { include_str!("progenitor_client.rs") } diff --git a/progenitor-client/src/progenitor_client.rs b/progenitor-client/src/progenitor_client.rs index db672853..121bad97 100644 --- a/progenitor-client/src/progenitor_client.rs +++ b/progenitor-client/src/progenitor_client.rs @@ -1,6 +1,8 @@ // Copyright 2025 Oxide Computer Company #![allow(dead_code)] +// `Error` is public API. Boxing its large variants would be a breaking change. +#![allow(clippy::result_large_err)] //! Support code for generated clients. @@ -21,14 +23,16 @@ type InnerByteStream = std::pin::Pin Self { Self(inner) } /// Consumes the [`ByteStream`] and return its inner [`Stream`]. + #[must_use] pub fn into_inner(self) -> InnerByteStream { self.0 } @@ -52,7 +56,7 @@ impl DerefMut for ByteStream { pub trait ClientInfo { /// Get the version of this API. /// - /// This string is pulled directly from the source OpenAPI document and may + /// This string is pulled directly from the source `OpenAPI` document and may /// be in any format the API selects. fn api_version() -> &'static str; @@ -89,15 +93,16 @@ where /// Information about an operation, consumed by hook implementations. pub struct OperationInfo { - /// The corresponding operationId from the source OpenAPI document. + /// The corresponding operationId from the source `OpenAPI` document. pub operation_id: &'static str, } -/// Interface for changing the behavior of generated clients. All clients -/// implement this for `&Client`; to override the default behavior, implement -/// some or all of the interfaces for the `Client` type (without the +/// Interface for changing the behavior of generated clients. +/// +/// All clients implement this for `&Client`; to override the default behavior, +/// implement some or all of the interfaces for the `Client` type (without the /// reference). This mechanism relies on so-called "auto-ref specialization". -#[allow(async_fn_in_trait, unused)] +#[allow(async_fn_in_trait, unused_variables)] pub trait ClientHooks where Self: ClientInfo, @@ -164,6 +169,13 @@ pub struct ResponseValue { impl ResponseValue { #[doc(hidden)] + #[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest response futures use browser-local state on wasm" + ) + )] pub async fn from_response(response: reqwest::Response) -> Result> { let status = response.status(); let headers = response.headers().clone(); @@ -203,6 +215,7 @@ impl ResponseValue { impl ResponseValue { #[doc(hidden)] + #[must_use] pub fn stream(response: reqwest::Response) -> Self { let status = response.status(); let headers = response.headers().clone(); @@ -216,7 +229,8 @@ impl ResponseValue { impl ResponseValue<()> { #[doc(hidden)] - pub fn empty(response: reqwest::Response) -> Self { + #[must_use] + pub fn empty(response: &reqwest::Response) -> Self { let status = response.status(); let headers = response.headers().clone(); // TODO is there anything we want to do to confirm that there is no @@ -233,7 +247,11 @@ impl ResponseValue { /// Creates a [`ResponseValue`] from the inner type, status, and headers. /// /// Useful for generating test fixtures. - pub fn new(inner: T, status: reqwest::StatusCode, headers: reqwest::header::HeaderMap) -> Self { + pub const fn new( + inner: T, + status: reqwest::StatusCode, + headers: reqwest::header::HeaderMap, + ) -> Self { Self { inner, status, @@ -241,18 +259,18 @@ impl ResponseValue { } } - /// Consumes the ResponseValue, returning the wrapped value. + /// Consumes the [`ResponseValue`], returning the wrapped value. pub fn into_inner(self) -> T { self.inner } /// Gets the status from this response. - pub fn status(&self) -> reqwest::StatusCode { + pub const fn status(&self) -> reqwest::StatusCode { self.status } /// Gets the headers from this response. - pub fn headers(&self) -> &reqwest::header::HeaderMap { + pub const fn headers(&self) -> &reqwest::header::HeaderMap { &self.headers } @@ -288,6 +306,7 @@ impl ResponseValue { impl ResponseValue { /// Consumes the `ResponseValue`, returning the wrapped [`Stream`]. + #[must_use] pub fn into_inner_stream(self) -> InnerByteStream { self.into_inner().into_inner() } @@ -355,14 +374,12 @@ impl Error { /// Returns the status code, if the error was generated from a response. pub fn status(&self) -> Option { match self { - Error::InvalidRequest(_) => None, - Error::Custom(_) => None, - Error::CommunicationError(e) => e.status(), - Error::ErrorResponse(rv) => Some(rv.status()), - Error::InvalidUpgrade(e) => e.status(), - Error::ResponseBodyError(e) => e.status(), - Error::InvalidResponsePayload(_, _) => None, - Error::UnexpectedResponse(r) => Some(r.status()), + Self::InvalidRequest(_) | Self::Custom(_) | Self::InvalidResponsePayload(_, _) => None, + Self::CommunicationError(e) | Self::InvalidUpgrade(e) | Self::ResponseBodyError(e) => { + e.status() + } + Self::ErrorResponse(rv) => Some(rv.status()), + Self::UnexpectedResponse(r) => Some(r.status()), } } @@ -378,10 +395,10 @@ impl Error { /// * 504 Gateway Timeout pub fn is_retryable(&self) -> bool { match self { - Error::CommunicationError(_) => true, - Error::ErrorResponse(rv) => is_retryable_status(rv.status()), - Error::UnexpectedResponse(r) => is_retryable_status(r.status()), - Error::InvalidUpgrade(e) | Error::ResponseBodyError(e) => { + Self::CommunicationError(_) => true, + Self::ErrorResponse(rv) => is_retryable_status(rv.status()), + Self::UnexpectedResponse(r) => is_retryable_status(r.status()), + Self::InvalidUpgrade(e) | Self::ResponseBodyError(e) => { // We expect InvalidUpgrade and ResponseBodyError to be 2xx // statuses. // @@ -392,9 +409,7 @@ impl Error { // it is appropriate to check for retryability. e.status().is_some_and(is_retryable_status) } - Error::InvalidRequest(_) => false, - Error::InvalidResponsePayload(_, _) => false, - Error::Custom(_) => false, + Self::InvalidRequest(_) | Self::InvalidResponsePayload(_, _) | Self::Custom(_) => false, } } @@ -404,10 +419,10 @@ impl Error { /// various error response bodies. pub fn into_untyped(self) -> Error { match self { - Error::InvalidRequest(s) => Error::InvalidRequest(s), - Error::Custom(s) => Error::Custom(s), - Error::CommunicationError(e) => Error::CommunicationError(e), - Error::ErrorResponse(ResponseValue { + Self::InvalidRequest(s) => Error::InvalidRequest(s), + Self::Custom(s) => Error::Custom(s), + Self::CommunicationError(e) => Error::CommunicationError(e), + Self::ErrorResponse(ResponseValue { inner: _, status, headers, @@ -416,10 +431,10 @@ impl Error { status, headers, }), - Error::InvalidUpgrade(e) => Error::InvalidUpgrade(e), - Error::ResponseBodyError(e) => Error::ResponseBodyError(e), - Error::InvalidResponsePayload(b, e) => Error::InvalidResponsePayload(b, e), - Error::UnexpectedResponse(r) => Error::UnexpectedResponse(r), + Self::InvalidUpgrade(e) => Error::InvalidUpgrade(e), + Self::ResponseBodyError(e) => Error::ResponseBodyError(e), + Self::InvalidResponsePayload(b, e) => Error::InvalidResponsePayload(b, e), + Self::UnexpectedResponse(r) => Error::UnexpectedResponse(r), } } } @@ -448,30 +463,30 @@ where { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Error::InvalidRequest(s) => { - write!(f, "Invalid Request: {}", s)?; + Self::InvalidRequest(s) => { + write!(f, "Invalid Request: {s}")?; } - Error::CommunicationError(e) => { - write!(f, "Communication Error: {}", e)?; + Self::CommunicationError(e) => { + write!(f, "Communication Error: {e}")?; } - Error::ErrorResponse(rve) => { + Self::ErrorResponse(rve) => { write!(f, "Error Response: ")?; rve.fmt_info(f)?; } - Error::InvalidUpgrade(e) => { - write!(f, "Invalid Response Upgrade: {}", e)?; + Self::InvalidUpgrade(e) => { + write!(f, "Invalid Response Upgrade: {e}")?; } - Error::ResponseBodyError(e) => { - write!(f, "Invalid Response Body Bytes: {}", e)?; + Self::ResponseBodyError(e) => { + write!(f, "Invalid Response Body Bytes: {e}")?; } - Error::InvalidResponsePayload(b, e) => { - write!(f, "Invalid Response Payload ({:?}): {}", b, e)?; + Self::InvalidResponsePayload(b, e) => { + write!(f, "Invalid Response Payload ({b:?}): {e}")?; } - Error::UnexpectedResponse(r) => { - write!(f, "Unexpected Response: {:?}", r)?; + Self::UnexpectedResponse(r) => { + write!(f, "Unexpected Response: {r:?}")?; } - Error::Custom(s) => { - write!(f, "Error: {}", s)?; + Self::Custom(s) => { + write!(f, "Error: {s}")?; } } @@ -529,10 +544,10 @@ where { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { - Error::CommunicationError(e) => Some(e), - Error::InvalidUpgrade(e) => Some(e), - Error::ResponseBodyError(e) => Some(e), - Error::InvalidResponsePayload(_b, e) => Some(e), + Self::CommunicationError(e) | Self::InvalidUpgrade(e) | Self::ResponseBodyError(e) => { + Some(e) + } + Self::InvalidResponsePayload(_b, e) => Some(e), _ => None, } } @@ -566,6 +581,7 @@ const PATH_SET: &percent_encoding::AsciiSet = &percent_encoding::CONTROLS #[doc(hidden)] /// Percent encode input string. +#[must_use] pub fn encode_path(pc: &str) -> String { percent_encoding::utf8_percent_encode(pc, PATH_SET).to_string() } @@ -597,7 +613,7 @@ pub struct QueryParam<'a, T> { impl<'a, T> QueryParam<'a, T> { #[doc(hidden)] - pub fn new(name: &'a str, value: &'a T) -> Self { + pub const fn new(name: &'a str, value: &'a T) -> Self { Self { name, value } } } @@ -617,7 +633,7 @@ where } } -pub(crate) struct QuerySerializer<'a, S> { +struct QuerySerializer<'a, S> { inner: S, name: &'a str, } diff --git a/progenitor-client/tests/client_test.rs b/progenitor-client/tests/client_test.rs index 96fd118e..a77ffb72 100644 --- a/progenitor-client/tests/client_test.rs +++ b/progenitor-client/tests/client_test.rs @@ -171,6 +171,18 @@ fn test_query_enum_untagged() { Object { a: u64, b: u64 }, Array(Vec), } + + #[derive(Serialize)] + #[serde(transparent)] + struct Name(String); + + #[derive(Serialize)] + #[serde(untagged)] + enum NameOrId { + Name(Name), + Id(uuid::Uuid), + } + let value = Value::Simple; let result = encode_query_param("ignored", &value).unwrap(); assert_eq!(result, ""); @@ -190,15 +202,6 @@ fn test_query_enum_untagged() { let result = encode_query_param("paramName", &value).unwrap(); assert_eq!(result, "paramName=1¶mName=2¶mName=3¶mName=4"); - #[derive(Serialize)] - #[serde(transparent)] - struct Name(String); - #[derive(Serialize)] - #[serde(untagged)] - enum NameOrId { - Name(Name), - Id(uuid::Uuid), - } let value = Some(NameOrId::Name(Name("xyz".to_string()))); let result = encode_query_param("paramName", &value).unwrap(); assert_eq!(result, "paramName=xyz"); diff --git a/progenitor-impl/src/cli.rs b/progenitor-impl/src/cli.rs index fcba1a48..1e81a26d 100644 --- a/progenitor-impl/src/cli.rs +++ b/progenitor-impl/src/cli.rs @@ -24,6 +24,17 @@ struct CliOperation { impl Generator { /// Generate a `clap`-based CLI. + /// + /// # Errors + /// + /// Returns an error if the `OpenAPI` document is invalid or its types + /// cannot be converted into CLI arguments. + /// + /// # Panics + /// + /// Panics if validated component references violate an internal generator + /// invariant. + #[allow(clippy::too_many_lines, reason = "keeps generation stages together")] pub fn cli(&mut self, spec: &OpenAPI, crate_name: &str) -> Result { validate_openapi(spec)?; @@ -48,7 +59,13 @@ impl Generator { }) }) .map(|(path, method, operation, path_parameters)| { - self.process_operation(operation, &spec.components, path, method, path_parameters) + self.process_operation( + operation, + spec.components.as_ref(), + path, + method, + path_parameters, + ) }) .collect::>>()?; @@ -184,7 +201,12 @@ impl Generator { Ok(code) } - fn cli_method(&mut self, method: &crate::method::OperationMethod) -> CliOperation { + #[allow(clippy::too_many_lines, reason = "mirrors the generated CLI method")] + #[allow( + clippy::single_match_else, + reason = "the match documents both request execution modes" + )] + fn cli_method(&self, method: &crate::method::OperationMethod) -> CliOperation { let CliArg { parser: parser_args, consumer: consumer_args, @@ -233,9 +255,9 @@ impl Generator { let op_name = format_ident!("{}", &method.operation_id); let (_, success_kind) = - self.extract_responses(method, OperationResponseStatus::is_success_or_default); + Self::extract_responses(method, OperationResponseStatus::is_success_or_default); let (_, error_kind) = - self.extract_responses(method, OperationResponseStatus::is_error_or_default); + Self::extract_responses(method, OperationResponseStatus::is_error_or_default); let execute_and_output = match method.dropshot_paginated { // Normal, one-shot API calls. @@ -390,6 +412,7 @@ impl Generator { } } + #[allow(clippy::too_many_lines, reason = "keeps argument generation cohesive")] fn cli_method_args(&self, method: &crate::method::OperationMethod) -> CliArg { let mut args = CliOperationArgs::default(); @@ -404,8 +427,8 @@ impl Generator { OperationParameterKind::Body(_) => continue, OperationParameterKind::Path => true, - OperationParameterKind::Query(required) => *required, - OperationParameterKind::Header(required) => *required, + OperationParameterKind::Query(required) + | OperationParameterKind::Header(required) => *required, }; // For paginated endpoints, we don't generate 'page_token' args. @@ -413,8 +436,8 @@ impl Generator { continue; } - let first_page_required = first_page_required_set - .map_or(false, |required| required.contains(¶m.api_name)); + let first_page_required = + first_page_required_set.is_some_and(|required| required.contains(¶m.api_name)); let volitionality = if innately_required || first_page_required { Volitionality::Required @@ -432,7 +455,12 @@ impl Generator { // There should be no conflicting path or query parameters. assert!(!args.has_arg(&arg_name)); - let parser = clap_arg(&arg_name, volitionality, ¶m.description, &arg_type); + let parser = clap_arg( + &arg_name, + volitionality, + param.description.as_ref(), + &arg_type, + ); let arg_fn_name = sanitize(¶m.name, Case::Snake); let arg_fn = format_ident!("{}", arg_fn_name); @@ -452,7 +480,7 @@ impl Generator { } }; - args.add_arg(arg_name, CliArg { parser, consumer }) + args.add_arg(arg_name, CliArg { parser, consumer }); } let maybe_body_type_id = method @@ -476,14 +504,14 @@ impl Generator { match details { typify::TypeDetails::Struct(struct_info) => { for prop_info in struct_info.properties_info() { - self.cli_method_body_arg(&mut args, prop_info) + self.cli_method_body_arg(&mut args, prop_info); } } _ => { // If the body is not a struct, we don't know what's // required or how to generate it - args.body_required() + args.body_required(); } } } @@ -582,11 +610,7 @@ impl Generator { None }; - let prop_type = if let Some(inner_type) = maybe_inner_type { - inner_type - } else { - prop_type - }; + let prop_type = maybe_inner_type.unwrap_or(prop_type); let scalar = prop_type.has_impl(TypeSpaceImpl::FromStr); @@ -600,7 +624,7 @@ impl Generator { let parser = clap_arg( &prop_name, volitionality, - &description.map(str::to_string), + description.map(str::to_string).as_ref(), &prop_type, ); @@ -619,9 +643,9 @@ impl Generator { }) } }; - args.add_arg(prop_name, CliArg { parser, consumer }) + args.add_arg(prop_name, CliArg { parser, consumer }); } else if required { - args.body_required() + args.body_required(); } // Cases @@ -637,6 +661,7 @@ impl Generator { } } +#[derive(Clone, Copy)] enum Volitionality { Optional, Required, @@ -646,10 +671,10 @@ enum Volitionality { fn clap_arg( arg_name: &str, volitionality: Volitionality, - description: &Option, + description: Option<&String>, arg_type: &Type, ) -> TokenStream { - let help = description.as_ref().map(|description| { + let help = description.map(|description| { quote! { .help(#description) } @@ -665,7 +690,7 @@ fn clap_arg( let maybe_var_names = e .variants() .map(|(var_name, var_details)| { - if let TypeEnumVariant::Simple = var_details { + if matches!(var_details, TypeEnumVariant::Simple) { Some(format_ident!("{}", var_name)) } else { None @@ -687,16 +712,14 @@ fn clap_arg( None }; - let value_parser = if let Some(enum_parser) = maybe_enum_parser { - enum_parser - } else { + let value_parser = maybe_enum_parser.unwrap_or_else(|| { // Let clap pick a value parser for us. This has the benefit of // allowing for override implementations. A generated client may // implement ValueParserFactory for a type to create a custom parser. quote! { ::clap::value_parser!(#arg_type_name) } - }; + }); let required = match volitionality { Volitionality::Optional => quote! { .required(false) }, diff --git a/progenitor-impl/src/httpmock.rs b/progenitor-impl/src/httpmock.rs index 2c58ba59..820b0584 100644 --- a/progenitor-impl/src/httpmock.rs +++ b/progenitor-impl/src/httpmock.rs @@ -30,6 +30,16 @@ impl Generator { /// The `crate_path` parameter should be a valid Rust path corresponding to /// the SDK. This can include `::` and instances of `-` in the crate name /// should be converted to `_`. + /// + /// # Errors + /// + /// Returns an error if the `OpenAPI` document or crate path is invalid, or + /// if its types cannot be converted into mock definitions. + /// + /// # Panics + /// + /// Panics if validated component references violate an internal generator + /// invariant. pub fn httpmock(&mut self, spec: &OpenAPI, crate_path: &str) -> Result { validate_openapi(spec)?; @@ -54,7 +64,13 @@ impl Generator { }) }) .map(|(path, method, operation, path_parameters)| { - self.process_operation(operation, &spec.components, path, method, path_parameters) + self.process_operation( + operation, + spec.components.as_ref(), + path, + method, + path_parameters, + ) }) .collect::>>()?; @@ -75,7 +91,7 @@ impl Generator { let crate_path = syn::TypePath { qself: None, path: syn::parse_str(crate_path) - .unwrap_or_else(|_| panic!("{} is not a valid identifier", crate_path)), + .unwrap_or_else(|_| panic!("{crate_path} is not a valid identifier")), }; let code = quote! { @@ -127,7 +143,8 @@ impl Generator { Ok(code) } - fn httpmock_method(&mut self, method: &crate::method::OperationMethod) -> MockOp { + #[allow(clippy::too_many_lines, reason = "mirrors the generated mock method")] + fn httpmock_method(&self, method: &crate::method::OperationMethod) -> MockOp { let when_name = sanitize(&format!("{}-when", method.operation_id), Case::Pascal); let when = format_ident!("{}", when_name).to_token_stream(); let then_name = sanitize(&format!("{}-then", method.operation_id), Case::Pascal); @@ -328,7 +345,8 @@ impl Generator { }, ) } - crate::method::OperationResponseKind::None => Default::default(), + crate::method::OperationResponseKind::None + | crate::method::OperationResponseKind::Upgrade => Default::default(), crate::method::OperationResponseKind::Raw => ( quote! { value: ::serde_json::Value, @@ -338,7 +356,6 @@ impl Generator { .json_body(value) }, ), - crate::method::OperationResponseKind::Upgrade => Default::default(), }; match status_code { diff --git a/progenitor-impl/src/lib.rs b/progenitor-impl/src/lib.rs index 4d5a96a6..8cb707bc 100644 --- a/progenitor-impl/src/lib.rs +++ b/progenitor-impl/src/lib.rs @@ -1,10 +1,13 @@ // Copyright 2025 Oxide Computer Company -//! Core implementation for the progenitor OpenAPI client generator. +//! Core implementation for the progenitor `OpenAPI` client generator. #![deny(missing_docs)] -use std::collections::{BTreeMap, HashMap, HashSet}; +use std::{ + collections::{BTreeMap, HashMap, HashSet}, + fmt::Write as _, +}; use openapiv3::OpenAPI; use proc_macro2::TokenStream; @@ -47,7 +50,7 @@ pub enum Error { #[allow(missing_docs)] pub type Result = std::result::Result; -/// OpenAPI generator. +/// `OpenAPI` generator. pub struct Generator { type_space: TypeSpace, settings: GenerationSettings, @@ -85,49 +88,42 @@ struct CrateSpec { } /// Style of generated client. -#[derive(Clone, Deserialize, PartialEq, Eq)] +#[derive(Clone, Deserialize, PartialEq, Eq, Default)] pub enum InterfaceStyle { /// Use positional style. + #[default] Positional, /// Use builder style. Builder, } -impl Default for InterfaceStyle { - fn default() -> Self { - Self::Positional - } -} - -/// Style for using the OpenAPI tags when generating names in the client. -#[derive(Clone, Deserialize)] +/// Style for using the `OpenAPI` tags when generating names in the client. +#[derive(Clone, Deserialize, Default)] pub enum TagStyle { /// Merge tags to create names in the generated client. + #[default] Merged, /// Use each tag name to create separate names in the generated client. Separate, } -impl Default for TagStyle { - fn default() -> Self { - Self::Merged - } -} - +// These public builder methods intentionally accept owned or borrowed values. +#[allow(clippy::needless_pass_by_value)] impl GenerationSettings { /// Create new generator settings with default values. + #[must_use] pub fn new() -> Self { Self::default() } - /// Set the [InterfaceStyle]. - pub fn with_interface(&mut self, interface: InterfaceStyle) -> &mut Self { + /// Set the [`InterfaceStyle`]. + pub const fn with_interface(&mut self, interface: InterfaceStyle) -> &mut Self { self.interface = interface; self } - /// Set the [TagStyle]. - pub fn with_tag(&mut self, tag: TagStyle) -> &mut Self { + /// Set the [`TagStyle`]. + pub const fn with_tag(&mut self, tag: TagStyle) -> &mut Self { self.tag = tag; self } @@ -175,7 +171,7 @@ impl GenerationSettings { } /// Modify a type with the given name. - /// See [typify::TypeSpaceSettings::with_patch]. + /// See [`typify::TypeSpaceSettings::with_patch`]. pub fn with_patch>(&mut self, type_name: S, patch: &TypePatch) -> &mut Self { self.patch .insert(type_name.as_ref().to_string(), patch.clone()); @@ -183,7 +179,7 @@ impl GenerationSettings { } /// Replace a referenced type with a named type. - /// See [typify::TypeSpaceSettings::with_replacement]. + /// See [`typify::TypeSpaceSettings::with_replacement`]. pub fn with_replacement>( &mut self, type_name: TS, @@ -198,7 +194,7 @@ impl GenerationSettings { } /// Replace a given schema with a named type. - /// See [typify::TypeSpaceSettings::with_conversion]. + /// See [`typify::TypeSpaceSettings::with_conversion`]. pub fn with_conversion>( &mut self, schema: schemars::schema::SchemaObject, @@ -211,9 +207,9 @@ impl GenerationSettings { } /// Policy regarding crates referenced by the schema extension - /// `x-rust-type` not explicitly specified via [Self::with_crate]. - /// See [typify::TypeSpaceSettings::with_unknown_crates]. - pub fn with_unknown_crates(&mut self, policy: UnknownPolicy) -> &mut Self { + /// `x-rust-type` not explicitly specified via [`Self::with_crate`]. + /// See [`typify::TypeSpaceSettings::with_unknown_crates`]. + pub const fn with_unknown_crates(&mut self, policy: UnknownPolicy) -> &mut Self { self.unknown_crates = policy; self } @@ -221,7 +217,7 @@ impl GenerationSettings { /// Explicitly named crates whose types may be used during generation /// rather than generating new types based on their schemas (base on the /// presence of the x-rust-type extension). - /// See [typify::TypeSpaceSettings::with_crate]. + /// See [`typify::TypeSpaceSettings::with_crate`]. pub fn with_crate( &mut self, crate_name: S1, @@ -244,14 +240,14 @@ impl GenerationSettings { /// - [`indexmap::IndexMap`] /// /// The requiremnets for a map type can be found in the - /// [typify::TypeSpaceSettings::with_map_type] documentation. + /// [`typify::TypeSpaceSettings::with_map_type`] documentation. pub fn with_map_type(&mut self, map_type: MT) -> &mut Self { self.map_type = Some(map_type.to_string()); self } /// Set the underlying reqwest client's timeout - pub fn with_timeout(&mut self, timeout: u64) -> &mut Self { + pub const fn with_timeout(&mut self, timeout: u64) -> &mut Self { self.timeout = Some(timeout); self } @@ -261,7 +257,7 @@ impl Default for Generator { fn default() -> Self { Self { type_space: TypeSpace::new(TypeSpaceSettings::default().with_type_mod("types")), - settings: Default::default(), + settings: GenerationSettings::default(), uses_futures: Default::default(), uses_websockets: Default::default(), } @@ -270,6 +266,7 @@ impl Default for Generator { impl Generator { /// Create a new generator with default values. + #[must_use] pub fn new(settings: &GenerationSettings) -> Self { let mut type_settings = TypeSpaceSettings::default(); type_settings @@ -296,13 +293,13 @@ impl Generator { .replace .iter() .for_each(|(type_name, (replace_name, impls))| { - type_settings.with_replacement(type_name, replace_name, impls.iter().cloned()); + type_settings.with_replacement(type_name, replace_name, impls.iter().copied()); }); settings .convert .iter() .for_each(|(schema, type_name, impls)| { - type_settings.with_conversion(schema.clone(), type_name, impls.iter().cloned()); + type_settings.with_conversion(schema.clone(), type_name, impls.iter().copied()); }); // Set the map type if specified. @@ -318,7 +315,21 @@ impl Generator { } } - /// Emit a [TokenStream] containing the generated client code. + /// Emit a [`TokenStream`] containing the generated client code. + /// + /// # Errors + /// + /// Returns an error if the `OpenAPI` document is invalid or its schemas + /// cannot be converted into Rust types. + /// + /// # Panics + /// + /// Panics if validated component references violate an internal generator + /// invariant. + #[allow( + clippy::too_many_lines, + reason = "keeps top-level generation stages together" + )] pub fn generate_tokens(&mut self, spec: &OpenAPI) -> Result { validate_openapi(spec)?; @@ -343,16 +354,22 @@ impl Generator { }) }) .map(|(path, method, operation, path_parameters)| { - self.process_operation(operation, &spec.components, path, method, path_parameters) + self.process_operation( + operation, + spec.components.as_ref(), + path, + method, + path_parameters, + ) }) .collect::>>()?; let operation_code = match (&self.settings.interface, &self.settings.tag) { - (InterfaceStyle::Positional, TagStyle::Merged) => self + (InterfaceStyle::Positional, TagStyle::Merged) => Ok(self .generate_tokens_positional_merged( &raw_methods, self.settings.inner_type.is_some(), - ), + )), (InterfaceStyle::Positional, TagStyle::Separate) => { unimplemented!("positional arguments with separate tags are currently unsupported") } @@ -366,7 +383,7 @@ impl Generator { .collect::>(); self.generate_tokens_builder_separate( &raw_methods, - tag_info, + &tag_info, self.settings.inner_type.is_some(), ) } @@ -374,10 +391,10 @@ impl Generator { let types = self.type_space.to_stream(); - let (inner_type, inner_fn_value) = match self.settings.inner_type.as_ref() { - Some(inner_type) => (inner_type.clone(), quote! { &self.inner }), - None => (quote! { () }, quote! { &() }), - }; + let (inner_type, inner_fn_value) = self.settings.inner_type.as_ref().map_or_else( + || (quote! { () }, quote! { &() }), + |inner_type| (inner_type.clone(), quote! { &self.inner }), + ); let inner_property = self.settings.inner_type.as_ref().map(|inner| { quote! { @@ -397,7 +414,7 @@ impl Generator { let client_timeout = self.settings.timeout.unwrap_or(15); let client_docstring = { - let mut s = format!("Client for {}", spec.info.title); + let mut s = format!("Client for `{}`", spec.info.title); if let Some(ss) = &spec.info.description { s.push_str("\n\n"); @@ -408,7 +425,7 @@ impl Generator { s.push_str(ss); } - s.push_str(&format!("\n\nVersion: {}", &spec.info.version)); + write!(&mut s, "\n\nVersion: {}", spec.info.version).unwrap(); s }; @@ -438,6 +455,14 @@ impl Generator { /// Types used as operation parameters and responses. #[allow(clippy::all)] + #[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" + )] + #[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" + )] pub mod types { #types } @@ -456,6 +481,11 @@ impl Generator { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new( baseurl: &str, #inner_parameter @@ -481,6 +511,7 @@ impl Generator { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client( baseurl: &str, client: reqwest::Client, @@ -524,11 +555,11 @@ impl Generator { &mut self, input_methods: &[method::OperationMethod], has_inner: bool, - ) -> Result { + ) -> TokenStream { let methods = input_methods .iter() .map(|method| self.positional_method(method, has_inner)) - .collect::>>()?; + .collect::>(); // The allow(unused_imports) on the `pub use` is necessary with Rust // 1.76+, in case the generated file is not at the top level of the @@ -536,6 +567,25 @@ impl Generator { let out = quote! { #[allow(clippy::all)] + #[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" + )] + #[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" + )] + #[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) + )] + #[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" + )] impl Client { #(#methods)* } @@ -546,7 +596,7 @@ impl Generator { pub use super::Client; } }; - Ok(out) + out } fn generate_tokens_builder_merged( @@ -561,7 +611,7 @@ impl Generator { let builder_methods = input_methods .iter() - .map(|method| self.builder_impl(method)) + .map(Self::builder_impl) .collect::>(); let out = quote! { @@ -571,6 +621,21 @@ impl Generator { /// Types for composing operation parameters. #[allow(clippy::all)] + #[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" + )] + #[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) + )] + #[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" + )] pub mod builder { use super::types; #[allow(unused_imports)] @@ -600,7 +665,7 @@ impl Generator { fn generate_tokens_builder_separate( &mut self, input_methods: &[method::OperationMethod], - tag_info: BTreeMap<&String, &openapiv3::Tag>, + tag_info: &BTreeMap<&String, &openapiv3::Tag>, has_inner: bool, ) -> Result { let builder_struct = input_methods @@ -608,7 +673,7 @@ impl Generator { .map(|method| self.builder_struct(method, TagStyle::Separate, has_inner)) .collect::>>()?; - let (traits_and_impls, trait_preludes) = self.builder_tags(input_methods, &tag_info); + let (traits_and_impls, trait_preludes) = Self::builder_tags(input_methods, tag_info); // The allow(unused_imports) on the `pub use` is necessary with Rust // 1.76+, in case the generated file is not at the top level of the @@ -619,6 +684,21 @@ impl Generator { /// Types for composing operation parameters. #[allow(clippy::all)] + #[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" + )] + #[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) + )] + #[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" + )] pub mod builder { use super::types; #[allow(unused_imports)] @@ -648,32 +728,43 @@ impl Generator { Ok(out) } - /// Get the [TypeSpace] for schemas present in the OpenAPI specification. - pub fn get_type_space(&self) -> &TypeSpace { + /// Get the [`TypeSpace`] for schemas present in the `OpenAPI` specification. + #[must_use] + pub const fn get_type_space(&self) -> &TypeSpace { &self.type_space } /// Whether the generated client needs to use additional crates to support /// futures. - pub fn uses_futures(&self) -> bool { + #[must_use] + pub const fn uses_futures(&self) -> bool { self.uses_futures } /// Whether the generated client needs to use additional crates to support /// websockets. - pub fn uses_websockets(&self) -> bool { + #[must_use] + pub const fn uses_websockets(&self) -> bool { self.uses_websockets } } /// Add newlines after end-braces at <= two levels of indentation. -pub fn space_out_items(content: String) -> Result { +/// +/// # Errors +/// +/// This function currently always returns `Ok`. +/// +/// # Panics +/// +/// Panics if one of the built-in regular expressions is invalid. +pub fn space_out_items(content: &str) -> Result { Ok(if cfg!(not(windows)) { - let regex = regex::Regex::new(r#"(\n\s*})(\n\s{0,8}[^} ])"#).unwrap(); - regex.replace_all(&content, "$1\n$2").to_string() + let regex = regex::Regex::new(r"(\n\s*})(\n\s{0,8}[^} ])").unwrap(); + regex.replace_all(content, "$1\n$2").to_string() } else { - let regex = regex::Regex::new(r#"(\n\s*})(\r\n\s{0,8}[^} ])"#).unwrap(); - regex.replace_all(&content, "$1\r\n$2").to_string() + let regex = regex::Regex::new(r"(\n\s*})(\r\n\s{0,8}[^} ])").unwrap(); + regex.replace_all(content, "$1\r\n$2").to_string() }) } @@ -683,13 +774,17 @@ fn validate_openapi_spec_version(spec_version: &str) -> Result<()> { Ok(()) } else { Err(Error::UnexpectedFormat(format!( - "invalid version: {}", - spec_version + "invalid version: {spec_version}" ))) } } -/// Do some very basic checks of the OpenAPI documents. +/// Do some very basic checks of the `OpenAPI` documents. +/// +/// # Errors +/// +/// Returns an error if the document uses an unsupported version, contains +/// unresolved path references, or repeats an operation ID. pub fn validate_openapi(spec: &OpenAPI) -> Result<()> { validate_openapi_spec_version(spec.openapi.as_str())?; @@ -697,17 +792,16 @@ pub fn validate_openapi(spec: &OpenAPI) -> Result<()> { spec.paths.paths.iter().try_for_each(|p| { match p.1 { openapiv3::ReferenceOr::Reference { reference: _ } => Err(Error::UnexpectedFormat( - format!("path {} uses reference, unsupported", p.0,), + format!("path {} uses reference, unsupported", p.0), )), openapiv3::ReferenceOr::Item(item) => { // Make sure every operation has an operation ID, and that each // operation ID is only used once in the document. item.iter().try_for_each(|(_, o)| { if let Some(oid) = o.operation_id.as_ref() { - if !opids.insert(oid.to_string()) { + if !opids.insert(oid.clone()) { return Err(Error::UnexpectedFormat(format!( - "duplicate operation ID: {}", - oid, + "duplicate operation ID: {oid}", ))); } } else { diff --git a/progenitor-impl/src/method.rs b/progenitor-impl/src/method.rs index 6752823c..8965c01e 100644 --- a/progenitor-impl/src/method.rs +++ b/progenitor-impl/src/method.rs @@ -3,6 +3,7 @@ use std::{ cmp::Ordering, collections::{BTreeMap, BTreeSet}, + fmt::Write as _, str::FromStr, }; @@ -19,7 +20,7 @@ use crate::{ use crate::{to_schema::ToSchema, util::ReferenceOrExt}; /// The intermediate representation of an operation that will become a method. -pub(crate) struct OperationMethod { +pub struct OperationMethod { pub operation_id: String, pub tags: Vec, pub method: HttpMethod, @@ -56,21 +57,21 @@ impl std::str::FromStr for HttpMethod { "head" => Ok(Self::Head), "patch" => Ok(Self::Patch), "trace" => Ok(Self::Trace), - _ => Err(Error::InternalError(format!("bad method: {}", s))), + _ => Err(Error::InternalError(format!("bad method: {s}"))), } } } impl HttpMethod { - fn as_str(&self) -> &'static str { + const fn as_str(&self) -> &'static str { match self { - HttpMethod::Get => "get", - HttpMethod::Put => "put", - HttpMethod::Post => "post", - HttpMethod::Delete => "delete", - HttpMethod::Options => "options", - HttpMethod::Head => "head", - HttpMethod::Patch => "patch", - HttpMethod::Trace => "trace", + Self::Get => "get", + Self::Put => "put", + Self::Post => "post", + Self::Delete => "delete", + Self::Options => "options", + Self::Head => "head", + Self::Patch => "patch", + Self::Trace => "trace", } } } @@ -118,16 +119,14 @@ pub enum OperationParameterKind { } impl OperationParameterKind { - fn is_required(&self) -> bool { + const fn is_required(&self) -> bool { match self { - OperationParameterKind::Path => true, - OperationParameterKind::Query(required) => *required, - OperationParameterKind::Header(required) => *required, + Self::Query(required) | Self::Header(required) => *required, // TODO may be optional - OperationParameterKind::Body(_) => true, + Self::Path | Self::Body(_) => true, } } - fn is_optional(&self) -> bool { + const fn is_optional(&self) -> bool { !self.is_required() } } @@ -151,8 +150,7 @@ impl FromStr for BodyContentType { "application/x-www-form-urlencoded" => Ok(Self::FormUrlencoded), "text/plain" | "text/x-markdown" => Ok(Self::Text(String::from(&s[..offset]))), _ => Err(Error::UnexpectedFormat(format!( - "unexpected content type: {}", - s + "unexpected content type: {s}" ))), } } @@ -170,7 +168,7 @@ impl std::fmt::Display for BodyContentType { } #[derive(Debug)] -pub(crate) struct OperationResponse { +pub struct OperationResponse { pub status_code: OperationResponseStatus, pub typ: OperationResponseKind, // TODO this isn't currently used because dropshot doesn't give us a @@ -197,7 +195,7 @@ impl PartialOrd for OperationResponse { } #[derive(Debug, Clone, Eq, PartialEq)] -pub(crate) enum OperationResponseStatus { +pub enum OperationResponseStatus { Code(u16), Range(u16), Default, @@ -206,39 +204,34 @@ pub(crate) enum OperationResponseStatus { impl OperationResponseStatus { fn to_value(&self) -> u16 { match self { - OperationResponseStatus::Code(code) => { + Self::Code(code) => { assert!(*code < 1000); *code } - OperationResponseStatus::Range(range) => { + Self::Range(range) => { assert!(*range < 10); *range * 100 } - OperationResponseStatus::Default => 1000, + Self::Default => 1000, } } - pub fn is_success_or_default(&self) -> bool { + pub const fn is_success_or_default(&self) -> bool { matches!( self, - OperationResponseStatus::Default - | OperationResponseStatus::Code(101) - | OperationResponseStatus::Code(200..=299) - | OperationResponseStatus::Range(2) + Self::Default | Self::Code(101 | 200..=299) | Self::Range(2) ) } - pub fn is_error_or_default(&self) -> bool { + pub const fn is_error_or_default(&self) -> bool { matches!( self, - OperationResponseStatus::Default - | OperationResponseStatus::Code(400..=599) - | OperationResponseStatus::Range(4..=5) + Self::Default | Self::Code(400..=599) | Self::Range(4..=5) ) } - pub fn is_default(&self) -> bool { - matches!(self, OperationResponseStatus::Default) + pub const fn is_default(&self) -> bool { + matches!(self, Self::Default) } } @@ -255,7 +248,7 @@ impl PartialOrd for OperationResponseStatus { } #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] -pub(crate) enum OperationResponseKind { +pub enum OperationResponseKind { Type(TypeId), None, Raw, @@ -265,17 +258,17 @@ pub(crate) enum OperationResponseKind { impl OperationResponseKind { pub fn into_tokens(self, type_space: &TypeSpace) -> TokenStream { match self { - OperationResponseKind::Type(ref type_id) => { + Self::Type(ref type_id) => { let type_name = type_space.get_type(type_id).unwrap().ident(); quote! { #type_name } } - OperationResponseKind::None => { + Self::None => { quote! { () } } - OperationResponseKind::Raw => { + Self::Raw => { quote! { ByteStream } } - OperationResponseKind::Upgrade => { + Self::Upgrade => { quote! { reqwest::Upgraded } } } @@ -283,10 +276,11 @@ impl OperationResponseKind { } impl Generator { + #[allow(clippy::too_many_lines, reason = "keeps operation analysis cohesive")] pub(crate) fn process_operation( &mut self, operation: &openapiv3::Operation, - components: &Option, + components: Option<&Components>, path: &str, method: &str, path_parameters: &[ReferenceOr], @@ -315,7 +309,7 @@ impl Generator { let schema = parameter_data.schema()?.to_schema(); let name = sanitize( - &format!("{}-{}", operation_id, ¶meter_data.name), + &format!("{}-{}", operation_id, parameter_data.name), Case::Pascal, ); let typ = self.type_space.add_type_with_name(&schema, Some(name))?; @@ -339,7 +333,7 @@ impl Generator { &format!( "{}-{}", operation.operation_id.as_ref().unwrap(), - ¶meter_data.name, + parameter_data.name, ), Case::Pascal, ); @@ -376,7 +370,7 @@ impl Generator { &format!( "{}-{}", operation.operation_id.as_ref().unwrap(), - ¶meter_data.name, + parameter_data.name, ), Case::Pascal, ); @@ -392,13 +386,13 @@ impl Generator { }) } openapiv3::Parameter::Path { style, .. } => Err(Error::UnexpectedFormat( - format!("unsupported style of path parameter {:#?}", style,), + format!("unsupported style of path parameter {style:#?}"), )), openapiv3::Parameter::Query { style, .. } => Err(Error::UnexpectedFormat( - format!("unsupported style of query parameter {:#?}", style,), + format!("unsupported style of query parameter {style:#?}"), )), cookie @ openapiv3::Parameter::Cookie { .. } => Err(Error::UnexpectedFormat( - format!("cookie parameters are not supported {:#?}", cookie,), + format!("cookie parameters are not supported {cookie:#?}"), )), } }) @@ -469,7 +463,7 @@ impl Generator { let typ = if let Some(schema) = &mt.schema { let schema = schema.to_schema(); let name = sanitize( - &format!("{}-response", operation.operation_id.as_ref().unwrap(),), + &format!("{}-response", operation.operation_id.as_ref().unwrap()), Case::Pascal, ); self.type_space.add_type_with_name(&schema, Some(name))? @@ -490,8 +484,7 @@ impl Generator { if matches!( status_code, OperationResponseStatus::Default - | OperationResponseStatus::Code(101) - | OperationResponseStatus::Code(200..=299) + | OperationResponseStatus::Code(101 | 200..=299) | OperationResponseStatus::Range(2) ) { success = true; @@ -527,19 +520,16 @@ impl Generator { if dropshot_websocket && dropshot_paginated.is_some() { return Err(Error::InvalidExtension(format!( - "conflicting extensions in {:?}", - operation_id + "conflicting extensions in {operation_id:?}" ))); } if dropshot_websocket - && responses + && !responses .iter() - .find(|r| r.status_code == OperationResponseStatus::Code(101)) - .is_none() + .any(|r| r.status_code == OperationResponseStatus::Code(101)) { return Err(Error::InvalidExtension(format!( - "websocket endpoint {:?} must include an explicit 101 response code", - operation_id + "websocket endpoint {operation_id:?} must include an explicit 101 response code" ))); } @@ -557,11 +547,12 @@ impl Generator { }) } + #[allow(clippy::too_many_lines, reason = "mirrors the generated method")] pub(crate) fn positional_method( &mut self, method: &OperationMethod, has_inner: bool, - ) -> Result { + ) -> TokenStream { let operation_id = format_ident!("{}", method.operation_id); // Render each parameter as it will appear in the method signature. @@ -618,7 +609,7 @@ impl Generator { success: success_type, error: error_type, body, - } = self.method_sig_body(method, quote! { Self }, quote! { self }, has_inner)?; + } = self.method_sig_body(method, "e! { Self }, "e! { self }, has_inner); let method_impl = quote! { #[doc = #doc_comment] @@ -698,6 +689,10 @@ impl Generator { quote! { #[doc = #doc_comment] + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn #stream_id #bounds ( &'a self, #(#stream_params),* @@ -766,19 +761,20 @@ impl Generator { #stream_impl }; - Ok(all) + all } /// Common code generation between positional and builder interface-styles. /// Returns a struct with the success and error types and the core body /// implementation that marshals arguments and executes the request. + #[allow(clippy::too_many_lines, reason = "mirrors the generated request body")] fn method_sig_body( &self, method: &OperationMethod, - client_type: TokenStream, - client_value: TokenStream, + client_type: &TokenStream, + client_value: &TokenStream, has_inner: bool, - ) -> Result { + ) -> MethodSigBody { let param_names = method .params .iter() @@ -880,7 +876,7 @@ impl Generator { }) .collect(); - let url_path = method.path.compile(url_renames, client_value.clone()); + let url_path = method.path.compile(&url_renames, client_value); let url_path = quote! { let #url_ident = #url_path; }; @@ -937,7 +933,7 @@ impl Generator { assert!(body_func.clone().count() <= 1); let (success_response_items, response_type) = - self.extract_responses(method, OperationResponseStatus::is_success_or_default); + Self::extract_responses(method, OperationResponseStatus::is_success_or_default); let success_response_matches = success_response_items.iter().map(|response| { let pat = match &response.status_code { @@ -955,7 +951,7 @@ impl Generator { } OperationResponseKind::None => { quote! { - Ok(ResponseValue::empty(#response_ident)) + Ok(ResponseValue::empty(&#response_ident)) } } OperationResponseKind::Raw => { @@ -975,7 +971,7 @@ impl Generator { // Errors... let (error_response_items, error_type) = - self.extract_responses(method, OperationResponseStatus::is_error_or_default); + Self::extract_responses(method, OperationResponseStatus::is_error_or_default); let error_response_matches = error_response_items.iter().map(|response| { let pat = match &response.status_code { @@ -1005,7 +1001,7 @@ impl Generator { OperationResponseKind::None => { quote! { Err(Error::ErrorResponse( - ResponseValue::empty(#response_ident) + ResponseValue::empty(&#response_ident) )) } } @@ -1019,12 +1015,12 @@ impl Generator { OperationResponseKind::Upgrade => { if response.status_code == OperationResponseStatus::Default { return quote! {}; // catch-all handled below - } else { - todo!( - "non-default error response handling for \ - upgrade requests is not yet implemented" - ); } + + todo!( + "non-default error response handling for \ + upgrade requests is not yet implemented" + ); } }; @@ -1060,9 +1056,10 @@ impl Generator { } }; - let inner = match has_inner { - true => quote! { &#client_value.inner, }, - false => quote! {}, + let inner = if has_inner { + quote! { &#client_value.inner, } + } else { + quote! {} }; let pre_hook = self.settings.pre_hook.as_ref().map(|hook| { quote! { @@ -1167,22 +1164,21 @@ impl Generator { } }; - Ok(MethodSigBody { + MethodSigBody { success: response_type.into_tokens(&self.type_space), error: error_type.into_tokens(&self.type_space), body: body_impl, - }) + } } /// Extract responses that match criteria specified by the `filter`. The /// result is a `Vec` that enumerates the cases matching /// the filter, and a `TokenStream` that represents the generated type for /// those cases. - pub(crate) fn extract_responses<'a>( - &self, - method: &'a OperationMethod, + pub(crate) fn extract_responses( + method: &OperationMethod, filter: fn(&OperationResponseStatus) -> bool, - ) -> (Vec<&'a OperationResponse>, OperationResponseKind) { + ) -> (Vec<&OperationResponse>, OperationResponseKind) { let mut response_items = method .responses .iter() @@ -1194,8 +1190,8 @@ impl Generator { // since it will never be hit. Note that this is a no-op for error // responses. let len = response_items.len(); - if len >= 2 { - if let ( + if len >= 2 + && let ( OperationResponse { status_code: OperationResponseStatus::Range(2), .. @@ -1205,9 +1201,8 @@ impl Generator { .. }, ) = (&response_items[len - 2], &response_items[len - 1]) - { - response_items.pop(); - } + { + response_items.pop(); } let response_types = response_items @@ -1242,8 +1237,7 @@ impl Generator { .filter(|param| { matches!( (param.api_name.as_str(), ¶m.kind), - ("page_token", OperationParameterKind::Query(false)) - | ("limit", OperationParameterKind::Query(false)) + ("page_token" | "limit", OperationParameterKind::Query(false)) ) }) .count() @@ -1292,9 +1286,8 @@ impl Generator { }; let typ = self.type_space.get_type(success_response).ok()?; - let details = match typ.details() { - typify::TypeDetails::Struct(details) => details, - _ => return None, + let typify::TypeDetails::Struct(details) = typ.details() else { + return None; }; let properties = details.properties().collect::>(); @@ -1380,7 +1373,7 @@ impl Generator { /// } /// ``` /// - /// The Client's operation_id method simply invokes the builder's new + /// The client's `operation_id` method simply invokes the builder's new /// method, which assigns an error value to mandatory field and a /// `Ok(None)` value to optional ones: /// ```ignore @@ -1420,6 +1413,7 @@ impl Generator { /// Finally, paginated interfaces have a `stream()` method which uses the /// `send()` method above to fetch each page of results to assemble the /// items into a single `impl Stream`. + #[allow(clippy::too_many_lines, reason = "mirrors the generated builder")] pub(crate) fn builder_struct( &mut self, method: &OperationMethod, @@ -1437,6 +1431,11 @@ impl Generator { .collect::>(); let client_ident = unique_ident_from("client", ¶m_names); + let client_init = if client_ident == format_ident!("client") { + quote! { client } + } else { + quote! { #client_ident: client } + }; let mut cloneable = true; @@ -1624,7 +1623,7 @@ impl Generator { OperationParameterType::RawBody => match param.kind { OperationParameterKind::Body(BodyContentType::OctetStream) => { let err_msg = - format!("conversion to `reqwest::Body` for {} failed", param.name,); + format!("conversion to `reqwest::Body` for {} failed", param.name); Ok(quote! { pub fn #param_name(mut self, value: B) -> Self @@ -1638,7 +1637,7 @@ impl Generator { } OperationParameterKind::Body(BodyContentType::Text(_)) => { let err_msg = - format!("conversion to `String` for {} failed", param.name,); + format!("conversion to `String` for {} failed", param.name); Ok(quote! { pub fn #param_name(mut self, value: V) -> Self @@ -1664,15 +1663,17 @@ impl Generator { body, } = self.method_sig_body( method, - quote! { super::Client }, - quote! { #client_ident }, + "e! { super::Client }, + "e! { #client_ident }, has_inner, - )?; + ); let send_doc = format!( - "Sends a `{}` request to `{}`", + "Sends a `{}` request to `{}`\n\n\ + # Errors\n\n\ + Returns an error if request construction, transport, or response decoding fails.", method.method.as_str().to_ascii_uppercase(), - method.path.to_string(), + method.path, ); let send_impl = quote! { #[doc = #send_doc] @@ -1733,7 +1734,7 @@ impl Generator { let stream_doc = format!( "Streams `{}` requests to `{}`", method.method.as_str().to_ascii_uppercase(), - method.path.to_string(), + method.path, ); quote! { @@ -1822,7 +1823,7 @@ impl Generator { let struct_doc = match (tag_style, method.tags.len(), method.tags.first()) { (TagStyle::Merged, _, _) | (TagStyle::Separate, 0, _) => { let ty = format!("Client::{}", method.operation_id); - format!("Builder for [`{}`]\n\n[`{}`]: super::{}", ty, ty, ty,) + format!("Builder for [`{ty}`]\n\n[`{ty}`]: super::{ty}") } (TagStyle::Separate, 1, Some(tag)) => { let ty = format!( @@ -1830,7 +1831,7 @@ impl Generator { sanitize(tag, Case::Pascal), method.operation_id ); - format!("Builder for [`{}`]\n\n[`{}`]: super::{}", ty, ty, ty,) + format!("Builder for [`{ty}`]\n\n[`{ty}`]: super::{ty}") } (TagStyle::Separate, _, _) => { format!( @@ -1857,7 +1858,7 @@ impl Generator { sanitize(tag, Case::Pascal), method.operation_id, ); - format!("[`{}`]: super::{}", ty, ty) + format!("[`{ty}`]: super::{ty}") }) .collect::>() .join("\n"), @@ -1874,9 +1875,13 @@ impl Generator { } impl<'a> #struct_ident<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - #client_ident: client, + #client_init, #( #param_names: #param_values, )* } } @@ -1888,17 +1893,15 @@ impl Generator { }) } - fn builder_helper(&self, method: &OperationMethod) -> BuilderImpl { + fn builder_helper(method: &OperationMethod) -> BuilderImpl { let operation_id = format_ident!("{}", method.operation_id); let struct_name = sanitize(&method.operation_id, Case::Pascal); let struct_ident = format_ident!("{}", struct_name); - let params = method - .params - .iter() - .map(|param| format!("\n .{}({})", param.name, param.name)) - .collect::>() - .join(""); + let mut params = String::new(); + for param in &method.params { + write!(&mut params, "\n .{}({})", param.name, param.name).unwrap(); + } let eg = format!( "\ @@ -1924,7 +1927,7 @@ impl Generator { BuilderImpl { doc, sig, body } } - /// Generates a pair of TokenStreams. + /// Generates a pair of `TokenStream`s. /// /// The first includes all the operation code; impl Client for operations /// with no tags and code of this form for each tag: @@ -1945,15 +1948,14 @@ impl Generator { /// pub use super::ClientTagExt; /// ``` pub(crate) fn builder_tags( - &self, methods: &[OperationMethod], tag_info: &BTreeMap<&String, &openapiv3::Tag>, ) -> (TokenStream, TokenStream) { let mut base = Vec::new(); let mut ext = BTreeMap::new(); - methods.iter().for_each(|method| { - let BuilderImpl { doc, sig, body } = self.builder_helper(method); + for method in methods { + let BuilderImpl { doc, sig, body } = Self::builder_helper(method); if method.tags.is_empty() { let impl_body = quote! { @@ -1974,13 +1976,13 @@ impl Generator { #body } }; - method.tags.iter().for_each(|tag| { + for tag in &method.tags { ext.entry(tag.clone()) .or_insert_with(Vec::new) .push((trait_sig.clone(), impl_body.clone())); - }); + } } - }); + } let base_impl = (!base.is_empty()).then(|| { quote! { @@ -2028,8 +2030,8 @@ impl Generator { ) } - pub(crate) fn builder_impl(&self, method: &OperationMethod) -> TokenStream { - let BuilderImpl { doc, sig, body } = self.builder_helper(method); + pub(crate) fn builder_impl(method: &OperationMethod) -> TokenStream { + let BuilderImpl { doc, sig, body } = Self::builder_helper(method); let impl_body = quote! { #[doc = #doc] @@ -2044,7 +2046,7 @@ impl Generator { fn get_body_param( &mut self, operation: &openapiv3::Operation, - components: &Option, + components: Option<&Components>, ) -> Result> { let body = match &operation.request_body { Some(body) => body.item(components)?, @@ -2100,8 +2102,7 @@ impl Generator { )), } if enumeration.is_empty() => Ok(()), _ => Err(Error::UnexpectedFormat(format!( - "invalid schema for application/octet-stream: {:?}", - schema + "invalid schema for application/octet-stream: {schema:?}" ))), }?; OperationParameterType::RawBody @@ -2134,8 +2135,7 @@ impl Generator { )), } if enumeration.is_empty() => Ok(()), _ => Err(Error::UnexpectedFormat(format!( - "invalid schema for {}: {:?}", - content_type, schema + "invalid schema for {content_type}: {schema:?}" ))), }?; OperationParameterType::RawBody @@ -2148,7 +2148,7 @@ impl Generator { todo!("media type encoding not empty: {:#?}", media_type); } let name = sanitize( - &format!("{}-body", operation.operation_id.as_ref().unwrap(),), + &format!("{}-body", operation.operation_id.as_ref().unwrap()), Case::Pascal, ); let typ = self @@ -2180,11 +2180,13 @@ fn make_doc_comment(method: &OperationMethod) -> String { buf.push_str("\n\n"); } - buf.push_str(&format!( + write!( + &mut buf, "Sends a `{}` request to `{}`\n\n", method.method.as_str().to_ascii_uppercase(), - method.path.to_string(), - )); + method.path, + ) + .unwrap(); if method .params @@ -2195,7 +2197,7 @@ fn make_doc_comment(method: &OperationMethod) -> String { { buf.push_str("Arguments:\n"); for param in &method.params { - buf.push_str(&format!("- `{}`", param.name)); + write!(&mut buf, "- `{}`", param.name).unwrap(); if let Some(description) = ¶m.description { buf.push_str(": "); buf.push_str(description); @@ -2204,6 +2206,10 @@ fn make_doc_comment(method: &OperationMethod) -> String { } } + buf.push_str( + "\n# Errors\n\nReturns an error if request construction, transport, or response decoding fails.\n", + ); + buf } @@ -2219,11 +2225,13 @@ fn make_stream_doc_comment(method: &OperationMethod) -> String { buf.push_str("\n\n"); } - buf.push_str(&format!( + write!( + &mut buf, "Sends repeated `{}` requests to `{}` until there are no more results.\n\n", method.method.as_str().to_ascii_uppercase(), - method.path.to_string(), - )); + method.path, + ) + .unwrap(); if method .params @@ -2239,7 +2247,7 @@ fn make_stream_doc_comment(method: &OperationMethod) -> String { continue; } - buf.push_str(&format!("- `{}`", param.name)); + write!(&mut buf, "- `{}`", param.name).unwrap(); if let Some(description) = ¶m.description { buf.push_str(": "); buf.push_str(description); @@ -2269,50 +2277,44 @@ fn sort_params(raw_params: &mut [OperationParameter], names: &[String]) { let a_index = names .iter() .position(|x| x == a_name) - .unwrap_or_else(|| panic!("{} missing from path", a_name)); + .unwrap_or_else(|| panic!("{a_name} missing from path")); let b_index = names .iter() .position(|x| x == b_name) - .unwrap_or_else(|| panic!("{} missing from path", b_name)); + .unwrap_or_else(|| panic!("{b_name} missing from path")); a_index.cmp(&b_index) } - (OperationParameterKind::Path, OperationParameterKind::Query(_)) => Ordering::Less, - (OperationParameterKind::Path, OperationParameterKind::Body(_)) => Ordering::Less, - (OperationParameterKind::Path, OperationParameterKind::Header(_)) => Ordering::Less, + ( + OperationParameterKind::Path, + OperationParameterKind::Query(_) + | OperationParameterKind::Body(_) + | OperationParameterKind::Header(_), + ) + | ( + OperationParameterKind::Query(_), + OperationParameterKind::Body(_) | OperationParameterKind::Header(_), + ) => Ordering::Less, // Query params are in lexicographic order. - (OperationParameterKind::Query(_), OperationParameterKind::Body(_)) => { - Ordering::Less - } - (OperationParameterKind::Query(_), OperationParameterKind::Query(_)) => { + (OperationParameterKind::Query(_), OperationParameterKind::Query(_)) + | (OperationParameterKind::Header(_), OperationParameterKind::Header(_)) => { a_name.cmp(b_name) } - (OperationParameterKind::Query(_), OperationParameterKind::Path) => { - Ordering::Greater - } - (OperationParameterKind::Query(_), OperationParameterKind::Header(_)) => { - Ordering::Less - } // Body params are last and should be singular. - (OperationParameterKind::Body(_), OperationParameterKind::Path) => { - Ordering::Greater - } - (OperationParameterKind::Body(_), OperationParameterKind::Query(_)) => { - Ordering::Greater - } - (OperationParameterKind::Body(_), OperationParameterKind::Header(_)) => { - Ordering::Greater - } (OperationParameterKind::Body(_), OperationParameterKind::Body(_)) => { panic!("should only be one body") } - // Header params are in lexicographic order. - (OperationParameterKind::Header(_), OperationParameterKind::Header(_)) => { - a_name.cmp(b_name) - } - (OperationParameterKind::Header(_), _) => Ordering::Greater, + (OperationParameterKind::Query(_), OperationParameterKind::Path) + | ( + OperationParameterKind::Body(_), + OperationParameterKind::Path + | OperationParameterKind::Query(_) + | OperationParameterKind::Header(_), + ) + // Header params sort after every other parameter kind. + | (OperationParameterKind::Header(_), _) => Ordering::Greater, } }, ); @@ -2327,7 +2329,7 @@ impl ParameterDataExt for openapiv3::ParameterData { match &self.format { openapiv3::ParameterSchemaOrContent::Schema(s) => Ok(s), openapiv3::ParameterSchemaOrContent::Content(c) => Err(Error::UnexpectedFormat( - format!("unexpected content {:#?}", c), + format!("unexpected content {c:#?}"), )), } } diff --git a/progenitor-impl/src/template.rs b/progenitor-impl/src/template.rs index 1fa227f9..10f401b3 100644 --- a/progenitor-impl/src/template.rs +++ b/progenitor-impl/src/template.rs @@ -19,10 +19,10 @@ pub struct PathTemplate { } impl PathTemplate { - pub fn compile(&self, rename: HashMap<&String, &String>, client: TokenStream) -> TokenStream { + pub fn compile(&self, rename: &HashMap<&String, &String>, client: &TokenStream) -> TokenStream { let mut fmt = String::new(); fmt.push_str("{}"); - for c in self.components.iter() { + for c in &self.components { match c { Component::Constant(n) => fmt.push_str(n), Component::Parameter(_) => fmt.push_str("{}"), @@ -35,7 +35,7 @@ impl PathTemplate { "{}", rename .get(&n) - .expect(&format!("missing path name mapping {}", n)), + .unwrap_or_else(|| panic!("missing path name mapping {n}")), ); Some(quote! { encode_path(&#param.to_string()) @@ -46,7 +46,7 @@ impl PathTemplate { }); quote! { - format!(#fmt, #client.baseurl, #(#components,)*) + format!(#fmt, #client.baseurl #(, #components)*) } } @@ -54,7 +54,7 @@ impl PathTemplate { self.components .iter() .filter_map(|c| match c { - Component::Parameter(name) => Some(name.to_string()), + Component::Parameter(name) => Some(name.clone()), Component::Constant(_) => None, }) .collect() @@ -69,7 +69,7 @@ impl PathTemplate { Component::Parameter(_) => "[^/]*".to_string(), }) .collect::(); - format!("^{}$", inner) + format!("^{inner}$") } pub fn as_wildcard_param(&self, param: &str) -> String { @@ -82,7 +82,7 @@ impl PathTemplate { Component::Parameter(_) => ".*".to_string(), }) .collect::(); - format!("^{}$", inner) + format!("^{inner}$") } } @@ -133,10 +133,7 @@ pub fn parse(t: &str) -> Result { State::Parameter => { if c == '}' { if a.contains('/') || a.contains('{') { - return Err(Error::InvalidPath(format!( - "invalid parameter name {:?}", - a, - ))); + return Err(Error::InvalidPath(format!("invalid parameter name {a:?}"))); } components.push(Component::Parameter(a)); a = String::new(); @@ -158,15 +155,16 @@ pub fn parse(t: &str) -> Result { Ok(PathTemplate { components }) } -impl ToString for PathTemplate { - fn to_string(&self) -> std::string::String { - self.components - .iter() - .map(|component| match component { - Component::Constant(s) => s.clone(), - Component::Parameter(s) => format!("{{{}}}", s), - }) - .fold(String::new(), |a, b| a + &b) +impl std::fmt::Display for PathTemplate { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + for component in &self.components { + match component { + Component::Constant(s) => f.write_str(s)?, + Component::Parameter(s) => write!(f, "{{{s}}}")?, + } + } + + Ok(()) } } @@ -178,7 +176,7 @@ mod tests { #[test] fn basic() { - let trials = vec![ + let trials = [ ( "/info", "/info", @@ -258,20 +256,20 @@ mod tests { ), ]; - for (path, expect_string, want) in trials.iter() { + for (path, expect_string, want) in &trials { match parse(path) { Ok(t) => { assert_eq!(&t, want); assert_eq!(t.to_string().as_str(), *expect_string); } - Err(e) => panic!("path {} {}", path, e), + Err(e) => panic!("path {path} {e}"), } } } #[test] fn names() { - let trials = vec![ + let trials = [ ("/info", vec![]), ("/measure/{number}", vec!["number".to_string()]), ( @@ -280,10 +278,10 @@ mod tests { ), ]; - for (path, want) in trials.iter() { + for (path, want) in &trials { match parse(path) { Ok(t) => assert_eq!(&t.names(), want), - Err(e) => panic!("path {} {}", path, e), + Err(e) => panic!("path {path} {e}"), } } } @@ -293,8 +291,12 @@ mod tests { let mut rename = HashMap::new(); let number = "number".to_string(); rename.insert(&number, &number); + #[allow( + clippy::literal_string_with_formatting_args, + reason = "braces delimit path template parameters" + )] let t = parse("/measure/{number}").unwrap(); - let out = t.compile(rename, quote::quote! { self }); + let out = t.compile(&rename, "e::quote! { self }); let want = quote::quote! { format!("{}/measure/{}", self.baseurl, @@ -313,8 +315,12 @@ mod tests { rename.insert(&one, &one); rename.insert(&two, &two); rename.insert(&three, &three); + #[allow( + clippy::literal_string_with_formatting_args, + reason = "braces delimit path template parameters" + )] let t = parse("/abc/def:{one}:jkl/{two}/a:{three}").unwrap(); - let out = t.compile(rename, quote::quote! { self }); + let out = t.compile(&rename, "e::quote! { self }); let want = quote::quote! { format!("{}/abc/def:{}:jkl/{}/a:{}", self.baseurl, diff --git a/progenitor-impl/src/to_schema.rs b/progenitor-impl/src/to_schema.rs index 3274c5c7..5bf1d328 100644 --- a/progenitor-impl/src/to_schema.rs +++ b/progenitor-impl/src/to_schema.rs @@ -1,5 +1,7 @@ // Copyright 2024 Oxide Computer Company +use std::collections::BTreeMap; + use indexmap::IndexMap; use openapiv3::AnySchema; use schemars::schema::SingleOrVec; @@ -50,10 +52,10 @@ where impl Convert for openapiv3::ReferenceOr { fn convert(&self) -> schemars::schema::Schema { match self { - openapiv3::ReferenceOr::Reference { reference } => { + Self::Reference { reference } => { schemars::schema::SchemaObject::new_ref(reference.clone()).into() } - openapiv3::ReferenceOr::Item(schema) => schema.convert(), + Self::Item(schema) => schema.convert(), } } } @@ -69,6 +71,14 @@ where } impl Convert for openapiv3::Schema { + #[allow( + clippy::too_many_lines, + reason = "covers the complete schema conversion" + )] + #[allow( + clippy::cast_precision_loss, + reason = "OpenAPI represents numeric constraints as f64" + )] fn convert(&self) -> schemars::schema::Schema { // TODO the discriminator field is used in a way that seems both // important and unfortunately redundant. It corresponds to the same @@ -129,7 +139,10 @@ impl Convert for openapiv3::Schema { max_length, })) => schemars::schema::SchemaObject { metadata, - instance_type: instance_type(schemars::schema::InstanceType::String, nullable), + instance_type: Some(instance_type( + schemars::schema::InstanceType::String, + nullable, + )), format: format.convert(), enum_values: enumeration.convert(), string: Some(Box::new(schemars::schema::StringValidation { @@ -160,7 +173,10 @@ impl Convert for openapiv3::Schema { }; schemars::schema::SchemaObject { metadata, - instance_type: instance_type(schemars::schema::InstanceType::Number, nullable), + instance_type: Some(instance_type( + schemars::schema::InstanceType::Number, + nullable, + )), format: format.convert(), enum_values: enumeration.convert(), number: Some(Box::new(schemars::schema::NumberValidation { @@ -197,7 +213,10 @@ impl Convert for openapiv3::Schema { }; schemars::schema::SchemaObject { metadata, - instance_type: instance_type(schemars::schema::InstanceType::Integer, nullable), + instance_type: Some(instance_type( + schemars::schema::InstanceType::Integer, + nullable, + )), format: format.convert(), enum_values: enumeration.convert(), number: Some(Box::new(schemars::schema::NumberValidation { @@ -221,7 +240,10 @@ impl Convert for openapiv3::Schema { max_properties, })) => schemars::schema::SchemaObject { metadata, - instance_type: instance_type(schemars::schema::InstanceType::Object, nullable), + instance_type: Some(instance_type( + schemars::schema::InstanceType::Object, + nullable, + )), object: Some(Box::new(schemars::schema::ObjectValidation { max_properties: max_properties.convert(), min_properties: min_properties.convert(), @@ -243,7 +265,10 @@ impl Convert for openapiv3::Schema { unique_items, })) => schemars::schema::SchemaObject { metadata, - instance_type: instance_type(schemars::schema::InstanceType::Array, nullable), + instance_type: Some(instance_type( + schemars::schema::InstanceType::Array, + nullable, + )), array: Some(Box::new(schemars::schema::ArrayValidation { items: items.as_ref().map(|items| { schemars::schema::SingleOrVec::Single(Box::new(items.convert())) @@ -263,7 +288,10 @@ impl Convert for openapiv3::Schema { enumeration, })) => schemars::schema::SchemaObject { metadata, - instance_type: instance_type(schemars::schema::InstanceType::Boolean, nullable), + instance_type: Some(instance_type( + schemars::schema::InstanceType::Boolean, + nullable, + )), enum_values: enumeration.convert(), extensions, ..Default::default() @@ -450,10 +478,12 @@ impl Convert for openapiv3::Schema { so.string().pattern = Some(pattern.clone()); } if let Some(min_length) = min_length { - so.string().min_length = Some(*min_length as u32); + so.string().min_length = + Some(u32::try_from(*min_length).expect("minimum length exceeds u32")); } if let Some(max_length) = max_length { - so.string().max_length = Some(*max_length as u32); + so.string().max_length = + Some(u32::try_from(*max_length).expect("maximum length exceeds u32")); } // Number @@ -496,21 +526,27 @@ impl Convert for openapiv3::Schema { so.object().additional_properties = additional_properties.convert(); } if let Some(min_properties) = min_properties { - so.object().min_properties = Some(*min_properties as u32); + so.object().min_properties = Some( + u32::try_from(*min_properties).expect("minimum property count exceeds u32"), + ); } if let Some(max_properties) = max_properties { - so.object().max_properties = Some(*max_properties as u32); + so.object().max_properties = Some( + u32::try_from(*max_properties).expect("maximum property count exceeds u32"), + ); } // Array if items.is_some() { - so.array().items = items.convert().clone().map(SingleOrVec::Single); + so.array().items = items.convert().map(SingleOrVec::Single); } if let Some(min_items) = min_items { - so.array().min_items = Some(*min_items as u32); + so.array().min_items = + Some(u32::try_from(*min_items).expect("minimum item count exceeds u32")); } if let Some(max_items) = max_items { - so.array().max_items = Some(*max_items as u32); + so.array().max_items = + Some(u32::try_from(*max_items).expect("maximum item count exceeds u32")); } if let Some(unique_items) = unique_items { so.array().unique_items = Some(*unique_items); @@ -533,28 +569,40 @@ impl Convert for openapiv3::Schema { // We do this last so we can infer types if none are specified. match (typ.as_deref(), nullable) { (Some("boolean"), _) => { - so.instance_type = - instance_type(schemars::schema::InstanceType::Boolean, nullable); + so.instance_type = Some(instance_type( + schemars::schema::InstanceType::Boolean, + nullable, + )); } (Some("object"), _) => { - so.instance_type = - instance_type(schemars::schema::InstanceType::Object, nullable); + so.instance_type = Some(instance_type( + schemars::schema::InstanceType::Object, + nullable, + )); } (Some("array"), _) => { - so.instance_type = - instance_type(schemars::schema::InstanceType::Array, nullable); + so.instance_type = Some(instance_type( + schemars::schema::InstanceType::Array, + nullable, + )); } (Some("number"), _) => { - so.instance_type = - instance_type(schemars::schema::InstanceType::Number, nullable); + so.instance_type = Some(instance_type( + schemars::schema::InstanceType::Number, + nullable, + )); } (Some("string"), _) => { - so.instance_type = - instance_type(schemars::schema::InstanceType::String, nullable); + so.instance_type = Some(instance_type( + schemars::schema::InstanceType::String, + nullable, + )); } (Some("integer"), _) => { - so.instance_type = - instance_type(schemars::schema::InstanceType::Integer, nullable); + so.instance_type = Some(instance_type( + schemars::schema::InstanceType::Integer, + nullable, + )); } (Some(typ), _) => todo!("invalid type: {}", typ), @@ -594,7 +642,7 @@ impl Convert for openapiv3::Schema { (None, _) => None, }; } - }; + } // If we have exactly one type, and it's null, and we have // subschemas that means that we must have had a bunch of @@ -627,9 +675,9 @@ where { fn convert(&self) -> Option { match self { - openapiv3::VariantOrUnknownOrEmpty::Item(i) => Some(i.convert()), - openapiv3::VariantOrUnknownOrEmpty::Unknown(s) => Some(s.clone()), - openapiv3::VariantOrUnknownOrEmpty::Empty => None, + Self::Item(i) => Some(i.convert()), + Self::Unknown(s) => Some(s.clone()), + Self::Empty => None, } } } @@ -637,11 +685,11 @@ where impl Convert for openapiv3::StringFormat { fn convert(&self) -> String { match self { - openapiv3::StringFormat::Date => "date", - openapiv3::StringFormat::DateTime => "date-time", - openapiv3::StringFormat::Password => "password", - openapiv3::StringFormat::Byte => "byte", - openapiv3::StringFormat::Binary => "binary", + Self::Date => "date", + Self::DateTime => "date-time", + Self::Password => "password", + Self::Byte => "byte", + Self::Binary => "binary", } .to_string() } @@ -650,8 +698,8 @@ impl Convert for openapiv3::StringFormat { impl Convert for openapiv3::NumberFormat { fn convert(&self) -> String { match self { - openapiv3::NumberFormat::Float => "float", - openapiv3::NumberFormat::Double => "double", + Self::Float => "float", + Self::Double => "double", } .to_string() } @@ -660,8 +708,8 @@ impl Convert for openapiv3::NumberFormat { impl Convert for openapiv3::IntegerFormat { fn convert(&self) -> String { match self { - openapiv3::IntegerFormat::Int32 => "int32", - openapiv3::IntegerFormat::Int64 => "int64", + Self::Int32 => "int32", + Self::Int64 => "int64", } .to_string() } @@ -669,46 +717,40 @@ impl Convert for openapiv3::IntegerFormat { impl Convert for Option { fn convert(&self) -> Value { - match self { - Some(value) => Value::String(value.clone()), - None => Value::Null, - } + self.as_ref() + .map_or(Value::Null, |value| Value::String(value.clone())) } } impl Convert for Option { fn convert(&self) -> Value { - match self { - Some(value) => Value::Number(serde_json::Number::from_f64(*value).unwrap()), - None => Value::Null, - } + self.as_ref().map_or(Value::Null, |value| { + Value::Number(serde_json::Number::from_f64(*value).unwrap()) + }) } } impl Convert for Option { fn convert(&self) -> Value { - match self { - Some(value) => Value::Number(serde_json::Number::from(*value)), - None => Value::Null, - } + self.as_ref().map_or(Value::Null, |value| { + Value::Number(serde_json::Number::from(*value)) + }) } } impl Convert for Option { fn convert(&self) -> Value { - match self { - Some(value) => Value::Bool(*value), - None => Value::Null, - } + self.as_ref() + .map_or(Value::Null, |value| Value::Bool(*value)) } } fn instance_type( instance_type: schemars::schema::InstanceType, nullable: bool, -) -> Option> { +) -> schemars::schema::SingleOrVec { if nullable { - Some(vec![instance_type, schemars::schema::InstanceType::Null].into()) + vec![instance_type, schemars::schema::InstanceType::Null].into() } else { - Some(instance_type.into()) + instance_type.into() } } @@ -721,7 +763,7 @@ fn oneof_nullable_wrapper( let extensions = schema.extensions; schema.metadata = None; - schema.extensions = Default::default(); + schema.extensions = BTreeMap::default(); schemars::schema::SchemaObject { metadata, @@ -746,12 +788,12 @@ fn oneof_nullable_wrapper( impl Convert> for Option { fn convert(&self) -> Option { - (*self).map(|m| m as u32) + (*self).map(|m| u32::try_from(m).expect("schema bound exceeds u32")) } } -impl Convert> for Option { - fn convert(&self) -> Option { +impl Convert for Option { + fn convert(&self) -> Self { *self } } @@ -791,8 +833,8 @@ where impl Convert for openapiv3::AdditionalProperties { fn convert(&self) -> schemars::schema::Schema { match self { - openapiv3::AdditionalProperties::Any(b) => schemars::schema::Schema::Bool(*b), - openapiv3::AdditionalProperties::Schema(schema) => schema.convert(), + Self::Any(b) => schemars::schema::Schema::Bool(*b), + Self::Schema(schema) => schema.convert(), } } } diff --git a/progenitor-impl/src/util.rs b/progenitor-impl/src/util.rs index cfb71ba4..c9fb9f92 100644 --- a/progenitor-impl/src/util.rs +++ b/progenitor-impl/src/util.rs @@ -8,43 +8,43 @@ use unicode_ident::{is_xid_continue, is_xid_start}; use crate::Result; -pub(crate) trait ReferenceOrExt { - fn item<'a>(&'a self, components: &'a Option) -> Result<&'a T>; +pub trait ReferenceOrExt { + fn item<'a>(&'a self, components: Option<&'a Components>) -> Result<&'a T>; } -pub(crate) trait ComponentLookup: Sized { +pub trait ComponentLookup: Sized { fn get_components(components: &Components) -> &IndexMap>; } impl ReferenceOrExt for openapiv3::ReferenceOr { - fn item<'a>(&'a self, components: &'a Option) -> Result<&'a T> { + fn item<'a>(&'a self, components: Option<&'a Components>) -> Result<&'a T> { match self { - ReferenceOr::Item(item) => Ok(item), - ReferenceOr::Reference { reference } => { + Self::Item(item) => Ok(item), + Self::Reference { reference } => { let idx = reference.rfind('/').unwrap(); let key = &reference[idx + 1..]; - let parameters = T::get_components(components.as_ref().unwrap()); + let parameters = T::get_components(components.unwrap()); parameters .get(key) - .unwrap_or_else(|| panic!("key {} is missing", key)) + .unwrap_or_else(|| panic!("key {key} is missing")) .item(components) } } } } -pub(crate) fn items<'a, T>( +pub fn items<'a, T>( refs: &'a [ReferenceOr], - components: &'a Option, + components: Option<&'a Components>, ) -> impl Iterator> where T: ComponentLookup, { - refs.iter().map(|r| r.item(components)) + refs.iter().map(move |r| r.item(components)) } -pub(crate) fn parameter_map<'a>( +pub fn parameter_map<'a>( refs: &'a [ReferenceOr], - components: &'a Option, + components: Option<&'a Components>, ) -> Result> { items(refs, components) .map(|res| res.map(|param| (¶m.parameter_data_ref().name, param))) @@ -75,12 +75,13 @@ impl ComponentLookup for Schema { } } -pub(crate) enum Case { +#[derive(Clone, Copy)] +pub enum Case { Pascal, Snake, } -pub(crate) fn sanitize(input: &str, case: Case) -> String { +pub fn sanitize(input: &str, case: Case) -> String { use heck::{ToPascalCase, ToSnakeCase}; let to_case = match case { Case::Pascal => str::to_pascal_case, @@ -100,23 +101,20 @@ pub(crate) fn sanitize(input: &str, case: Case) -> String { let out = match out.chars().next() { None => to_case("x"), Some(c) if is_xid_start(c) => out, - Some(_) => format!("_{}", out), + Some(_) => format!("_{out}"), }; // Make sure the string is a valid Rust identifier. if typify::accept_as_ident(&out) { out } else { - format!("{}_", out) + format!("{out}_") } } -/// Given a desired name and a slice of proc_macro2::Ident, generate a new +/// Given a desired name and a slice of `proc_macro2::Ident`, generate a new /// Ident that is unique from the slice. -pub(crate) fn unique_ident_from( - name: &str, - identities: &[proc_macro2::Ident], -) -> proc_macro2::Ident { +pub fn unique_ident_from(name: &str, identities: &[proc_macro2::Ident]) -> proc_macro2::Ident { let mut name = name.to_string(); loop { @@ -126,6 +124,6 @@ pub(crate) fn unique_ident_from( return ident; } - name.insert_str(0, "_"); + name.insert(0, '_'); } } diff --git a/progenitor-impl/tests/output/src/buildomat_builder.rs b/progenitor-impl/tests/output/src/buildomat_builder.rs index 67ddc5e1..8c22841a 100644 --- a/progenitor-impl/tests/output/src/buildomat_builder.rs +++ b/progenitor-impl/tests/output/src/buildomat_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -2347,7 +2355,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Buildomat +///Client for `Buildomat` /// ///Version: 1.0 pub struct Client { @@ -2361,6 +2369,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -2380,6 +2393,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -2410,7 +2424,12 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `POST` request to `/v1/control/hold` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.control_hold() /// .send() /// .await; @@ -2421,7 +2440,12 @@ impl Client { ///Sends a `POST` request to `/v1/control/resume` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.control_resume() /// .send() /// .await; @@ -2432,7 +2456,12 @@ impl Client { ///Sends a `GET` request to `/v1/task/{Task}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_get() /// .task(task) /// .send() @@ -2444,7 +2473,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.tasks_get() /// .send() /// .await; @@ -2455,7 +2489,12 @@ impl Client { ///Sends a `POST` request to `/v1/tasks` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_submit() /// .body(body) /// .send() @@ -2467,7 +2506,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks/{task}/events` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_events_get() /// .task(task) /// .minseq(minseq) @@ -2480,7 +2524,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks/{task}/outputs` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_outputs_get() /// .task(task) /// .send() @@ -2492,7 +2541,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_output_download() /// .task(task) /// .output(output) @@ -2505,7 +2559,12 @@ impl Client { ///Sends a `POST` request to `/v1/users` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.user_create() /// .body(body) /// .send() @@ -2517,7 +2576,12 @@ impl Client { ///Sends a `GET` request to `/v1/whoami` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.whoami() /// .send() /// .await; @@ -2528,7 +2592,12 @@ impl Client { ///Sends a `PUT` request to `/v1/whoami/name` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.whoami_put_name() /// .body(body) /// .send() @@ -2540,7 +2609,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/bootstrap` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_bootstrap() /// .body(body) /// .send() @@ -2552,7 +2626,12 @@ impl Client { ///Sends a `GET` request to `/v1/worker/ping` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_ping() /// .send() /// .await; @@ -2563,7 +2642,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/append` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_append() /// .task(task) /// .body(body) @@ -2576,7 +2660,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/chunk` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_upload_chunk() /// .task(task) /// .body(body) @@ -2589,7 +2678,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/complete` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_complete() /// .task(task) /// .body(body) @@ -2602,7 +2696,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/output` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_add_output() /// .task(task) /// .body(body) @@ -2615,7 +2714,12 @@ impl Client { ///Sends a `GET` request to `/v1/workers` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.workers_list() /// .send() /// .await; @@ -2626,7 +2730,12 @@ impl Client { ///Sends a `POST` request to `/v1/workers/recycle` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.workers_recycle() /// .send() /// .await; @@ -2637,7 +2746,12 @@ impl Client { ///Sends a `GET` request to `/v1/things` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.get_thing_or_things() /// .id(id) /// .send() @@ -2649,7 +2763,12 @@ impl Client { ///Sends a `GET` request to `/v1/header-arg` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.header_arg() /// .accept_language(accept_language) /// .send() @@ -2662,6 +2781,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -2678,14 +2812,23 @@ pub mod builder { } impl<'a> ControlHold<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/control/hold` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/control/hold", client.baseurl,); + let url = format!("{}/v1/control/hold", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2724,14 +2867,23 @@ pub mod builder { } impl<'a> ControlResume<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/control/resume` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/control/resume", client.baseurl,); + let url = format!("{}/v1/control/resume", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2747,7 +2899,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -2763,9 +2915,13 @@ pub mod builder { } impl<'a> TaskGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), } } @@ -2781,13 +2937,18 @@ pub mod builder { } ///Sends a `GET` request to `/v1/task/{Task}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task } = self; let task = task.map_err(Error::InvalidRequest)?; let url = format!( "{}/v1/task/{}", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -2827,14 +2988,23 @@ pub mod builder { } impl<'a> TasksGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/tasks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result>, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/tasks", client.baseurl,); + let url = format!("{}/v1/tasks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2874,9 +3044,13 @@ pub mod builder { } impl<'a> TaskSubmit<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -2902,12 +3076,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/tasks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body .and_then(|v| types::TaskSubmit::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/tasks", client.baseurl,); + let url = format!("{}/v1/tasks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2949,9 +3128,13 @@ pub mod builder { } impl<'a> TaskEventsGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), minseq: Ok(None), } @@ -2979,6 +3162,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/tasks/{task}/events` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result>, Error<()>> { @@ -2992,7 +3180,7 @@ pub mod builder { let url = format!( "{}/v1/tasks/{}/events", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3034,9 +3222,13 @@ pub mod builder { } impl<'a> TaskOutputsGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), } } @@ -3052,6 +3244,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/tasks/{task}/outputs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result>, Error<()>> { @@ -3060,7 +3257,7 @@ pub mod builder { let url = format!( "{}/v1/tasks/{}/outputs", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3102,9 +3299,13 @@ pub mod builder { } impl<'a> TaskOutputDownload<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), output: Err("output was not initialized".to_string()), } @@ -3131,6 +3332,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -3143,7 +3349,7 @@ pub mod builder { "{}/v1/tasks/{}/outputs/{}", client.baseurl, encode_path(&task.to_string()), - encode_path(&output.to_string()), + encode_path(&output.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3176,9 +3382,13 @@ pub mod builder { } impl<'a> UserCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3204,12 +3414,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/users` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body .and_then(|v| types::UserCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/users", client.baseurl,); + let url = format!("{}/v1/users", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3249,14 +3464,23 @@ pub mod builder { } impl<'a> Whoami<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/whoami` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/whoami", client.baseurl,); + let url = format!("{}/v1/whoami", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3296,9 +3520,13 @@ pub mod builder { } impl<'a> WhoamiPutName<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -3315,10 +3543,15 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/whoami/name` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/whoami/name", client.baseurl,); + let url = format!("{}/v1/whoami/name", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3343,7 +3576,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3359,9 +3592,13 @@ pub mod builder { } impl<'a> WorkerBootstrap<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3387,12 +3624,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/bootstrap` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body .and_then(|v| types::WorkerBootstrap::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/worker/bootstrap", client.baseurl,); + let url = format!("{}/v1/worker/bootstrap", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3432,14 +3674,23 @@ pub mod builder { } impl<'a> WorkerPing<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/worker/ping` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/worker/ping", client.baseurl,); + let url = format!("{}/v1/worker/ping", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3480,9 +3731,13 @@ pub mod builder { } impl<'a> WorkerTaskAppend<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -3521,6 +3776,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/append` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3530,7 +3790,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/append", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3552,7 +3812,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3569,9 +3829,13 @@ pub mod builder { } impl<'a> WorkerTaskUploadChunk<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Err("body was not initialized".to_string()), } @@ -3598,6 +3862,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/chunk` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3605,7 +3874,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/chunk", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3652,9 +3921,13 @@ pub mod builder { } impl<'a> WorkerTaskComplete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -3693,6 +3966,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/complete` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3702,7 +3980,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/complete", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3724,7 +4002,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3741,9 +4019,13 @@ pub mod builder { } impl<'a> WorkerTaskAddOutput<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -3780,6 +4062,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/output` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3789,7 +4076,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/output", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3811,7 +4098,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3826,14 +4113,23 @@ pub mod builder { } impl<'a> WorkersList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/workers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/workers", client.baseurl,); + let url = format!("{}/v1/workers", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3872,14 +4168,23 @@ pub mod builder { } impl<'a> WorkersRecycle<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/workers/recycle` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/workers/recycle", client.baseurl,); + let url = format!("{}/v1/workers/recycle", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3895,7 +4200,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3911,9 +4216,13 @@ pub mod builder { } impl<'a> GetThingOrThings<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Ok(None), } } @@ -3930,10 +4239,15 @@ pub mod builder { } ///Sends a `GET` request to `/v1/things` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/things", client.baseurl,); + let url = format!("{}/v1/things", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3974,9 +4288,13 @@ pub mod builder { } impl<'a> HeaderArg<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, accept_language: Ok(None), } } @@ -3992,13 +4310,18 @@ pub mod builder { } ///Sends a `GET` request to `/v1/header-arg` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, accept_language, } = self; let accept_language = accept_language.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/header-arg", client.baseurl,); + let url = format!("{}/v1/header-arg", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -4017,8 +4340,8 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::empty(response)), - _ => Err(Error::ErrorResponse(ResponseValue::empty(response))), + 200..=299 => Ok(ResponseValue::empty(&response)), + _ => Err(Error::ErrorResponse(ResponseValue::empty(&response))), } } } diff --git a/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs b/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs index 57874b00..ce2ea59b 100644 --- a/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -2304,7 +2312,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Buildomat +///Client for `Buildomat` /// ///Version: 1.0 pub struct Client { @@ -2318,6 +2326,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -2337,6 +2350,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -2367,7 +2381,12 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `POST` request to `/v1/control/hold` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.control_hold() /// .send() /// .await; @@ -2378,7 +2397,12 @@ impl Client { ///Sends a `POST` request to `/v1/control/resume` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.control_resume() /// .send() /// .await; @@ -2389,7 +2413,12 @@ impl Client { ///Sends a `GET` request to `/v1/task/{Task}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_get() /// .task(task) /// .send() @@ -2401,7 +2430,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.tasks_get() /// .send() /// .await; @@ -2412,7 +2446,12 @@ impl Client { ///Sends a `POST` request to `/v1/tasks` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_submit() /// .body(body) /// .send() @@ -2424,7 +2463,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks/{task}/events` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_events_get() /// .task(task) /// .minseq(minseq) @@ -2437,7 +2481,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks/{task}/outputs` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_outputs_get() /// .task(task) /// .send() @@ -2449,7 +2498,12 @@ impl Client { ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.task_output_download() /// .task(task) /// .output(output) @@ -2462,7 +2516,12 @@ impl Client { ///Sends a `POST` request to `/v1/users` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.user_create() /// .body(body) /// .send() @@ -2474,7 +2533,12 @@ impl Client { ///Sends a `GET` request to `/v1/whoami` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.whoami() /// .send() /// .await; @@ -2485,7 +2549,12 @@ impl Client { ///Sends a `PUT` request to `/v1/whoami/name` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.whoami_put_name() /// .body(body) /// .send() @@ -2497,7 +2566,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/bootstrap` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_bootstrap() /// .body(body) /// .send() @@ -2509,7 +2583,12 @@ impl Client { ///Sends a `GET` request to `/v1/worker/ping` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_ping() /// .send() /// .await; @@ -2520,7 +2599,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/append` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_append() /// .task(task) /// .body(body) @@ -2533,7 +2617,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/chunk` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_upload_chunk() /// .task(task) /// .body(body) @@ -2546,7 +2635,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/complete` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_complete() /// .task(task) /// .body(body) @@ -2559,7 +2653,12 @@ impl Client { ///Sends a `POST` request to `/v1/worker/task/{task}/output` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.worker_task_add_output() /// .task(task) /// .body(body) @@ -2572,7 +2671,12 @@ impl Client { ///Sends a `GET` request to `/v1/workers` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.workers_list() /// .send() /// .await; @@ -2583,7 +2687,12 @@ impl Client { ///Sends a `POST` request to `/v1/workers/recycle` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.workers_recycle() /// .send() /// .await; @@ -2594,7 +2703,12 @@ impl Client { ///Sends a `GET` request to `/v1/things` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.get_thing_or_things() /// .id(id) /// .send() @@ -2606,7 +2720,12 @@ impl Client { ///Sends a `GET` request to `/v1/header-arg` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.header_arg() /// .accept_language(accept_language) /// .send() @@ -2619,6 +2738,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -2635,14 +2769,23 @@ pub mod builder { } impl<'a> ControlHold<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/control/hold` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/control/hold", client.baseurl,); + let url = format!("{}/v1/control/hold", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2681,14 +2824,23 @@ pub mod builder { } impl<'a> ControlResume<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/control/resume` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/control/resume", client.baseurl,); + let url = format!("{}/v1/control/resume", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2704,7 +2856,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -2720,9 +2872,13 @@ pub mod builder { } impl<'a> TaskGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), } } @@ -2738,13 +2894,18 @@ pub mod builder { } ///Sends a `GET` request to `/v1/task/{Task}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task } = self; let task = task.map_err(Error::InvalidRequest)?; let url = format!( "{}/v1/task/{}", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -2784,14 +2945,23 @@ pub mod builder { } impl<'a> TasksGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/tasks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result>, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/tasks", client.baseurl,); + let url = format!("{}/v1/tasks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2831,9 +3001,13 @@ pub mod builder { } impl<'a> TaskSubmit<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -2859,12 +3033,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/tasks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body .and_then(|v| types::TaskSubmit::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/tasks", client.baseurl,); + let url = format!("{}/v1/tasks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -2906,9 +3085,13 @@ pub mod builder { } impl<'a> TaskEventsGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), minseq: Ok(None), } @@ -2936,6 +3119,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/tasks/{task}/events` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result>, Error<()>> { @@ -2949,7 +3137,7 @@ pub mod builder { let url = format!( "{}/v1/tasks/{}/events", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -2991,9 +3179,13 @@ pub mod builder { } impl<'a> TaskOutputsGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), } } @@ -3009,6 +3201,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/tasks/{task}/outputs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result>, Error<()>> { @@ -3017,7 +3214,7 @@ pub mod builder { let url = format!( "{}/v1/tasks/{}/outputs", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3059,9 +3256,13 @@ pub mod builder { } impl<'a> TaskOutputDownload<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), output: Err("output was not initialized".to_string()), } @@ -3088,6 +3289,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -3100,7 +3306,7 @@ pub mod builder { "{}/v1/tasks/{}/outputs/{}", client.baseurl, encode_path(&task.to_string()), - encode_path(&output.to_string()), + encode_path(&output.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3133,9 +3339,13 @@ pub mod builder { } impl<'a> UserCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3161,12 +3371,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/users` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body .and_then(|v| types::UserCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/users", client.baseurl,); + let url = format!("{}/v1/users", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3206,14 +3421,23 @@ pub mod builder { } impl<'a> Whoami<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/whoami` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/whoami", client.baseurl,); + let url = format!("{}/v1/whoami", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3253,9 +3477,13 @@ pub mod builder { } impl<'a> WhoamiPutName<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -3272,10 +3500,15 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/whoami/name` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/whoami/name", client.baseurl,); + let url = format!("{}/v1/whoami/name", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3300,7 +3533,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3316,9 +3549,13 @@ pub mod builder { } impl<'a> WorkerBootstrap<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3344,12 +3581,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/bootstrap` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body .and_then(|v| types::WorkerBootstrap::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/worker/bootstrap", client.baseurl,); + let url = format!("{}/v1/worker/bootstrap", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3389,14 +3631,23 @@ pub mod builder { } impl<'a> WorkerPing<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/worker/ping` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/worker/ping", client.baseurl,); + let url = format!("{}/v1/worker/ping", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3437,9 +3688,13 @@ pub mod builder { } impl<'a> WorkerTaskAppend<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -3478,6 +3733,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/append` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3487,7 +3747,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/append", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3509,7 +3769,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3526,9 +3786,13 @@ pub mod builder { } impl<'a> WorkerTaskUploadChunk<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Err("body was not initialized".to_string()), } @@ -3555,6 +3819,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/chunk` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3562,7 +3831,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/chunk", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3609,9 +3878,13 @@ pub mod builder { } impl<'a> WorkerTaskComplete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -3650,6 +3923,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/complete` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3659,7 +3937,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/complete", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3681,7 +3959,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3698,9 +3976,13 @@ pub mod builder { } impl<'a> WorkerTaskAddOutput<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, task: Err("task was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -3737,6 +4019,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/worker/task/{task}/output` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; @@ -3746,7 +4033,7 @@ pub mod builder { let url = format!( "{}/v1/worker/task/{}/output", client.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3768,7 +4055,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3783,14 +4070,23 @@ pub mod builder { } impl<'a> WorkersList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/workers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/workers", client.baseurl,); + let url = format!("{}/v1/workers", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3829,14 +4125,23 @@ pub mod builder { } impl<'a> WorkersRecycle<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/workers/recycle` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client } = self; - let url = format!("{}/v1/workers/recycle", client.baseurl,); + let url = format!("{}/v1/workers/recycle", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3852,7 +4157,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -3868,9 +4173,13 @@ pub mod builder { } impl<'a> GetThingOrThings<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Ok(None), } } @@ -3887,10 +4196,15 @@ pub mod builder { } ///Sends a `GET` request to `/v1/things` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/things", client.baseurl,); + let url = format!("{}/v1/things", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3931,9 +4245,13 @@ pub mod builder { } impl<'a> HeaderArg<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, accept_language: Ok(None), } } @@ -3949,13 +4267,18 @@ pub mod builder { } ///Sends a `GET` request to `/v1/header-arg` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, accept_language, } = self; let accept_language = accept_language.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/header-arg", client.baseurl,); + let url = format!("{}/v1/header-arg", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3974,8 +4297,8 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::empty(response)), - _ => Err(Error::ErrorResponse(ResponseValue::empty(response))), + 200..=299 => Ok(ResponseValue::empty(&response)), + _ => Err(Error::ErrorResponse(ResponseValue::empty(&response))), } } } diff --git a/progenitor-impl/tests/output/src/buildomat_positional.rs b/progenitor-impl/tests/output/src/buildomat_positional.rs index 9da9d999..c69e7706 100644 --- a/progenitor-impl/tests/output/src/buildomat_positional.rs +++ b/progenitor-impl/tests/output/src/buildomat_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -828,7 +836,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Buildomat +///Client for `Buildomat` /// ///Version: 1.0 pub struct Client { @@ -842,6 +850,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -861,6 +874,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -889,10 +903,35 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `POST` request to `/v1/control/hold` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn control_hold<'a>(&'a self) -> Result, Error<()>> { - let url = format!("{}/v1/control/hold", self.baseurl,); + let url = format!("{}/v1/control/hold", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -922,8 +961,14 @@ impl Client { } ///Sends a `POST` request to `/v1/control/resume` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn control_resume<'a>(&'a self) -> Result, Error<()>> { - let url = format!("{}/v1/control/resume", self.baseurl,); + let url = format!("{}/v1/control/resume", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -939,12 +984,18 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } ///Sends a `GET` request to `/v1/task/{Task}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn task_get<'a>( &'a self, task: &'a str, @@ -952,7 +1003,7 @@ impl Client { let url = format!( "{}/v1/task/{}", self.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -983,10 +1034,16 @@ impl Client { } ///Sends a `GET` request to `/v1/tasks` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn tasks_get<'a>( &'a self, ) -> Result>, Error<()>> { - let url = format!("{}/v1/tasks", self.baseurl,); + let url = format!("{}/v1/tasks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1016,11 +1073,17 @@ impl Client { } ///Sends a `POST` request to `/v1/tasks` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn task_submit<'a>( &'a self, body: &'a types::TaskSubmit, ) -> Result, Error<()>> { - let url = format!("{}/v1/tasks", self.baseurl,); + let url = format!("{}/v1/tasks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1051,6 +1114,12 @@ impl Client { } ///Sends a `GET` request to `/v1/tasks/{task}/events` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn task_events_get<'a>( &'a self, task: &'a str, @@ -1059,7 +1128,7 @@ impl Client { let url = format!( "{}/v1/tasks/{}/events", self.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1091,6 +1160,12 @@ impl Client { } ///Sends a `GET` request to `/v1/tasks/{task}/outputs` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn task_outputs_get<'a>( &'a self, task: &'a str, @@ -1098,7 +1173,7 @@ impl Client { let url = format!( "{}/v1/tasks/{}/outputs", self.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1129,6 +1204,12 @@ impl Client { } ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn task_output_download<'a>( &'a self, task: &'a str, @@ -1138,7 +1219,7 @@ impl Client { "{}/v1/tasks/{}/outputs/{}", self.baseurl, encode_path(&task.to_string()), - encode_path(&output.to_string()), + encode_path(&output.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1161,11 +1242,17 @@ impl Client { } ///Sends a `POST` request to `/v1/users` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn user_create<'a>( &'a self, body: &'a types::UserCreate, ) -> Result, Error<()>> { - let url = format!("{}/v1/users", self.baseurl,); + let url = format!("{}/v1/users", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1196,8 +1283,14 @@ impl Client { } ///Sends a `GET` request to `/v1/whoami` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn whoami<'a>(&'a self) -> Result, Error<()>> { - let url = format!("{}/v1/whoami", self.baseurl,); + let url = format!("{}/v1/whoami", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1227,11 +1320,17 @@ impl Client { } ///Sends a `PUT` request to `/v1/whoami/name` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn whoami_put_name<'a>( &'a self, body: String, ) -> Result, Error<()>> { - let url = format!("{}/v1/whoami/name", self.baseurl,); + let url = format!("{}/v1/whoami/name", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1256,17 +1355,23 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } ///Sends a `POST` request to `/v1/worker/bootstrap` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn worker_bootstrap<'a>( &'a self, body: &'a types::WorkerBootstrap, ) -> Result, Error<()>> { - let url = format!("{}/v1/worker/bootstrap", self.baseurl,); + let url = format!("{}/v1/worker/bootstrap", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1297,10 +1402,16 @@ impl Client { } ///Sends a `GET` request to `/v1/worker/ping` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn worker_ping<'a>( &'a self, ) -> Result, Error<()>> { - let url = format!("{}/v1/worker/ping", self.baseurl,); + let url = format!("{}/v1/worker/ping", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1330,6 +1441,12 @@ impl Client { } ///Sends a `POST` request to `/v1/worker/task/{task}/append` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn worker_task_append<'a>( &'a self, task: &'a str, @@ -1338,7 +1455,7 @@ impl Client { let url = format!( "{}/v1/worker/task/{}/append", self.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1360,12 +1477,18 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } ///Sends a `POST` request to `/v1/worker/task/{task}/chunk` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn worker_task_upload_chunk<'a, B: Into>( &'a self, task: &'a str, @@ -1374,7 +1497,7 @@ impl Client { let url = format!( "{}/v1/worker/task/{}/chunk", self.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1410,6 +1533,12 @@ impl Client { } ///Sends a `POST` request to `/v1/worker/task/{task}/complete` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn worker_task_complete<'a>( &'a self, task: &'a str, @@ -1418,7 +1547,7 @@ impl Client { let url = format!( "{}/v1/worker/task/{}/complete", self.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1440,12 +1569,18 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } ///Sends a `POST` request to `/v1/worker/task/{task}/output` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn worker_task_add_output<'a>( &'a self, task: &'a str, @@ -1454,7 +1589,7 @@ impl Client { let url = format!( "{}/v1/worker/task/{}/output", self.baseurl, - encode_path(&task.to_string()), + encode_path(&task.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1476,16 +1611,22 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } ///Sends a `GET` request to `/v1/workers` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn workers_list<'a>( &'a self, ) -> Result, Error<()>> { - let url = format!("{}/v1/workers", self.baseurl,); + let url = format!("{}/v1/workers", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1515,8 +1656,14 @@ impl Client { } ///Sends a `POST` request to `/v1/workers/recycle` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn workers_recycle<'a>(&'a self) -> Result, Error<()>> { - let url = format!("{}/v1/workers/recycle", self.baseurl,); + let url = format!("{}/v1/workers/recycle", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1532,17 +1679,23 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } ///Sends a `GET` request to `/v1/things` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn get_thing_or_things<'a>( &'a self, id: Option<&'a types::GetThingOrThingsId>, ) -> Result, Error<()>> { - let url = format!("{}/v1/things", self.baseurl,); + let url = format!("{}/v1/things", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1573,11 +1726,17 @@ impl Client { } ///Sends a `GET` request to `/v1/header-arg` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn header_arg<'a>( &'a self, accept_language: Option, ) -> Result, Error<()>> { - let url = format!("{}/v1/header-arg", self.baseurl,); + let url = format!("{}/v1/header-arg", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1597,8 +1756,8 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::empty(response)), - _ => Err(Error::ErrorResponse(ResponseValue::empty(response))), + 200..=299 => Ok(ResponseValue::empty(&response)), + _ => Err(Error::ErrorResponse(ResponseValue::empty(&response))), } } } diff --git a/progenitor-impl/tests/output/src/cli_gen_builder.rs b/progenitor-impl/tests/output/src/cli_gen_builder.rs index 6da23e1b..e20e2c88 100644 --- a/progenitor-impl/tests/output/src/cli_gen_builder.rs +++ b/progenitor-impl/tests/output/src/cli_gen_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -135,7 +143,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for CLI gen test +///Client for `CLI gen test` /// ///Test case to exercise CLI generation /// @@ -151,6 +159,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -170,6 +183,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -200,7 +214,12 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `GET` request to `/uno` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.uno() /// .gateway(gateway) /// .body(body) @@ -214,6 +233,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -232,9 +266,13 @@ pub mod builder { } impl<'a> Uno<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, gateway: Err("gateway was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -271,6 +309,11 @@ pub mod builder { } ///Sends a `GET` request to `/uno` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -281,7 +324,7 @@ pub mod builder { let body = body .and_then(|v| types::UnoBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/uno", client.baseurl,); + let url = format!("{}/uno", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/cli_gen_builder_tagged.rs b/progenitor-impl/tests/output/src/cli_gen_builder_tagged.rs index a8b76da1..282f9e12 100644 --- a/progenitor-impl/tests/output/src/cli_gen_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/cli_gen_builder_tagged.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -133,7 +141,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for CLI gen test +///Client for `CLI gen test` /// ///Test case to exercise CLI generation /// @@ -149,6 +157,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -168,6 +181,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -198,7 +212,12 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `GET` request to `/uno` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.uno() /// .gateway(gateway) /// .body(body) @@ -212,6 +231,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -230,9 +264,13 @@ pub mod builder { } impl<'a> Uno<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, gateway: Err("gateway was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -269,6 +307,11 @@ pub mod builder { } ///Sends a `GET` request to `/uno` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -279,7 +322,7 @@ pub mod builder { let body = body .and_then(|v| types::UnoBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/uno", client.baseurl,); + let url = format!("{}/uno", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/cli_gen_positional.rs b/progenitor-impl/tests/output/src/cli_gen_positional.rs index f9353414..8d7e12b6 100644 --- a/progenitor-impl/tests/output/src/cli_gen_positional.rs +++ b/progenitor-impl/tests/output/src/cli_gen_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -62,7 +70,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for CLI gen test +///Client for `CLI gen test` /// ///Test case to exercise CLI generation /// @@ -78,6 +86,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -97,6 +110,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -125,14 +139,39 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `GET` request to `/uno` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn uno<'a>( &'a self, gateway: &'a str, body: &'a types::UnoBody, ) -> Result, Error<()>> { - let url = format!("{}/uno", self.baseurl,); + let url = format!("{}/uno", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/keeper_builder.rs b/progenitor-impl/tests/output/src/keeper_builder.rs index e65cc3fc..11befc43 100644 --- a/progenitor-impl/tests/output/src/keeper_builder.rs +++ b/progenitor-impl/tests/output/src/keeper_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -1199,7 +1207,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Keeper API +///Client for `Keeper API` /// ///report execution of cron jobs through a mechanism other than mail /// @@ -1215,6 +1223,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -1234,6 +1247,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -1267,7 +1281,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.enrol() /// .authorization(authorization) /// .body(body) @@ -1282,7 +1301,12 @@ impl Client { /// ///Arguments: /// - `authorization`: Authorization header (bearer token) - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.global_jobs() /// .authorization(authorization) /// .send() @@ -1296,7 +1320,12 @@ impl Client { /// ///Arguments: /// - `authorization`: Authorization header (bearer token) - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ping() /// .authorization(authorization) /// .send() @@ -1311,7 +1340,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.report_finish() /// .authorization(authorization) /// .body(body) @@ -1327,7 +1361,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.report_output() /// .authorization(authorization) /// .body(body) @@ -1343,7 +1382,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.report_start() /// .authorization(authorization) /// .body(body) @@ -1357,6 +1401,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -1375,9 +1434,13 @@ pub mod builder { } impl<'a> Enrol<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1414,6 +1477,11 @@ pub mod builder { } ///Sends a `POST` request to `/enrol` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1424,7 +1492,7 @@ pub mod builder { let body = body .and_then(|v| types::EnrolBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/enrol", client.baseurl,); + let url = format!("{}/enrol", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1446,7 +1514,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -1462,9 +1530,13 @@ pub mod builder { } impl<'a> GlobalJobs<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), } } @@ -1480,13 +1552,18 @@ pub mod builder { } ///Sends a `GET` request to `/global/jobs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - let url = format!("{}/global/jobs", client.baseurl,); + let url = format!("{}/global/jobs", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1527,9 +1604,13 @@ pub mod builder { } impl<'a> Ping<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), } } @@ -1545,13 +1626,18 @@ pub mod builder { } ///Sends a `GET` request to `/ping` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - let url = format!("{}/ping", client.baseurl,); + let url = format!("{}/ping", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1593,9 +1679,13 @@ pub mod builder { } impl<'a> ReportFinish<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1634,6 +1724,11 @@ pub mod builder { } ///Sends a `POST` request to `/report/finish` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1644,7 +1739,7 @@ pub mod builder { let body = body .and_then(|v| types::ReportFinishBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/report/finish", client.baseurl,); + let url = format!("{}/report/finish", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1687,9 +1782,13 @@ pub mod builder { } impl<'a> ReportOutput<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1728,6 +1827,11 @@ pub mod builder { } ///Sends a `POST` request to `/report/output` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1738,7 +1842,7 @@ pub mod builder { let body = body .and_then(|v| types::ReportOutputBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/report/output", client.baseurl,); + let url = format!("{}/report/output", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1781,9 +1885,13 @@ pub mod builder { } impl<'a> ReportStart<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1820,6 +1928,11 @@ pub mod builder { } ///Sends a `POST` request to `/report/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1830,7 +1943,7 @@ pub mod builder { let body = body .and_then(|v| types::ReportStartBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/report/start", client.baseurl,); + let url = format!("{}/report/start", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/keeper_builder_tagged.rs b/progenitor-impl/tests/output/src/keeper_builder_tagged.rs index 4b8ddbb1..cef659f5 100644 --- a/progenitor-impl/tests/output/src/keeper_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/keeper_builder_tagged.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -1179,7 +1187,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Keeper API +///Client for `Keeper API` /// ///report execution of cron jobs through a mechanism other than mail /// @@ -1195,6 +1203,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -1214,6 +1227,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -1247,7 +1261,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.enrol() /// .authorization(authorization) /// .body(body) @@ -1262,7 +1281,12 @@ impl Client { /// ///Arguments: /// - `authorization`: Authorization header (bearer token) - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.global_jobs() /// .authorization(authorization) /// .send() @@ -1276,7 +1300,12 @@ impl Client { /// ///Arguments: /// - `authorization`: Authorization header (bearer token) - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ping() /// .authorization(authorization) /// .send() @@ -1291,7 +1320,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.report_finish() /// .authorization(authorization) /// .body(body) @@ -1307,7 +1341,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.report_output() /// .authorization(authorization) /// .body(body) @@ -1323,7 +1362,12 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.report_start() /// .authorization(authorization) /// .body(body) @@ -1337,6 +1381,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -1355,9 +1414,13 @@ pub mod builder { } impl<'a> Enrol<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1394,6 +1457,11 @@ pub mod builder { } ///Sends a `POST` request to `/enrol` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1404,7 +1472,7 @@ pub mod builder { let body = body .and_then(|v| types::EnrolBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/enrol", client.baseurl,); + let url = format!("{}/enrol", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1426,7 +1494,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -1442,9 +1510,13 @@ pub mod builder { } impl<'a> GlobalJobs<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), } } @@ -1460,13 +1532,18 @@ pub mod builder { } ///Sends a `GET` request to `/global/jobs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - let url = format!("{}/global/jobs", client.baseurl,); + let url = format!("{}/global/jobs", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1507,9 +1584,13 @@ pub mod builder { } impl<'a> Ping<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), } } @@ -1525,13 +1606,18 @@ pub mod builder { } ///Sends a `GET` request to `/ping` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - let url = format!("{}/ping", client.baseurl,); + let url = format!("{}/ping", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1573,9 +1659,13 @@ pub mod builder { } impl<'a> ReportFinish<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1614,6 +1704,11 @@ pub mod builder { } ///Sends a `POST` request to `/report/finish` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1624,7 +1719,7 @@ pub mod builder { let body = body .and_then(|v| types::ReportFinishBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/report/finish", client.baseurl,); + let url = format!("{}/report/finish", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1667,9 +1762,13 @@ pub mod builder { } impl<'a> ReportOutput<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1708,6 +1807,11 @@ pub mod builder { } ///Sends a `POST` request to `/report/output` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1718,7 +1822,7 @@ pub mod builder { let body = body .and_then(|v| types::ReportOutputBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/report/output", client.baseurl,); + let url = format!("{}/report/output", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1761,9 +1865,13 @@ pub mod builder { } impl<'a> ReportStart<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, authorization: Err("authorization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -1800,6 +1908,11 @@ pub mod builder { } ///Sends a `POST` request to `/report/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -1810,7 +1923,7 @@ pub mod builder { let body = body .and_then(|v| types::ReportStartBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/report/start", client.baseurl,); + let url = format!("{}/report/start", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/keeper_positional.rs b/progenitor-impl/tests/output/src/keeper_positional.rs index ef64d5ce..df0b199d 100644 --- a/progenitor-impl/tests/output/src/keeper_positional.rs +++ b/progenitor-impl/tests/output/src/keeper_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -384,7 +392,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Keeper API +///Client for `Keeper API` /// ///report execution of cron jobs through a mechanism other than mail /// @@ -400,6 +408,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -419,6 +432,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -447,18 +461,42 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `POST` request to `/enrol` /// ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn enrol<'a>( &'a self, authorization: &'a str, body: &'a types::EnrolBody, ) -> Result, Error<()>> { - let url = format!("{}/enrol", self.baseurl,); + let url = format!("{}/enrol", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -480,7 +518,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), + 201u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } @@ -489,11 +527,16 @@ impl Client { /// ///Arguments: /// - `authorization`: Authorization header (bearer token) + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn global_jobs<'a>( &'a self, authorization: &'a str, ) -> Result, Error<()>> { - let url = format!("{}/global/jobs", self.baseurl,); + let url = format!("{}/global/jobs", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -527,11 +570,16 @@ impl Client { /// ///Arguments: /// - `authorization`: Authorization header (bearer token) + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ping<'a>( &'a self, authorization: &'a str, ) -> Result, Error<()>> { - let url = format!("{}/ping", self.baseurl,); + let url = format!("{}/ping", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -566,12 +614,17 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn report_finish<'a>( &'a self, authorization: &'a str, body: &'a types::ReportFinishBody, ) -> Result, Error<()>> { - let url = format!("{}/report/finish", self.baseurl,); + let url = format!("{}/report/finish", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -607,12 +660,17 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn report_output<'a>( &'a self, authorization: &'a str, body: &'a types::ReportOutputBody, ) -> Result, Error<()>> { - let url = format!("{}/report/output", self.baseurl,); + let url = format!("{}/report/output", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -648,12 +706,17 @@ impl Client { ///Arguments: /// - `authorization`: Authorization header (bearer token) /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn report_start<'a>( &'a self, authorization: &'a str, body: &'a types::ReportStartBody, ) -> Result, Error<()>> { - let url = format!("{}/report/start", self.baseurl,); + let url = format!("{}/report/start", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/nexus_builder.rs b/progenitor-impl/tests/output/src/nexus_builder.rs index 1ee5b69e..9b8d541b 100644 --- a/progenitor-impl/tests/output/src/nexus_builder.rs +++ b/progenitor-impl/tests/output/src/nexus_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -25135,7 +25143,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Oxide Region API +///Client for `Oxide Region API` /// ///API for interacting with the Oxide control plane /// @@ -25151,6 +25159,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -25170,6 +25183,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -25204,7 +25218,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/disks/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_view_by_id() /// .id(id) /// .send() @@ -25218,7 +25237,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/images/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_view_by_id() /// .id(id) /// .send() @@ -25232,7 +25256,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/instances/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_view_by_id() /// .id(id) /// .send() @@ -25246,7 +25275,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/network-interfaces/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_view_by_id() /// .id(id) /// .send() @@ -25264,7 +25298,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/organizations/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_view_by_id() /// .id(id) /// .send() @@ -25280,7 +25319,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/projects/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_view_by_id() /// .id(id) /// .send() @@ -25294,7 +25338,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/snapshots/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_view_by_id() /// .id(id) /// .send() @@ -25308,7 +25357,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_view_by_id() /// .id(id) /// .send() @@ -25322,7 +25376,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/vpc-routers/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_view_by_id() /// .id(id) /// .send() @@ -25336,7 +25395,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_view_by_id() /// .id(id) /// .send() @@ -25350,7 +25414,12 @@ impl Client { /// ///Sends a `GET` request to `/by-id/vpcs/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_view_by_id() /// .id(id) /// .send() @@ -25368,7 +25437,12 @@ impl Client { /// ///Sends a `POST` request to `/device/auth` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.device_auth_request() /// .body(body) /// .send() @@ -25387,7 +25461,12 @@ impl Client { /// ///Sends a `POST` request to `/device/confirm` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.device_auth_confirm() /// .body(body) /// .send() @@ -25404,7 +25483,12 @@ impl Client { /// ///Sends a `POST` request to `/device/token` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.device_access_token() /// .body(body) /// .send() @@ -25423,7 +25507,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.group_list() /// .limit(limit) /// .page_token(page_token) @@ -25437,7 +25526,12 @@ impl Client { ///Sends a `POST` request to `/login` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_spoof() /// .body(body) /// .send() @@ -25451,7 +25545,12 @@ impl Client { /// ///Sends a `POST` request to `/login/{silo_name}/local` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_local() /// .silo_name(silo_name) /// .body(body) @@ -25469,7 +25568,12 @@ impl Client { /// ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_saml_begin() /// .silo_name(silo_name) /// .provider_name(provider_name) @@ -25484,7 +25588,12 @@ impl Client { /// ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_saml() /// .silo_name(silo_name) /// .provider_name(provider_name) @@ -25498,7 +25607,12 @@ impl Client { ///Sends a `POST` request to `/logout` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.logout() /// .send() /// .await; @@ -25518,7 +25632,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_list() /// .limit(limit) /// .page_token(page_token) @@ -25536,7 +25655,12 @@ impl Client { /// ///Sends a `POST` request to `/organizations` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_create() /// .body(body) /// .send() @@ -25554,7 +25678,12 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_view() /// .organization_name(organization_name) /// .send() @@ -25573,7 +25702,12 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_update() /// .organization_name(organization_name) /// .body(body) @@ -25592,7 +25726,12 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_delete() /// .organization_name(organization_name) /// .send() @@ -25610,7 +25749,12 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_view() /// .organization_name(organization_name) /// .send() @@ -25629,7 +25773,12 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_update() /// .organization_name(organization_name) /// .body(body) @@ -25652,7 +25801,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_list() /// .organization_name(organization_name) /// .limit(limit) @@ -25674,7 +25828,12 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_create() /// .organization_name(organization_name) /// .body(body) @@ -25695,7 +25854,12 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25717,7 +25881,12 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25739,7 +25908,12 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25764,7 +25938,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25787,7 +25966,12 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25807,7 +25991,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25825,7 +26014,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25853,7 +26047,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_metrics_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25885,7 +26084,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25910,7 +26114,12 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25930,7 +26139,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25952,7 +26166,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25976,7 +26195,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26001,7 +26225,12 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26021,7 +26250,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26039,7 +26273,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26067,7 +26306,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26090,7 +26334,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/attach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_attach() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26111,7 +26360,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/detach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_detach() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26130,7 +26384,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/external-ips` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_external_ip_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26150,7 +26409,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/migrate` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_migrate() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26177,7 +26441,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26198,7 +26467,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26217,7 +26491,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26236,7 +26515,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26261,7 +26545,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26282,7 +26571,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/reboot` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_reboot() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26317,7 +26611,12 @@ impl Client { /// read, counting *backward* from the most recently buffered data /// retrieved from the instance. (See note on `from_start` about mutual /// exclusivity) - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26340,7 +26639,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_stream() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26360,7 +26664,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream_v2` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_stream_v2() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26380,7 +26689,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/start` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_start() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26400,7 +26714,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/stop` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_stop() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26422,7 +26741,12 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26442,7 +26766,12 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26466,7 +26795,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26491,7 +26825,12 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26509,7 +26848,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26527,7 +26871,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26551,7 +26900,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26574,7 +26928,12 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26592,7 +26951,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26610,7 +26974,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26629,7 +26998,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26647,7 +27021,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_firewall_rules_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26665,7 +27044,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_firewall_rules_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26692,7 +27076,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26713,7 +27102,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26732,7 +27126,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26751,7 +27150,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26771,7 +27175,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26801,7 +27210,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26823,7 +27237,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26843,7 +27262,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26863,7 +27287,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26884,7 +27313,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26912,7 +27346,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26933,7 +27372,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26952,7 +27396,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26971,7 +27420,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26991,7 +27445,12 @@ impl Client { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -27019,7 +27478,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_list_network_interfaces() /// .organization_name(organization_name) /// .project_name(project_name) @@ -27041,7 +27505,12 @@ impl Client { /// ///Sends a `GET` request to `/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.policy_view() /// .send() /// .await; @@ -27054,7 +27523,12 @@ impl Client { /// ///Sends a `PUT` request to `/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.policy_update() /// .body(body) /// .send() @@ -27072,7 +27546,12 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.role_list() /// .limit(limit) /// .page_token(page_token) @@ -27089,7 +27568,12 @@ impl Client { /// ///Arguments: /// - `role_name`: The built-in role's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.role_view() /// .role_name(role_name) /// .send() @@ -27103,7 +27587,12 @@ impl Client { /// ///Sends a `GET` request to `/session/me` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_me() /// .send() /// .await; @@ -27121,7 +27610,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_me_groups() /// .limit(limit) /// .page_token(page_token) @@ -27144,7 +27638,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_list() /// .limit(limit) /// .page_token(page_token) @@ -27162,7 +27661,12 @@ impl Client { /// ///Sends a `POST` request to `/session/me/sshkeys` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_create() /// .body(body) /// .send() @@ -27179,7 +27683,12 @@ impl Client { /// ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_view() /// .ssh_key_name(ssh_key_name) /// .send() @@ -27196,7 +27705,12 @@ impl Client { /// ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_delete() /// .ssh_key_name(ssh_key_name) /// .send() @@ -27210,7 +27724,12 @@ impl Client { /// ///Sends a `GET` request to `/system/by-id/images/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_view_by_id() /// .id(id) /// .send() @@ -27224,7 +27743,12 @@ impl Client { /// ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_view_by_id() /// .id(id) /// .send() @@ -27238,7 +27762,12 @@ impl Client { /// ///Sends a `GET` request to `/system/by-id/silos/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_view_by_id() /// .id(id) /// .send() @@ -27261,7 +27790,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_list() /// .limit(limit) /// .page_token(page_token) @@ -27280,7 +27814,12 @@ impl Client { /// ///Sends a `POST` request to `/system/certificates` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_create() /// .body(body) /// .send() @@ -27296,7 +27835,12 @@ impl Client { /// ///Sends a `GET` request to `/system/certificates/{certificate}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_view() /// .certificate(certificate) /// .send() @@ -27312,7 +27856,12 @@ impl Client { /// ///Sends a `DELETE` request to `/system/certificates/{certificate}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_delete() /// .certificate(certificate) /// .send() @@ -27331,7 +27880,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.physical_disk_list() /// .limit(limit) /// .page_token(page_token) @@ -27352,7 +27906,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.rack_list() /// .limit(limit) /// .page_token(page_token) @@ -27370,7 +27929,12 @@ impl Client { /// ///Arguments: /// - `rack_id`: The rack's unique ID. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.rack_view() /// .rack_id(rack_id) /// .send() @@ -27389,7 +27953,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.sled_list() /// .limit(limit) /// .page_token(page_token) @@ -27407,7 +27976,12 @@ impl Client { /// ///Arguments: /// - `sled_id`: The sled's unique ID. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.sled_view() /// .sled_id(sled_id) /// .send() @@ -27427,7 +28001,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.sled_physical_disk_list() /// .sled_id(sled_id) /// .limit(limit) @@ -27453,7 +28032,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_list() /// .limit(limit) /// .page_token(page_token) @@ -27472,7 +28056,12 @@ impl Client { /// ///Sends a `POST` request to `/system/images` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_create() /// .body(body) /// .send() @@ -27488,7 +28077,12 @@ impl Client { /// ///Sends a `GET` request to `/system/images/{image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_view() /// .image_name(image_name) /// .send() @@ -27506,7 +28100,12 @@ impl Client { /// ///Sends a `DELETE` request to `/system/images/{image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_delete() /// .image_name(image_name) /// .send() @@ -27525,7 +28124,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_list() /// .limit(limit) /// .page_token(page_token) @@ -27541,7 +28145,12 @@ impl Client { /// ///Sends a `POST` request to `/system/ip-pools` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_create() /// .body(body) /// .send() @@ -27555,7 +28164,12 @@ impl Client { /// ///Sends a `GET` request to `/system/ip-pools/{pool_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_view() /// .pool_name(pool_name) /// .send() @@ -27569,7 +28183,12 @@ impl Client { /// ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_update() /// .pool_name(pool_name) /// .body(body) @@ -27584,7 +28203,12 @@ impl Client { /// ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_delete() /// .pool_name(pool_name) /// .send() @@ -27605,7 +28229,12 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_range_list() /// .pool_name(pool_name) /// .limit(limit) @@ -27621,7 +28250,12 @@ impl Client { /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_range_add() /// .pool_name(pool_name) /// .body(body) @@ -27636,7 +28270,12 @@ impl Client { /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/remove` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_range_remove() /// .pool_name(pool_name) /// .body(body) @@ -27651,7 +28290,12 @@ impl Client { /// ///Sends a `GET` request to `/system/ip-pools-service` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_view() /// .send() /// .await; @@ -27670,7 +28314,12 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_range_list() /// .limit(limit) /// .page_token(page_token) @@ -27685,7 +28334,12 @@ impl Client { /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_range_add() /// .body(body) /// .send() @@ -27699,7 +28353,12 @@ impl Client { /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_range_remove() /// .body(body) /// .send() @@ -27721,7 +28380,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_metric() /// .metric_name(metric_name) /// .end_time(end_time) @@ -27740,7 +28404,12 @@ impl Client { /// ///Sends a `GET` request to `/system/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_policy_view() /// .send() /// .await; @@ -27753,7 +28422,12 @@ impl Client { /// ///Sends a `PUT` request to `/system/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_policy_update() /// .body(body) /// .send() @@ -27772,7 +28446,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saga_list() /// .limit(limit) /// .page_token(page_token) @@ -27788,7 +28467,12 @@ impl Client { /// ///Sends a `GET` request to `/system/sagas/{saga_id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saga_view() /// .saga_id(saga_id) /// .send() @@ -27809,7 +28493,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_list() /// .limit(limit) /// .page_token(page_token) @@ -27825,7 +28514,12 @@ impl Client { /// ///Sends a `POST` request to `/system/silos` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_create() /// .body(body) /// .send() @@ -27843,7 +28537,12 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_view() /// .silo_name(silo_name) /// .send() @@ -27861,7 +28560,12 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_delete() /// .silo_name(silo_name) /// .send() @@ -27881,7 +28585,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_identity_provider_list() /// .silo_name(silo_name) /// .limit(limit) @@ -27906,7 +28615,12 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.local_idp_user_create() /// .silo_name(silo_name) /// .body(body) @@ -27925,7 +28639,12 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.local_idp_user_delete() /// .silo_name(silo_name) /// .user_id(user_id) @@ -27949,7 +28668,12 @@ impl Client { /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.local_idp_user_set_password() /// .silo_name(silo_name) /// .user_id(user_id) @@ -27969,7 +28693,12 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saml_identity_provider_create() /// .silo_name(silo_name) /// .body(body) @@ -27988,7 +28717,12 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `provider_name`: The SAML identity provider's name - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saml_identity_provider_view() /// .silo_name(silo_name) /// .provider_name(provider_name) @@ -28005,7 +28739,12 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_policy_view() /// .silo_name(silo_name) /// .send() @@ -28022,7 +28761,12 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_policy_update() /// .silo_name(silo_name) /// .body(body) @@ -28043,7 +28787,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_users_list() /// .silo_name(silo_name) /// .limit(limit) @@ -28063,7 +28812,12 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_user_view() /// .silo_name(silo_name) /// .user_id(user_id) @@ -28083,7 +28837,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_user_list() /// .limit(limit) /// .page_token(page_token) @@ -28101,7 +28860,12 @@ impl Client { /// ///Arguments: /// - `user_name`: The built-in user's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_user_view() /// .user_name(user_name) /// .send() @@ -28119,7 +28883,12 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.timeseries_schema_get() /// .limit(limit) /// .page_token(page_token) @@ -28139,7 +28908,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.user_list() /// .limit(limit) /// .page_token(page_token) @@ -28162,7 +28936,12 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_list_v1() /// .limit(limit) /// .organization(organization) @@ -28180,7 +28959,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/disks` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_create_v1() /// .organization(organization) /// .project(project) @@ -28196,7 +28980,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/disks/{disk}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_view_v1() /// .disk(disk) /// .organization(organization) @@ -28212,7 +29001,12 @@ impl Client { /// ///Sends a `DELETE` request to `/v1/disks/{disk}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_delete_v1() /// .disk(disk) /// .organization(organization) @@ -28235,7 +29029,12 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_list_v1() /// .limit(limit) /// .organization(organization) @@ -28253,7 +29052,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/instances` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_create_v1() /// .organization(organization) /// .project(project) @@ -28269,7 +29073,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/instances/{instance}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_view_v1() /// .instance(instance) /// .organization(organization) @@ -28285,7 +29094,12 @@ impl Client { /// ///Sends a `DELETE` request to `/v1/instances/{instance}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_delete_v1() /// .instance(instance) /// .organization(organization) @@ -28309,7 +29123,12 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_list_v1() /// .instance(instance) /// .limit(limit) @@ -28328,7 +29147,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_attach_v1() /// .instance(instance) /// .organization(organization) @@ -28345,7 +29169,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_detach_v1() /// .instance(instance) /// .organization(organization) @@ -28362,7 +29191,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/instances/{instance}/migrate` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_migrate_v1() /// .instance(instance) /// .organization(organization) @@ -28379,7 +29213,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/instances/{instance}/reboot` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_reboot_v1() /// .instance(instance) /// .organization(organization) @@ -28410,7 +29249,12 @@ impl Client { /// exclusivity) /// - `organization` /// - `project` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_v1() /// .instance(instance) /// .from_start(from_start) @@ -28430,7 +29274,12 @@ impl Client { ///Sends a `GET` request to /// `/v1/instances/{instance}/serial-console/stream` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_stream_v1() /// .instance(instance) /// .organization(organization) @@ -28446,7 +29295,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/instances/{instance}/start` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_start_v1() /// .instance(instance) /// .organization(organization) @@ -28462,7 +29316,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/instances/{instance}/stop` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_stop_v1() /// .instance(instance) /// .organization(organization) @@ -28483,7 +29342,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_list_v1() /// .limit(limit) /// .page_token(page_token) @@ -28499,7 +29363,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/organizations` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_create_v1() /// .body(body) /// .send() @@ -28513,7 +29382,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/organizations/{organization}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_view_v1() /// .organization(organization) /// .send() @@ -28527,7 +29401,12 @@ impl Client { /// ///Sends a `PUT` request to `/v1/organizations/{organization}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_update_v1() /// .organization(organization) /// .body(body) @@ -28542,7 +29421,12 @@ impl Client { /// ///Sends a `DELETE` request to `/v1/organizations/{organization}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_delete_v1() /// .organization(organization) /// .send() @@ -28556,7 +29440,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/organizations/{organization}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_view_v1() /// .organization(organization) /// .send() @@ -28570,7 +29459,12 @@ impl Client { /// ///Sends a `PUT` request to `/v1/organizations/{organization}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_update_v1() /// .organization(organization) /// .body(body) @@ -28591,7 +29485,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_list_v1() /// .limit(limit) /// .organization(organization) @@ -28608,7 +29507,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/projects` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_create_v1() /// .organization(organization) /// .body(body) @@ -28623,7 +29527,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/projects/{project}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_view_v1() /// .project(project) /// .organization(organization) @@ -28638,7 +29547,12 @@ impl Client { /// ///Sends a `PUT` request to `/v1/projects/{project}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_update_v1() /// .project(project) /// .organization(organization) @@ -28654,7 +29568,12 @@ impl Client { /// ///Sends a `DELETE` request to `/v1/projects/{project}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_delete_v1() /// .project(project) /// .organization(organization) @@ -28669,7 +29588,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/projects/{project}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_view_v1() /// .project(project) /// .organization(organization) @@ -28684,7 +29608,12 @@ impl Client { /// ///Sends a `PUT` request to `/v1/projects/{project}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_update_v1() /// .project(project) /// .organization(organization) @@ -28705,7 +29634,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_component_version_list() /// .limit(limit) /// .page_token(page_token) @@ -28726,7 +29660,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.update_deployments_list() /// .limit(limit) /// .page_token(page_token) @@ -28742,7 +29681,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/system/update/deployments/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.update_deployment_view() /// .id(id) /// .send() @@ -28756,7 +29700,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/system/update/refresh` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_refresh() /// .send() /// .await; @@ -28769,7 +29718,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/system/update/start` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_start() /// .body(body) /// .send() @@ -28785,7 +29739,12 @@ impl Client { /// ///Sends a `POST` request to `/v1/system/update/stop` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_stop() /// .send() /// .await; @@ -28803,7 +29762,12 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_list() /// .limit(limit) /// .page_token(page_token) @@ -28819,7 +29783,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/system/update/updates/{version}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_view() /// .version(version) /// .send() @@ -28834,7 +29803,12 @@ impl Client { ///Sends a `GET` request to /// `/v1/system/update/updates/{version}/components` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_components_list() /// .version(version) /// .send() @@ -28848,7 +29822,12 @@ impl Client { /// ///Sends a `GET` request to `/v1/system/update/version` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_version() /// .send() /// .await; @@ -28860,6 +29839,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -28877,9 +29871,13 @@ pub mod builder { } impl<'a> DiskViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -28895,13 +29893,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/disks/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/disks/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -28948,9 +29951,13 @@ pub mod builder { } impl<'a> ImageViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -28966,13 +29973,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/images/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/images/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29019,9 +30031,13 @@ pub mod builder { } impl<'a> InstanceViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29037,13 +30053,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/instances/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/instances/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29090,9 +30111,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29108,6 +30133,11 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/network-interfaces/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -29116,7 +30146,7 @@ pub mod builder { let url = format!( "{}/by-id/network-interfaces/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29163,9 +30193,13 @@ pub mod builder { } impl<'a> OrganizationViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29181,13 +30215,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/organizations/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/organizations/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29234,9 +30273,13 @@ pub mod builder { } impl<'a> ProjectViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29252,13 +30295,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/projects/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/projects/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29305,9 +30353,13 @@ pub mod builder { } impl<'a> SnapshotViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29323,13 +30375,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/snapshots/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/snapshots/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29376,9 +30433,13 @@ pub mod builder { } impl<'a> VpcRouterRouteViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29394,13 +30455,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpc-router-routes/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29447,9 +30513,13 @@ pub mod builder { } impl<'a> VpcRouterViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29465,13 +30535,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpc-routers/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpc-routers/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29518,9 +30593,13 @@ pub mod builder { } impl<'a> VpcSubnetViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29536,13 +30615,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpc-subnets/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29589,9 +30673,13 @@ pub mod builder { } impl<'a> VpcViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29607,13 +30695,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpcs/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpcs/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29660,9 +30753,13 @@ pub mod builder { } impl<'a> DeviceAuthRequest<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -29690,12 +30787,17 @@ pub mod builder { } ///Sends a `POST` request to `/device/auth` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::DeviceAuthRequest::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/device/auth", client.baseurl,); + let url = format!("{}/device/auth", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29732,9 +30834,13 @@ pub mod builder { } impl<'a> DeviceAuthConfirm<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -29762,12 +30868,17 @@ pub mod builder { } ///Sends a `POST` request to `/device/confirm` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::DeviceAuthVerify::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/device/confirm", client.baseurl,); + let url = format!("{}/device/confirm", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29792,7 +30903,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -29814,9 +30925,13 @@ pub mod builder { } impl<'a> DeviceAccessToken<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -29846,6 +30961,11 @@ pub mod builder { } ///Sends a `POST` request to `/device/token` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body @@ -29853,7 +30973,7 @@ pub mod builder { types::DeviceAccessTokenRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!("{}/device/token", client.baseurl,); + let url = format!("{}/device/token", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29892,9 +31012,13 @@ pub mod builder { } impl<'a> GroupList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -29933,6 +31057,11 @@ pub mod builder { } ///Sends a `GET` request to `/groups` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -29945,7 +31074,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/groups", client.baseurl,); + let url = format!("{}/groups", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30043,9 +31172,13 @@ pub mod builder { } impl<'a> LoginSpoof<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -30071,12 +31204,17 @@ pub mod builder { } ///Sends a `POST` request to `/login` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::SpoofLoginBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/login", client.baseurl,); + let url = format!("{}/login", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30101,7 +31239,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -30124,9 +31262,13 @@ pub mod builder { } impl<'a> LoginLocal<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -30168,6 +31310,11 @@ pub mod builder { } ///Sends a `POST` request to `/login/{silo_name}/local` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30183,7 +31330,7 @@ pub mod builder { let url = format!( "{}/login/{}/local", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30228,9 +31375,13 @@ pub mod builder { } impl<'a> LoginSamlBegin<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), provider_name: Err("provider_name was not initialized".to_string()), } @@ -30257,6 +31408,11 @@ pub mod builder { } ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30269,7 +31425,7 @@ pub mod builder { "{}/login/{}/saml/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30310,9 +31466,13 @@ pub mod builder { } impl<'a> LoginSaml<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), provider_name: Err("provider_name was not initialized".to_string()), body: Err("body was not initialized".to_string()), @@ -30350,6 +31510,11 @@ pub mod builder { } ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30364,7 +31529,7 @@ pub mod builder { "{}/login/{}/saml/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30411,14 +31576,23 @@ pub mod builder { } impl<'a> Logout<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/logout` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/logout", client.baseurl,); + let url = format!("{}/logout", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30442,7 +31616,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -30466,9 +31640,13 @@ pub mod builder { } impl<'a> OrganizationList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -30507,6 +31685,11 @@ pub mod builder { } ///Sends a `GET` request to `/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -30519,7 +31702,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/organizations", client.baseurl,); + let url = format!("{}/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30617,9 +31800,13 @@ pub mod builder { } impl<'a> OrganizationCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -30647,12 +31834,17 @@ pub mod builder { } ///Sends a `POST` request to `/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::OrganizationCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/organizations", client.baseurl,); + let url = format!("{}/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30699,9 +31891,13 @@ pub mod builder { } impl<'a> OrganizationView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), } } @@ -30717,6 +31913,11 @@ pub mod builder { } ///Sends a `GET` request to `/organizations/{organization_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30726,7 +31927,7 @@ pub mod builder { let url = format!( "{}/organizations/{}", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30774,9 +31975,13 @@ pub mod builder { } impl<'a> OrganizationUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -30815,6 +32020,11 @@ pub mod builder { } ///Sends a `PUT` request to `/organizations/{organization_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30828,7 +32038,7 @@ pub mod builder { let url = format!( "{}/organizations/{}", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30876,9 +32086,13 @@ pub mod builder { } impl<'a> OrganizationDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), } } @@ -30894,6 +32108,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/organizations/{organization_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30903,7 +32122,7 @@ pub mod builder { let url = format!( "{}/organizations/{}", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30928,7 +32147,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -30950,9 +32169,13 @@ pub mod builder { } impl<'a> OrganizationPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), } } @@ -30968,6 +32191,11 @@ pub mod builder { } ///Sends a `GET` request to `/organizations/{organization_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -30979,7 +32207,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/policy", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31027,9 +32255,13 @@ pub mod builder { } impl<'a> OrganizationPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -31070,6 +32302,11 @@ pub mod builder { } ///Sends a `PUT` request to `/organizations/{organization_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -31085,7 +32322,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/policy", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31136,9 +32373,13 @@ pub mod builder { } impl<'a> ProjectList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -31189,6 +32430,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -31206,7 +32452,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/projects", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31307,9 +32553,13 @@ pub mod builder { } impl<'a> ProjectCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -31347,6 +32597,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31360,7 +32615,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/projects", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31409,9 +32664,13 @@ pub mod builder { } impl<'a> ProjectView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), } @@ -31439,6 +32698,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31451,7 +32715,7 @@ pub mod builder { "{}/organizations/{}/projects/{}", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31500,9 +32764,13 @@ pub mod builder { } impl<'a> ProjectUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -31551,6 +32819,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31567,7 +32840,7 @@ pub mod builder { "{}/organizations/{}/projects/{}", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31616,9 +32889,13 @@ pub mod builder { } impl<'a> ProjectDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), } @@ -31646,6 +32923,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31658,7 +32940,7 @@ pub mod builder { "{}/organizations/{}/projects/{}", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31683,7 +32965,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -31709,9 +32991,13 @@ pub mod builder { } impl<'a> DiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -31773,6 +33059,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -31793,7 +33084,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/disks", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31895,9 +33186,13 @@ pub mod builder { } impl<'a> DiskCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -31946,6 +33241,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31962,7 +33262,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/disks", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32012,9 +33312,13 @@ pub mod builder { } impl<'a> DiskView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), disk_name: Err("disk_name was not initialized".to_string()), @@ -32054,6 +33358,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32069,7 +33378,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32118,9 +33427,13 @@ pub mod builder { } impl<'a> DiskDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), disk_name: Err("disk_name was not initialized".to_string()), @@ -32160,6 +33473,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32175,7 +33493,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32200,7 +33518,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -32229,9 +33547,13 @@ pub mod builder { } impl<'a> DiskMetricsList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), disk_name: Err("disk_name was not initialized".to_string()), @@ -32330,6 +33652,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}/metrics/{metric_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -32358,7 +33685,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&disk_name.to_string()), - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32468,9 +33795,13 @@ pub mod builder { } impl<'a> ImageList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -32532,6 +33863,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -32552,7 +33888,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/images", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32654,9 +33990,13 @@ pub mod builder { } impl<'a> ImageCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -32705,6 +34045,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32721,7 +34066,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/images", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32771,9 +34116,13 @@ pub mod builder { } impl<'a> ImageView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), image_name: Err("image_name was not initialized".to_string()), @@ -32813,6 +34162,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32828,7 +34182,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32877,9 +34231,13 @@ pub mod builder { } impl<'a> ImageDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), image_name: Err("image_name was not initialized".to_string()), @@ -32919,6 +34277,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32934,7 +34297,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32959,7 +34322,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -32985,9 +34348,13 @@ pub mod builder { } impl<'a> InstanceList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -33050,6 +34417,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -33070,7 +34442,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/instances", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33173,9 +34545,13 @@ pub mod builder { } impl<'a> InstanceCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -33225,6 +34601,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33241,7 +34622,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/instances", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33291,9 +34672,13 @@ pub mod builder { } impl<'a> InstanceView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33333,6 +34718,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33348,7 +34738,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33397,9 +34787,13 @@ pub mod builder { } impl<'a> InstanceDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33439,6 +34833,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33454,7 +34853,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33479,7 +34878,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -33506,9 +34905,13 @@ pub mod builder { } impl<'a> InstanceDiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33582,6 +34985,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -33605,7 +35013,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33709,9 +35117,13 @@ pub mod builder { } impl<'a> InstanceDiskAttach<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33772,6 +35184,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/attach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33791,7 +35208,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33842,9 +35259,13 @@ pub mod builder { } impl<'a> InstanceDiskDetach<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33905,6 +35326,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/detach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33924,7 +35350,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33974,9 +35400,13 @@ pub mod builder { } impl<'a> InstanceExternalIpList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34016,6 +35446,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/external-ips` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -34033,7 +35468,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34083,9 +35518,13 @@ pub mod builder { } impl<'a> InstanceMigrate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34146,6 +35585,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/migrate` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -34165,7 +35609,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34218,9 +35662,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34294,6 +35742,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -34318,7 +35771,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34422,9 +35875,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34489,6 +35946,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -34510,7 +35972,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34561,9 +36023,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34614,6 +36080,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -34634,7 +36105,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34685,9 +36156,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34763,6 +36238,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -34787,7 +36267,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34838,9 +36318,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34891,6 +36375,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -34909,7 +36398,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34934,7 +36423,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -34958,9 +36447,13 @@ pub mod builder { } impl<'a> InstanceReboot<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35000,6 +36493,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/reboot` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35015,7 +36513,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35067,9 +36565,13 @@ pub mod builder { } impl<'a> InstanceSerialConsole<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35145,6 +36647,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/serial-console` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35168,7 +36675,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35226,9 +36733,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleStream<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35268,6 +36779,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/serial-console/stream` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -35283,7 +36799,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35332,9 +36848,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleStreamV2<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35374,6 +36894,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/serial-console/stream_v2` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35389,7 +36914,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35444,9 +36969,13 @@ pub mod builder { } impl<'a> InstanceStart<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35486,6 +37015,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35501,7 +37035,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35550,9 +37084,13 @@ pub mod builder { } impl<'a> InstanceStop<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35592,6 +37130,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/stop` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35607,7 +37150,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35655,9 +37198,13 @@ pub mod builder { } impl<'a> ProjectPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), } @@ -35685,6 +37232,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35699,7 +37251,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/policy", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35748,9 +37300,13 @@ pub mod builder { } impl<'a> ProjectPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -35801,6 +37357,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35819,7 +37380,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/policy", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35871,9 +37432,13 @@ pub mod builder { } impl<'a> SnapshotList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -35936,6 +37501,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35956,7 +37526,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/snapshots", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36059,9 +37629,13 @@ pub mod builder { } impl<'a> SnapshotCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -36111,6 +37685,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36127,7 +37706,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/snapshots", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36177,9 +37756,13 @@ pub mod builder { } impl<'a> SnapshotView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), snapshot_name: Err("snapshot_name was not initialized".to_string()), @@ -36219,6 +37802,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36234,7 +37822,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36283,9 +37871,13 @@ pub mod builder { } impl<'a> SnapshotDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), snapshot_name: Err("snapshot_name was not initialized".to_string()), @@ -36325,6 +37917,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36340,7 +37937,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36365,7 +37962,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -36391,9 +37988,13 @@ pub mod builder { } impl<'a> VpcList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -36455,6 +38056,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -36475,7 +38081,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/vpcs", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36577,9 +38183,13 @@ pub mod builder { } impl<'a> VpcCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -36628,6 +38238,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36644,7 +38259,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/vpcs", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36694,9 +38309,13 @@ pub mod builder { } impl<'a> VpcView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -36736,6 +38355,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36751,7 +38375,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36801,9 +38425,13 @@ pub mod builder { } impl<'a> VpcUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -36864,6 +38492,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36883,7 +38516,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36933,9 +38566,13 @@ pub mod builder { } impl<'a> VpcDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -36975,6 +38612,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36990,7 +38632,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37015,7 +38657,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -37039,9 +38681,13 @@ pub mod builder { } impl<'a> VpcFirewallRulesView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37081,6 +38727,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -37098,7 +38749,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37148,9 +38799,13 @@ pub mod builder { } impl<'a> VpcFirewallRulesUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37216,6 +38871,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -37239,7 +38899,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37292,9 +38952,13 @@ pub mod builder { } impl<'a> VpcRouterList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37368,6 +39032,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -37391,7 +39060,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37495,9 +39164,13 @@ pub mod builder { } impl<'a> VpcRouterCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37558,6 +39231,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37577,7 +39255,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37628,9 +39306,13 @@ pub mod builder { } impl<'a> VpcRouterView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37681,6 +39363,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37699,7 +39386,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37750,9 +39437,13 @@ pub mod builder { } impl<'a> VpcRouterUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37824,6 +39515,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37846,7 +39542,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37897,9 +39593,13 @@ pub mod builder { } impl<'a> VpcRouterDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37950,6 +39650,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37968,7 +39673,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37993,7 +39698,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -38021,9 +39726,13 @@ pub mod builder { } impl<'a> VpcRouterRouteList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38108,6 +39817,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -38134,7 +39848,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38239,9 +39953,13 @@ pub mod builder { } impl<'a> VpcRouterRouteCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38317,6 +40035,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38341,7 +40064,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38393,9 +40116,13 @@ pub mod builder { } impl<'a> VpcRouterRouteView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38457,6 +40184,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38478,7 +40210,7 @@ pub mod builder { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38530,9 +40262,13 @@ pub mod builder { } impl<'a> VpcRouterRouteUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38619,6 +40355,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38646,7 +40387,7 @@ pub mod builder { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38698,9 +40439,13 @@ pub mod builder { } impl<'a> VpcRouterRouteDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38762,6 +40507,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38783,7 +40533,7 @@ pub mod builder { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38808,7 +40558,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -38835,9 +40585,13 @@ pub mod builder { } impl<'a> VpcSubnetList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38911,6 +40665,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -38934,7 +40693,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39038,9 +40797,13 @@ pub mod builder { } impl<'a> VpcSubnetCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39101,6 +40864,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -39120,7 +40888,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39171,9 +40939,13 @@ pub mod builder { } impl<'a> VpcSubnetView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39224,6 +40996,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -39242,7 +41019,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39293,9 +41070,13 @@ pub mod builder { } impl<'a> VpcSubnetUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39367,6 +41148,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -39389,7 +41175,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39440,9 +41226,13 @@ pub mod builder { } impl<'a> VpcSubnetDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39493,6 +41283,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -39511,7 +41306,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39536,7 +41331,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -39564,9 +41359,13 @@ pub mod builder { } impl<'a> VpcSubnetListNetworkInterfaces<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39651,6 +41450,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}/network-interfaces` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -39678,7 +41482,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39778,16 +41582,25 @@ pub mod builder { } impl<'a> PolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/policy", client.baseurl,); + let url = format!("{}/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -39833,9 +41646,13 @@ pub mod builder { } impl<'a> PolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -39861,6 +41678,11 @@ pub mod builder { } ///Sends a `PUT` request to `/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -39868,7 +41690,7 @@ pub mod builder { let body = body .and_then(|v| types::SiloRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/policy", client.baseurl,); + let url = format!("{}/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -39916,9 +41738,13 @@ pub mod builder { } impl<'a> RoleList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), } @@ -39945,6 +41771,11 @@ pub mod builder { } ///Sends a `GET` request to `/roles` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -39955,7 +41786,7 @@ pub mod builder { } = self; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!("{}/roles", client.baseurl,); + let url = format!("{}/roles", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40051,9 +41882,13 @@ pub mod builder { } impl<'a> RoleView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, role_name: Err("role_name was not initialized".to_string()), } } @@ -40069,13 +41904,18 @@ pub mod builder { } ///Sends a `GET` request to `/roles/{role_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, role_name } = self; let role_name = role_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/roles/{}", client.baseurl, - encode_path(&role_name.to_string()), + encode_path(&role_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40121,14 +41961,23 @@ pub mod builder { } impl<'a> SessionMe<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/session/me` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/session/me", client.baseurl,); + let url = format!("{}/session/me", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40176,9 +42025,13 @@ pub mod builder { } impl<'a> SessionMeGroups<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -40217,6 +42070,11 @@ pub mod builder { } ///Sends a `GET` request to `/session/me/groups` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -40229,7 +42087,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/session/me/groups", client.baseurl,); + let url = format!("{}/session/me/groups", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40329,9 +42187,13 @@ pub mod builder { } impl<'a> SessionSshkeyList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -40370,6 +42232,11 @@ pub mod builder { } ///Sends a `GET` request to `/session/me/sshkeys` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -40382,7 +42249,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/session/me/sshkeys", client.baseurl,); + let url = format!("{}/session/me/sshkeys", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40480,9 +42347,13 @@ pub mod builder { } impl<'a> SessionSshkeyCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -40508,12 +42379,17 @@ pub mod builder { } ///Sends a `POST` request to `/session/me/sshkeys` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::SshKeyCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/session/me/sshkeys", client.baseurl,); + let url = format!("{}/session/me/sshkeys", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40560,9 +42436,13 @@ pub mod builder { } impl<'a> SessionSshkeyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, ssh_key_name: Err("ssh_key_name was not initialized".to_string()), } } @@ -40578,6 +42458,11 @@ pub mod builder { } ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -40587,7 +42472,7 @@ pub mod builder { let url = format!( "{}/session/me/sshkeys/{}", client.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40634,9 +42519,13 @@ pub mod builder { } impl<'a> SessionSshkeyDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, ssh_key_name: Err("ssh_key_name was not initialized".to_string()), } } @@ -40652,6 +42541,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -40661,7 +42555,7 @@ pub mod builder { let url = format!( "{}/session/me/sshkeys/{}", client.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40686,7 +42580,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -40708,9 +42602,13 @@ pub mod builder { } impl<'a> SystemImageViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -40726,13 +42624,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/by-id/images/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/by-id/images/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40779,9 +42682,13 @@ pub mod builder { } impl<'a> IpPoolViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -40797,13 +42704,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/by-id/ip-pools/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40850,9 +42762,13 @@ pub mod builder { } impl<'a> SiloViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -40868,13 +42784,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/by-id/silos/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/by-id/silos/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40923,9 +42844,13 @@ pub mod builder { } impl<'a> CertificateList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -40964,6 +42889,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/certificates` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -40976,7 +42906,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/certificates", client.baseurl,); + let url = format!("{}/system/certificates", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41074,9 +43004,13 @@ pub mod builder { } impl<'a> CertificateCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -41104,12 +43038,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/certificates` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::CertificateCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/certificates", client.baseurl,); + let url = format!("{}/system/certificates", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41156,9 +43095,13 @@ pub mod builder { } impl<'a> CertificateView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, certificate: Err("certificate was not initialized".to_string()), } } @@ -41174,6 +43117,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/certificates/{certificate}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -41183,7 +43131,7 @@ pub mod builder { let url = format!( "{}/system/certificates/{}", client.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41230,9 +43178,13 @@ pub mod builder { } impl<'a> CertificateDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, certificate: Err("certificate was not initialized".to_string()), } } @@ -41248,6 +43200,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/certificates/{certificate}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -41257,7 +43214,7 @@ pub mod builder { let url = format!( "{}/system/certificates/{}", client.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41282,7 +43239,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -41306,9 +43263,13 @@ pub mod builder { } impl<'a> PhysicalDiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -41347,6 +43308,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41359,7 +43325,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/hardware/disks", client.baseurl,); + let url = format!("{}/system/hardware/disks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41459,9 +43425,13 @@ pub mod builder { } impl<'a> RackList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -41500,6 +43470,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/racks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41512,7 +43487,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/hardware/racks", client.baseurl,); + let url = format!("{}/system/hardware/racks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41610,9 +43585,13 @@ pub mod builder { } impl<'a> RackView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, rack_id: Err("rack_id was not initialized".to_string()), } } @@ -41628,13 +43607,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/racks/{rack_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, rack_id } = self; let rack_id = rack_id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/hardware/racks/{}", client.baseurl, - encode_path(&rack_id.to_string()), + encode_path(&rack_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41683,9 +43667,13 @@ pub mod builder { } impl<'a> SledList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -41724,6 +43712,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/sleds` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41736,7 +43729,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/hardware/sleds", client.baseurl,); + let url = format!("{}/system/hardware/sleds", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41834,9 +43827,13 @@ pub mod builder { } impl<'a> SledView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, sled_id: Err("sled_id was not initialized".to_string()), } } @@ -41852,13 +43849,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/sleds/{sled_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, sled_id } = self; let sled_id = sled_id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/hardware/sleds/{}", client.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41908,9 +43910,13 @@ pub mod builder { } impl<'a> SledPhysicalDiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, sled_id: Err("sled_id was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -41960,6 +43966,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/sleds/{sled_id}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41977,7 +43988,7 @@ pub mod builder { let url = format!( "{}/system/hardware/sleds/{}/disks", client.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42078,9 +44089,13 @@ pub mod builder { } impl<'a> SystemImageList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -42119,6 +44134,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -42131,7 +44151,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/images", client.baseurl,); + let url = format!("{}/system/images", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42229,9 +44249,13 @@ pub mod builder { } impl<'a> SystemImageCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -42259,12 +44283,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::GlobalImageCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/images", client.baseurl,); + let url = format!("{}/system/images", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42311,9 +44340,13 @@ pub mod builder { } impl<'a> SystemImageView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, image_name: Err("image_name was not initialized".to_string()), } } @@ -42329,13 +44362,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/images/{image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, image_name } = self; let image_name = image_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/images/{}", client.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42382,9 +44420,13 @@ pub mod builder { } impl<'a> SystemImageDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, image_name: Err("image_name was not initialized".to_string()), } } @@ -42400,13 +44442,18 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/images/{image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, image_name } = self; let image_name = image_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/images/{}", client.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42431,7 +44478,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -42455,9 +44502,13 @@ pub mod builder { } impl<'a> IpPoolList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -42496,6 +44547,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -42508,7 +44564,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools", client.baseurl,); + let url = format!("{}/system/ip-pools", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42606,9 +44662,13 @@ pub mod builder { } impl<'a> IpPoolCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -42634,12 +44694,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::IpPoolCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools", client.baseurl,); + let url = format!("{}/system/ip-pools", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42686,9 +44751,13 @@ pub mod builder { } impl<'a> IpPoolView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), } } @@ -42704,13 +44773,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools/{pool_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, pool_name } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/ip-pools/{}", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42758,9 +44832,13 @@ pub mod builder { } impl<'a> IpPoolUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -42797,6 +44875,11 @@ pub mod builder { } ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -42810,7 +44893,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42858,9 +44941,13 @@ pub mod builder { } impl<'a> IpPoolDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), } } @@ -42876,13 +44963,18 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, pool_name } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/ip-pools/{}", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42907,7 +44999,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -42931,9 +45023,13 @@ pub mod builder { } impl<'a> IpPoolRangeList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -42971,6 +45067,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools/{pool_name}/ranges` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -42986,7 +45087,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}/ranges", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43084,9 +45185,13 @@ pub mod builder { } impl<'a> IpPoolRangeAdd<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), body: Err("body was not initialized".to_string()), } @@ -43113,6 +45218,11 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -43124,7 +45234,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}/ranges/add", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43173,9 +45283,13 @@ pub mod builder { } impl<'a> IpPoolRangeRemove<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), body: Err("body was not initialized".to_string()), } @@ -43203,6 +45317,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/ip-pools/{pool_name}/ranges/remove` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -43214,7 +45333,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}/ranges/remove", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43240,7 +45359,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -43261,14 +45380,23 @@ pub mod builder { } impl<'a> IpPoolServiceView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/system/ip-pools-service` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/system/ip-pools-service", client.baseurl,); + let url = format!("{}/system/ip-pools-service", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43315,9 +45443,13 @@ pub mod builder { } impl<'a> IpPoolServiceRangeList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), } @@ -43344,6 +45476,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools-service/ranges` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43354,7 +45491,7 @@ pub mod builder { } = self; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools-service/ranges", client.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43450,9 +45587,13 @@ pub mod builder { } impl<'a> IpPoolServiceRangeAdd<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -43468,10 +45609,15 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools-service/ranges/add", client.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/add", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43518,9 +45664,13 @@ pub mod builder { } impl<'a> IpPoolServiceRangeRemove<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -43536,10 +45686,15 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools-service/ranges/remove", client.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/remove", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43564,7 +45719,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -43591,9 +45746,13 @@ pub mod builder { } impl<'a> SystemMetric<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, metric_name: Err("metric_name was not initialized".to_string()), end_time: Ok(None), id: Err("id was not initialized".to_string()), @@ -43668,6 +45827,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/metrics/{metric_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43689,7 +45853,7 @@ pub mod builder { let url = format!( "{}/system/metrics/{}", client.baseurl, - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43746,16 +45910,25 @@ pub mod builder { } impl<'a> SystemPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/system/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/system/policy", client.baseurl,); + let url = format!("{}/system/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43801,9 +45974,13 @@ pub mod builder { } impl<'a> SystemPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -43829,6 +46006,11 @@ pub mod builder { } ///Sends a `PUT` request to `/system/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43836,7 +46018,7 @@ pub mod builder { let body = body .and_then(|v| types::FleetRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/policy", client.baseurl,); + let url = format!("{}/system/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43885,9 +46067,13 @@ pub mod builder { } impl<'a> SagaList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -43926,6 +46112,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/sagas` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43938,7 +46129,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/sagas", client.baseurl,); + let url = format!("{}/system/sagas", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -44036,9 +46227,13 @@ pub mod builder { } impl<'a> SagaView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, saga_id: Err("saga_id was not initialized".to_string()), } } @@ -44054,13 +46249,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/sagas/{saga_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, saga_id } = self; let saga_id = saga_id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/sagas/{}", client.baseurl, - encode_path(&saga_id.to_string()), + encode_path(&saga_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44109,9 +46309,13 @@ pub mod builder { } impl<'a> SiloList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -44150,6 +46354,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -44162,7 +46371,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/silos", client.baseurl,); + let url = format!("{}/system/silos", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -44260,9 +46469,13 @@ pub mod builder { } impl<'a> SiloCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -44288,12 +46501,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/silos` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::SiloCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/silos", client.baseurl,); + let url = format!("{}/system/silos", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -44340,9 +46558,13 @@ pub mod builder { } impl<'a> SiloView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), } } @@ -44358,13 +46580,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos/{silo_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, silo_name } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/silos/{}", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44411,9 +46638,13 @@ pub mod builder { } impl<'a> SiloDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), } } @@ -44429,13 +46660,18 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/silos/{silo_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, silo_name } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/silos/{}", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44460,7 +46696,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -44485,9 +46721,13 @@ pub mod builder { } impl<'a> SiloIdentityProviderList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -44538,6 +46778,11 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/identity-providers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -44556,7 +46801,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/identity-providers", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44657,9 +46902,13 @@ pub mod builder { } impl<'a> LocalIdpUserCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -44697,6 +46946,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/local/users` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -44710,7 +46964,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/identity-providers/local/users", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44759,9 +47013,13 @@ pub mod builder { } impl<'a> LocalIdpUserDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), user_id: Err("user_id was not initialized".to_string()), } @@ -44789,6 +47047,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -44801,7 +47064,7 @@ pub mod builder { "{}/system/silos/{}/identity-providers/local/users/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44826,7 +47089,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -44850,9 +47113,13 @@ pub mod builder { } impl<'a> LocalIdpUserSetPassword<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), user_id: Err("user_id was not initialized".to_string()), body: Err("body was not initialized".to_string()), @@ -44892,6 +47159,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}/ /// set-password` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -44906,7 +47178,7 @@ pub mod builder { "{}/system/silos/{}/identity-providers/local/users/{}/set-password", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44932,7 +47204,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -44955,9 +47227,13 @@ pub mod builder { } impl<'a> SamlIdentityProviderCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -45000,6 +47276,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/saml` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45017,7 +47298,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/identity-providers/saml", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45066,9 +47347,13 @@ pub mod builder { } impl<'a> SamlIdentityProviderView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), provider_name: Err("provider_name was not initialized".to_string()), } @@ -45096,6 +47381,11 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/identity-providers/saml/{provider_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45110,7 +47400,7 @@ pub mod builder { "{}/system/silos/{}/identity-providers/saml/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45157,9 +47447,13 @@ pub mod builder { } impl<'a> SiloPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), } } @@ -45175,6 +47469,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos/{silo_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45183,7 +47482,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/policy", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45231,9 +47530,13 @@ pub mod builder { } impl<'a> SiloPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -45270,6 +47573,11 @@ pub mod builder { } ///Sends a `PUT` request to `/system/silos/{silo_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45285,7 +47593,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/policy", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45336,9 +47644,13 @@ pub mod builder { } impl<'a> SiloUsersList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -45388,6 +47700,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos/{silo_name}/users/all` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45405,7 +47722,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/users/all", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45505,9 +47822,13 @@ pub mod builder { } impl<'a> SiloUserView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), user_id: Err("user_id was not initialized".to_string()), } @@ -45535,6 +47856,11 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/users/id/{user_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -45547,7 +47873,7 @@ pub mod builder { "{}/system/silos/{}/users/id/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45596,9 +47922,13 @@ pub mod builder { } impl<'a> SystemUserList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -45637,6 +47967,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/user` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45649,7 +47984,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/user", client.baseurl,); + let url = format!("{}/system/user", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -45747,9 +48082,13 @@ pub mod builder { } impl<'a> SystemUserView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, user_name: Err("user_name was not initialized".to_string()), } } @@ -45765,13 +48104,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/user/{user_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, user_name } = self; let user_name = user_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/user/{}", client.baseurl, - encode_path(&user_name.to_string()), + encode_path(&user_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45819,9 +48163,13 @@ pub mod builder { } impl<'a> TimeseriesSchemaGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), } @@ -45848,6 +48196,11 @@ pub mod builder { } ///Sends a `GET` request to `/timeseries/schema` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -45859,7 +48212,7 @@ pub mod builder { } = self; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!("{}/timeseries/schema", client.baseurl,); + let url = format!("{}/timeseries/schema", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -45957,9 +48310,13 @@ pub mod builder { } impl<'a> UserList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -45998,6 +48355,11 @@ pub mod builder { } ///Sends a `GET` request to `/users` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -46010,7 +48372,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/users", client.baseurl,); + let url = format!("{}/users", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46112,9 +48474,13 @@ pub mod builder { } impl<'a> DiskListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), organization: Ok(None), page_token: Ok(None), @@ -46177,6 +48543,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -46193,7 +48564,7 @@ pub mod builder { let page_token = page_token.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/disks", client.baseurl,); + let url = format!("{}/v1/disks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46300,9 +48671,13 @@ pub mod builder { } impl<'a> DiskCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Ok(None), project: Err("project was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -46351,6 +48726,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46363,7 +48743,7 @@ pub mod builder { let body = body .and_then(|v| types::DiskCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/disks", client.baseurl,); + let url = format!("{}/v1/disks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46417,9 +48797,13 @@ pub mod builder { } impl<'a> DiskViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, disk: Err("disk was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -46459,6 +48843,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/disks/{disk}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46472,7 +48861,7 @@ pub mod builder { let url = format!( "{}/v1/disks/{}", client.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -46526,9 +48915,13 @@ pub mod builder { } impl<'a> DiskDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, disk: Err("disk was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -46568,6 +48961,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/disks/{disk}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46581,7 +48979,7 @@ pub mod builder { let url = format!( "{}/v1/disks/{}", client.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -46611,7 +49009,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -46637,9 +49035,13 @@ pub mod builder { } impl<'a> InstanceListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), organization: Ok(None), page_token: Ok(None), @@ -46702,6 +49104,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -46718,7 +49125,7 @@ pub mod builder { let page_token = page_token.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/instances", client.baseurl,); + let url = format!("{}/v1/instances", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46825,9 +49232,13 @@ pub mod builder { } impl<'a> InstanceCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Ok(None), project: Err("project was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -46876,6 +49287,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46888,7 +49304,7 @@ pub mod builder { let body = body .and_then(|v| types::InstanceCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/instances", client.baseurl,); + let url = format!("{}/v1/instances", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46942,9 +49358,13 @@ pub mod builder { } impl<'a> InstanceViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -46984,6 +49404,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances/{instance}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46997,7 +49422,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47051,9 +49476,13 @@ pub mod builder { } impl<'a> InstanceDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47093,6 +49522,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/instances/{instance}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47106,7 +49540,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47136,7 +49570,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -47163,9 +49597,13 @@ pub mod builder { } impl<'a> InstanceDiskListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), limit: Ok(None), organization: Ok(None), @@ -47239,6 +49677,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances/{instance}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -47260,7 +49703,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/disks", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47369,9 +49812,13 @@ pub mod builder { } impl<'a> InstanceDiskAttachV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47432,6 +49879,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47449,7 +49901,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/disks/attach", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47505,9 +49957,13 @@ pub mod builder { } impl<'a> InstanceDiskDetachV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47568,6 +50024,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47585,7 +50046,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/disks/detach", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47641,9 +50102,13 @@ pub mod builder { } impl<'a> InstanceMigrateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47704,6 +50169,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/migrate` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47721,7 +50191,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/migrate", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47776,9 +50246,13 @@ pub mod builder { } impl<'a> InstanceRebootV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47818,6 +50292,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/reboot` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47831,7 +50310,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/reboot", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47888,9 +50367,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), from_start: Ok(None), max_bytes: Ok(None), @@ -47966,6 +50449,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances/{instance}/serial-console` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -47987,7 +50475,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/serial-console", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48050,9 +50538,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleStreamV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -48093,6 +50585,11 @@ pub mod builder { ///Sends a `GET` request to /// `/v1/instances/{instance}/serial-console/stream` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48106,7 +50603,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/serial-console/stream", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48166,9 +50663,13 @@ pub mod builder { } impl<'a> InstanceStartV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -48208,6 +50709,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48221,7 +50727,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/start", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48275,9 +50781,13 @@ pub mod builder { } impl<'a> InstanceStopV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -48317,6 +50827,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/stop` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48330,7 +50845,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/stop", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48384,9 +50899,13 @@ pub mod builder { } impl<'a> OrganizationListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -48425,6 +50944,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -48437,7 +50961,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/organizations", client.baseurl,); + let url = format!("{}/v1/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -48535,9 +51059,13 @@ pub mod builder { } impl<'a> OrganizationCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -48565,12 +51093,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::OrganizationCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/organizations", client.baseurl,); + let url = format!("{}/v1/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -48617,9 +51150,13 @@ pub mod builder { } impl<'a> OrganizationViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), } } @@ -48635,6 +51172,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/organizations/{organization}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48644,7 +51186,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48692,9 +51234,13 @@ pub mod builder { } impl<'a> OrganizationUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -48733,6 +51279,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/organizations/{organization}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48746,7 +51297,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48794,9 +51345,13 @@ pub mod builder { } impl<'a> OrganizationDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), } } @@ -48812,6 +51367,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/organizations/{organization}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48821,7 +51381,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48846,7 +51406,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -48868,9 +51428,13 @@ pub mod builder { } impl<'a> OrganizationPolicyViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), } } @@ -48886,6 +51450,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/organizations/{organization}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -48897,7 +51466,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}/policy", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48945,9 +51514,13 @@ pub mod builder { } impl<'a> OrganizationPolicyUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -48988,6 +51561,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/organizations/{organization}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -49003,7 +51581,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}/policy", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49054,9 +51632,13 @@ pub mod builder { } impl<'a> ProjectListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), organization: Ok(None), page_token: Ok(None), @@ -49107,6 +51689,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -49121,7 +51708,7 @@ pub mod builder { let organization = organization.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/projects", client.baseurl,); + let url = format!("{}/v1/projects", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -49225,9 +51812,13 @@ pub mod builder { } impl<'a> ProjectCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -49264,6 +51855,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49274,7 +51870,7 @@ pub mod builder { let body = body .and_then(|v| types::ProjectCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/projects", client.baseurl,); + let url = format!("{}/v1/projects", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -49326,9 +51922,13 @@ pub mod builder { } impl<'a> ProjectViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), } @@ -49356,6 +51956,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/projects/{project}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49367,7 +51972,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49420,9 +52025,13 @@ pub mod builder { } impl<'a> ProjectUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), body: Ok(::std::default::Default::default()), @@ -49471,6 +52080,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/projects/{project}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49486,7 +52100,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49539,9 +52153,13 @@ pub mod builder { } impl<'a> ProjectDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), } @@ -49569,6 +52187,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/projects/{project}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49580,7 +52203,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49609,7 +52232,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -49632,9 +52255,13 @@ pub mod builder { } impl<'a> ProjectPolicyViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), } @@ -49662,6 +52289,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/projects/{project}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -49675,7 +52307,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}/policy", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49728,9 +52360,13 @@ pub mod builder { } impl<'a> ProjectPolicyUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), body: Ok(::std::default::Default::default()), @@ -49781,6 +52417,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/projects/{project}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -49798,7 +52439,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}/policy", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49852,9 +52493,13 @@ pub mod builder { } impl<'a> SystemComponentVersionList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -49893,6 +52538,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/components` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -49906,7 +52556,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/components", client.baseurl,); + let url = format!("{}/v1/system/update/components", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50007,9 +52657,13 @@ pub mod builder { } impl<'a> UpdateDeploymentsList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -50048,6 +52702,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/deployments` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -50061,7 +52720,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/deployments", client.baseurl,); + let url = format!("{}/v1/system/update/deployments", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50159,9 +52818,13 @@ pub mod builder { } impl<'a> UpdateDeploymentView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -50177,6 +52840,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/deployments/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50185,7 +52853,7 @@ pub mod builder { let url = format!( "{}/v1/system/update/deployments/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -50231,14 +52899,23 @@ pub mod builder { } impl<'a> SystemUpdateRefresh<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/system/update/refresh` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/v1/system/update/refresh", client.baseurl,); + let url = format!("{}/v1/system/update/refresh", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50262,7 +52939,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -50284,9 +52961,13 @@ pub mod builder { } impl<'a> SystemUpdateStart<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -50314,6 +52995,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/system/update/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50321,7 +53007,7 @@ pub mod builder { let body = body .and_then(|v| types::SystemUpdateStart::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/start", client.baseurl,); + let url = format!("{}/v1/system/update/start", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50367,14 +53053,23 @@ pub mod builder { } impl<'a> SystemUpdateStop<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/system/update/stop` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/v1/system/update/stop", client.baseurl,); + let url = format!("{}/v1/system/update/stop", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50398,7 +53093,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -50422,9 +53117,13 @@ pub mod builder { } impl<'a> SystemUpdateList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -50463,6 +53162,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/updates` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50475,7 +53179,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/updates", client.baseurl,); + let url = format!("{}/v1/system/update/updates", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50573,9 +53277,13 @@ pub mod builder { } impl<'a> SystemUpdateView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, version: Err("version was not initialized".to_string()), } } @@ -50591,13 +53299,18 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/updates/{version}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, version } = self; let version = version.map_err(Error::InvalidRequest)?; let url = format!( "{}/v1/system/update/updates/{}", client.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -50644,9 +53357,13 @@ pub mod builder { } impl<'a> SystemUpdateComponentsList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, version: Err("version was not initialized".to_string()), } } @@ -50663,6 +53380,11 @@ pub mod builder { ///Sends a `GET` request to /// `/v1/system/update/updates/{version}/components` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50671,7 +53393,7 @@ pub mod builder { let url = format!( "{}/v1/system/update/updates/{}/components", client.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -50717,16 +53439,25 @@ pub mod builder { } impl<'a> SystemVersion<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/system/update/version` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/v1/system/update/version", client.baseurl,); + let url = format!("{}/v1/system/update/version", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/nexus_builder_tagged.rs b/progenitor-impl/tests/output/src/nexus_builder_tagged.rs index 38643b07..6fe9f6d8 100644 --- a/progenitor-impl/tests/output/src/nexus_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/nexus_builder_tagged.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -24678,7 +24686,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Oxide Region API +///Client for `Oxide Region API` /// ///API for interacting with the Oxide control plane /// @@ -24694,6 +24702,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -24713,6 +24726,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -24749,7 +24763,12 @@ pub trait ClientDisksExt { /// ///Sends a `GET` request to `/by-id/disks/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_view_by_id() /// .id(id) /// .send() @@ -24770,7 +24789,12 @@ pub trait ClientDisksExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -24790,7 +24814,12 @@ pub trait ClientDisksExt { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -24807,7 +24836,12 @@ pub trait ClientDisksExt { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -24822,7 +24856,12 @@ pub trait ClientDisksExt { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -24847,7 +24886,12 @@ pub trait ClientDisksExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_metrics_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -24872,7 +24916,12 @@ pub trait ClientDisksExt { /// subsequent page /// - `project` /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_list_v1() /// .limit(limit) /// .organization(organization) @@ -24887,7 +24936,12 @@ pub trait ClientDisksExt { /// ///Sends a `POST` request to `/v1/disks` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_create_v1() /// .organization(organization) /// .project(project) @@ -24900,7 +24954,12 @@ pub trait ClientDisksExt { /// ///Sends a `GET` request to `/v1/disks/{disk}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_view_v1() /// .disk(disk) /// .organization(organization) @@ -24913,7 +24972,12 @@ pub trait ClientDisksExt { /// ///Sends a `DELETE` request to `/v1/disks/{disk}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.disk_delete_v1() /// .disk(disk) /// .organization(organization) @@ -24976,7 +25040,12 @@ pub trait ClientHiddenExt { /// ///Sends a `POST` request to `/device/auth` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.device_auth_request() /// .body(body) /// .send() @@ -24992,7 +25061,12 @@ pub trait ClientHiddenExt { /// ///Sends a `POST` request to `/device/confirm` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.device_auth_confirm() /// .body(body) /// .send() @@ -25006,7 +25080,12 @@ pub trait ClientHiddenExt { /// ///Sends a `POST` request to `/device/token` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.device_access_token() /// .body(body) /// .send() @@ -25015,7 +25094,12 @@ pub trait ClientHiddenExt { fn device_access_token(&self) -> builder::DeviceAccessToken<'_>; ///Sends a `POST` request to `/login` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_spoof() /// .body(body) /// .send() @@ -25024,7 +25108,12 @@ pub trait ClientHiddenExt { fn login_spoof(&self) -> builder::LoginSpoof<'_>; ///Sends a `POST` request to `/logout` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.logout() /// .send() /// .await; @@ -25034,7 +25123,12 @@ pub trait ClientHiddenExt { /// ///Sends a `GET` request to `/session/me` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_me() /// .send() /// .await; @@ -25049,7 +25143,12 @@ pub trait ClientHiddenExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_me_groups() /// .limit(limit) /// .page_token(page_token) @@ -25096,7 +25195,12 @@ pub trait ClientImagesExt { /// ///Sends a `GET` request to `/by-id/images/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_view_by_id() /// .id(id) /// .send() @@ -25118,7 +25222,12 @@ pub trait ClientImagesExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25140,7 +25249,12 @@ pub trait ClientImagesExt { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25157,7 +25271,12 @@ pub trait ClientImagesExt { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25176,7 +25295,12 @@ pub trait ClientImagesExt { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.image_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25216,7 +25340,12 @@ pub trait ClientInstancesExt { /// ///Sends a `GET` request to `/by-id/instances/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_view_by_id() /// .id(id) /// .send() @@ -25227,7 +25356,12 @@ pub trait ClientInstancesExt { /// ///Sends a `GET` request to `/by-id/network-interfaces/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_view_by_id() /// .id(id) /// .send() @@ -25248,7 +25382,12 @@ pub trait ClientInstancesExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25270,7 +25409,12 @@ pub trait ClientInstancesExt { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25287,7 +25431,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25302,7 +25451,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25327,7 +25481,12 @@ pub trait ClientInstancesExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25347,7 +25506,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/attach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_attach() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25365,7 +25529,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/detach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_detach() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25381,7 +25550,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/external-ips` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_external_ip_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25398,7 +25572,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/migrate` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_migrate() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25422,7 +25601,12 @@ pub trait ClientInstancesExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25440,7 +25624,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25456,7 +25645,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25472,7 +25666,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25494,7 +25693,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_network_interface_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25512,7 +25716,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/reboot` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_reboot() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25544,7 +25753,12 @@ pub trait ClientInstancesExt { /// read, counting *backward* from the most recently buffered data /// retrieved from the instance. (See note on `from_start` about mutual /// exclusivity) - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25564,7 +25778,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_stream() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25581,7 +25800,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream_v2` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_stream_v2() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25598,7 +25822,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/start` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_start() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25615,7 +25844,12 @@ pub trait ClientInstancesExt { /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/stop` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_stop() /// .organization_name(organization_name) /// .project_name(project_name) @@ -25635,7 +25869,12 @@ pub trait ClientInstancesExt { /// subsequent page /// - `project` /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_list_v1() /// .limit(limit) /// .organization(organization) @@ -25650,7 +25889,12 @@ pub trait ClientInstancesExt { /// ///Sends a `POST` request to `/v1/instances` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_create_v1() /// .organization(organization) /// .project(project) @@ -25663,7 +25907,12 @@ pub trait ClientInstancesExt { /// ///Sends a `GET` request to `/v1/instances/{instance}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_view_v1() /// .instance(instance) /// .organization(organization) @@ -25676,7 +25925,12 @@ pub trait ClientInstancesExt { /// ///Sends a `DELETE` request to `/v1/instances/{instance}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_delete_v1() /// .instance(instance) /// .organization(organization) @@ -25697,7 +25951,12 @@ pub trait ClientInstancesExt { /// subsequent page /// - `project` /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_list_v1() /// .instance(instance) /// .limit(limit) @@ -25713,7 +25972,12 @@ pub trait ClientInstancesExt { /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_attach_v1() /// .instance(instance) /// .organization(organization) @@ -25727,7 +25991,12 @@ pub trait ClientInstancesExt { /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_disk_detach_v1() /// .instance(instance) /// .organization(organization) @@ -25741,7 +26010,12 @@ pub trait ClientInstancesExt { /// ///Sends a `POST` request to `/v1/instances/{instance}/migrate` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_migrate_v1() /// .instance(instance) /// .organization(organization) @@ -25755,7 +26029,12 @@ pub trait ClientInstancesExt { /// ///Sends a `POST` request to `/v1/instances/{instance}/reboot` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_reboot_v1() /// .instance(instance) /// .organization(organization) @@ -25783,7 +26062,12 @@ pub trait ClientInstancesExt { /// exclusivity) /// - `organization` /// - `project` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_v1() /// .instance(instance) /// .from_start(from_start) @@ -25800,7 +26084,12 @@ pub trait ClientInstancesExt { ///Sends a `GET` request to /// `/v1/instances/{instance}/serial-console/stream` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial_console_stream_v1() /// .instance(instance) /// .organization(organization) @@ -25813,7 +26102,12 @@ pub trait ClientInstancesExt { /// ///Sends a `POST` request to `/v1/instances/{instance}/start` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_start_v1() /// .instance(instance) /// .organization(organization) @@ -25826,7 +26120,12 @@ pub trait ClientInstancesExt { /// ///Sends a `POST` request to `/v1/instances/{instance}/stop` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_stop_v1() /// .instance(instance) /// .organization(organization) @@ -25987,7 +26286,12 @@ pub trait ClientLoginExt { /// ///Sends a `POST` request to `/login/{silo_name}/local` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_local() /// .silo_name(silo_name) /// .body(body) @@ -26002,7 +26306,12 @@ pub trait ClientLoginExt { /// ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_saml_begin() /// .silo_name(silo_name) /// .provider_name(provider_name) @@ -26014,7 +26323,12 @@ pub trait ClientLoginExt { /// ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.login_saml() /// .silo_name(silo_name) /// .provider_name(provider_name) @@ -26051,7 +26365,12 @@ pub trait ClientMetricsExt { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.timeseries_schema_get() /// .limit(limit) /// .page_token(page_token) @@ -26076,7 +26395,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `GET` request to `/by-id/organizations/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_view_by_id() /// .id(id) /// .send() @@ -26094,7 +26418,12 @@ pub trait ClientOrganizationsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_list() /// .limit(limit) /// .page_token(page_token) @@ -26109,7 +26438,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `POST` request to `/organizations` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_create() /// .body(body) /// .send() @@ -26124,7 +26458,12 @@ pub trait ClientOrganizationsExt { /// ///Arguments: /// - `organization_name`: The organization's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_view() /// .organization_name(organization_name) /// .send() @@ -26140,7 +26479,12 @@ pub trait ClientOrganizationsExt { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_update() /// .organization_name(organization_name) /// .body(body) @@ -26156,7 +26500,12 @@ pub trait ClientOrganizationsExt { /// ///Arguments: /// - `organization_name`: The organization's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_delete() /// .organization_name(organization_name) /// .send() @@ -26171,7 +26520,12 @@ pub trait ClientOrganizationsExt { /// ///Arguments: /// - `organization_name`: The organization's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_view() /// .organization_name(organization_name) /// .send() @@ -26187,7 +26541,12 @@ pub trait ClientOrganizationsExt { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_update() /// .organization_name(organization_name) /// .body(body) @@ -26204,7 +26563,12 @@ pub trait ClientOrganizationsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_list_v1() /// .limit(limit) /// .page_token(page_token) @@ -26217,7 +26581,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `POST` request to `/v1/organizations` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_create_v1() /// .body(body) /// .send() @@ -26228,7 +26597,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `GET` request to `/v1/organizations/{organization}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_view_v1() /// .organization(organization) /// .send() @@ -26239,7 +26613,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `PUT` request to `/v1/organizations/{organization}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_update_v1() /// .organization(organization) /// .body(body) @@ -26251,7 +26630,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `DELETE` request to `/v1/organizations/{organization}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_delete_v1() /// .organization(organization) /// .send() @@ -26262,7 +26646,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `GET` request to `/v1/organizations/{organization}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_view_v1() /// .organization(organization) /// .send() @@ -26273,7 +26662,12 @@ pub trait ClientOrganizationsExt { /// ///Sends a `PUT` request to `/v1/organizations/{organization}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.organization_policy_update_v1() /// .organization(organization) /// .body(body) @@ -26351,7 +26745,12 @@ pub trait ClientPolicyExt { /// ///Sends a `GET` request to `/system/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_policy_view() /// .send() /// .await; @@ -26361,7 +26760,12 @@ pub trait ClientPolicyExt { /// ///Sends a `PUT` request to `/system/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_policy_update() /// .body(body) /// .send() @@ -26389,7 +26793,12 @@ pub trait ClientProjectsExt { /// ///Sends a `GET` request to `/by-id/projects/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_view_by_id() /// .id(id) /// .send() @@ -26408,7 +26817,12 @@ pub trait ClientProjectsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_list() /// .organization_name(organization_name) /// .limit(limit) @@ -26427,7 +26841,12 @@ pub trait ClientProjectsExt { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_create() /// .organization_name(organization_name) /// .body(body) @@ -26445,7 +26864,12 @@ pub trait ClientProjectsExt { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26464,7 +26888,12 @@ pub trait ClientProjectsExt { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26483,7 +26912,12 @@ pub trait ClientProjectsExt { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26501,7 +26935,12 @@ pub trait ClientProjectsExt { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26518,7 +26957,12 @@ pub trait ClientProjectsExt { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26537,7 +26981,12 @@ pub trait ClientProjectsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_list_v1() /// .limit(limit) /// .organization(organization) @@ -26551,7 +27000,12 @@ pub trait ClientProjectsExt { /// ///Sends a `POST` request to `/v1/projects` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_create_v1() /// .organization(organization) /// .body(body) @@ -26563,7 +27017,12 @@ pub trait ClientProjectsExt { /// ///Sends a `GET` request to `/v1/projects/{project}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_view_v1() /// .project(project) /// .organization(organization) @@ -26575,7 +27034,12 @@ pub trait ClientProjectsExt { /// ///Sends a `PUT` request to `/v1/projects/{project}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_update_v1() /// .project(project) /// .organization(organization) @@ -26588,7 +27052,12 @@ pub trait ClientProjectsExt { /// ///Sends a `DELETE` request to `/v1/projects/{project}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_delete_v1() /// .project(project) /// .organization(organization) @@ -26600,7 +27069,12 @@ pub trait ClientProjectsExt { /// ///Sends a `GET` request to `/v1/projects/{project}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_view_v1() /// .project(project) /// .organization(organization) @@ -26612,7 +27086,12 @@ pub trait ClientProjectsExt { /// ///Sends a `PUT` request to `/v1/projects/{project}/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.project_policy_update_v1() /// .project(project) /// .organization(organization) @@ -26696,7 +27175,12 @@ pub trait ClientRolesExt { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.role_list() /// .limit(limit) /// .page_token(page_token) @@ -26710,7 +27194,12 @@ pub trait ClientRolesExt { /// ///Arguments: /// - `role_name`: The built-in role's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.role_view() /// .role_name(role_name) /// .send() @@ -26742,7 +27231,12 @@ pub trait ClientSessionExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_list() /// .limit(limit) /// .page_token(page_token) @@ -26757,7 +27251,12 @@ pub trait ClientSessionExt { /// ///Sends a `POST` request to `/session/me/sshkeys` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_create() /// .body(body) /// .send() @@ -26771,7 +27270,12 @@ pub trait ClientSessionExt { /// ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_view() /// .ssh_key_name(ssh_key_name) /// .send() @@ -26785,7 +27289,12 @@ pub trait ClientSessionExt { /// ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.session_sshkey_delete() /// .ssh_key_name(ssh_key_name) /// .send() @@ -26823,7 +27332,12 @@ pub trait ClientSilosExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.group_list() /// .limit(limit) /// .page_token(page_token) @@ -26836,7 +27350,12 @@ pub trait ClientSilosExt { /// ///Sends a `GET` request to `/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.policy_view() /// .send() /// .await; @@ -26846,7 +27365,12 @@ pub trait ClientSilosExt { /// ///Sends a `PUT` request to `/policy` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.policy_update() /// .body(body) /// .send() @@ -26862,7 +27386,12 @@ pub trait ClientSilosExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.user_list() /// .limit(limit) /// .page_token(page_token) @@ -26897,7 +27426,12 @@ pub trait ClientSnapshotsExt { /// ///Sends a `GET` request to `/by-id/snapshots/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_view_by_id() /// .id(id) /// .send() @@ -26916,7 +27450,12 @@ pub trait ClientSnapshotsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26938,7 +27477,12 @@ pub trait ClientSnapshotsExt { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26953,7 +27497,12 @@ pub trait ClientSnapshotsExt { /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -26968,7 +27517,12 @@ pub trait ClientSnapshotsExt { /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.snapshot_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -27007,7 +27561,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/by-id/images/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_view_by_id() /// .id(id) /// .send() @@ -27018,7 +27577,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_view_by_id() /// .id(id) /// .send() @@ -27029,7 +27593,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/by-id/silos/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_view_by_id() /// .id(id) /// .send() @@ -27049,7 +27618,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_list() /// .limit(limit) /// .page_token(page_token) @@ -27065,7 +27639,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/certificates` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_create() /// .body(body) /// .send() @@ -27078,7 +27657,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/certificates/{certificate}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_view() /// .certificate(certificate) /// .send() @@ -27091,7 +27675,12 @@ pub trait ClientSystemExt { /// ///Sends a `DELETE` request to `/system/certificates/{certificate}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.certificate_delete() /// .certificate(certificate) /// .send() @@ -27107,7 +27696,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.physical_disk_list() /// .limit(limit) /// .page_token(page_token) @@ -27125,7 +27719,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.rack_list() /// .limit(limit) /// .page_token(page_token) @@ -27140,7 +27739,12 @@ pub trait ClientSystemExt { /// ///Arguments: /// - `rack_id`: The rack's unique ID. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.rack_view() /// .rack_id(rack_id) /// .send() @@ -27156,7 +27760,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.sled_list() /// .limit(limit) /// .page_token(page_token) @@ -27171,7 +27780,12 @@ pub trait ClientSystemExt { /// ///Arguments: /// - `sled_id`: The sled's unique ID. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.sled_view() /// .sled_id(sled_id) /// .send() @@ -27188,7 +27802,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.sled_physical_disk_list() /// .sled_id(sled_id) /// .limit(limit) @@ -27211,7 +27830,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_list() /// .limit(limit) /// .page_token(page_token) @@ -27227,7 +27851,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/images` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_create() /// .body(body) /// .send() @@ -27240,7 +27869,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/images/{image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_view() /// .image_name(image_name) /// .send() @@ -27255,7 +27889,12 @@ pub trait ClientSystemExt { /// ///Sends a `DELETE` request to `/system/images/{image_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_image_delete() /// .image_name(image_name) /// .send() @@ -27271,7 +27910,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_list() /// .limit(limit) /// .page_token(page_token) @@ -27284,7 +27928,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/ip-pools` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_create() /// .body(body) /// .send() @@ -27295,7 +27944,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/ip-pools/{pool_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_view() /// .pool_name(pool_name) /// .send() @@ -27306,7 +27960,12 @@ pub trait ClientSystemExt { /// ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_update() /// .pool_name(pool_name) /// .body(body) @@ -27318,7 +27977,12 @@ pub trait ClientSystemExt { /// ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_delete() /// .pool_name(pool_name) /// .send() @@ -27336,7 +28000,12 @@ pub trait ClientSystemExt { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_range_list() /// .pool_name(pool_name) /// .limit(limit) @@ -27349,7 +28018,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_range_add() /// .pool_name(pool_name) /// .body(body) @@ -27361,7 +28035,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/remove` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_range_remove() /// .pool_name(pool_name) /// .body(body) @@ -27373,7 +28052,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/ip-pools-service` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_view() /// .send() /// .await; @@ -27389,7 +28073,12 @@ pub trait ClientSystemExt { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_range_list() /// .limit(limit) /// .page_token(page_token) @@ -27401,7 +28090,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_range_add() /// .body(body) /// .send() @@ -27412,7 +28106,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.ip_pool_service_range_remove() /// .body(body) /// .send() @@ -27431,7 +28130,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_metric() /// .metric_name(metric_name) /// .end_time(end_time) @@ -27452,7 +28156,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saga_list() /// .limit(limit) /// .page_token(page_token) @@ -27465,7 +28174,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/system/sagas/{saga_id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saga_view() /// .saga_id(saga_id) /// .send() @@ -27483,7 +28197,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_list() /// .limit(limit) /// .page_token(page_token) @@ -27496,7 +28215,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/system/silos` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_create() /// .body(body) /// .send() @@ -27511,7 +28235,12 @@ pub trait ClientSystemExt { /// ///Arguments: /// - `silo_name`: The silo's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_view() /// .silo_name(silo_name) /// .send() @@ -27526,7 +28255,12 @@ pub trait ClientSystemExt { /// ///Arguments: /// - `silo_name`: The silo's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_delete() /// .silo_name(silo_name) /// .send() @@ -27543,7 +28277,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_identity_provider_list() /// .silo_name(silo_name) /// .limit(limit) @@ -27565,7 +28304,12 @@ pub trait ClientSystemExt { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.local_idp_user_create() /// .silo_name(silo_name) /// .body(body) @@ -27581,7 +28325,12 @@ pub trait ClientSystemExt { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.local_idp_user_delete() /// .silo_name(silo_name) /// .user_id(user_id) @@ -27602,7 +28351,12 @@ pub trait ClientSystemExt { /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.local_idp_user_set_password() /// .silo_name(silo_name) /// .user_id(user_id) @@ -27619,7 +28373,12 @@ pub trait ClientSystemExt { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saml_identity_provider_create() /// .silo_name(silo_name) /// .body(body) @@ -27635,7 +28394,12 @@ pub trait ClientSystemExt { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `provider_name`: The SAML identity provider's name - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.saml_identity_provider_view() /// .silo_name(silo_name) /// .provider_name(provider_name) @@ -27649,7 +28413,12 @@ pub trait ClientSystemExt { /// ///Arguments: /// - `silo_name`: The silo's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_policy_view() /// .silo_name(silo_name) /// .send() @@ -27663,7 +28432,12 @@ pub trait ClientSystemExt { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_policy_update() /// .silo_name(silo_name) /// .body(body) @@ -27681,7 +28455,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_users_list() /// .silo_name(silo_name) /// .limit(limit) @@ -27698,7 +28477,12 @@ pub trait ClientSystemExt { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.silo_user_view() /// .silo_name(silo_name) /// .user_id(user_id) @@ -27715,7 +28499,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_user_list() /// .limit(limit) /// .page_token(page_token) @@ -27730,7 +28519,12 @@ pub trait ClientSystemExt { /// ///Arguments: /// - `user_name`: The built-in user's unique name. - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_user_view() /// .user_name(user_name) /// .send() @@ -27746,7 +28540,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_component_version_list() /// .limit(limit) /// .page_token(page_token) @@ -27764,7 +28563,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.update_deployments_list() /// .limit(limit) /// .page_token(page_token) @@ -27777,7 +28581,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/v1/system/update/deployments/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.update_deployment_view() /// .id(id) /// .send() @@ -27788,7 +28597,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/v1/system/update/refresh` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_refresh() /// .send() /// .await; @@ -27798,7 +28612,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/v1/system/update/start` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_start() /// .body(body) /// .send() @@ -27811,7 +28630,12 @@ pub trait ClientSystemExt { /// ///Sends a `POST` request to `/v1/system/update/stop` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_stop() /// .send() /// .await; @@ -27826,7 +28650,12 @@ pub trait ClientSystemExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_list() /// .limit(limit) /// .page_token(page_token) @@ -27839,7 +28668,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/v1/system/update/updates/{version}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_view() /// .version(version) /// .send() @@ -27851,7 +28685,12 @@ pub trait ClientSystemExt { ///Sends a `GET` request to /// `/v1/system/update/updates/{version}/components` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_update_components_list() /// .version(version) /// .send() @@ -27862,7 +28701,12 @@ pub trait ClientSystemExt { /// ///Sends a `GET` request to `/v1/system/update/version` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.system_version() /// .send() /// .await; @@ -28111,7 +28955,12 @@ pub trait ClientVpcsExt { /// ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_view_by_id() /// .id(id) /// .send() @@ -28122,7 +28971,12 @@ pub trait ClientVpcsExt { /// ///Sends a `GET` request to `/by-id/vpc-routers/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_view_by_id() /// .id(id) /// .send() @@ -28133,7 +28987,12 @@ pub trait ClientVpcsExt { /// ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_view_by_id() /// .id(id) /// .send() @@ -28144,7 +29003,12 @@ pub trait ClientVpcsExt { /// ///Sends a `GET` request to `/by-id/vpcs/{id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_view_by_id() /// .id(id) /// .send() @@ -28163,7 +29027,12 @@ pub trait ClientVpcsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28183,7 +29052,12 @@ pub trait ClientVpcsExt { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28198,7 +29072,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28213,7 +29092,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28229,7 +29113,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28244,7 +29133,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_firewall_rules_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28259,7 +29153,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_firewall_rules_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28283,7 +29182,12 @@ pub trait ClientVpcsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28301,7 +29205,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28317,7 +29226,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28333,7 +29247,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28350,7 +29269,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28377,7 +29301,12 @@ pub trait ClientVpcsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28396,7 +29325,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28413,7 +29347,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28430,7 +29369,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28448,7 +29392,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_router_route_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28473,7 +29422,12 @@ pub trait ClientVpcsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_list() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28491,7 +29445,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_create() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28507,7 +29466,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_view() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28523,7 +29487,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_update() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28540,7 +29509,12 @@ pub trait ClientVpcsExt { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_delete() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28565,7 +29539,12 @@ pub trait ClientVpcsExt { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.vpc_subnet_list_network_interfaces() /// .organization_name(organization_name) /// .project_name(project_name) @@ -28692,6 +29671,21 @@ impl ClientVpcsExt for Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -28709,9 +29703,13 @@ pub mod builder { } impl<'a> DiskViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -28727,13 +29725,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/disks/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/disks/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -28780,9 +29783,13 @@ pub mod builder { } impl<'a> ImageViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -28798,13 +29805,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/images/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/images/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -28851,9 +29863,13 @@ pub mod builder { } impl<'a> InstanceViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -28869,13 +29885,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/instances/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/instances/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -28923,9 +29944,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -28941,6 +29966,11 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/network-interfaces/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -28949,7 +29979,7 @@ pub mod builder { let url = format!( "{}/by-id/network-interfaces/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -28996,9 +30026,13 @@ pub mod builder { } impl<'a> OrganizationViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29014,13 +30048,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/organizations/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/organizations/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29067,9 +30106,13 @@ pub mod builder { } impl<'a> ProjectViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29085,13 +30128,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/projects/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/projects/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29138,9 +30186,13 @@ pub mod builder { } impl<'a> SnapshotViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29156,13 +30208,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/snapshots/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/snapshots/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29209,9 +30266,13 @@ pub mod builder { } impl<'a> VpcRouterRouteViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29227,13 +30288,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpc-router-routes/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29280,9 +30346,13 @@ pub mod builder { } impl<'a> VpcRouterViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29298,13 +30368,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpc-routers/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpc-routers/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29351,9 +30426,13 @@ pub mod builder { } impl<'a> VpcSubnetViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29369,13 +30448,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpc-subnets/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29422,9 +30506,13 @@ pub mod builder { } impl<'a> VpcViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -29440,13 +30528,18 @@ pub mod builder { } ///Sends a `GET` request to `/by-id/vpcs/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/by-id/vpcs/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -29493,9 +30586,13 @@ pub mod builder { } impl<'a> DeviceAuthRequest<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -29523,12 +30620,17 @@ pub mod builder { } ///Sends a `POST` request to `/device/auth` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::DeviceAuthRequest::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/device/auth", client.baseurl,); + let url = format!("{}/device/auth", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29565,9 +30667,13 @@ pub mod builder { } impl<'a> DeviceAuthConfirm<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -29595,12 +30701,17 @@ pub mod builder { } ///Sends a `POST` request to `/device/confirm` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::DeviceAuthVerify::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/device/confirm", client.baseurl,); + let url = format!("{}/device/confirm", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29625,7 +30736,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -29647,9 +30758,13 @@ pub mod builder { } impl<'a> DeviceAccessToken<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -29679,6 +30794,11 @@ pub mod builder { } ///Sends a `POST` request to `/device/token` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body @@ -29686,7 +30806,7 @@ pub mod builder { types::DeviceAccessTokenRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!("{}/device/token", client.baseurl,); + let url = format!("{}/device/token", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29725,9 +30845,13 @@ pub mod builder { } impl<'a> GroupList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -29766,6 +30890,11 @@ pub mod builder { } ///Sends a `GET` request to `/groups` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -29778,7 +30907,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/groups", client.baseurl,); + let url = format!("{}/groups", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29876,9 +31005,13 @@ pub mod builder { } impl<'a> LoginSpoof<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -29904,12 +31037,17 @@ pub mod builder { } ///Sends a `POST` request to `/login` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::SpoofLoginBody::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/login", client.baseurl,); + let url = format!("{}/login", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -29934,7 +31072,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -29957,9 +31095,13 @@ pub mod builder { } impl<'a> LoginLocal<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -30001,6 +31143,11 @@ pub mod builder { } ///Sends a `POST` request to `/login/{silo_name}/local` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30016,7 +31163,7 @@ pub mod builder { let url = format!( "{}/login/{}/local", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30061,9 +31208,13 @@ pub mod builder { } impl<'a> LoginSamlBegin<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), provider_name: Err("provider_name was not initialized".to_string()), } @@ -30090,6 +31241,11 @@ pub mod builder { } ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30102,7 +31258,7 @@ pub mod builder { "{}/login/{}/saml/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30143,9 +31299,13 @@ pub mod builder { } impl<'a> LoginSaml<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), provider_name: Err("provider_name was not initialized".to_string()), body: Err("body was not initialized".to_string()), @@ -30183,6 +31343,11 @@ pub mod builder { } ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30197,7 +31362,7 @@ pub mod builder { "{}/login/{}/saml/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30244,14 +31409,23 @@ pub mod builder { } impl<'a> Logout<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/logout` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/logout", client.baseurl,); + let url = format!("{}/logout", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30275,7 +31449,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -30299,9 +31473,13 @@ pub mod builder { } impl<'a> OrganizationList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -30340,6 +31518,11 @@ pub mod builder { } ///Sends a `GET` request to `/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -30352,7 +31535,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/organizations", client.baseurl,); + let url = format!("{}/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30450,9 +31633,13 @@ pub mod builder { } impl<'a> OrganizationCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -30480,12 +31667,17 @@ pub mod builder { } ///Sends a `POST` request to `/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::OrganizationCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/organizations", client.baseurl,); + let url = format!("{}/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -30532,9 +31724,13 @@ pub mod builder { } impl<'a> OrganizationView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), } } @@ -30550,6 +31746,11 @@ pub mod builder { } ///Sends a `GET` request to `/organizations/{organization_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30559,7 +31760,7 @@ pub mod builder { let url = format!( "{}/organizations/{}", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30607,9 +31808,13 @@ pub mod builder { } impl<'a> OrganizationUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -30648,6 +31853,11 @@ pub mod builder { } ///Sends a `PUT` request to `/organizations/{organization_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30661,7 +31871,7 @@ pub mod builder { let url = format!( "{}/organizations/{}", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30709,9 +31919,13 @@ pub mod builder { } impl<'a> OrganizationDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), } } @@ -30727,6 +31941,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/organizations/{organization_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -30736,7 +31955,7 @@ pub mod builder { let url = format!( "{}/organizations/{}", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30761,7 +31980,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -30783,9 +32002,13 @@ pub mod builder { } impl<'a> OrganizationPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), } } @@ -30801,6 +32024,11 @@ pub mod builder { } ///Sends a `GET` request to `/organizations/{organization_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -30812,7 +32040,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/policy", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30860,9 +32088,13 @@ pub mod builder { } impl<'a> OrganizationPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -30903,6 +32135,11 @@ pub mod builder { } ///Sends a `PUT` request to `/organizations/{organization_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -30918,7 +32155,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/policy", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -30969,9 +32206,13 @@ pub mod builder { } impl<'a> ProjectList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -31022,6 +32263,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -31039,7 +32285,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/projects", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31140,9 +32386,13 @@ pub mod builder { } impl<'a> ProjectCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -31180,6 +32430,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31193,7 +32448,7 @@ pub mod builder { let url = format!( "{}/organizations/{}/projects", client.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31242,9 +32497,13 @@ pub mod builder { } impl<'a> ProjectView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), } @@ -31272,6 +32531,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31284,7 +32548,7 @@ pub mod builder { "{}/organizations/{}/projects/{}", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31333,9 +32597,13 @@ pub mod builder { } impl<'a> ProjectUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -31384,6 +32652,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31400,7 +32673,7 @@ pub mod builder { "{}/organizations/{}/projects/{}", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31449,9 +32722,13 @@ pub mod builder { } impl<'a> ProjectDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), } @@ -31479,6 +32756,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31491,7 +32773,7 @@ pub mod builder { "{}/organizations/{}/projects/{}", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31516,7 +32798,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -31542,9 +32824,13 @@ pub mod builder { } impl<'a> DiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -31606,6 +32892,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -31626,7 +32917,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/disks", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31728,9 +33019,13 @@ pub mod builder { } impl<'a> DiskCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -31779,6 +33074,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31795,7 +33095,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/disks", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31845,9 +33145,13 @@ pub mod builder { } impl<'a> DiskView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), disk_name: Err("disk_name was not initialized".to_string()), @@ -31887,6 +33191,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -31902,7 +33211,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -31951,9 +33260,13 @@ pub mod builder { } impl<'a> DiskDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), disk_name: Err("disk_name was not initialized".to_string()), @@ -31993,6 +33306,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32008,7 +33326,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32033,7 +33351,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -32062,9 +33380,13 @@ pub mod builder { } impl<'a> DiskMetricsList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), disk_name: Err("disk_name was not initialized".to_string()), @@ -32163,6 +33485,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}/metrics/{metric_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -32191,7 +33518,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&disk_name.to_string()), - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32301,9 +33628,13 @@ pub mod builder { } impl<'a> ImageList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -32365,6 +33696,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -32385,7 +33721,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/images", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32487,9 +33823,13 @@ pub mod builder { } impl<'a> ImageCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -32538,6 +33878,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32554,7 +33899,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/images", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32604,9 +33949,13 @@ pub mod builder { } impl<'a> ImageView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), image_name: Err("image_name was not initialized".to_string()), @@ -32646,6 +33995,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32661,7 +34015,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32710,9 +34064,13 @@ pub mod builder { } impl<'a> ImageDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), image_name: Err("image_name was not initialized".to_string()), @@ -32752,6 +34110,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -32767,7 +34130,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -32792,7 +34155,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -32818,9 +34181,13 @@ pub mod builder { } impl<'a> InstanceList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -32883,6 +34250,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -32903,7 +34275,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/instances", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33006,9 +34378,13 @@ pub mod builder { } impl<'a> InstanceCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -33058,6 +34434,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33074,7 +34455,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/instances", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33124,9 +34505,13 @@ pub mod builder { } impl<'a> InstanceView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33166,6 +34551,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33181,7 +34571,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33230,9 +34620,13 @@ pub mod builder { } impl<'a> InstanceDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33272,6 +34666,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33287,7 +34686,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33312,7 +34711,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -33339,9 +34738,13 @@ pub mod builder { } impl<'a> InstanceDiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33415,6 +34818,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -33438,7 +34846,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33542,9 +34950,13 @@ pub mod builder { } impl<'a> InstanceDiskAttach<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33605,6 +35017,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/attach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33624,7 +35041,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33675,9 +35092,13 @@ pub mod builder { } impl<'a> InstanceDiskDetach<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33738,6 +35159,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/detach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33757,7 +35183,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33807,9 +35233,13 @@ pub mod builder { } impl<'a> InstanceExternalIpList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33849,6 +35279,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/external-ips` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -33866,7 +35301,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -33916,9 +35351,13 @@ pub mod builder { } impl<'a> InstanceMigrate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -33979,6 +35418,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/migrate` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -33998,7 +35442,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34051,9 +35495,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34127,6 +35575,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -34151,7 +35604,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34255,9 +35708,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34322,6 +35779,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -34343,7 +35805,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34394,9 +35856,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34447,6 +35913,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -34467,7 +35938,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34518,9 +35989,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34596,6 +36071,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -34620,7 +36100,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34671,9 +36151,13 @@ pub mod builder { } impl<'a> InstanceNetworkInterfaceDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34724,6 +36208,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -34742,7 +36231,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34767,7 +36256,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -34791,9 +36280,13 @@ pub mod builder { } impl<'a> InstanceReboot<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34833,6 +36326,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/reboot` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -34848,7 +36346,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -34900,9 +36398,13 @@ pub mod builder { } impl<'a> InstanceSerialConsole<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -34978,6 +36480,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/serial-console` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35001,7 +36508,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35059,9 +36566,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleStream<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35101,6 +36612,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/serial-console/stream` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -35116,7 +36632,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35165,9 +36681,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleStreamV2<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35207,6 +36727,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/serial-console/stream_v2` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35222,7 +36747,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35277,9 +36802,13 @@ pub mod builder { } impl<'a> InstanceStart<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35319,6 +36848,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35334,7 +36868,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35383,9 +36917,13 @@ pub mod builder { } impl<'a> InstanceStop<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), instance_name: Err("instance_name was not initialized".to_string()), @@ -35425,6 +36963,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/stop` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35440,7 +36983,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35488,9 +37031,13 @@ pub mod builder { } impl<'a> ProjectPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), } @@ -35518,6 +37065,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35532,7 +37084,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/policy", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35581,9 +37133,13 @@ pub mod builder { } impl<'a> ProjectPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -35634,6 +37190,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35652,7 +37213,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/policy", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35704,9 +37265,13 @@ pub mod builder { } impl<'a> SnapshotList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -35769,6 +37334,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -35789,7 +37359,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/snapshots", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -35892,9 +37462,13 @@ pub mod builder { } impl<'a> SnapshotCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -35944,6 +37518,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -35960,7 +37539,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/snapshots", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36010,9 +37589,13 @@ pub mod builder { } impl<'a> SnapshotView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), snapshot_name: Err("snapshot_name was not initialized".to_string()), @@ -36052,6 +37635,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36067,7 +37655,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36116,9 +37704,13 @@ pub mod builder { } impl<'a> SnapshotDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), snapshot_name: Err("snapshot_name was not initialized".to_string()), @@ -36158,6 +37750,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36173,7 +37770,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36198,7 +37795,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -36224,9 +37821,13 @@ pub mod builder { } impl<'a> VpcList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), limit: Ok(None), @@ -36288,6 +37889,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -36308,7 +37914,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/vpcs", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36410,9 +38016,13 @@ pub mod builder { } impl<'a> VpcCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -36461,6 +38071,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36477,7 +38092,7 @@ pub mod builder { "{}/organizations/{}/projects/{}/vpcs", client.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36527,9 +38142,13 @@ pub mod builder { } impl<'a> VpcView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -36569,6 +38188,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36584,7 +38208,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36634,9 +38258,13 @@ pub mod builder { } impl<'a> VpcUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -36697,6 +38325,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36716,7 +38349,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36766,9 +38399,13 @@ pub mod builder { } impl<'a> VpcDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -36808,6 +38445,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -36823,7 +38465,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36848,7 +38490,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -36872,9 +38514,13 @@ pub mod builder { } impl<'a> VpcFirewallRulesView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -36914,6 +38560,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -36931,7 +38582,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -36981,9 +38632,13 @@ pub mod builder { } impl<'a> VpcFirewallRulesUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37049,6 +38704,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -37072,7 +38732,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37125,9 +38785,13 @@ pub mod builder { } impl<'a> VpcRouterList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37201,6 +38865,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -37224,7 +38893,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37328,9 +38997,13 @@ pub mod builder { } impl<'a> VpcRouterCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37391,6 +39064,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37410,7 +39088,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37461,9 +39139,13 @@ pub mod builder { } impl<'a> VpcRouterView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37514,6 +39196,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37532,7 +39219,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37583,9 +39270,13 @@ pub mod builder { } impl<'a> VpcRouterUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37657,6 +39348,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37679,7 +39375,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37730,9 +39426,13 @@ pub mod builder { } impl<'a> VpcRouterDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37783,6 +39483,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -37801,7 +39506,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -37826,7 +39531,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -37854,9 +39559,13 @@ pub mod builder { } impl<'a> VpcRouterRouteList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -37941,6 +39650,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -37967,7 +39681,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38072,9 +39786,13 @@ pub mod builder { } impl<'a> VpcRouterRouteCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38150,6 +39868,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38174,7 +39897,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38226,9 +39949,13 @@ pub mod builder { } impl<'a> VpcRouterRouteView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38290,6 +40017,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38311,7 +40043,7 @@ pub mod builder { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38363,9 +40095,13 @@ pub mod builder { } impl<'a> VpcRouterRouteUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38452,6 +40188,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38479,7 +40220,7 @@ pub mod builder { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38531,9 +40272,13 @@ pub mod builder { } impl<'a> VpcRouterRouteDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38595,6 +40340,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38616,7 +40366,7 @@ pub mod builder { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38641,7 +40391,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -38668,9 +40418,13 @@ pub mod builder { } impl<'a> VpcSubnetList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38744,6 +40498,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -38767,7 +40526,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -38871,9 +40630,13 @@ pub mod builder { } impl<'a> VpcSubnetCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -38934,6 +40697,11 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -38953,7 +40721,7 @@ pub mod builder { client.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39004,9 +40772,13 @@ pub mod builder { } impl<'a> VpcSubnetView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39057,6 +40829,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -39075,7 +40852,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39126,9 +40903,13 @@ pub mod builder { } impl<'a> VpcSubnetUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39200,6 +40981,11 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -39222,7 +41008,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39273,9 +41059,13 @@ pub mod builder { } impl<'a> VpcSubnetDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39326,6 +41116,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -39344,7 +41139,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39369,7 +41164,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -39397,9 +41192,13 @@ pub mod builder { } impl<'a> VpcSubnetListNetworkInterfaces<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization_name: Err("organization_name was not initialized".to_string()), project_name: Err("project_name was not initialized".to_string()), vpc_name: Err("vpc_name was not initialized".to_string()), @@ -39484,6 +41283,11 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}/network-interfaces` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -39511,7 +41315,7 @@ pub mod builder { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39611,16 +41415,25 @@ pub mod builder { } impl<'a> PolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/policy", client.baseurl,); + let url = format!("{}/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -39666,9 +41479,13 @@ pub mod builder { } impl<'a> PolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -39694,6 +41511,11 @@ pub mod builder { } ///Sends a `PUT` request to `/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -39701,7 +41523,7 @@ pub mod builder { let body = body .and_then(|v| types::SiloRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/policy", client.baseurl,); + let url = format!("{}/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -39749,9 +41571,13 @@ pub mod builder { } impl<'a> RoleList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), } @@ -39778,6 +41604,11 @@ pub mod builder { } ///Sends a `GET` request to `/roles` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -39788,7 +41619,7 @@ pub mod builder { } = self; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!("{}/roles", client.baseurl,); + let url = format!("{}/roles", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -39884,9 +41715,13 @@ pub mod builder { } impl<'a> RoleView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, role_name: Err("role_name was not initialized".to_string()), } } @@ -39902,13 +41737,18 @@ pub mod builder { } ///Sends a `GET` request to `/roles/{role_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, role_name } = self; let role_name = role_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/roles/{}", client.baseurl, - encode_path(&role_name.to_string()), + encode_path(&role_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -39954,14 +41794,23 @@ pub mod builder { } impl<'a> SessionMe<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/session/me` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/session/me", client.baseurl,); + let url = format!("{}/session/me", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40009,9 +41858,13 @@ pub mod builder { } impl<'a> SessionMeGroups<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -40050,6 +41903,11 @@ pub mod builder { } ///Sends a `GET` request to `/session/me/groups` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -40062,7 +41920,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/session/me/groups", client.baseurl,); + let url = format!("{}/session/me/groups", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40162,9 +42020,13 @@ pub mod builder { } impl<'a> SessionSshkeyList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -40203,6 +42065,11 @@ pub mod builder { } ///Sends a `GET` request to `/session/me/sshkeys` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -40215,7 +42082,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/session/me/sshkeys", client.baseurl,); + let url = format!("{}/session/me/sshkeys", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40313,9 +42180,13 @@ pub mod builder { } impl<'a> SessionSshkeyCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -40341,12 +42212,17 @@ pub mod builder { } ///Sends a `POST` request to `/session/me/sshkeys` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::SshKeyCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/session/me/sshkeys", client.baseurl,); + let url = format!("{}/session/me/sshkeys", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40393,9 +42269,13 @@ pub mod builder { } impl<'a> SessionSshkeyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, ssh_key_name: Err("ssh_key_name was not initialized".to_string()), } } @@ -40411,6 +42291,11 @@ pub mod builder { } ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -40420,7 +42305,7 @@ pub mod builder { let url = format!( "{}/session/me/sshkeys/{}", client.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40467,9 +42352,13 @@ pub mod builder { } impl<'a> SessionSshkeyDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, ssh_key_name: Err("ssh_key_name was not initialized".to_string()), } } @@ -40485,6 +42374,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -40494,7 +42388,7 @@ pub mod builder { let url = format!( "{}/session/me/sshkeys/{}", client.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40519,7 +42413,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -40541,9 +42435,13 @@ pub mod builder { } impl<'a> SystemImageViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -40559,13 +42457,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/by-id/images/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/by-id/images/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40612,9 +42515,13 @@ pub mod builder { } impl<'a> IpPoolViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -40630,13 +42537,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/by-id/ip-pools/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40683,9 +42595,13 @@ pub mod builder { } impl<'a> SiloViewById<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -40701,13 +42617,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/by-id/silos/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/by-id/silos/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -40756,9 +42677,13 @@ pub mod builder { } impl<'a> CertificateList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -40797,6 +42722,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/certificates` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -40809,7 +42739,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/certificates", client.baseurl,); + let url = format!("{}/system/certificates", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40907,9 +42837,13 @@ pub mod builder { } impl<'a> CertificateCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -40937,12 +42871,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/certificates` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::CertificateCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/certificates", client.baseurl,); + let url = format!("{}/system/certificates", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -40989,9 +42928,13 @@ pub mod builder { } impl<'a> CertificateView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, certificate: Err("certificate was not initialized".to_string()), } } @@ -41007,6 +42950,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/certificates/{certificate}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -41016,7 +42964,7 @@ pub mod builder { let url = format!( "{}/system/certificates/{}", client.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41063,9 +43011,13 @@ pub mod builder { } impl<'a> CertificateDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, certificate: Err("certificate was not initialized".to_string()), } } @@ -41081,6 +43033,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/certificates/{certificate}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -41090,7 +43047,7 @@ pub mod builder { let url = format!( "{}/system/certificates/{}", client.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41115,7 +43072,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -41139,9 +43096,13 @@ pub mod builder { } impl<'a> PhysicalDiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -41180,6 +43141,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41192,7 +43158,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/hardware/disks", client.baseurl,); + let url = format!("{}/system/hardware/disks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41292,9 +43258,13 @@ pub mod builder { } impl<'a> RackList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -41333,6 +43303,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/racks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41345,7 +43320,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/hardware/racks", client.baseurl,); + let url = format!("{}/system/hardware/racks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41443,9 +43418,13 @@ pub mod builder { } impl<'a> RackView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, rack_id: Err("rack_id was not initialized".to_string()), } } @@ -41461,13 +43440,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/racks/{rack_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, rack_id } = self; let rack_id = rack_id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/hardware/racks/{}", client.baseurl, - encode_path(&rack_id.to_string()), + encode_path(&rack_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41516,9 +43500,13 @@ pub mod builder { } impl<'a> SledList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -41557,6 +43545,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/sleds` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41569,7 +43562,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/hardware/sleds", client.baseurl,); + let url = format!("{}/system/hardware/sleds", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -41667,9 +43660,13 @@ pub mod builder { } impl<'a> SledView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, sled_id: Err("sled_id was not initialized".to_string()), } } @@ -41685,13 +43682,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/sleds/{sled_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, sled_id } = self; let sled_id = sled_id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/hardware/sleds/{}", client.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41741,9 +43743,13 @@ pub mod builder { } impl<'a> SledPhysicalDiskList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, sled_id: Err("sled_id was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -41793,6 +43799,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/hardware/sleds/{sled_id}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41810,7 +43821,7 @@ pub mod builder { let url = format!( "{}/system/hardware/sleds/{}/disks", client.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -41911,9 +43922,13 @@ pub mod builder { } impl<'a> SystemImageList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -41952,6 +43967,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -41964,7 +43984,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/images", client.baseurl,); + let url = format!("{}/system/images", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42062,9 +44082,13 @@ pub mod builder { } impl<'a> SystemImageCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -42092,12 +44116,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/images` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::GlobalImageCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/images", client.baseurl,); + let url = format!("{}/system/images", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42144,9 +44173,13 @@ pub mod builder { } impl<'a> SystemImageView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, image_name: Err("image_name was not initialized".to_string()), } } @@ -42162,13 +44195,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/images/{image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, image_name } = self; let image_name = image_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/images/{}", client.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42215,9 +44253,13 @@ pub mod builder { } impl<'a> SystemImageDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, image_name: Err("image_name was not initialized".to_string()), } } @@ -42233,13 +44275,18 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/images/{image_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, image_name } = self; let image_name = image_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/images/{}", client.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42264,7 +44311,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -42288,9 +44335,13 @@ pub mod builder { } impl<'a> IpPoolList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -42329,6 +44380,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -42341,7 +44397,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools", client.baseurl,); + let url = format!("{}/system/ip-pools", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42439,9 +44495,13 @@ pub mod builder { } impl<'a> IpPoolCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -42467,12 +44527,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::IpPoolCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools", client.baseurl,); + let url = format!("{}/system/ip-pools", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -42519,9 +44584,13 @@ pub mod builder { } impl<'a> IpPoolView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), } } @@ -42537,13 +44606,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools/{pool_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, pool_name } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/ip-pools/{}", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42591,9 +44665,13 @@ pub mod builder { } impl<'a> IpPoolUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -42630,6 +44708,11 @@ pub mod builder { } ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -42643,7 +44726,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42691,9 +44774,13 @@ pub mod builder { } impl<'a> IpPoolDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), } } @@ -42709,13 +44796,18 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, pool_name } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/ip-pools/{}", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42740,7 +44832,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -42764,9 +44856,13 @@ pub mod builder { } impl<'a> IpPoolRangeList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -42804,6 +44900,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools/{pool_name}/ranges` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -42819,7 +44920,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}/ranges", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -42917,9 +45018,13 @@ pub mod builder { } impl<'a> IpPoolRangeAdd<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), body: Err("body was not initialized".to_string()), } @@ -42946,6 +45051,11 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -42957,7 +45067,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}/ranges/add", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43006,9 +45116,13 @@ pub mod builder { } impl<'a> IpPoolRangeRemove<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, pool_name: Err("pool_name was not initialized".to_string()), body: Err("body was not initialized".to_string()), } @@ -43036,6 +45150,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/ip-pools/{pool_name}/ranges/remove` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -43047,7 +45166,7 @@ pub mod builder { let url = format!( "{}/system/ip-pools/{}/ranges/remove", client.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43073,7 +45192,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -43094,14 +45213,23 @@ pub mod builder { } impl<'a> IpPoolServiceView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/system/ip-pools-service` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/system/ip-pools-service", client.baseurl,); + let url = format!("{}/system/ip-pools-service", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43148,9 +45276,13 @@ pub mod builder { } impl<'a> IpPoolServiceRangeList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), } @@ -43177,6 +45309,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/ip-pools-service/ranges` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43187,7 +45324,7 @@ pub mod builder { } = self; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools-service/ranges", client.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43283,9 +45420,13 @@ pub mod builder { } impl<'a> IpPoolServiceRangeAdd<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -43301,10 +45442,15 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools-service/ranges/add", client.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/add", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43351,9 +45497,13 @@ pub mod builder { } impl<'a> IpPoolServiceRangeRemove<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -43369,10 +45519,15 @@ pub mod builder { } ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/ip-pools-service/ranges/remove", client.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/remove", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43397,7 +45552,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -43424,9 +45579,13 @@ pub mod builder { } impl<'a> SystemMetric<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, metric_name: Err("metric_name was not initialized".to_string()), end_time: Ok(None), id: Err("id was not initialized".to_string()), @@ -43501,6 +45660,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/metrics/{metric_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43522,7 +45686,7 @@ pub mod builder { let url = format!( "{}/system/metrics/{}", client.baseurl, - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43579,16 +45743,25 @@ pub mod builder { } impl<'a> SystemPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/system/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/system/policy", client.baseurl,); + let url = format!("{}/system/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43634,9 +45807,13 @@ pub mod builder { } impl<'a> SystemPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -43662,6 +45839,11 @@ pub mod builder { } ///Sends a `PUT` request to `/system/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43669,7 +45851,7 @@ pub mod builder { let body = body .and_then(|v| types::FleetRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/policy", client.baseurl,); + let url = format!("{}/system/policy", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43718,9 +45900,13 @@ pub mod builder { } impl<'a> SagaList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -43759,6 +45945,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/sagas` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43771,7 +45962,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/sagas", client.baseurl,); + let url = format!("{}/system/sagas", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -43869,9 +46060,13 @@ pub mod builder { } impl<'a> SagaView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, saga_id: Err("saga_id was not initialized".to_string()), } } @@ -43887,13 +46082,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/sagas/{saga_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, saga_id } = self; let saga_id = saga_id.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/sagas/{}", client.baseurl, - encode_path(&saga_id.to_string()), + encode_path(&saga_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -43942,9 +46142,13 @@ pub mod builder { } impl<'a> SiloList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -43983,6 +46187,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -43995,7 +46204,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/silos", client.baseurl,); + let url = format!("{}/system/silos", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -44093,9 +46302,13 @@ pub mod builder { } impl<'a> SiloCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -44121,12 +46334,17 @@ pub mod builder { } ///Sends a `POST` request to `/system/silos` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::SiloCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/system/silos", client.baseurl,); + let url = format!("{}/system/silos", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -44173,9 +46391,13 @@ pub mod builder { } impl<'a> SiloView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), } } @@ -44191,13 +46413,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos/{silo_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, silo_name } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/silos/{}", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44244,9 +46471,13 @@ pub mod builder { } impl<'a> SiloDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), } } @@ -44262,13 +46493,18 @@ pub mod builder { } ///Sends a `DELETE` request to `/system/silos/{silo_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, silo_name } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/silos/{}", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44293,7 +46529,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -44318,9 +46554,13 @@ pub mod builder { } impl<'a> SiloIdentityProviderList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -44371,6 +46611,11 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/identity-providers` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -44389,7 +46634,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/identity-providers", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44490,9 +46735,13 @@ pub mod builder { } impl<'a> LocalIdpUserCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -44530,6 +46779,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/local/users` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -44543,7 +46797,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/identity-providers/local/users", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44592,9 +46846,13 @@ pub mod builder { } impl<'a> LocalIdpUserDelete<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), user_id: Err("user_id was not initialized".to_string()), } @@ -44622,6 +46880,11 @@ pub mod builder { ///Sends a `DELETE` request to /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -44634,7 +46897,7 @@ pub mod builder { "{}/system/silos/{}/identity-providers/local/users/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44659,7 +46922,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -44683,9 +46946,13 @@ pub mod builder { } impl<'a> LocalIdpUserSetPassword<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), user_id: Err("user_id was not initialized".to_string()), body: Err("body was not initialized".to_string()), @@ -44725,6 +46992,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}/ /// set-password` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -44739,7 +47011,7 @@ pub mod builder { "{}/system/silos/{}/identity-providers/local/users/{}/set-password", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44765,7 +47037,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -44788,9 +47060,13 @@ pub mod builder { } impl<'a> SamlIdentityProviderCreate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -44833,6 +47109,11 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/saml` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -44850,7 +47131,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/identity-providers/saml", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44899,9 +47180,13 @@ pub mod builder { } impl<'a> SamlIdentityProviderView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), provider_name: Err("provider_name was not initialized".to_string()), } @@ -44929,6 +47214,11 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/identity-providers/saml/{provider_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -44943,7 +47233,7 @@ pub mod builder { "{}/system/silos/{}/identity-providers/saml/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -44990,9 +47280,13 @@ pub mod builder { } impl<'a> SiloPolicyView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), } } @@ -45008,6 +47302,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos/{silo_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45016,7 +47315,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/policy", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45064,9 +47363,13 @@ pub mod builder { } impl<'a> SiloPolicyUpdate<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -45103,6 +47406,11 @@ pub mod builder { } ///Sends a `PUT` request to `/system/silos/{silo_name}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45118,7 +47426,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/policy", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45169,9 +47477,13 @@ pub mod builder { } impl<'a> SiloUsersList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), limit: Ok(None), page_token: Ok(None), @@ -45221,6 +47533,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/silos/{silo_name}/users/all` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45238,7 +47555,7 @@ pub mod builder { let url = format!( "{}/system/silos/{}/users/all", client.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45338,9 +47655,13 @@ pub mod builder { } impl<'a> SiloUserView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, silo_name: Err("silo_name was not initialized".to_string()), user_id: Err("user_id was not initialized".to_string()), } @@ -45368,6 +47689,11 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/users/id/{user_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -45380,7 +47706,7 @@ pub mod builder { "{}/system/silos/{}/users/id/{}", client.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45429,9 +47755,13 @@ pub mod builder { } impl<'a> SystemUserList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -45470,6 +47800,11 @@ pub mod builder { } ///Sends a `GET` request to `/system/user` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45482,7 +47817,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/system/user", client.baseurl,); + let url = format!("{}/system/user", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -45580,9 +47915,13 @@ pub mod builder { } impl<'a> SystemUserView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, user_name: Err("user_name was not initialized".to_string()), } } @@ -45598,13 +47937,18 @@ pub mod builder { } ///Sends a `GET` request to `/system/user/{user_name}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, user_name } = self; let user_name = user_name.map_err(Error::InvalidRequest)?; let url = format!( "{}/system/user/{}", client.baseurl, - encode_path(&user_name.to_string()), + encode_path(&user_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -45652,9 +47996,13 @@ pub mod builder { } impl<'a> TimeseriesSchemaGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), } @@ -45681,6 +48029,11 @@ pub mod builder { } ///Sends a `GET` request to `/timeseries/schema` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -45692,7 +48045,7 @@ pub mod builder { } = self; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!("{}/timeseries/schema", client.baseurl,); + let url = format!("{}/timeseries/schema", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -45790,9 +48143,13 @@ pub mod builder { } impl<'a> UserList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -45831,6 +48188,11 @@ pub mod builder { } ///Sends a `GET` request to `/users` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -45843,7 +48205,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/users", client.baseurl,); + let url = format!("{}/users", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -45945,9 +48307,13 @@ pub mod builder { } impl<'a> DiskListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), organization: Ok(None), page_token: Ok(None), @@ -46010,6 +48376,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -46026,7 +48397,7 @@ pub mod builder { let page_token = page_token.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/disks", client.baseurl,); + let url = format!("{}/v1/disks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46133,9 +48504,13 @@ pub mod builder { } impl<'a> DiskCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Ok(None), project: Err("project was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -46184,6 +48559,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46196,7 +48576,7 @@ pub mod builder { let body = body .and_then(|v| types::DiskCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/disks", client.baseurl,); + let url = format!("{}/v1/disks", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46250,9 +48630,13 @@ pub mod builder { } impl<'a> DiskViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, disk: Err("disk was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -46292,6 +48676,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/disks/{disk}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46305,7 +48694,7 @@ pub mod builder { let url = format!( "{}/v1/disks/{}", client.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -46359,9 +48748,13 @@ pub mod builder { } impl<'a> DiskDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, disk: Err("disk was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -46401,6 +48794,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/disks/{disk}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46414,7 +48812,7 @@ pub mod builder { let url = format!( "{}/v1/disks/{}", client.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -46444,7 +48842,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -46470,9 +48868,13 @@ pub mod builder { } impl<'a> InstanceListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), organization: Ok(None), page_token: Ok(None), @@ -46535,6 +48937,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -46551,7 +48958,7 @@ pub mod builder { let page_token = page_token.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/instances", client.baseurl,); + let url = format!("{}/v1/instances", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46658,9 +49065,13 @@ pub mod builder { } impl<'a> InstanceCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Ok(None), project: Err("project was not initialized".to_string()), body: Ok(::std::default::Default::default()), @@ -46709,6 +49120,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46721,7 +49137,7 @@ pub mod builder { let body = body .and_then(|v| types::InstanceCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/instances", client.baseurl,); + let url = format!("{}/v1/instances", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -46775,9 +49191,13 @@ pub mod builder { } impl<'a> InstanceViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -46817,6 +49237,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances/{instance}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46830,7 +49255,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -46884,9 +49309,13 @@ pub mod builder { } impl<'a> InstanceDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -46926,6 +49355,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/instances/{instance}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -46939,7 +49373,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -46969,7 +49403,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -46996,9 +49430,13 @@ pub mod builder { } impl<'a> InstanceDiskListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), limit: Ok(None), organization: Ok(None), @@ -47072,6 +49510,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances/{instance}/disks` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -47093,7 +49536,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/disks", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47202,9 +49645,13 @@ pub mod builder { } impl<'a> InstanceDiskAttachV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47265,6 +49712,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47282,7 +49734,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/disks/attach", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47338,9 +49790,13 @@ pub mod builder { } impl<'a> InstanceDiskDetachV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47401,6 +49857,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47418,7 +49879,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/disks/detach", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47474,9 +49935,13 @@ pub mod builder { } impl<'a> InstanceMigrateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47537,6 +50002,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/migrate` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47554,7 +50024,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/migrate", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47609,9 +50079,13 @@ pub mod builder { } impl<'a> InstanceRebootV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47651,6 +50125,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/reboot` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47664,7 +50143,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/reboot", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47721,9 +50200,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), from_start: Ok(None), max_bytes: Ok(None), @@ -47799,6 +50282,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/instances/{instance}/serial-console` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -47820,7 +50308,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/serial-console", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47883,9 +50371,13 @@ pub mod builder { } impl<'a> InstanceSerialConsoleStreamV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -47926,6 +50418,11 @@ pub mod builder { ///Sends a `GET` request to /// `/v1/instances/{instance}/serial-console/stream` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -47939,7 +50436,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/serial-console/stream", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -47999,9 +50496,13 @@ pub mod builder { } impl<'a> InstanceStartV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -48041,6 +50542,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48054,7 +50560,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/start", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48108,9 +50614,13 @@ pub mod builder { } impl<'a> InstanceStopV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, instance: Err("instance was not initialized".to_string()), organization: Ok(None), project: Ok(None), @@ -48150,6 +50660,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/instances/{instance}/stop` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48163,7 +50678,7 @@ pub mod builder { let url = format!( "{}/v1/instances/{}/stop", client.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48217,9 +50732,13 @@ pub mod builder { } impl<'a> OrganizationListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -48258,6 +50777,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -48270,7 +50794,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/organizations", client.baseurl,); + let url = format!("{}/v1/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -48368,9 +50892,13 @@ pub mod builder { } impl<'a> OrganizationCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -48398,12 +50926,17 @@ pub mod builder { } ///Sends a `POST` request to `/v1/organizations` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::OrganizationCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/organizations", client.baseurl,); + let url = format!("{}/v1/organizations", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -48450,9 +50983,13 @@ pub mod builder { } impl<'a> OrganizationViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), } } @@ -48468,6 +51005,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/organizations/{organization}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48477,7 +51019,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48525,9 +51067,13 @@ pub mod builder { } impl<'a> OrganizationUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -48566,6 +51112,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/organizations/{organization}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48579,7 +51130,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48627,9 +51178,13 @@ pub mod builder { } impl<'a> OrganizationDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), } } @@ -48645,6 +51200,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/organizations/{organization}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -48654,7 +51214,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48679,7 +51239,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -48701,9 +51261,13 @@ pub mod builder { } impl<'a> OrganizationPolicyViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), } } @@ -48719,6 +51283,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/organizations/{organization}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -48730,7 +51299,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}/policy", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48778,9 +51347,13 @@ pub mod builder { } impl<'a> OrganizationPolicyUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -48821,6 +51394,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/organizations/{organization}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -48836,7 +51414,7 @@ pub mod builder { let url = format!( "{}/v1/organizations/{}/policy", client.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -48887,9 +51465,13 @@ pub mod builder { } impl<'a> ProjectListV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), organization: Ok(None), page_token: Ok(None), @@ -48940,6 +51522,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -48954,7 +51541,7 @@ pub mod builder { let organization = organization.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/projects", client.baseurl,); + let url = format!("{}/v1/projects", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -49058,9 +51645,13 @@ pub mod builder { } impl<'a> ProjectCreateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, organization: Err("organization was not initialized".to_string()), body: Ok(::std::default::Default::default()), } @@ -49097,6 +51688,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/projects` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49107,7 +51703,7 @@ pub mod builder { let body = body .and_then(|v| types::ProjectCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/projects", client.baseurl,); + let url = format!("{}/v1/projects", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -49159,9 +51755,13 @@ pub mod builder { } impl<'a> ProjectViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), } @@ -49189,6 +51789,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/projects/{project}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49200,7 +51805,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49253,9 +51858,13 @@ pub mod builder { } impl<'a> ProjectUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), body: Ok(::std::default::Default::default()), @@ -49304,6 +51913,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/projects/{project}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49319,7 +51933,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49372,9 +51986,13 @@ pub mod builder { } impl<'a> ProjectDeleteV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), } @@ -49402,6 +52020,11 @@ pub mod builder { } ///Sends a `DELETE` request to `/v1/projects/{project}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -49413,7 +52036,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49442,7 +52065,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -49465,9 +52088,13 @@ pub mod builder { } impl<'a> ProjectPolicyViewV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), } @@ -49495,6 +52122,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/projects/{project}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -49508,7 +52140,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}/policy", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49561,9 +52193,13 @@ pub mod builder { } impl<'a> ProjectPolicyUpdateV1<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, project: Err("project was not initialized".to_string()), organization: Ok(None), body: Ok(::std::default::Default::default()), @@ -49614,6 +52250,11 @@ pub mod builder { } ///Sends a `PUT` request to `/v1/projects/{project}/policy` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -49631,7 +52272,7 @@ pub mod builder { let url = format!( "{}/v1/projects/{}/policy", client.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -49685,9 +52326,13 @@ pub mod builder { } impl<'a> SystemComponentVersionList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -49726,6 +52371,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/components` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -49739,7 +52389,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/components", client.baseurl,); + let url = format!("{}/v1/system/update/components", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -49840,9 +52490,13 @@ pub mod builder { } impl<'a> UpdateDeploymentsList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -49881,6 +52535,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/deployments` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -49894,7 +52553,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/deployments", client.baseurl,); + let url = format!("{}/v1/system/update/deployments", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -49992,9 +52651,13 @@ pub mod builder { } impl<'a> UpdateDeploymentView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), } } @@ -50010,6 +52673,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/deployments/{id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50018,7 +52686,7 @@ pub mod builder { let url = format!( "{}/v1/system/update/deployments/{}", client.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -50064,14 +52732,23 @@ pub mod builder { } impl<'a> SystemUpdateRefresh<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/system/update/refresh` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/v1/system/update/refresh", client.baseurl,); + let url = format!("{}/v1/system/update/refresh", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50095,7 +52772,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -50117,9 +52794,13 @@ pub mod builder { } impl<'a> SystemUpdateStart<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -50147,6 +52828,11 @@ pub mod builder { } ///Sends a `POST` request to `/v1/system/update/start` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50154,7 +52840,7 @@ pub mod builder { let body = body .and_then(|v| types::SystemUpdateStart::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/start", client.baseurl,); + let url = format!("{}/v1/system/update/start", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50200,14 +52886,23 @@ pub mod builder { } impl<'a> SystemUpdateStop<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `POST` request to `/v1/system/update/stop` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/v1/system/update/stop", client.baseurl,); + let url = format!("{}/v1/system/update/stop", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50231,7 +52926,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -50255,9 +52950,13 @@ pub mod builder { } impl<'a> SystemUpdateList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), sort_by: Ok(None), @@ -50296,6 +52995,11 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/updates` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50308,7 +53012,7 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let sort_by = sort_by.map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/update/updates", client.baseurl,); + let url = format!("{}/v1/system/update/updates", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -50406,9 +53110,13 @@ pub mod builder { } impl<'a> SystemUpdateView<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, version: Err("version was not initialized".to_string()), } } @@ -50424,13 +53132,18 @@ pub mod builder { } ///Sends a `GET` request to `/v1/system/update/updates/{version}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, version } = self; let version = version.map_err(Error::InvalidRequest)?; let url = format!( "{}/v1/system/update/updates/{}", client.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -50477,9 +53190,13 @@ pub mod builder { } impl<'a> SystemUpdateComponentsList<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, version: Err("version was not initialized".to_string()), } } @@ -50496,6 +53213,11 @@ pub mod builder { ///Sends a `GET` request to /// `/v1/system/update/updates/{version}/components` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -50504,7 +53226,7 @@ pub mod builder { let url = format!( "{}/v1/system/update/updates/{}/components", client.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -50550,16 +53272,25 @@ pub mod builder { } impl<'a> SystemVersion<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/v1/system/update/version` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/v1/system/update/version", client.baseurl,); + let url = format!("{}/v1/system/update/version", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/nexus_positional.rs b/progenitor-impl/tests/output/src/nexus_positional.rs index e3dd2867..2f628adc 100644 --- a/progenitor-impl/tests/output/src/nexus_positional.rs +++ b/progenitor-impl/tests/output/src/nexus_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -12866,7 +12874,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Oxide Region API +///Client for `Oxide Region API` /// ///API for interacting with the Oxide control plane /// @@ -12882,6 +12890,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -12901,6 +12914,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -12929,12 +12943,37 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Fetch a disk by id /// ///Use `GET /v1/disks/{disk}` instead /// ///Sends a `GET` request to `/by-id/disks/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -12942,7 +12981,7 @@ impl Client { let url = format!( "{}/by-id/disks/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -12981,6 +13020,12 @@ impl Client { ///Fetch an image by id /// ///Sends a `GET` request to `/by-id/images/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -12988,7 +13033,7 @@ impl Client { let url = format!( "{}/by-id/images/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13027,6 +13072,12 @@ impl Client { ///Fetch an instance by id /// ///Sends a `GET` request to `/by-id/instances/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13034,7 +13085,7 @@ impl Client { let url = format!( "{}/by-id/instances/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13073,6 +13124,12 @@ impl Client { ///Fetch a network interface by id /// ///Sends a `GET` request to `/by-id/network-interfaces/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13080,7 +13137,7 @@ impl Client { let url = format!( "{}/by-id/network-interfaces/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13121,6 +13178,12 @@ impl Client { ///Use `GET /v1/organizations/{organization}` instead /// ///Sends a `GET` request to `/by-id/organizations/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13128,7 +13191,7 @@ impl Client { let url = format!( "{}/by-id/organizations/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13169,6 +13232,12 @@ impl Client { ///Use `GET /v1/projects/{project}` instead /// ///Sends a `GET` request to `/by-id/projects/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13176,7 +13245,7 @@ impl Client { let url = format!( "{}/by-id/projects/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13215,6 +13284,12 @@ impl Client { ///Fetch a snapshot by id /// ///Sends a `GET` request to `/by-id/snapshots/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13222,7 +13297,7 @@ impl Client { let url = format!( "{}/by-id/snapshots/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13261,6 +13336,12 @@ impl Client { ///Fetch a route by id /// ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13268,7 +13349,7 @@ impl Client { let url = format!( "{}/by-id/vpc-router-routes/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13307,6 +13388,12 @@ impl Client { ///Get a router by id /// ///Sends a `GET` request to `/by-id/vpc-routers/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13314,7 +13401,7 @@ impl Client { let url = format!( "{}/by-id/vpc-routers/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13353,6 +13440,12 @@ impl Client { ///Fetch a subnet by id /// ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13360,7 +13453,7 @@ impl Client { let url = format!( "{}/by-id/vpc-subnets/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13399,6 +13492,12 @@ impl Client { ///Fetch a VPC /// ///Sends a `GET` request to `/by-id/vpcs/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13406,7 +13505,7 @@ impl Client { let url = format!( "{}/by-id/vpcs/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13449,11 +13548,17 @@ impl Client { /// must be verified and confirmed prior to a token being granted. /// ///Sends a `POST` request to `/device/auth` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn device_auth_request<'a>( &'a self, body: &'a types::DeviceAuthRequest, ) -> Result, Error> { - let url = format!("{}/device/auth", self.baseurl,); + let url = format!("{}/device/auth", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13487,11 +13592,17 @@ impl Client { /// `/device/token`. /// ///Sends a `POST` request to `/device/confirm` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn device_auth_confirm<'a>( &'a self, body: &'a types::DeviceAuthVerify, ) -> Result, Error> { - let url = format!("{}/device/confirm", self.baseurl,); + let url = format!("{}/device/confirm", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13516,7 +13627,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -13533,11 +13644,17 @@ impl Client { /// verified and the grant is confirmed. /// ///Sends a `POST` request to `/device/token` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn device_access_token<'a>( &'a self, body: &'a types::DeviceAccessTokenRequest, ) -> Result, Error> { - let url = format!("{}/device/token", self.baseurl,); + let url = format!("{}/device/token", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13572,13 +13689,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn group_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/groups", self.baseurl,); + let url = format!("{}/groups", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13627,6 +13749,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn group_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -13659,11 +13785,17 @@ impl Client { } ///Sends a `POST` request to `/login` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_spoof<'a>( &'a self, body: &'a types::SpoofLoginBody, ) -> Result, Error> { - let url = format!("{}/login", self.baseurl,); + let url = format!("{}/login", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13688,7 +13820,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -13702,6 +13834,12 @@ impl Client { ///Authenticate a user (i.e., log in) via username and password /// ///Sends a `POST` request to `/login/{silo_name}/local` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_local<'a>( &'a self, silo_name: &'a types::Name, @@ -13710,7 +13848,7 @@ impl Client { let url = format!( "{}/login/{}/local", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13749,6 +13887,12 @@ impl Client { /// them to their identity provider. /// ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_saml_begin<'a>( &'a self, silo_name: &'a types::Name, @@ -13758,7 +13902,7 @@ impl Client { "{}/login/{}/saml/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13789,6 +13933,12 @@ impl Client { ///Authenticate a user (i.e., log in) via SAML /// ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_saml<'a, B: Into>( &'a self, silo_name: &'a types::Name, @@ -13799,7 +13949,7 @@ impl Client { "{}/login/{}/saml/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13837,8 +13987,14 @@ impl Client { } ///Sends a `POST` request to `/logout` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn logout<'a>(&'a self) -> Result, Error> { - let url = format!("{}/logout", self.baseurl,); + let url = format!("{}/logout", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13862,7 +14018,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -13884,13 +14040,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/organizations", self.baseurl,); + let url = format!("{}/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13941,6 +14102,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn organization_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -13978,11 +14143,17 @@ impl Client { ///Use `POST /v1/organizations` instead /// ///Sends a `POST` request to `/organizations` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_create<'a>( &'a self, body: &'a types::OrganizationCreate, ) -> Result, Error> { - let url = format!("{}/organizations", self.baseurl,); + let url = format!("{}/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -14026,6 +14197,11 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14033,7 +14209,7 @@ impl Client { let url = format!( "{}/organizations/{}", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14078,6 +14254,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_update<'a>( &'a self, organization_name: &'a types::Name, @@ -14086,7 +14267,7 @@ impl Client { let url = format!( "{}/organizations/{}", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14131,6 +14312,11 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -14138,7 +14324,7 @@ impl Client { let url = format!( "{}/organizations/{}", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14163,7 +14349,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -14182,6 +14368,11 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14189,7 +14380,7 @@ impl Client { let url = format!( "{}/organizations/{}/policy", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14234,6 +14425,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_update<'a>( &'a self, organization_name: &'a types::Name, @@ -14242,7 +14438,7 @@ impl Client { let url = format!( "{}/organizations/{}/policy", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14291,6 +14487,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_list<'a>( &'a self, organization_name: &'a types::Name, @@ -14301,7 +14502,7 @@ impl Client { let url = format!( "{}/organizations/{}/projects", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14355,6 +14556,10 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn project_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -14396,6 +14601,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_create<'a>( &'a self, organization_name: &'a types::Name, @@ -14404,7 +14614,7 @@ impl Client { let url = format!( "{}/organizations/{}/projects", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14451,6 +14661,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14460,7 +14675,7 @@ impl Client { "{}/organizations/{}/projects/{}", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14507,6 +14722,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_update<'a>( &'a self, organization_name: &'a types::Name, @@ -14517,7 +14737,7 @@ impl Client { "{}/organizations/{}/projects/{}", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14564,6 +14784,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -14573,7 +14798,7 @@ impl Client { "{}/organizations/{}/projects/{}", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14598,7 +14823,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -14623,6 +14848,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_list<'a>( &'a self, organization_name: &'a types::Name, @@ -14635,7 +14865,7 @@ impl Client { "{}/organizations/{}/projects/{}/disks", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14690,6 +14920,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn disk_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -14738,6 +14972,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_create<'a>( &'a self, organization_name: &'a types::Name, @@ -14748,7 +14987,7 @@ impl Client { "{}/organizations/{}/projects/{}/disks", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14792,6 +15031,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14803,7 +15048,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14844,6 +15089,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -14855,7 +15106,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14880,7 +15131,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -14907,6 +15158,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_metrics_list<'a>( &'a self, organization_name: &'a types::Name, @@ -14924,7 +15180,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&disk_name.to_string()), - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14984,6 +15240,10 @@ impl Client { /// - `end_time`: An exclusive end time of metrics. /// - `limit`: Maximum number of items returned by a single call /// - `start_time`: An inclusive start time of metrics. + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn disk_metrics_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15054,6 +15314,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15066,7 +15331,7 @@ impl Client { "{}/organizations/{}/projects/{}/images", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15122,6 +15387,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn image_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15172,6 +15441,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_create<'a>( &'a self, organization_name: &'a types::Name, @@ -15182,7 +15456,7 @@ impl Client { "{}/organizations/{}/projects/{}/images", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15226,6 +15500,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_view<'a>( &'a self, organization_name: &'a types::Name, @@ -15237,7 +15517,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15282,6 +15562,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -15293,7 +15579,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15318,7 +15604,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -15341,6 +15627,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15353,7 +15644,7 @@ impl Client { "{}/organizations/{}/projects/{}/instances", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15406,6 +15697,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15457,6 +15752,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_create<'a>( &'a self, organization_name: &'a types::Name, @@ -15467,7 +15767,7 @@ impl Client { "{}/organizations/{}/projects/{}/instances", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15511,6 +15811,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_view<'a>( &'a self, organization_name: &'a types::Name, @@ -15522,7 +15828,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15563,6 +15869,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -15574,7 +15886,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15599,7 +15911,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -15626,6 +15938,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15640,7 +15957,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15696,6 +16013,10 @@ impl Client { /// - `instance_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_disk_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15751,6 +16072,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/attach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_attach<'a>( &'a self, organization_name: &'a types::Name, @@ -15763,7 +16090,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15807,6 +16134,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/detach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_detach<'a>( &'a self, organization_name: &'a types::Name, @@ -15819,7 +16152,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15861,6 +16194,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/external-ips` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_external_ip_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15872,7 +16211,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15915,6 +16254,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/migrate` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_migrate<'a>( &'a self, organization_name: &'a types::Name, @@ -15927,7 +16272,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15978,6 +16323,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15992,7 +16342,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16046,6 +16396,10 @@ impl Client { /// - `instance_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_network_interface_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -16100,6 +16454,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_create<'a>( &'a self, organization_name: &'a types::Name, @@ -16112,7 +16472,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16154,6 +16514,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_view<'a>( &'a self, organization_name: &'a types::Name, @@ -16167,7 +16533,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16208,6 +16574,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_update<'a>( &'a self, organization_name: &'a types::Name, @@ -16222,7 +16594,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16269,6 +16641,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -16282,7 +16660,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16307,7 +16685,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -16325,6 +16703,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/reboot` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_reboot<'a>( &'a self, organization_name: &'a types::Name, @@ -16336,7 +16720,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16395,6 +16779,11 @@ impl Client { /// read, counting *backward* from the most recently buffered data /// retrieved from the instance. (See note on `from_start` about mutual /// exclusivity) + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console<'a>( &'a self, organization_name: &'a types::Name, @@ -16409,7 +16798,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16461,6 +16850,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -16472,7 +16867,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16515,6 +16910,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream_v2` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_stream_v2<'a>( &'a self, organization_name: &'a types::Name, @@ -16526,7 +16927,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16575,6 +16976,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/start` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_start<'a>( &'a self, organization_name: &'a types::Name, @@ -16586,7 +16993,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16629,6 +17036,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/stop` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_stop<'a>( &'a self, organization_name: &'a types::Name, @@ -16640,7 +17053,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16686,6 +17099,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_view<'a>( &'a self, organization_name: &'a types::Name, @@ -16695,7 +17113,7 @@ impl Client { "{}/organizations/{}/projects/{}/policy", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16740,6 +17158,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_update<'a>( &'a self, organization_name: &'a types::Name, @@ -16750,7 +17173,7 @@ impl Client { "{}/organizations/{}/projects/{}/policy", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16799,6 +17222,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_list<'a>( &'a self, organization_name: &'a types::Name, @@ -16811,7 +17239,7 @@ impl Client { "{}/organizations/{}/projects/{}/snapshots", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16864,6 +17292,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn snapshot_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -16915,6 +17347,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_create<'a>( &'a self, organization_name: &'a types::Name, @@ -16925,7 +17362,7 @@ impl Client { "{}/organizations/{}/projects/{}/snapshots", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16967,6 +17404,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_view<'a>( &'a self, organization_name: &'a types::Name, @@ -16978,7 +17421,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17019,6 +17462,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -17030,7 +17479,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17055,7 +17504,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -17078,6 +17527,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_list<'a>( &'a self, organization_name: &'a types::Name, @@ -17090,7 +17544,7 @@ impl Client { "{}/organizations/{}/projects/{}/vpcs", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17143,6 +17597,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -17191,6 +17649,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_create<'a>( &'a self, organization_name: &'a types::Name, @@ -17201,7 +17664,7 @@ impl Client { "{}/organizations/{}/projects/{}/vpcs", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17243,6 +17706,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_view<'a>( &'a self, organization_name: &'a types::Name, @@ -17254,7 +17723,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17295,6 +17764,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_update<'a>( &'a self, organization_name: &'a types::Name, @@ -17307,7 +17782,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17349,6 +17824,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -17360,7 +17841,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17385,7 +17866,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -17401,6 +17882,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_firewall_rules_view<'a>( &'a self, organization_name: &'a types::Name, @@ -17412,7 +17899,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17453,6 +17940,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_firewall_rules_update<'a>( &'a self, organization_name: &'a types::Name, @@ -17465,7 +17958,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17516,6 +18009,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_list<'a>( &'a self, organization_name: &'a types::Name, @@ -17530,7 +18028,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17584,6 +18082,10 @@ impl Client { /// - `vpc_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_router_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -17638,6 +18140,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_create<'a>( &'a self, organization_name: &'a types::Name, @@ -17650,7 +18158,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17692,6 +18200,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_view<'a>( &'a self, organization_name: &'a types::Name, @@ -17705,7 +18219,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17746,6 +18260,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_update<'a>( &'a self, organization_name: &'a types::Name, @@ -17760,7 +18280,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17802,6 +18322,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -17815,7 +18341,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17840,7 +18366,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -17868,6 +18394,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_list<'a>( &'a self, organization_name: &'a types::Name, @@ -17884,7 +18415,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17942,6 +18473,10 @@ impl Client { /// - `router_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_router_route_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -17999,6 +18534,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_create<'a>( &'a self, organization_name: &'a types::Name, @@ -18013,7 +18554,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18055,6 +18596,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_view<'a>( &'a self, organization_name: &'a types::Name, @@ -18070,7 +18617,7 @@ impl Client { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18111,6 +18658,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_update<'a>( &'a self, organization_name: &'a types::Name, @@ -18127,7 +18680,7 @@ impl Client { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18169,6 +18722,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -18184,7 +18743,7 @@ impl Client { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18209,7 +18768,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -18234,6 +18793,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_list<'a>( &'a self, organization_name: &'a types::Name, @@ -18248,7 +18812,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18302,6 +18866,10 @@ impl Client { /// - `vpc_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_subnet_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -18356,6 +18924,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_create<'a>( &'a self, organization_name: &'a types::Name, @@ -18368,7 +18942,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18410,6 +18984,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_view<'a>( &'a self, organization_name: &'a types::Name, @@ -18423,7 +19003,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18464,6 +19044,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_update<'a>( &'a self, organization_name: &'a types::Name, @@ -18478,7 +19064,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18520,6 +19106,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -18533,7 +19125,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18558,7 +19150,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -18584,6 +19176,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_list_network_interfaces<'a>( &'a self, organization_name: &'a types::Name, @@ -18600,7 +19197,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18656,6 +19253,10 @@ impl Client { /// - `subnet_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_subnet_list_network_interfaces_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -18711,10 +19312,16 @@ impl Client { ///Fetch the current silo's IAM policy /// ///Sends a `GET` request to `/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn policy_view<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/policy", self.baseurl,); + let url = format!("{}/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18752,11 +19359,17 @@ impl Client { ///Update the current silo's IAM policy /// ///Sends a `PUT` request to `/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn policy_update<'a>( &'a self, body: &'a types::SiloRolePolicy, ) -> Result, Error> { - let url = format!("{}/policy", self.baseurl,); + let url = format!("{}/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18800,12 +19413,17 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn role_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!("{}/roles", self.baseurl,); + let url = format!("{}/roles", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18852,6 +19470,10 @@ impl Client { /// ///Arguments: /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn role_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -18888,6 +19510,11 @@ impl Client { /// ///Arguments: /// - `role_name`: The built-in role's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn role_view<'a>( &'a self, role_name: &'a str, @@ -18895,7 +19522,7 @@ impl Client { let url = format!( "{}/roles/{}", self.baseurl, - encode_path(&role_name.to_string()), + encode_path(&role_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18934,10 +19561,16 @@ impl Client { ///Fetch the user associated with the current session /// ///Sends a `GET` request to `/session/me` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_me<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/session/me", self.baseurl,); + let url = format!("{}/session/me", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18981,13 +19614,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_me_groups<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/session/me/groups", self.baseurl,); + let url = format!("{}/session/me/groups", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19036,6 +19674,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn session_me_groups_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19078,13 +19720,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/session/me/sshkeys", self.baseurl,); + let url = format!("{}/session/me/sshkeys", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19135,6 +19782,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn session_sshkey_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19171,11 +19822,17 @@ impl Client { ///Create an SSH public key for the currently authenticated user. /// ///Sends a `POST` request to `/session/me/sshkeys` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_create<'a>( &'a self, body: &'a types::SshKeyCreate, ) -> Result, Error> { - let url = format!("{}/session/me/sshkeys", self.baseurl,); + let url = format!("{}/session/me/sshkeys", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19217,6 +19874,12 @@ impl Client { /// user. /// ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_view<'a>( &'a self, ssh_key_name: &'a types::Name, @@ -19224,7 +19887,7 @@ impl Client { let url = format!( "{}/session/me/sshkeys/{}", self.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19266,6 +19929,12 @@ impl Client { /// user. /// ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_delete<'a>( &'a self, ssh_key_name: &'a types::Name, @@ -19273,7 +19942,7 @@ impl Client { let url = format!( "{}/session/me/sshkeys/{}", self.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19298,7 +19967,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -19312,6 +19981,12 @@ impl Client { ///Fetch a system-wide image by id /// ///Sends a `GET` request to `/system/by-id/images/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -19319,7 +19994,7 @@ impl Client { let url = format!( "{}/system/by-id/images/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19358,6 +20033,12 @@ impl Client { ///Fetch an IP pool by id /// ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -19365,7 +20046,7 @@ impl Client { let url = format!( "{}/system/by-id/ip-pools/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19404,6 +20085,12 @@ impl Client { ///Fetch a silo by id /// ///Sends a `GET` request to `/system/by-id/silos/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -19411,7 +20098,7 @@ impl Client { let url = format!( "{}/system/by-id/silos/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19460,13 +20147,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/certificates", self.baseurl,); + let url = format!("{}/system/certificates", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19519,6 +20211,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn certificate_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19557,11 +20253,17 @@ impl Client { /// serve external connections. /// ///Sends a `POST` request to `/system/certificates` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_create<'a>( &'a self, body: &'a types::CertificateCreate, ) -> Result, Error> { - let url = format!("{}/system/certificates", self.baseurl,); + let url = format!("{}/system/certificates", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19599,9 +20301,15 @@ impl Client { ///Fetch a certificate /// - ///Returns the details of a specific certificate + ///Returns the details of a specific certificate + /// + ///Sends a `GET` request to `/system/certificates/{certificate}` + /// + /// + ///# Errors /// - ///Sends a `GET` request to `/system/certificates/{certificate}` + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_view<'a>( &'a self, certificate: &'a types::NameOrId, @@ -19609,7 +20317,7 @@ impl Client { let url = format!( "{}/system/certificates/{}", self.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19650,6 +20358,12 @@ impl Client { ///Permanently delete a certificate. This operation cannot be undone. /// ///Sends a `DELETE` request to `/system/certificates/{certificate}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_delete<'a>( &'a self, certificate: &'a types::NameOrId, @@ -19657,7 +20371,7 @@ impl Client { let url = format!( "{}/system/certificates/{}", self.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19682,7 +20396,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -19702,13 +20416,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn physical_disk_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/hardware/disks", self.baseurl,); + let url = format!("{}/system/hardware/disks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19757,6 +20476,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn physical_disk_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19798,13 +20521,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn rack_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/hardware/racks", self.baseurl,); + let url = format!("{}/system/hardware/racks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19853,6 +20581,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn rack_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19890,6 +20622,11 @@ impl Client { /// ///Arguments: /// - `rack_id`: The rack's unique ID. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn rack_view<'a>( &'a self, rack_id: &'a ::uuid::Uuid, @@ -19897,7 +20634,7 @@ impl Client { let url = format!( "{}/system/hardware/racks/{}", self.baseurl, - encode_path(&rack_id.to_string()), + encode_path(&rack_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19942,13 +20679,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn sled_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/hardware/sleds", self.baseurl,); + let url = format!("{}/system/hardware/sleds", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19997,6 +20739,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn sled_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -20034,6 +20780,11 @@ impl Client { /// ///Arguments: /// - `sled_id`: The sled's unique ID. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn sled_view<'a>( &'a self, sled_id: &'a ::uuid::Uuid, @@ -20041,7 +20792,7 @@ impl Client { let url = format!( "{}/system/hardware/sleds/{}", self.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20087,6 +20838,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn sled_physical_disk_list<'a>( &'a self, sled_id: &'a ::uuid::Uuid, @@ -20097,7 +20853,7 @@ impl Client { let url = format!( "{}/system/hardware/sleds/{}/disks", self.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20149,6 +20905,10 @@ impl Client { /// - `sled_id`: The sled's unique ID. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn sled_physical_disk_list_stream<'a>( &'a self, sled_id: &'a ::uuid::Uuid, @@ -20195,13 +20955,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/images", self.baseurl,); + let url = format!("{}/system/images", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20254,6 +21019,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_image_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -20292,11 +21061,17 @@ impl Client { /// in any silo as a base for instances. /// ///Sends a `POST` request to `/system/images` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_create<'a>( &'a self, body: &'a types::GlobalImageCreate, ) -> Result, Error> { - let url = format!("{}/system/images", self.baseurl,); + let url = format!("{}/system/images", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20337,6 +21112,12 @@ impl Client { ///Returns the details of a specific system-wide image. /// ///Sends a `GET` request to `/system/images/{image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_view<'a>( &'a self, image_name: &'a types::Name, @@ -20344,7 +21125,7 @@ impl Client { let url = format!( "{}/system/images/{}", self.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20387,6 +21168,12 @@ impl Client { /// new instances can not be created with this image. /// ///Sends a `DELETE` request to `/system/images/{image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_delete<'a>( &'a self, image_name: &'a types::Name, @@ -20394,7 +21181,7 @@ impl Client { let url = format!( "{}/system/images/{}", self.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20419,7 +21206,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -20439,13 +21226,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/ip-pools", self.baseurl,); + let url = format!("{}/system/ip-pools", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20494,6 +21286,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn ip_pool_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -20528,11 +21324,17 @@ impl Client { ///Create an IP pool /// ///Sends a `POST` request to `/system/ip-pools` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_create<'a>( &'a self, body: &'a types::IpPoolCreate, ) -> Result, Error> { - let url = format!("{}/system/ip-pools", self.baseurl,); + let url = format!("{}/system/ip-pools", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20571,6 +21373,12 @@ impl Client { ///Fetch an IP pool /// ///Sends a `GET` request to `/system/ip-pools/{pool_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_view<'a>( &'a self, pool_name: &'a types::Name, @@ -20578,7 +21386,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20617,6 +21425,12 @@ impl Client { ///Update an IP Pool /// ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_update<'a>( &'a self, pool_name: &'a types::Name, @@ -20625,7 +21439,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20665,6 +21479,12 @@ impl Client { ///Delete an IP Pool /// ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_delete<'a>( &'a self, pool_name: &'a types::Name, @@ -20672,7 +21492,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20697,7 +21517,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -20719,6 +21539,11 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_range_list<'a>( &'a self, pool_name: &'a types::Name, @@ -20728,7 +21553,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}/ranges", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20779,6 +21604,10 @@ impl Client { ///Arguments: /// - `pool_name` /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn ip_pool_range_list_stream<'a>( &'a self, pool_name: &'a types::Name, @@ -20814,6 +21643,12 @@ impl Client { ///Add a range to an IP pool /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_range_add<'a>( &'a self, pool_name: &'a types::Name, @@ -20822,7 +21657,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}/ranges/add", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20862,6 +21697,12 @@ impl Client { ///Remove a range from an IP pool /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/remove` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_range_remove<'a>( &'a self, pool_name: &'a types::Name, @@ -20870,7 +21711,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}/ranges/remove", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20896,7 +21737,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -20910,10 +21751,16 @@ impl Client { ///Fetch the IP pool used for Oxide services /// ///Sends a `GET` request to `/system/ip-pools-service` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_view<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service", self.baseurl,); + let url = format!("{}/system/ip-pools-service", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20958,12 +21805,17 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_range_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service/ranges", self.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21012,6 +21864,10 @@ impl Client { /// ///Arguments: /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn ip_pool_service_range_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -21046,11 +21902,17 @@ impl Client { ///Add a range to an IP pool used for Oxide services /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_range_add<'a>( &'a self, body: &'a types::IpRange, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service/ranges/add", self.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/add", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21089,11 +21951,17 @@ impl Client { ///Remove a range from an IP pool used for Oxide services /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_range_remove<'a>( &'a self, body: &'a types::IpRange, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service/ranges/remove", self.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/remove", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21118,7 +21986,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21141,6 +22009,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_metric<'a>( &'a self, metric_name: types::SystemMetricName, @@ -21153,7 +22026,7 @@ impl Client { let url = format!( "{}/system/metrics/{}", self.baseurl, - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21203,10 +22076,16 @@ impl Client { ///Fetch the top-level IAM policy /// ///Sends a `GET` request to `/system/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_policy_view<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/system/policy", self.baseurl,); + let url = format!("{}/system/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21244,11 +22123,17 @@ impl Client { ///Update the top-level IAM policy /// ///Sends a `PUT` request to `/system/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_policy_update<'a>( &'a self, body: &'a types::FleetRolePolicy, ) -> Result, Error> { - let url = format!("{}/system/policy", self.baseurl,); + let url = format!("{}/system/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21293,13 +22178,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saga_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/sagas", self.baseurl,); + let url = format!("{}/system/sagas", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21348,6 +22238,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn saga_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -21382,6 +22276,12 @@ impl Client { ///Fetch a saga /// ///Sends a `GET` request to `/system/sagas/{saga_id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saga_view<'a>( &'a self, saga_id: &'a ::uuid::Uuid, @@ -21389,7 +22289,7 @@ impl Client { let url = format!( "{}/system/sagas/{}", self.baseurl, - encode_path(&saga_id.to_string()), + encode_path(&saga_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21436,13 +22336,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/silos", self.baseurl,); + let url = format!("{}/system/silos", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21493,6 +22398,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn silo_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -21527,11 +22436,17 @@ impl Client { ///Create a silo /// ///Sends a `POST` request to `/system/silos` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_create<'a>( &'a self, body: &'a types::SiloCreate, ) -> Result, Error> { - let url = format!("{}/system/silos", self.baseurl,); + let url = format!("{}/system/silos", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21575,6 +22490,11 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_view<'a>( &'a self, silo_name: &'a types::Name, @@ -21582,7 +22502,7 @@ impl Client { let url = format!( "{}/system/silos/{}", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21626,6 +22546,11 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_delete<'a>( &'a self, silo_name: &'a types::Name, @@ -21633,7 +22558,7 @@ impl Client { let url = format!( "{}/system/silos/{}", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21658,7 +22583,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21679,6 +22604,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_identity_provider_list<'a>( &'a self, silo_name: &'a types::Name, @@ -21689,7 +22619,7 @@ impl Client { let url = format!( "{}/system/silos/{}/identity-providers", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21741,6 +22671,10 @@ impl Client { /// - `silo_name`: The silo's unique name. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn silo_identity_provider_list_stream<'a>( &'a self, silo_name: &'a types::Name, @@ -21786,6 +22720,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn local_idp_user_create<'a>( &'a self, silo_name: &'a types::Name, @@ -21794,7 +22733,7 @@ impl Client { let url = format!( "{}/system/silos/{}/identity-providers/local/users", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21839,6 +22778,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn local_idp_user_delete<'a>( &'a self, silo_name: &'a types::Name, @@ -21848,7 +22792,7 @@ impl Client { "{}/system/silos/{}/identity-providers/local/users/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21873,7 +22817,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21897,6 +22841,11 @@ impl Client { /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn local_idp_user_set_password<'a>( &'a self, silo_name: &'a types::Name, @@ -21907,7 +22856,7 @@ impl Client { "{}/system/silos/{}/identity-providers/local/users/{}/set-password", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21933,7 +22882,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21952,6 +22901,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saml_identity_provider_create<'a>( &'a self, silo_name: &'a types::Name, @@ -21960,7 +22914,7 @@ impl Client { let url = format!( "{}/system/silos/{}/identity-providers/saml", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22005,6 +22959,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `provider_name`: The SAML identity provider's name + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saml_identity_provider_view<'a>( &'a self, silo_name: &'a types::Name, @@ -22014,7 +22973,7 @@ impl Client { "{}/system/silos/{}/identity-providers/saml/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22056,6 +23015,11 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_policy_view<'a>( &'a self, silo_name: &'a types::Name, @@ -22063,7 +23027,7 @@ impl Client { let url = format!( "{}/system/silos/{}/policy", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22106,6 +23070,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_policy_update<'a>( &'a self, silo_name: &'a types::Name, @@ -22114,7 +23083,7 @@ impl Client { let url = format!( "{}/system/silos/{}/policy", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22161,6 +23130,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_users_list<'a>( &'a self, silo_name: &'a types::Name, @@ -22171,7 +23145,7 @@ impl Client { let url = format!( "{}/system/silos/{}/users/all", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22222,6 +23196,10 @@ impl Client { /// - `silo_name`: The silo's unique name. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn silo_users_list_stream<'a>( &'a self, silo_name: &'a types::Name, @@ -22261,6 +23239,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_user_view<'a>( &'a self, silo_name: &'a types::Name, @@ -22270,7 +23253,7 @@ impl Client { "{}/system/silos/{}/users/id/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22315,13 +23298,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_user_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/user", self.baseurl,); + let url = format!("{}/system/user", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22370,6 +23358,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_user_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22408,6 +23400,11 @@ impl Client { /// ///Arguments: /// - `user_name`: The built-in user's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_user_view<'a>( &'a self, user_name: &'a types::Name, @@ -22415,7 +23412,7 @@ impl Client { let url = format!( "{}/system/user/{}", self.baseurl, - encode_path(&user_name.to_string()), + encode_path(&user_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22459,12 +23456,17 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn timeseries_schema_get<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!("{}/timeseries/schema", self.baseurl,); + let url = format!("{}/timeseries/schema", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22511,6 +23513,10 @@ impl Client { /// ///Arguments: /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn timeseries_schema_get_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22551,13 +23557,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn user_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/users", self.baseurl,); + let url = format!("{}/users", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22606,6 +23617,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn user_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22648,6 +23663,11 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22656,7 +23676,7 @@ impl Client { project: Option<&'a types::NameOrId>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/disks", self.baseurl,); + let url = format!("{}/v1/disks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22712,6 +23732,10 @@ impl Client { /// - `organization` /// - `project` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn disk_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22748,13 +23772,19 @@ impl Client { ///Create a disk /// ///Sends a `POST` request to `/v1/disks` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_create_v1<'a>( &'a self, organization: Option<&'a types::NameOrId>, project: &'a types::NameOrId, body: &'a types::DiskCreate, ) -> Result, Error> { - let url = format!("{}/v1/disks", self.baseurl,); + let url = format!("{}/v1/disks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22798,6 +23828,12 @@ impl Client { ///Fetch a disk /// ///Sends a `GET` request to `/v1/disks/{disk}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_view_v1<'a>( &'a self, disk: &'a types::NameOrId, @@ -22807,7 +23843,7 @@ impl Client { let url = format!( "{}/v1/disks/{}", self.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22851,6 +23887,12 @@ impl Client { ///Delete a disk /// ///Sends a `DELETE` request to `/v1/disks/{disk}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_delete_v1<'a>( &'a self, disk: &'a types::NameOrId, @@ -22860,7 +23902,7 @@ impl Client { let url = format!( "{}/v1/disks/{}", self.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22890,7 +23932,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -22912,6 +23954,11 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22920,7 +23967,7 @@ impl Client { project: Option<&'a types::NameOrId>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/instances", self.baseurl,); + let url = format!("{}/v1/instances", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22976,6 +24023,10 @@ impl Client { /// - `organization` /// - `project` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -23013,13 +24064,19 @@ impl Client { ///Create an instance /// ///Sends a `POST` request to `/v1/instances` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_create_v1<'a>( &'a self, organization: Option<&'a types::NameOrId>, project: &'a types::NameOrId, body: &'a types::InstanceCreate, ) -> Result, Error> { - let url = format!("{}/v1/instances", self.baseurl,); + let url = format!("{}/v1/instances", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -23063,6 +24120,12 @@ impl Client { ///Fetch an instance /// ///Sends a `GET` request to `/v1/instances/{instance}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_view_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23072,7 +24135,7 @@ impl Client { let url = format!( "{}/v1/instances/{}", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23116,6 +24179,12 @@ impl Client { ///Delete an instance /// ///Sends a `DELETE` request to `/v1/instances/{instance}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_delete_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23125,7 +24194,7 @@ impl Client { let url = format!( "{}/v1/instances/{}", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23155,7 +24224,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -23178,6 +24247,11 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_list_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23190,7 +24264,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/disks", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23248,6 +24322,10 @@ impl Client { /// - `organization` /// - `project` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_disk_list_v1_stream<'a>( &'a self, instance: &'a types::NameOrId, @@ -23292,6 +24370,12 @@ impl Client { ///Attach a disk to an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_attach_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23302,7 +24386,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/disks/attach", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23347,6 +24431,12 @@ impl Client { ///Detach a disk from an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_detach_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23357,7 +24447,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/disks/detach", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23402,6 +24492,12 @@ impl Client { ///Migrate an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/migrate` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_migrate_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23412,7 +24508,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/migrate", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23457,6 +24553,12 @@ impl Client { ///Reboot an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/reboot` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_reboot_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23466,7 +24568,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/reboot", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23526,6 +24628,11 @@ impl Client { /// exclusivity) /// - `organization` /// - `project` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23538,7 +24645,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/serial-console", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23592,6 +24699,12 @@ impl Client { /// ///Sends a `GET` request to /// `/v1/instances/{instance}/serial-console/stream` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_stream_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23601,7 +24714,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/serial-console/stream", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23651,6 +24764,12 @@ impl Client { ///Boot an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/start` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_start_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23660,7 +24779,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/start", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23704,6 +24823,12 @@ impl Client { ///Stop an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/stop` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_stop_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23713,7 +24838,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/stop", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23763,13 +24888,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/organizations", self.baseurl,); + let url = format!("{}/v1/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -23818,6 +24948,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn organization_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -23853,11 +24987,17 @@ impl Client { ///Create an organization /// ///Sends a `POST` request to `/v1/organizations` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_create_v1<'a>( &'a self, body: &'a types::OrganizationCreate, ) -> Result, Error> { - let url = format!("{}/v1/organizations", self.baseurl,); + let url = format!("{}/v1/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -23896,6 +25036,12 @@ impl Client { ///Fetch an organization /// ///Sends a `GET` request to `/v1/organizations/{organization}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_view_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -23903,7 +25049,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23942,6 +25088,12 @@ impl Client { ///Update an organization /// ///Sends a `PUT` request to `/v1/organizations/{organization}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_update_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -23950,7 +25102,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23990,6 +25142,12 @@ impl Client { ///Delete an organization /// ///Sends a `DELETE` request to `/v1/organizations/{organization}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_delete_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -23997,7 +25155,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24022,7 +25180,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24036,6 +25194,12 @@ impl Client { ///Fetch an organization's IAM policy /// ///Sends a `GET` request to `/v1/organizations/{organization}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_view_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -24043,7 +25207,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}/policy", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24082,6 +25246,12 @@ impl Client { ///Update an organization's IAM policy /// ///Sends a `PUT` request to `/v1/organizations/{organization}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_update_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -24090,7 +25260,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}/policy", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24137,6 +25307,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24144,7 +25319,7 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/projects", self.baseurl,); + let url = format!("{}/v1/projects", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24198,6 +25373,10 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `organization` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn project_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24233,12 +25412,18 @@ impl Client { ///Create a project /// ///Sends a `POST` request to `/v1/projects` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_create_v1<'a>( &'a self, organization: &'a types::NameOrId, body: &'a types::ProjectCreate, ) -> Result, Error> { - let url = format!("{}/v1/projects", self.baseurl,); + let url = format!("{}/v1/projects", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24281,6 +25466,12 @@ impl Client { ///Fetch a project /// ///Sends a `GET` request to `/v1/projects/{project}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_view_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24289,7 +25480,7 @@ impl Client { let url = format!( "{}/v1/projects/{}", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24332,6 +25523,12 @@ impl Client { ///Update a project /// ///Sends a `PUT` request to `/v1/projects/{project}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_update_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24341,7 +25538,7 @@ impl Client { let url = format!( "{}/v1/projects/{}", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24385,6 +25582,12 @@ impl Client { ///Delete a project /// ///Sends a `DELETE` request to `/v1/projects/{project}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_delete_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24393,7 +25596,7 @@ impl Client { let url = format!( "{}/v1/projects/{}", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24422,7 +25625,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24436,6 +25639,12 @@ impl Client { ///Fetch a project's IAM policy /// ///Sends a `GET` request to `/v1/projects/{project}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_view_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24444,7 +25653,7 @@ impl Client { let url = format!( "{}/v1/projects/{}/policy", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24487,6 +25696,12 @@ impl Client { ///Update a project's IAM policy /// ///Sends a `PUT` request to `/v1/projects/{project}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_update_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24496,7 +25711,7 @@ impl Client { let url = format!( "{}/v1/projects/{}/policy", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24546,13 +25761,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_component_version_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/system/update/components", self.baseurl,); + let url = format!("{}/v1/system/update/components", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24601,6 +25821,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_component_version_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24642,13 +25866,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn update_deployments_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/system/update/deployments", self.baseurl,); + let url = format!("{}/v1/system/update/deployments", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24697,6 +25926,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn update_deployments_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24732,6 +25965,12 @@ impl Client { ///Fetch a system update deployment /// ///Sends a `GET` request to `/v1/system/update/deployments/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn update_deployment_view<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -24739,7 +25978,7 @@ impl Client { let url = format!( "{}/v1/system/update/deployments/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24778,10 +26017,16 @@ impl Client { ///Refresh update data /// ///Sends a `POST` request to `/v1/system/update/refresh` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_refresh<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/v1/system/update/refresh", self.baseurl,); + let url = format!("{}/v1/system/update/refresh", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24805,7 +26050,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24819,11 +26064,17 @@ impl Client { ///Start system update /// ///Sends a `POST` request to `/v1/system/update/start` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_start<'a>( &'a self, body: &'a types::SystemUpdateStart, ) -> Result, Error> { - let url = format!("{}/v1/system/update/start", self.baseurl,); + let url = format!("{}/v1/system/update/start", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24864,10 +26115,16 @@ impl Client { ///If there is no update in progress, do nothing. /// ///Sends a `POST` request to `/v1/system/update/stop` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_stop<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/v1/system/update/stop", self.baseurl,); + let url = format!("{}/v1/system/update/stop", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24891,7 +26148,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24911,13 +26168,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/system/update/updates", self.baseurl,); + let url = format!("{}/v1/system/update/updates", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24966,6 +26228,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_update_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -25001,6 +26267,12 @@ impl Client { ///View system update /// ///Sends a `GET` request to `/v1/system/update/updates/{version}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_view<'a>( &'a self, version: &'a types::SemverVersion, @@ -25008,7 +26280,7 @@ impl Client { let url = format!( "{}/v1/system/update/updates/{}", self.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -25048,6 +26320,12 @@ impl Client { /// ///Sends a `GET` request to /// `/v1/system/update/updates/{version}/components` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_components_list<'a>( &'a self, version: &'a types::SemverVersion, @@ -25055,7 +26333,7 @@ impl Client { let url = format!( "{}/v1/system/update/updates/{}/components", self.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -25094,10 +26372,16 @@ impl Client { ///View system version and update status /// ///Sends a `GET` request to `/v1/system/update/version` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_version<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/v1/system/update/version", self.baseurl,); + let url = format!("{}/v1/system/update/version", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/nexus_with_timeout.rs b/progenitor-impl/tests/output/src/nexus_with_timeout.rs index e15b1393..47080faa 100644 --- a/progenitor-impl/tests/output/src/nexus_with_timeout.rs +++ b/progenitor-impl/tests/output/src/nexus_with_timeout.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -12866,7 +12874,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Oxide Region API +///Client for `Oxide Region API` /// ///API for interacting with the Oxide control plane /// @@ -12882,6 +12890,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -12901,6 +12914,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -12929,12 +12943,37 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Fetch a disk by id /// ///Use `GET /v1/disks/{disk}` instead /// ///Sends a `GET` request to `/by-id/disks/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -12942,7 +12981,7 @@ impl Client { let url = format!( "{}/by-id/disks/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -12981,6 +13020,12 @@ impl Client { ///Fetch an image by id /// ///Sends a `GET` request to `/by-id/images/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -12988,7 +13033,7 @@ impl Client { let url = format!( "{}/by-id/images/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13027,6 +13072,12 @@ impl Client { ///Fetch an instance by id /// ///Sends a `GET` request to `/by-id/instances/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13034,7 +13085,7 @@ impl Client { let url = format!( "{}/by-id/instances/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13073,6 +13124,12 @@ impl Client { ///Fetch a network interface by id /// ///Sends a `GET` request to `/by-id/network-interfaces/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13080,7 +13137,7 @@ impl Client { let url = format!( "{}/by-id/network-interfaces/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13121,6 +13178,12 @@ impl Client { ///Use `GET /v1/organizations/{organization}` instead /// ///Sends a `GET` request to `/by-id/organizations/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13128,7 +13191,7 @@ impl Client { let url = format!( "{}/by-id/organizations/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13169,6 +13232,12 @@ impl Client { ///Use `GET /v1/projects/{project}` instead /// ///Sends a `GET` request to `/by-id/projects/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13176,7 +13245,7 @@ impl Client { let url = format!( "{}/by-id/projects/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13215,6 +13284,12 @@ impl Client { ///Fetch a snapshot by id /// ///Sends a `GET` request to `/by-id/snapshots/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13222,7 +13297,7 @@ impl Client { let url = format!( "{}/by-id/snapshots/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13261,6 +13336,12 @@ impl Client { ///Fetch a route by id /// ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13268,7 +13349,7 @@ impl Client { let url = format!( "{}/by-id/vpc-router-routes/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13307,6 +13388,12 @@ impl Client { ///Get a router by id /// ///Sends a `GET` request to `/by-id/vpc-routers/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13314,7 +13401,7 @@ impl Client { let url = format!( "{}/by-id/vpc-routers/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13353,6 +13440,12 @@ impl Client { ///Fetch a subnet by id /// ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13360,7 +13453,7 @@ impl Client { let url = format!( "{}/by-id/vpc-subnets/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13399,6 +13492,12 @@ impl Client { ///Fetch a VPC /// ///Sends a `GET` request to `/by-id/vpcs/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -13406,7 +13505,7 @@ impl Client { let url = format!( "{}/by-id/vpcs/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13449,11 +13548,17 @@ impl Client { /// must be verified and confirmed prior to a token being granted. /// ///Sends a `POST` request to `/device/auth` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn device_auth_request<'a>( &'a self, body: &'a types::DeviceAuthRequest, ) -> Result, Error> { - let url = format!("{}/device/auth", self.baseurl,); + let url = format!("{}/device/auth", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13487,11 +13592,17 @@ impl Client { /// `/device/token`. /// ///Sends a `POST` request to `/device/confirm` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn device_auth_confirm<'a>( &'a self, body: &'a types::DeviceAuthVerify, ) -> Result, Error> { - let url = format!("{}/device/confirm", self.baseurl,); + let url = format!("{}/device/confirm", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13516,7 +13627,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -13533,11 +13644,17 @@ impl Client { /// verified and the grant is confirmed. /// ///Sends a `POST` request to `/device/token` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn device_access_token<'a>( &'a self, body: &'a types::DeviceAccessTokenRequest, ) -> Result, Error> { - let url = format!("{}/device/token", self.baseurl,); + let url = format!("{}/device/token", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13572,13 +13689,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn group_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/groups", self.baseurl,); + let url = format!("{}/groups", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13627,6 +13749,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn group_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -13659,11 +13785,17 @@ impl Client { } ///Sends a `POST` request to `/login` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_spoof<'a>( &'a self, body: &'a types::SpoofLoginBody, ) -> Result, Error> { - let url = format!("{}/login", self.baseurl,); + let url = format!("{}/login", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13688,7 +13820,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -13702,6 +13834,12 @@ impl Client { ///Authenticate a user (i.e., log in) via username and password /// ///Sends a `POST` request to `/login/{silo_name}/local` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_local<'a>( &'a self, silo_name: &'a types::Name, @@ -13710,7 +13848,7 @@ impl Client { let url = format!( "{}/login/{}/local", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13749,6 +13887,12 @@ impl Client { /// them to their identity provider. /// ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_saml_begin<'a>( &'a self, silo_name: &'a types::Name, @@ -13758,7 +13902,7 @@ impl Client { "{}/login/{}/saml/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13789,6 +13933,12 @@ impl Client { ///Authenticate a user (i.e., log in) via SAML /// ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn login_saml<'a, B: Into>( &'a self, silo_name: &'a types::Name, @@ -13799,7 +13949,7 @@ impl Client { "{}/login/{}/saml/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -13837,8 +13987,14 @@ impl Client { } ///Sends a `POST` request to `/logout` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn logout<'a>(&'a self) -> Result, Error> { - let url = format!("{}/logout", self.baseurl,); + let url = format!("{}/logout", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13862,7 +14018,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -13884,13 +14040,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/organizations", self.baseurl,); + let url = format!("{}/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -13941,6 +14102,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn organization_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -13978,11 +14143,17 @@ impl Client { ///Use `POST /v1/organizations` instead /// ///Sends a `POST` request to `/organizations` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_create<'a>( &'a self, body: &'a types::OrganizationCreate, ) -> Result, Error> { - let url = format!("{}/organizations", self.baseurl,); + let url = format!("{}/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -14026,6 +14197,11 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14033,7 +14209,7 @@ impl Client { let url = format!( "{}/organizations/{}", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14078,6 +14254,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_update<'a>( &'a self, organization_name: &'a types::Name, @@ -14086,7 +14267,7 @@ impl Client { let url = format!( "{}/organizations/{}", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14131,6 +14312,11 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -14138,7 +14324,7 @@ impl Client { let url = format!( "{}/organizations/{}", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14163,7 +14349,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -14182,6 +14368,11 @@ impl Client { /// ///Arguments: /// - `organization_name`: The organization's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14189,7 +14380,7 @@ impl Client { let url = format!( "{}/organizations/{}/policy", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14234,6 +14425,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_update<'a>( &'a self, organization_name: &'a types::Name, @@ -14242,7 +14438,7 @@ impl Client { let url = format!( "{}/organizations/{}/policy", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14291,6 +14487,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_list<'a>( &'a self, organization_name: &'a types::Name, @@ -14301,7 +14502,7 @@ impl Client { let url = format!( "{}/organizations/{}/projects", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14355,6 +14556,10 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn project_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -14396,6 +14601,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_create<'a>( &'a self, organization_name: &'a types::Name, @@ -14404,7 +14614,7 @@ impl Client { let url = format!( "{}/organizations/{}/projects", self.baseurl, - encode_path(&organization_name.to_string()), + encode_path(&organization_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14451,6 +14661,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14460,7 +14675,7 @@ impl Client { "{}/organizations/{}/projects/{}", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14507,6 +14722,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_update<'a>( &'a self, organization_name: &'a types::Name, @@ -14517,7 +14737,7 @@ impl Client { "{}/organizations/{}/projects/{}", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14564,6 +14784,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -14573,7 +14798,7 @@ impl Client { "{}/organizations/{}/projects/{}", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14598,7 +14823,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -14623,6 +14848,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_list<'a>( &'a self, organization_name: &'a types::Name, @@ -14635,7 +14865,7 @@ impl Client { "{}/organizations/{}/projects/{}/disks", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14690,6 +14920,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn disk_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -14738,6 +14972,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_create<'a>( &'a self, organization_name: &'a types::Name, @@ -14748,7 +14987,7 @@ impl Client { "{}/organizations/{}/projects/{}/disks", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14792,6 +15031,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_view<'a>( &'a self, organization_name: &'a types::Name, @@ -14803,7 +15048,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14844,6 +15089,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -14855,7 +15106,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), + encode_path(&disk_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14880,7 +15131,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -14907,6 +15158,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_metrics_list<'a>( &'a self, organization_name: &'a types::Name, @@ -14924,7 +15180,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&disk_name.to_string()), - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -14984,6 +15240,10 @@ impl Client { /// - `end_time`: An exclusive end time of metrics. /// - `limit`: Maximum number of items returned by a single call /// - `start_time`: An inclusive start time of metrics. + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn disk_metrics_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15054,6 +15314,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15066,7 +15331,7 @@ impl Client { "{}/organizations/{}/projects/{}/images", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15122,6 +15387,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn image_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15172,6 +15441,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_create<'a>( &'a self, organization_name: &'a types::Name, @@ -15182,7 +15456,7 @@ impl Client { "{}/organizations/{}/projects/{}/images", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15226,6 +15500,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_view<'a>( &'a self, organization_name: &'a types::Name, @@ -15237,7 +15517,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15282,6 +15562,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn image_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -15293,7 +15579,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15318,7 +15604,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -15341,6 +15627,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15353,7 +15644,7 @@ impl Client { "{}/organizations/{}/projects/{}/instances", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15406,6 +15697,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15457,6 +15752,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_create<'a>( &'a self, organization_name: &'a types::Name, @@ -15467,7 +15767,7 @@ impl Client { "{}/organizations/{}/projects/{}/instances", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15511,6 +15811,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_view<'a>( &'a self, organization_name: &'a types::Name, @@ -15522,7 +15828,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15563,6 +15869,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -15574,7 +15886,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15599,7 +15911,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -15626,6 +15938,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15640,7 +15957,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15696,6 +16013,10 @@ impl Client { /// - `instance_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_disk_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -15751,6 +16072,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/attach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_attach<'a>( &'a self, organization_name: &'a types::Name, @@ -15763,7 +16090,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15807,6 +16134,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/disks/detach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_detach<'a>( &'a self, organization_name: &'a types::Name, @@ -15819,7 +16152,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15861,6 +16194,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/external-ips` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_external_ip_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15872,7 +16211,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15915,6 +16254,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/migrate` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_migrate<'a>( &'a self, organization_name: &'a types::Name, @@ -15927,7 +16272,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -15978,6 +16323,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_list<'a>( &'a self, organization_name: &'a types::Name, @@ -15992,7 +16342,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16046,6 +16396,10 @@ impl Client { /// - `instance_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_network_interface_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -16100,6 +16454,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_create<'a>( &'a self, organization_name: &'a types::Name, @@ -16112,7 +16472,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16154,6 +16514,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_view<'a>( &'a self, organization_name: &'a types::Name, @@ -16167,7 +16533,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16208,6 +16574,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_update<'a>( &'a self, organization_name: &'a types::Name, @@ -16222,7 +16594,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16269,6 +16641,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/network-interfaces/{interface_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_network_interface_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -16282,7 +16660,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), + encode_path(&interface_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16307,7 +16685,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -16325,6 +16703,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/reboot` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_reboot<'a>( &'a self, organization_name: &'a types::Name, @@ -16336,7 +16720,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16395,6 +16779,11 @@ impl Client { /// read, counting *backward* from the most recently buffered data /// retrieved from the instance. (See note on `from_start` about mutual /// exclusivity) + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console<'a>( &'a self, organization_name: &'a types::Name, @@ -16409,7 +16798,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16461,6 +16850,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -16472,7 +16867,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16515,6 +16910,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/serial-console/stream_v2` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_stream_v2<'a>( &'a self, organization_name: &'a types::Name, @@ -16526,7 +16927,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16575,6 +16976,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/start` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_start<'a>( &'a self, organization_name: &'a types::Name, @@ -16586,7 +16993,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16629,6 +17036,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/instances/ /// {instance_name}/stop` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_stop<'a>( &'a self, organization_name: &'a types::Name, @@ -16640,7 +17053,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), + encode_path(&instance_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16686,6 +17099,11 @@ impl Client { ///Arguments: /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_view<'a>( &'a self, organization_name: &'a types::Name, @@ -16695,7 +17113,7 @@ impl Client { "{}/organizations/{}/projects/{}/policy", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16740,6 +17158,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_update<'a>( &'a self, organization_name: &'a types::Name, @@ -16750,7 +17173,7 @@ impl Client { "{}/organizations/{}/projects/{}/policy", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16799,6 +17222,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_list<'a>( &'a self, organization_name: &'a types::Name, @@ -16811,7 +17239,7 @@ impl Client { "{}/organizations/{}/projects/{}/snapshots", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16864,6 +17292,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn snapshot_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -16915,6 +17347,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_create<'a>( &'a self, organization_name: &'a types::Name, @@ -16925,7 +17362,7 @@ impl Client { "{}/organizations/{}/projects/{}/snapshots", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -16967,6 +17404,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_view<'a>( &'a self, organization_name: &'a types::Name, @@ -16978,7 +17421,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17019,6 +17462,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/snapshots/ /// {snapshot_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn snapshot_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -17030,7 +17479,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), + encode_path(&snapshot_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17055,7 +17504,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -17078,6 +17527,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_list<'a>( &'a self, organization_name: &'a types::Name, @@ -17090,7 +17544,7 @@ impl Client { "{}/organizations/{}/projects/{}/vpcs", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17143,6 +17597,10 @@ impl Client { /// - `project_name`: The project's unique name within the organization. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -17191,6 +17649,11 @@ impl Client { /// - `organization_name`: The organization's unique name. /// - `project_name`: The project's unique name within the organization. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_create<'a>( &'a self, organization_name: &'a types::Name, @@ -17201,7 +17664,7 @@ impl Client { "{}/organizations/{}/projects/{}/vpcs", self.baseurl, encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), + encode_path(&project_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17243,6 +17706,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_view<'a>( &'a self, organization_name: &'a types::Name, @@ -17254,7 +17723,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17295,6 +17764,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_update<'a>( &'a self, organization_name: &'a types::Name, @@ -17307,7 +17782,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17349,6 +17824,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -17360,7 +17841,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17385,7 +17866,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -17401,6 +17882,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_firewall_rules_view<'a>( &'a self, organization_name: &'a types::Name, @@ -17412,7 +17899,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17453,6 +17940,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/firewall/rules` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_firewall_rules_update<'a>( &'a self, organization_name: &'a types::Name, @@ -17465,7 +17958,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17516,6 +18009,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_list<'a>( &'a self, organization_name: &'a types::Name, @@ -17530,7 +18028,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17584,6 +18082,10 @@ impl Client { /// - `vpc_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_router_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -17638,6 +18140,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_create<'a>( &'a self, organization_name: &'a types::Name, @@ -17650,7 +18158,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17692,6 +18200,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_view<'a>( &'a self, organization_name: &'a types::Name, @@ -17705,7 +18219,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17746,6 +18260,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_update<'a>( &'a self, organization_name: &'a types::Name, @@ -17760,7 +18280,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17802,6 +18322,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -17815,7 +18341,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17840,7 +18366,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -17868,6 +18394,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_list<'a>( &'a self, organization_name: &'a types::Name, @@ -17884,7 +18415,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -17942,6 +18473,10 @@ impl Client { /// - `router_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_router_route_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -17999,6 +18534,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_create<'a>( &'a self, organization_name: &'a types::Name, @@ -18013,7 +18554,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), + encode_path(&router_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18055,6 +18596,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_view<'a>( &'a self, organization_name: &'a types::Name, @@ -18070,7 +18617,7 @@ impl Client { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18111,6 +18658,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_update<'a>( &'a self, organization_name: &'a types::Name, @@ -18127,7 +18680,7 @@ impl Client { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18169,6 +18722,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_router_route_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -18184,7 +18743,7 @@ impl Client { encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), encode_path(&router_name.to_string()), - encode_path(&route_name.to_string()), + encode_path(&route_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18209,7 +18768,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -18234,6 +18793,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_list<'a>( &'a self, organization_name: &'a types::Name, @@ -18248,7 +18812,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18302,6 +18866,10 @@ impl Client { /// - `vpc_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_subnet_list_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -18356,6 +18924,12 @@ impl Client { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_create<'a>( &'a self, organization_name: &'a types::Name, @@ -18368,7 +18942,7 @@ impl Client { self.baseurl, encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), + encode_path(&vpc_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18410,6 +18984,12 @@ impl Client { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_view<'a>( &'a self, organization_name: &'a types::Name, @@ -18423,7 +19003,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18464,6 +19044,12 @@ impl Client { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_update<'a>( &'a self, organization_name: &'a types::Name, @@ -18478,7 +19064,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18520,6 +19106,12 @@ impl Client { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_delete<'a>( &'a self, organization_name: &'a types::Name, @@ -18533,7 +19125,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18558,7 +19150,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -18584,6 +19176,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn vpc_subnet_list_network_interfaces<'a>( &'a self, organization_name: &'a types::Name, @@ -18600,7 +19197,7 @@ impl Client { encode_path(&organization_name.to_string()), encode_path(&project_name.to_string()), encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), + encode_path(&subnet_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18656,6 +19253,10 @@ impl Client { /// - `subnet_name` /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn vpc_subnet_list_network_interfaces_stream<'a>( &'a self, organization_name: &'a types::Name, @@ -18711,10 +19312,16 @@ impl Client { ///Fetch the current silo's IAM policy /// ///Sends a `GET` request to `/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn policy_view<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/policy", self.baseurl,); + let url = format!("{}/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18752,11 +19359,17 @@ impl Client { ///Update the current silo's IAM policy /// ///Sends a `PUT` request to `/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn policy_update<'a>( &'a self, body: &'a types::SiloRolePolicy, ) -> Result, Error> { - let url = format!("{}/policy", self.baseurl,); + let url = format!("{}/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18800,12 +19413,17 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn role_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!("{}/roles", self.baseurl,); + let url = format!("{}/roles", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18852,6 +19470,10 @@ impl Client { /// ///Arguments: /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn role_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -18888,6 +19510,11 @@ impl Client { /// ///Arguments: /// - `role_name`: The built-in role's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn role_view<'a>( &'a self, role_name: &'a str, @@ -18895,7 +19522,7 @@ impl Client { let url = format!( "{}/roles/{}", self.baseurl, - encode_path(&role_name.to_string()), + encode_path(&role_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -18934,10 +19561,16 @@ impl Client { ///Fetch the user associated with the current session /// ///Sends a `GET` request to `/session/me` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_me<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/session/me", self.baseurl,); + let url = format!("{}/session/me", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -18981,13 +19614,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_me_groups<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/session/me/groups", self.baseurl,); + let url = format!("{}/session/me/groups", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19036,6 +19674,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn session_me_groups_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19078,13 +19720,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/session/me/sshkeys", self.baseurl,); + let url = format!("{}/session/me/sshkeys", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19135,6 +19782,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn session_sshkey_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19171,11 +19822,17 @@ impl Client { ///Create an SSH public key for the currently authenticated user. /// ///Sends a `POST` request to `/session/me/sshkeys` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_create<'a>( &'a self, body: &'a types::SshKeyCreate, ) -> Result, Error> { - let url = format!("{}/session/me/sshkeys", self.baseurl,); + let url = format!("{}/session/me/sshkeys", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19217,6 +19874,12 @@ impl Client { /// user. /// ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_view<'a>( &'a self, ssh_key_name: &'a types::Name, @@ -19224,7 +19887,7 @@ impl Client { let url = format!( "{}/session/me/sshkeys/{}", self.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19266,6 +19929,12 @@ impl Client { /// user. /// ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn session_sshkey_delete<'a>( &'a self, ssh_key_name: &'a types::Name, @@ -19273,7 +19942,7 @@ impl Client { let url = format!( "{}/session/me/sshkeys/{}", self.baseurl, - encode_path(&ssh_key_name.to_string()), + encode_path(&ssh_key_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19298,7 +19967,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -19312,6 +19981,12 @@ impl Client { ///Fetch a system-wide image by id /// ///Sends a `GET` request to `/system/by-id/images/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -19319,7 +19994,7 @@ impl Client { let url = format!( "{}/system/by-id/images/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19358,6 +20033,12 @@ impl Client { ///Fetch an IP pool by id /// ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -19365,7 +20046,7 @@ impl Client { let url = format!( "{}/system/by-id/ip-pools/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19404,6 +20085,12 @@ impl Client { ///Fetch a silo by id /// ///Sends a `GET` request to `/system/by-id/silos/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_view_by_id<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -19411,7 +20098,7 @@ impl Client { let url = format!( "{}/system/by-id/silos/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19460,13 +20147,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/certificates", self.baseurl,); + let url = format!("{}/system/certificates", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19519,6 +20211,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn certificate_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19557,11 +20253,17 @@ impl Client { /// serve external connections. /// ///Sends a `POST` request to `/system/certificates` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_create<'a>( &'a self, body: &'a types::CertificateCreate, ) -> Result, Error> { - let url = format!("{}/system/certificates", self.baseurl,); + let url = format!("{}/system/certificates", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19599,9 +20301,15 @@ impl Client { ///Fetch a certificate /// - ///Returns the details of a specific certificate + ///Returns the details of a specific certificate + /// + ///Sends a `GET` request to `/system/certificates/{certificate}` + /// + /// + ///# Errors /// - ///Sends a `GET` request to `/system/certificates/{certificate}` + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_view<'a>( &'a self, certificate: &'a types::NameOrId, @@ -19609,7 +20317,7 @@ impl Client { let url = format!( "{}/system/certificates/{}", self.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19650,6 +20358,12 @@ impl Client { ///Permanently delete a certificate. This operation cannot be undone. /// ///Sends a `DELETE` request to `/system/certificates/{certificate}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn certificate_delete<'a>( &'a self, certificate: &'a types::NameOrId, @@ -19657,7 +20371,7 @@ impl Client { let url = format!( "{}/system/certificates/{}", self.baseurl, - encode_path(&certificate.to_string()), + encode_path(&certificate.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19682,7 +20396,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -19702,13 +20416,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn physical_disk_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/hardware/disks", self.baseurl,); + let url = format!("{}/system/hardware/disks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19757,6 +20476,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn physical_disk_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19798,13 +20521,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn rack_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/hardware/racks", self.baseurl,); + let url = format!("{}/system/hardware/racks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19853,6 +20581,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn rack_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -19890,6 +20622,11 @@ impl Client { /// ///Arguments: /// - `rack_id`: The rack's unique ID. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn rack_view<'a>( &'a self, rack_id: &'a ::uuid::Uuid, @@ -19897,7 +20634,7 @@ impl Client { let url = format!( "{}/system/hardware/racks/{}", self.baseurl, - encode_path(&rack_id.to_string()), + encode_path(&rack_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -19942,13 +20679,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn sled_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/hardware/sleds", self.baseurl,); + let url = format!("{}/system/hardware/sleds", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -19997,6 +20739,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn sled_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -20034,6 +20780,11 @@ impl Client { /// ///Arguments: /// - `sled_id`: The sled's unique ID. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn sled_view<'a>( &'a self, sled_id: &'a ::uuid::Uuid, @@ -20041,7 +20792,7 @@ impl Client { let url = format!( "{}/system/hardware/sleds/{}", self.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20087,6 +20838,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn sled_physical_disk_list<'a>( &'a self, sled_id: &'a ::uuid::Uuid, @@ -20097,7 +20853,7 @@ impl Client { let url = format!( "{}/system/hardware/sleds/{}/disks", self.baseurl, - encode_path(&sled_id.to_string()), + encode_path(&sled_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20149,6 +20905,10 @@ impl Client { /// - `sled_id`: The sled's unique ID. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn sled_physical_disk_list_stream<'a>( &'a self, sled_id: &'a ::uuid::Uuid, @@ -20195,13 +20955,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/images", self.baseurl,); + let url = format!("{}/system/images", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20254,6 +21019,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_image_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -20292,11 +21061,17 @@ impl Client { /// in any silo as a base for instances. /// ///Sends a `POST` request to `/system/images` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_create<'a>( &'a self, body: &'a types::GlobalImageCreate, ) -> Result, Error> { - let url = format!("{}/system/images", self.baseurl,); + let url = format!("{}/system/images", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20337,6 +21112,12 @@ impl Client { ///Returns the details of a specific system-wide image. /// ///Sends a `GET` request to `/system/images/{image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_view<'a>( &'a self, image_name: &'a types::Name, @@ -20344,7 +21125,7 @@ impl Client { let url = format!( "{}/system/images/{}", self.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20387,6 +21168,12 @@ impl Client { /// new instances can not be created with this image. /// ///Sends a `DELETE` request to `/system/images/{image_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_image_delete<'a>( &'a self, image_name: &'a types::Name, @@ -20394,7 +21181,7 @@ impl Client { let url = format!( "{}/system/images/{}", self.baseurl, - encode_path(&image_name.to_string()), + encode_path(&image_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20419,7 +21206,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -20439,13 +21226,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/ip-pools", self.baseurl,); + let url = format!("{}/system/ip-pools", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20494,6 +21286,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn ip_pool_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -20528,11 +21324,17 @@ impl Client { ///Create an IP pool /// ///Sends a `POST` request to `/system/ip-pools` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_create<'a>( &'a self, body: &'a types::IpPoolCreate, ) -> Result, Error> { - let url = format!("{}/system/ip-pools", self.baseurl,); + let url = format!("{}/system/ip-pools", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20571,6 +21373,12 @@ impl Client { ///Fetch an IP pool /// ///Sends a `GET` request to `/system/ip-pools/{pool_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_view<'a>( &'a self, pool_name: &'a types::Name, @@ -20578,7 +21386,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20617,6 +21425,12 @@ impl Client { ///Update an IP Pool /// ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_update<'a>( &'a self, pool_name: &'a types::Name, @@ -20625,7 +21439,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20665,6 +21479,12 @@ impl Client { ///Delete an IP Pool /// ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_delete<'a>( &'a self, pool_name: &'a types::Name, @@ -20672,7 +21492,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20697,7 +21517,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -20719,6 +21539,11 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_range_list<'a>( &'a self, pool_name: &'a types::Name, @@ -20728,7 +21553,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}/ranges", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20779,6 +21604,10 @@ impl Client { ///Arguments: /// - `pool_name` /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn ip_pool_range_list_stream<'a>( &'a self, pool_name: &'a types::Name, @@ -20814,6 +21643,12 @@ impl Client { ///Add a range to an IP pool /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_range_add<'a>( &'a self, pool_name: &'a types::Name, @@ -20822,7 +21657,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}/ranges/add", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20862,6 +21697,12 @@ impl Client { ///Remove a range from an IP pool /// ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/remove` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_range_remove<'a>( &'a self, pool_name: &'a types::Name, @@ -20870,7 +21711,7 @@ impl Client { let url = format!( "{}/system/ip-pools/{}/ranges/remove", self.baseurl, - encode_path(&pool_name.to_string()), + encode_path(&pool_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -20896,7 +21737,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -20910,10 +21751,16 @@ impl Client { ///Fetch the IP pool used for Oxide services /// ///Sends a `GET` request to `/system/ip-pools-service` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_view<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service", self.baseurl,); + let url = format!("{}/system/ip-pools-service", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -20958,12 +21805,17 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_range_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service/ranges", self.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21012,6 +21864,10 @@ impl Client { /// ///Arguments: /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn ip_pool_service_range_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -21046,11 +21902,17 @@ impl Client { ///Add a range to an IP pool used for Oxide services /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_range_add<'a>( &'a self, body: &'a types::IpRange, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service/ranges/add", self.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/add", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21089,11 +21951,17 @@ impl Client { ///Remove a range from an IP pool used for Oxide services /// ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn ip_pool_service_range_remove<'a>( &'a self, body: &'a types::IpRange, ) -> Result, Error> { - let url = format!("{}/system/ip-pools-service/ranges/remove", self.baseurl,); + let url = format!("{}/system/ip-pools-service/ranges/remove", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21118,7 +21986,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21141,6 +22009,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `start_time`: An inclusive start time of metrics. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_metric<'a>( &'a self, metric_name: types::SystemMetricName, @@ -21153,7 +22026,7 @@ impl Client { let url = format!( "{}/system/metrics/{}", self.baseurl, - encode_path(&metric_name.to_string()), + encode_path(&metric_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21203,10 +22076,16 @@ impl Client { ///Fetch the top-level IAM policy /// ///Sends a `GET` request to `/system/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_policy_view<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/system/policy", self.baseurl,); + let url = format!("{}/system/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21244,11 +22123,17 @@ impl Client { ///Update the top-level IAM policy /// ///Sends a `PUT` request to `/system/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_policy_update<'a>( &'a self, body: &'a types::FleetRolePolicy, ) -> Result, Error> { - let url = format!("{}/system/policy", self.baseurl,); + let url = format!("{}/system/policy", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21293,13 +22178,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saga_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/sagas", self.baseurl,); + let url = format!("{}/system/sagas", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21348,6 +22238,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn saga_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -21382,6 +22276,12 @@ impl Client { ///Fetch a saga /// ///Sends a `GET` request to `/system/sagas/{saga_id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saga_view<'a>( &'a self, saga_id: &'a ::uuid::Uuid, @@ -21389,7 +22289,7 @@ impl Client { let url = format!( "{}/system/sagas/{}", self.baseurl, - encode_path(&saga_id.to_string()), + encode_path(&saga_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21436,13 +22336,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/silos", self.baseurl,); + let url = format!("{}/system/silos", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21493,6 +22398,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn silo_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -21527,11 +22436,17 @@ impl Client { ///Create a silo /// ///Sends a `POST` request to `/system/silos` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_create<'a>( &'a self, body: &'a types::SiloCreate, ) -> Result, Error> { - let url = format!("{}/system/silos", self.baseurl,); + let url = format!("{}/system/silos", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -21575,6 +22490,11 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_view<'a>( &'a self, silo_name: &'a types::Name, @@ -21582,7 +22502,7 @@ impl Client { let url = format!( "{}/system/silos/{}", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21626,6 +22546,11 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_delete<'a>( &'a self, silo_name: &'a types::Name, @@ -21633,7 +22558,7 @@ impl Client { let url = format!( "{}/system/silos/{}", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21658,7 +22583,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21679,6 +22604,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_identity_provider_list<'a>( &'a self, silo_name: &'a types::Name, @@ -21689,7 +22619,7 @@ impl Client { let url = format!( "{}/system/silos/{}/identity-providers", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21741,6 +22671,10 @@ impl Client { /// - `silo_name`: The silo's unique name. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn silo_identity_provider_list_stream<'a>( &'a self, silo_name: &'a types::Name, @@ -21786,6 +22720,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn local_idp_user_create<'a>( &'a self, silo_name: &'a types::Name, @@ -21794,7 +22733,7 @@ impl Client { let url = format!( "{}/system/silos/{}/identity-providers/local/users", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21839,6 +22778,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn local_idp_user_delete<'a>( &'a self, silo_name: &'a types::Name, @@ -21848,7 +22792,7 @@ impl Client { "{}/system/silos/{}/identity-providers/local/users/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21873,7 +22817,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21897,6 +22841,11 @@ impl Client { /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn local_idp_user_set_password<'a>( &'a self, silo_name: &'a types::Name, @@ -21907,7 +22856,7 @@ impl Client { "{}/system/silos/{}/identity-providers/local/users/{}/set-password", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -21933,7 +22882,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -21952,6 +22901,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saml_identity_provider_create<'a>( &'a self, silo_name: &'a types::Name, @@ -21960,7 +22914,7 @@ impl Client { let url = format!( "{}/system/silos/{}/identity-providers/saml", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22005,6 +22959,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `provider_name`: The SAML identity provider's name + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn saml_identity_provider_view<'a>( &'a self, silo_name: &'a types::Name, @@ -22014,7 +22973,7 @@ impl Client { "{}/system/silos/{}/identity-providers/saml/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), + encode_path(&provider_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22056,6 +23015,11 @@ impl Client { /// ///Arguments: /// - `silo_name`: The silo's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_policy_view<'a>( &'a self, silo_name: &'a types::Name, @@ -22063,7 +23027,7 @@ impl Client { let url = format!( "{}/system/silos/{}/policy", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22106,6 +23070,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `body` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_policy_update<'a>( &'a self, silo_name: &'a types::Name, @@ -22114,7 +23083,7 @@ impl Client { let url = format!( "{}/system/silos/{}/policy", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22161,6 +23130,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_users_list<'a>( &'a self, silo_name: &'a types::Name, @@ -22171,7 +23145,7 @@ impl Client { let url = format!( "{}/system/silos/{}/users/all", self.baseurl, - encode_path(&silo_name.to_string()), + encode_path(&silo_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22222,6 +23196,10 @@ impl Client { /// - `silo_name`: The silo's unique name. /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn silo_users_list_stream<'a>( &'a self, silo_name: &'a types::Name, @@ -22261,6 +23239,11 @@ impl Client { ///Arguments: /// - `silo_name`: The silo's unique name. /// - `user_id`: The user's internal id + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn silo_user_view<'a>( &'a self, silo_name: &'a types::Name, @@ -22270,7 +23253,7 @@ impl Client { "{}/system/silos/{}/users/id/{}", self.baseurl, encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), + encode_path(&user_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22315,13 +23298,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_user_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/system/user", self.baseurl,); + let url = format!("{}/system/user", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22370,6 +23358,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_user_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22408,6 +23400,11 @@ impl Client { /// ///Arguments: /// - `user_name`: The built-in user's unique name. + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_user_view<'a>( &'a self, user_name: &'a types::Name, @@ -22415,7 +23412,7 @@ impl Client { let url = format!( "{}/system/user/{}", self.baseurl, - encode_path(&user_name.to_string()), + encode_path(&user_name.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22459,12 +23456,17 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn timeseries_schema_get<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!("{}/timeseries/schema", self.baseurl,); + let url = format!("{}/timeseries/schema", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22511,6 +23513,10 @@ impl Client { /// ///Arguments: /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn timeseries_schema_get_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22551,13 +23557,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn user_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/users", self.baseurl,); + let url = format!("{}/users", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22606,6 +23617,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn user_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22648,6 +23663,11 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22656,7 +23676,7 @@ impl Client { project: Option<&'a types::NameOrId>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/disks", self.baseurl,); + let url = format!("{}/v1/disks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22712,6 +23732,10 @@ impl Client { /// - `organization` /// - `project` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn disk_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22748,13 +23772,19 @@ impl Client { ///Create a disk /// ///Sends a `POST` request to `/v1/disks` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_create_v1<'a>( &'a self, organization: Option<&'a types::NameOrId>, project: &'a types::NameOrId, body: &'a types::DiskCreate, ) -> Result, Error> { - let url = format!("{}/v1/disks", self.baseurl,); + let url = format!("{}/v1/disks", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22798,6 +23828,12 @@ impl Client { ///Fetch a disk /// ///Sends a `GET` request to `/v1/disks/{disk}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_view_v1<'a>( &'a self, disk: &'a types::NameOrId, @@ -22807,7 +23843,7 @@ impl Client { let url = format!( "{}/v1/disks/{}", self.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22851,6 +23887,12 @@ impl Client { ///Delete a disk /// ///Sends a `DELETE` request to `/v1/disks/{disk}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn disk_delete_v1<'a>( &'a self, disk: &'a types::NameOrId, @@ -22860,7 +23902,7 @@ impl Client { let url = format!( "{}/v1/disks/{}", self.baseurl, - encode_path(&disk.to_string()), + encode_path(&disk.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -22890,7 +23932,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -22912,6 +23954,11 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -22920,7 +23967,7 @@ impl Client { project: Option<&'a types::NameOrId>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/instances", self.baseurl,); + let url = format!("{}/v1/instances", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -22976,6 +24023,10 @@ impl Client { /// - `organization` /// - `project` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -23013,13 +24064,19 @@ impl Client { ///Create an instance /// ///Sends a `POST` request to `/v1/instances` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_create_v1<'a>( &'a self, organization: Option<&'a types::NameOrId>, project: &'a types::NameOrId, body: &'a types::InstanceCreate, ) -> Result, Error> { - let url = format!("{}/v1/instances", self.baseurl,); + let url = format!("{}/v1/instances", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -23063,6 +24120,12 @@ impl Client { ///Fetch an instance /// ///Sends a `GET` request to `/v1/instances/{instance}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_view_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23072,7 +24135,7 @@ impl Client { let url = format!( "{}/v1/instances/{}", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23116,6 +24179,12 @@ impl Client { ///Delete an instance /// ///Sends a `DELETE` request to `/v1/instances/{instance}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_delete_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23125,7 +24194,7 @@ impl Client { let url = format!( "{}/v1/instances/{}", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23155,7 +24224,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -23178,6 +24247,11 @@ impl Client { /// subsequent page /// - `project` /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_list_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23190,7 +24264,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/disks", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23248,6 +24322,10 @@ impl Client { /// - `organization` /// - `project` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn instance_disk_list_v1_stream<'a>( &'a self, instance: &'a types::NameOrId, @@ -23292,6 +24370,12 @@ impl Client { ///Attach a disk to an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_attach_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23302,7 +24386,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/disks/attach", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23347,6 +24431,12 @@ impl Client { ///Detach a disk from an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_disk_detach_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23357,7 +24447,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/disks/detach", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23402,6 +24492,12 @@ impl Client { ///Migrate an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/migrate` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_migrate_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23412,7 +24508,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/migrate", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23457,6 +24553,12 @@ impl Client { ///Reboot an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/reboot` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_reboot_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23466,7 +24568,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/reboot", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23526,6 +24628,11 @@ impl Client { /// exclusivity) /// - `organization` /// - `project` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23538,7 +24645,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/serial-console", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23592,6 +24699,12 @@ impl Client { /// ///Sends a `GET` request to /// `/v1/instances/{instance}/serial-console/stream` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial_console_stream_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23601,7 +24714,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/serial-console/stream", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23651,6 +24764,12 @@ impl Client { ///Boot an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/start` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_start_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23660,7 +24779,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/start", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23704,6 +24823,12 @@ impl Client { ///Stop an instance /// ///Sends a `POST` request to `/v1/instances/{instance}/stop` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_stop_v1<'a>( &'a self, instance: &'a types::NameOrId, @@ -23713,7 +24838,7 @@ impl Client { let url = format!( "{}/v1/instances/{}/stop", self.baseurl, - encode_path(&instance.to_string()), + encode_path(&instance.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23763,13 +24888,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/organizations", self.baseurl,); + let url = format!("{}/v1/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -23818,6 +24948,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn organization_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -23853,11 +24987,17 @@ impl Client { ///Create an organization /// ///Sends a `POST` request to `/v1/organizations` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_create_v1<'a>( &'a self, body: &'a types::OrganizationCreate, ) -> Result, Error> { - let url = format!("{}/v1/organizations", self.baseurl,); + let url = format!("{}/v1/organizations", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -23896,6 +25036,12 @@ impl Client { ///Fetch an organization /// ///Sends a `GET` request to `/v1/organizations/{organization}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_view_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -23903,7 +25049,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23942,6 +25088,12 @@ impl Client { ///Update an organization /// ///Sends a `PUT` request to `/v1/organizations/{organization}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_update_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -23950,7 +25102,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -23990,6 +25142,12 @@ impl Client { ///Delete an organization /// ///Sends a `DELETE` request to `/v1/organizations/{organization}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_delete_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -23997,7 +25155,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24022,7 +25180,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24036,6 +25194,12 @@ impl Client { ///Fetch an organization's IAM policy /// ///Sends a `GET` request to `/v1/organizations/{organization}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_view_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -24043,7 +25207,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}/policy", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24082,6 +25246,12 @@ impl Client { ///Update an organization's IAM policy /// ///Sends a `PUT` request to `/v1/organizations/{organization}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn organization_policy_update_v1<'a>( &'a self, organization: &'a types::NameOrId, @@ -24090,7 +25260,7 @@ impl Client { let url = format!( "{}/v1/organizations/{}/policy", self.baseurl, - encode_path(&organization.to_string()), + encode_path(&organization.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24137,6 +25307,11 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_list_v1<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24144,7 +25319,7 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/projects", self.baseurl,); + let url = format!("{}/v1/projects", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24198,6 +25373,10 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `organization` /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn project_list_v1_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24233,12 +25412,18 @@ impl Client { ///Create a project /// ///Sends a `POST` request to `/v1/projects` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_create_v1<'a>( &'a self, organization: &'a types::NameOrId, body: &'a types::ProjectCreate, ) -> Result, Error> { - let url = format!("{}/v1/projects", self.baseurl,); + let url = format!("{}/v1/projects", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24281,6 +25466,12 @@ impl Client { ///Fetch a project /// ///Sends a `GET` request to `/v1/projects/{project}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_view_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24289,7 +25480,7 @@ impl Client { let url = format!( "{}/v1/projects/{}", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24332,6 +25523,12 @@ impl Client { ///Update a project /// ///Sends a `PUT` request to `/v1/projects/{project}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_update_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24341,7 +25538,7 @@ impl Client { let url = format!( "{}/v1/projects/{}", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24385,6 +25582,12 @@ impl Client { ///Delete a project /// ///Sends a `DELETE` request to `/v1/projects/{project}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_delete_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24393,7 +25596,7 @@ impl Client { let url = format!( "{}/v1/projects/{}", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24422,7 +25625,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24436,6 +25639,12 @@ impl Client { ///Fetch a project's IAM policy /// ///Sends a `GET` request to `/v1/projects/{project}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_view_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24444,7 +25653,7 @@ impl Client { let url = format!( "{}/v1/projects/{}/policy", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24487,6 +25696,12 @@ impl Client { ///Update a project's IAM policy /// ///Sends a `PUT` request to `/v1/projects/{project}/policy` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn project_policy_update_v1<'a>( &'a self, project: &'a types::NameOrId, @@ -24496,7 +25711,7 @@ impl Client { let url = format!( "{}/v1/projects/{}/policy", self.baseurl, - encode_path(&project.to_string()), + encode_path(&project.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24546,13 +25761,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_component_version_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/system/update/components", self.baseurl,); + let url = format!("{}/v1/system/update/components", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24601,6 +25821,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_component_version_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24642,13 +25866,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn update_deployments_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/system/update/deployments", self.baseurl,); + let url = format!("{}/v1/system/update/deployments", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24697,6 +25926,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn update_deployments_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -24732,6 +25965,12 @@ impl Client { ///Fetch a system update deployment /// ///Sends a `GET` request to `/v1/system/update/deployments/{id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn update_deployment_view<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -24739,7 +25978,7 @@ impl Client { let url = format!( "{}/v1/system/update/deployments/{}", self.baseurl, - encode_path(&id.to_string()), + encode_path(&id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -24778,10 +26017,16 @@ impl Client { ///Refresh update data /// ///Sends a `POST` request to `/v1/system/update/refresh` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_refresh<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/v1/system/update/refresh", self.baseurl,); + let url = format!("{}/v1/system/update/refresh", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24805,7 +26050,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24819,11 +26064,17 @@ impl Client { ///Start system update /// ///Sends a `POST` request to `/v1/system/update/start` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_start<'a>( &'a self, body: &'a types::SystemUpdateStart, ) -> Result, Error> { - let url = format!("{}/v1/system/update/start", self.baseurl,); + let url = format!("{}/v1/system/update/start", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24864,10 +26115,16 @@ impl Client { ///If there is no update in progress, do nothing. /// ///Sends a `POST` request to `/v1/system/update/stop` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_stop<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/v1/system/update/stop", self.baseurl,); + let url = format!("{}/v1/system/update/stop", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24891,7 +26148,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -24911,13 +26168,18 @@ impl Client { /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page /// - `sort_by` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_list<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!("{}/v1/system/update/updates", self.baseurl,); + let url = format!("{}/v1/system/update/updates", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -24966,6 +26228,10 @@ impl Client { ///Arguments: /// - `limit`: Maximum number of items returned by a single call /// - `sort_by` + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn system_update_list_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, @@ -25001,6 +26267,12 @@ impl Client { ///View system update /// ///Sends a `GET` request to `/v1/system/update/updates/{version}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_view<'a>( &'a self, version: &'a types::SemverVersion, @@ -25008,7 +26280,7 @@ impl Client { let url = format!( "{}/v1/system/update/updates/{}", self.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -25048,6 +26320,12 @@ impl Client { /// ///Sends a `GET` request to /// `/v1/system/update/updates/{version}/components` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_update_components_list<'a>( &'a self, version: &'a types::SemverVersion, @@ -25055,7 +26333,7 @@ impl Client { let url = format!( "{}/v1/system/update/updates/{}/components", self.baseurl, - encode_path(&version.to_string()), + encode_path(&version.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -25094,10 +26372,16 @@ impl Client { ///View system version and update status /// ///Sends a `GET` request to `/v1/system/update/version` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn system_version<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/v1/system/update/version", self.baseurl,); + let url = format!("{}/v1/system/update/version", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/param_collision_builder.rs b/progenitor-impl/tests/output/src/param_collision_builder.rs index 1586c732..86253a7a 100644 --- a/progenitor-impl/tests/output/src/param_collision_builder.rs +++ b/progenitor-impl/tests/output/src/param_collision_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -37,7 +45,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Parameter name collision test +///Client for `Parameter name collision test` /// ///Minimal API for testing collision between parameter names and generated code /// @@ -53,6 +61,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -72,6 +85,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -111,7 +125,12 @@ impl Client { /// - `response`: Parameter name that was previously colliding /// - `result`: Parameter name that was previously colliding /// - `url`: Parameter name that was previously colliding - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.key_get() /// .query(query) /// .client(client) @@ -129,6 +148,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -151,6 +185,10 @@ pub mod builder { } impl<'a> KeyGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { _client: client, @@ -224,6 +262,11 @@ pub mod builder { } ///Sends a `GET` request to `/key/{query}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { _client, @@ -243,7 +286,7 @@ pub mod builder { let _url = format!( "{}/key/{}", _client.baseurl, - encode_path(&query.to_string()), + encode_path(&query.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -269,7 +312,7 @@ pub mod builder { _client.post(&_result, &info).await?; let _response = _result?; match _response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(_response)), + 200u16 => Ok(ResponseValue::empty(&_response)), _ => Err(Error::UnexpectedResponse(_response)), } } diff --git a/progenitor-impl/tests/output/src/param_collision_builder_tagged.rs b/progenitor-impl/tests/output/src/param_collision_builder_tagged.rs index 84814914..791c0ed1 100644 --- a/progenitor-impl/tests/output/src/param_collision_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/param_collision_builder_tagged.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -37,7 +45,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Parameter name collision test +///Client for `Parameter name collision test` /// ///Minimal API for testing collision between parameter names and generated code /// @@ -53,6 +61,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -72,6 +85,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -111,7 +125,12 @@ impl Client { /// - `response`: Parameter name that was previously colliding /// - `result`: Parameter name that was previously colliding /// - `url`: Parameter name that was previously colliding - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.key_get() /// .query(query) /// .client(client) @@ -129,6 +148,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -151,6 +185,10 @@ pub mod builder { } impl<'a> KeyGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { _client: client, @@ -224,6 +262,11 @@ pub mod builder { } ///Sends a `GET` request to `/key/{query}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { _client, @@ -243,7 +286,7 @@ pub mod builder { let _url = format!( "{}/key/{}", _client.baseurl, - encode_path(&query.to_string()), + encode_path(&query.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -269,7 +312,7 @@ pub mod builder { _client.post(&_result, &info).await?; let _response = _result?; match _response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(_response)), + 200u16 => Ok(ResponseValue::empty(&_response)), _ => Err(Error::UnexpectedResponse(_response)), } } diff --git a/progenitor-impl/tests/output/src/param_collision_positional.rs b/progenitor-impl/tests/output/src/param_collision_positional.rs index 9c0f9819..a4d26d59 100644 --- a/progenitor-impl/tests/output/src/param_collision_positional.rs +++ b/progenitor-impl/tests/output/src/param_collision_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -37,7 +45,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Parameter name collision test +///Client for `Parameter name collision test` /// ///Minimal API for testing collision between parameter names and generated code /// @@ -53,6 +61,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -72,6 +85,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -100,6 +114,25 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Gets a key /// @@ -112,6 +145,11 @@ impl Client { /// - `response`: Parameter name that was previously colliding /// - `result`: Parameter name that was previously colliding /// - `url`: Parameter name that was previously colliding + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn key_get<'a>( &'a self, query: bool, @@ -121,7 +159,7 @@ impl Client { result: bool, url: bool, ) -> Result, Error<()>> { - let _url = format!("{}/key/{}", self.baseurl, encode_path(&query.to_string()),); + let _url = format!("{}/key/{}", self.baseurl, encode_path(&query.to_string())); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -146,7 +184,7 @@ impl Client { self.post(&_result, &info).await?; let _response = _result?; match _response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(_response)), + 200u16 => Ok(ResponseValue::empty(&_response)), _ => Err(Error::UnexpectedResponse(_response)), } } diff --git a/progenitor-impl/tests/output/src/param_overrides_builder.rs b/progenitor-impl/tests/output/src/param_overrides_builder.rs index 1348260b..c19a0505 100644 --- a/progenitor-impl/tests/output/src/param_overrides_builder.rs +++ b/progenitor-impl/tests/output/src/param_overrides_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -37,7 +45,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Parameter override test +///Client for `Parameter override test` /// ///Minimal API for testing parameter overrides /// @@ -53,6 +61,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -72,6 +85,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -109,7 +123,12 @@ impl Client { /// parameter /// - `unique_key`: A key parameter that will not be overridden by the path /// spec - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.key_get() /// .key(key) /// .unique_key(unique_key) @@ -123,6 +142,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -141,9 +175,13 @@ pub mod builder { } impl<'a> KeyGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, key: Ok(None), unique_key: Ok(None), } @@ -171,6 +209,11 @@ pub mod builder { } ///Sends a `GET` request to `/key` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -179,7 +222,7 @@ pub mod builder { } = self; let key = key.map_err(Error::InvalidRequest)?; let unique_key = unique_key.map_err(Error::InvalidRequest)?; - let url = format!("{}/key", client.baseurl,); + let url = format!("{}/key", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -204,7 +247,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } diff --git a/progenitor-impl/tests/output/src/param_overrides_builder_tagged.rs b/progenitor-impl/tests/output/src/param_overrides_builder_tagged.rs index e55f5ff9..5b6b4a22 100644 --- a/progenitor-impl/tests/output/src/param_overrides_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/param_overrides_builder_tagged.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -37,7 +45,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Parameter override test +///Client for `Parameter override test` /// ///Minimal API for testing parameter overrides /// @@ -53,6 +61,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -72,6 +85,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -109,7 +123,12 @@ impl Client { /// parameter /// - `unique_key`: A key parameter that will not be overridden by the path /// spec - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.key_get() /// .key(key) /// .unique_key(unique_key) @@ -123,6 +142,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -141,9 +175,13 @@ pub mod builder { } impl<'a> KeyGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, key: Ok(None), unique_key: Ok(None), } @@ -171,6 +209,11 @@ pub mod builder { } ///Sends a `GET` request to `/key` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error<()>> { let Self { client, @@ -179,7 +222,7 @@ pub mod builder { } = self; let key = key.map_err(Error::InvalidRequest)?; let unique_key = unique_key.map_err(Error::InvalidRequest)?; - let url = format!("{}/key", client.baseurl,); + let url = format!("{}/key", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -204,7 +247,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } diff --git a/progenitor-impl/tests/output/src/param_overrides_positional.rs b/progenitor-impl/tests/output/src/param_overrides_positional.rs index 586105d3..19026c28 100644 --- a/progenitor-impl/tests/output/src/param_overrides_positional.rs +++ b/progenitor-impl/tests/output/src/param_overrides_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -37,7 +45,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Parameter override test +///Client for `Parameter override test` /// ///Minimal API for testing parameter overrides /// @@ -53,6 +61,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -72,6 +85,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -100,6 +114,25 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Gets a key /// @@ -110,12 +143,17 @@ impl Client { /// parameter /// - `unique_key`: A key parameter that will not be overridden by the path /// spec + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn key_get<'a>( &'a self, key: Option, unique_key: Option<&'a str>, ) -> Result, Error<()>> { - let url = format!("{}/key", self.baseurl,); + let url = format!("{}/key", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -140,7 +178,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), + 200u16 => Ok(ResponseValue::empty(&response)), _ => Err(Error::UnexpectedResponse(response)), } } diff --git a/progenitor-impl/tests/output/src/propolis_server_builder.rs b/progenitor-impl/tests/output/src/propolis_server_builder.rs index 20c0b542..d3dcb8a5 100644 --- a/progenitor-impl/tests/output/src/propolis_server_builder.rs +++ b/progenitor-impl/tests/output/src/propolis_server_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -2827,7 +2835,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Oxide Propolis Server API +///Client for `Oxide Propolis Server API` /// ///API for interacting with the Propolis hypervisor frontend. /// @@ -2843,6 +2851,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -2862,6 +2875,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -2892,7 +2906,12 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `GET` request to `/instance` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_get() /// .send() /// .await; @@ -2903,7 +2922,12 @@ impl Client { ///Sends a `PUT` request to `/instance` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_ensure() /// .body(body) /// .send() @@ -2917,7 +2941,12 @@ impl Client { /// ///Sends a `POST` request to `/instance/disk/{id}/snapshot/{snapshot_id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_issue_crucible_snapshot_request() /// .id(id) /// .snapshot_id(snapshot_id) @@ -2932,7 +2961,12 @@ impl Client { ///Sends a `GET` request to `/instance/migrate/status` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_migrate_status() /// .body(body) /// .send() @@ -2944,7 +2978,12 @@ impl Client { ///Sends a `GET` request to `/instance/serial` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial() /// .send() /// .await; @@ -2955,7 +2994,12 @@ impl Client { ///Sends a `PUT` request to `/instance/state` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_state_put() /// .body(body) /// .send() @@ -2967,7 +3011,12 @@ impl Client { ///Sends a `GET` request to `/instance/state-monitor` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_state_monitor() /// .body(body) /// .send() @@ -2980,6 +3029,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -2996,16 +3060,25 @@ pub mod builder { } impl<'a> InstanceGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/instance` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/instance", client.baseurl,); + let url = format!("{}/instance", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3051,9 +3124,13 @@ pub mod builder { } impl<'a> InstanceEnsure<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3083,6 +3160,11 @@ pub mod builder { } ///Sends a `PUT` request to `/instance` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -3090,7 +3172,7 @@ pub mod builder { let body = body .and_then(|v| types::InstanceEnsureRequest::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/instance", client.baseurl,); + let url = format!("{}/instance", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3138,9 +3220,13 @@ pub mod builder { } impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), snapshot_id: Err("snapshot_id was not initialized".to_string()), } @@ -3168,6 +3254,11 @@ pub mod builder { ///Sends a `POST` request to /// `/instance/disk/{id}/snapshot/{snapshot_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -3180,7 +3271,7 @@ pub mod builder { "{}/instance/disk/{}/snapshot/{}", client.baseurl, encode_path(&id.to_string()), - encode_path(&snapshot_id.to_string()), + encode_path(&snapshot_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3227,9 +3318,13 @@ pub mod builder { } impl<'a> InstanceMigrateStatus<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3260,6 +3355,11 @@ pub mod builder { } ///Sends a `GET` request to `/instance/migrate/status` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -3270,7 +3370,7 @@ pub mod builder { types::InstanceMigrateStatusRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!("{}/instance/migrate/status", client.baseurl,); + let url = format!("{}/instance/migrate/status", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3316,14 +3416,23 @@ pub mod builder { } impl<'a> InstanceSerial<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/instance/serial` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/instance/serial", client.baseurl,); + let url = format!("{}/instance/serial", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3375,9 +3484,13 @@ pub mod builder { } impl<'a> InstanceStatePut<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -3393,10 +3506,15 @@ pub mod builder { } ///Sends a `PUT` request to `/instance/state` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/instance/state", client.baseurl,); + let url = format!("{}/instance/state", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3421,7 +3539,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -3443,9 +3561,13 @@ pub mod builder { } impl<'a> InstanceStateMonitor<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3476,6 +3598,11 @@ pub mod builder { } ///Sends a `GET` request to `/instance/state-monitor` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -3486,7 +3613,7 @@ pub mod builder { types::InstanceStateMonitorRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!("{}/instance/state-monitor", client.baseurl,); + let url = format!("{}/instance/state-monitor", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/propolis_server_builder_tagged.rs b/progenitor-impl/tests/output/src/propolis_server_builder_tagged.rs index bf7b0717..1bc533c0 100644 --- a/progenitor-impl/tests/output/src/propolis_server_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/propolis_server_builder_tagged.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -2782,7 +2790,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Oxide Propolis Server API +///Client for `Oxide Propolis Server API` /// ///API for interacting with the Propolis hypervisor frontend. /// @@ -2798,6 +2806,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -2817,6 +2830,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -2847,7 +2861,12 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `GET` request to `/instance` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_get() /// .send() /// .await; @@ -2858,7 +2877,12 @@ impl Client { ///Sends a `PUT` request to `/instance` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_ensure() /// .body(body) /// .send() @@ -2872,7 +2896,12 @@ impl Client { /// ///Sends a `POST` request to `/instance/disk/{id}/snapshot/{snapshot_id}` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_issue_crucible_snapshot_request() /// .id(id) /// .snapshot_id(snapshot_id) @@ -2887,7 +2916,12 @@ impl Client { ///Sends a `GET` request to `/instance/migrate/status` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_migrate_status() /// .body(body) /// .send() @@ -2899,7 +2933,12 @@ impl Client { ///Sends a `GET` request to `/instance/serial` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_serial() /// .send() /// .await; @@ -2910,7 +2949,12 @@ impl Client { ///Sends a `PUT` request to `/instance/state` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_state_put() /// .body(body) /// .send() @@ -2922,7 +2966,12 @@ impl Client { ///Sends a `GET` request to `/instance/state-monitor` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.instance_state_monitor() /// .body(body) /// .send() @@ -2935,6 +2984,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -2951,16 +3015,25 @@ pub mod builder { } impl<'a> InstanceGet<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/instance` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { let Self { client } = self; - let url = format!("{}/instance", client.baseurl,); + let url = format!("{}/instance", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3006,9 +3079,13 @@ pub mod builder { } impl<'a> InstanceEnsure<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3038,6 +3115,11 @@ pub mod builder { } ///Sends a `PUT` request to `/instance` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -3045,7 +3127,7 @@ pub mod builder { let body = body .and_then(|v| types::InstanceEnsureRequest::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/instance", client.baseurl,); + let url = format!("{}/instance", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3093,9 +3175,13 @@ pub mod builder { } impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, id: Err("id was not initialized".to_string()), snapshot_id: Err("snapshot_id was not initialized".to_string()), } @@ -3123,6 +3209,11 @@ pub mod builder { ///Sends a `POST` request to /// `/instance/disk/{id}/snapshot/{snapshot_id}` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, @@ -3135,7 +3226,7 @@ pub mod builder { "{}/instance/disk/{}/snapshot/{}", client.baseurl, encode_path(&id.to_string()), - encode_path(&snapshot_id.to_string()), + encode_path(&snapshot_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -3182,9 +3273,13 @@ pub mod builder { } impl<'a> InstanceMigrateStatus<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3215,6 +3310,11 @@ pub mod builder { } ///Sends a `GET` request to `/instance/migrate/status` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -3225,7 +3325,7 @@ pub mod builder { types::InstanceMigrateStatusRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!("{}/instance/migrate/status", client.baseurl,); + let url = format!("{}/instance/migrate/status", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3271,14 +3371,23 @@ pub mod builder { } impl<'a> InstanceSerial<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { client } } ///Sends a `GET` request to `/instance/serial` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client } = self; - let url = format!("{}/instance/serial", client.baseurl,); + let url = format!("{}/instance/serial", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3330,9 +3439,13 @@ pub mod builder { } impl<'a> InstanceStatePut<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Err("body was not initialized".to_string()), } } @@ -3348,10 +3461,15 @@ pub mod builder { } ///Sends a `PUT` request to `/instance/state` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - let url = format!("{}/instance/state", client.baseurl,); + let url = format!("{}/instance/state", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -3376,7 +3494,7 @@ pub mod builder { client.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -3398,9 +3516,13 @@ pub mod builder { } impl<'a> InstanceStateMonitor<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -3431,6 +3553,11 @@ pub mod builder { } ///Sends a `GET` request to `/instance/state-monitor` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> @@ -3441,7 +3568,7 @@ pub mod builder { types::InstanceStateMonitorRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!("{}/instance/state-monitor", client.baseurl,); + let url = format!("{}/instance/state-monitor", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/propolis_server_positional.rs b/progenitor-impl/tests/output/src/propolis_server_positional.rs index 2e4a81c1..2c896866 100644 --- a/progenitor-impl/tests/output/src/propolis_server_positional.rs +++ b/progenitor-impl/tests/output/src/propolis_server_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -1350,7 +1358,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for Oxide Propolis Server API +///Client for `Oxide Propolis Server API` /// ///API for interacting with the Propolis hypervisor frontend. /// @@ -1366,6 +1374,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -1385,6 +1398,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -1413,12 +1427,37 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `GET` request to `/instance` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_get<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/instance", self.baseurl,); + let url = format!("{}/instance", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1454,11 +1493,17 @@ impl Client { } ///Sends a `PUT` request to `/instance` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_ensure<'a>( &'a self, body: &'a types::InstanceEnsureRequest, ) -> Result, Error> { - let url = format!("{}/instance", self.baseurl,); + let url = format!("{}/instance", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1497,6 +1542,12 @@ impl Client { ///Issue a snapshot request to a crucible backend /// ///Sends a `POST` request to `/instance/disk/{id}/snapshot/{snapshot_id}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_issue_crucible_snapshot_request<'a>( &'a self, id: &'a ::uuid::Uuid, @@ -1506,7 +1557,7 @@ impl Client { "{}/instance/disk/{}/snapshot/{}", self.baseurl, encode_path(&id.to_string()), - encode_path(&snapshot_id.to_string()), + encode_path(&snapshot_id.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -1543,11 +1594,17 @@ impl Client { } ///Sends a `GET` request to `/instance/migrate/status` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_migrate_status<'a>( &'a self, body: &'a types::InstanceMigrateStatusRequest, ) -> Result, Error> { - let url = format!("{}/instance/migrate/status", self.baseurl,); + let url = format!("{}/instance/migrate/status", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1584,10 +1641,16 @@ impl Client { } ///Sends a `GET` request to `/instance/serial` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_serial<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/instance/serial", self.baseurl,); + let url = format!("{}/instance/serial", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1629,11 +1692,17 @@ impl Client { } ///Sends a `PUT` request to `/instance/state` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_state_put<'a>( &'a self, body: types::InstanceStateRequested, ) -> Result, Error> { - let url = format!("{}/instance/state", self.baseurl,); + let url = format!("{}/instance/state", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -1658,7 +1727,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -1670,11 +1739,17 @@ impl Client { } ///Sends a `GET` request to `/instance/state-monitor` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn instance_state_monitor<'a>( &'a self, body: &'a types::InstanceStateMonitorRequest, ) -> Result, Error> { - let url = format!("{}/instance/state-monitor", self.baseurl,); + let url = format!("{}/instance/state-monitor", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/test_default_params_builder.rs b/progenitor-impl/tests/output/src/test_default_params_builder.rs index ca018c3f..da76b3fd 100644 --- a/progenitor-impl/tests/output/src/test_default_params_builder.rs +++ b/progenitor-impl/tests/output/src/test_default_params_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -194,7 +202,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for pagination-demo +///Client for `pagination-demo` /// ///Version: 9000.0.0 pub struct Client { @@ -208,6 +216,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -227,6 +240,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -257,7 +271,12 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `POST` request to `/` /// - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.default_params() /// .body(body) /// .send() @@ -270,6 +289,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -287,9 +321,13 @@ pub mod builder { } impl<'a> DefaultParams<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, body: Ok(::std::default::Default::default()), } } @@ -317,12 +355,17 @@ pub mod builder { } ///Sends a `POST` request to `/` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| types::BodyWithDefaults::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/", client.baseurl,); + let url = format!("{}/", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/test_default_params_positional.rs b/progenitor-impl/tests/output/src/test_default_params_positional.rs index 135b92e3..a6ffa7d6 100644 --- a/progenitor-impl/tests/output/src/test_default_params_positional.rs +++ b/progenitor-impl/tests/output/src/test_default_params_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -98,7 +106,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for pagination-demo +///Client for `pagination-demo` /// ///Version: 9000.0.0 pub struct Client { @@ -112,6 +120,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -131,6 +144,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -159,13 +173,38 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `POST` request to `/` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn default_params<'a>( &'a self, body: &'a types::BodyWithDefaults, ) -> Result, Error> { - let url = format!("{}/", self.baseurl,); + let url = format!("{}/", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/test_freeform_response.rs b/progenitor-impl/tests/output/src/test_freeform_response.rs index 3fac53b2..3ce9a06c 100644 --- a/progenitor-impl/tests/output/src/test_freeform_response.rs +++ b/progenitor-impl/tests/output/src/test_freeform_response.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -37,7 +45,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for pagination-demo +///Client for `pagination-demo` /// ///Version: 9000.0.0 pub struct Client { @@ -51,6 +59,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -70,6 +83,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -98,12 +112,37 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `GET` request to `/` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn freeform_response<'a>( &'a self, ) -> Result, Error> { - let url = format!("{}/", self.baseurl,); + let url = format!("{}/", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/test_renamed_parameters.rs b/progenitor-impl/tests/output/src/test_renamed_parameters.rs index a85319be..ab349f7e 100644 --- a/progenitor-impl/tests/output/src/test_renamed_parameters.rs +++ b/progenitor-impl/tests/output/src/test_renamed_parameters.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -71,7 +79,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for pagination-demo +///Client for `pagination-demo` /// ///Version: 9000.0.0 pub struct Client { @@ -85,6 +93,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -104,6 +117,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -132,8 +146,33 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `GET` request to `/{ref}/{type}/{trait}` + /// + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn renamed_parameters<'a>( &'a self, ref_: &'a str, @@ -148,7 +187,7 @@ impl Client { self.baseurl, encode_path(&ref_.to_string()), encode_path(&type_.to_string()), - encode_path(&trait_.to_string()), + encode_path(&trait_.to_string()) ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -176,7 +215,7 @@ impl Client { self.post(&result, &info).await?; let response = result?; match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), + 204u16 => Ok(ResponseValue::empty(&response)), 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), diff --git a/progenitor-impl/tests/output/src/test_stream_pagination_builder.rs b/progenitor-impl/tests/output/src/test_stream_pagination_builder.rs index 75cb5404..fc972711 100644 --- a/progenitor-impl/tests/output/src/test_stream_pagination_builder.rs +++ b/progenitor-impl/tests/output/src/test_stream_pagination_builder.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -266,7 +274,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for test_stream_pagination +///Client for `test_stream_pagination` /// ///Version: 1.0.0 pub struct Client { @@ -280,6 +288,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -299,6 +312,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -333,7 +347,12 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page - ///```ignore + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. + /// ```ignore /// let response = client.paginated_u32s() /// .limit(limit) /// .page_token(page_token) @@ -347,6 +366,21 @@ impl Client { /// Types for composing operation parameters. #[allow(clippy::all)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] pub mod builder { use super::types; #[allow(unused_imports)] @@ -365,9 +399,13 @@ pub mod builder { } impl<'a> PaginatedU32s<'a> { + #[allow( + clippy::missing_const_for_fn, + reason = "operation parameter defaults may require non-const initialization" + )] pub fn new(client: &'a super::Client) -> Self { Self { - client: client, + client, limit: Ok(None), page_token: Ok(None), } @@ -394,6 +432,11 @@ pub mod builder { } ///Sends a `GET` request to `/` + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn send( self, ) -> Result, Error> { @@ -404,7 +447,7 @@ pub mod builder { } = self; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!("{}/", client.baseurl,); + let url = format!("{}/", client.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), diff --git a/progenitor-impl/tests/output/src/test_stream_pagination_positional.rs b/progenitor-impl/tests/output/src/test_stream_pagination_positional.rs index 5c60b8a0..19cfca13 100644 --- a/progenitor-impl/tests/output/src/test_stream_pagination_positional.rs +++ b/progenitor-impl/tests/output/src/test_stream_pagination_positional.rs @@ -4,6 +4,14 @@ use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderE pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; /// Types used as operation parameters and responses. #[allow(clippy::all)] +#[allow( + clippy::struct_field_names, + reason = "type definitions are emitted by typify" +)] +#[allow( + clippy::default_trait_access, + reason = "default expressions are emitted by typify" +)] pub mod types { /// Error types. pub mod error { @@ -113,7 +121,7 @@ pub mod types { } #[derive(Clone, Debug)] -///Client for test_stream_pagination +///Client for `test_stream_pagination` /// ///Version: 1.0.0 pub struct Client { @@ -127,6 +135,11 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + /// + /// # Panics + /// + /// Panics if the default `reqwest::Client` cannot be built. + #[must_use] pub fn new(baseurl: &str) -> Self { #[cfg(not(target_arch = "wasm32"))] let client = { @@ -146,6 +159,7 @@ impl Client { /// `baseurl` is the base URL provided to the internal /// `reqwest::Client`, and should include a scheme and hostname, /// as well as port and a path stem if applicable. + #[must_use] pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { Self { baseurl: baseurl.to_string(), @@ -174,6 +188,25 @@ impl ClientInfo<()> for Client { impl ClientHooks<()> for &Client {} #[allow(clippy::all)] +#[allow( + clippy::too_many_arguments, + reason = "generated parameters mirror the OpenAPI operation" +)] +#[allow( + clippy::result_large_err, + reason = "generated methods preserve the public Error representation" +)] +#[cfg_attr( + target_arch = "wasm32", + allow( + clippy::future_not_send, + reason = "reqwest futures use browser-local state on wasm" + ) +)] +#[allow( + clippy::match_same_arms, + reason = "generated status ranges remain explicit" +)] impl Client { ///Sends a `GET` request to `/` /// @@ -181,12 +214,17 @@ impl Client { /// - `limit`: Maximum number of items returned by a single call /// - `page_token`: Token returned by previous call to retrieve the /// subsequent page + /// + ///# Errors + /// + ///Returns an error if request construction, transport, or response + /// decoding fails. pub async fn paginated_u32s<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!("{}/", self.baseurl,); + let url = format!("{}/", self.baseurl); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -230,6 +268,10 @@ impl Client { /// ///Arguments: /// - `limit`: Maximum number of items returned by a single call + #[allow( + clippy::elidable_lifetime_names, + reason = "the lifetime also binds borrowed stream parameters" + )] pub fn paginated_u32s_stream<'a>( &'a self, limit: Option<::std::num::NonZeroU32>, diff --git a/progenitor-impl/tests/test_output.rs b/progenitor-impl/tests/test_output.rs index 6e6f18b5..c6bcccb9 100644 --- a/progenitor-impl/tests/test_output.rs +++ b/progenitor-impl/tests/test_output.rs @@ -16,18 +16,15 @@ fn load_api

(p: P) -> OpenAPI where P: AsRef + std::clone::Clone + std::fmt::Debug, { - let mut f = File::open(p.clone()).unwrap(); - match serde_json::from_reader(f) { - Ok(json_value) => json_value, - _ => { - f = File::open(p).unwrap(); - serde_yaml::from_reader(f).unwrap() - } - } + let f = File::open(p.clone()).unwrap(); + serde_json::from_reader(f).unwrap_or_else(|_| { + let f = File::open(p).unwrap(); + serde_yaml::from_reader(f).unwrap() + }) } fn generate_formatted(generator: &mut Generator, spec: &OpenAPI) -> String { - let content = generator.generate_tokens(&spec).unwrap(); + let content = generator.generate_tokens(spec).unwrap(); reformat_code(content) } @@ -38,7 +35,7 @@ fn reformat_code(content: TokenStream) -> String { wrap_comments: Some(true), ..Default::default() }; - space_out_items(rustfmt_wrapper::rustfmt_config(rustfmt_config, content).unwrap()).unwrap() + space_out_items(&rustfmt_wrapper::rustfmt_config(rustfmt_config, content).unwrap()).unwrap() } #[track_caller] @@ -53,7 +50,7 @@ fn verify_apis(openapi_file: &str) { let mut generator = Generator::default(); let output = generate_formatted(&mut generator, &spec); expectorate::assert_contents( - format!("tests/output/src/{}_positional.rs", openapi_stem), + format!("tests/output/src/{openapi_stem}_positional.rs"), &output, ); @@ -71,12 +68,12 @@ fn verify_apis(openapi_file: &str) { ..Default::default() }, "usize", - [TypeImpl::Display].into_iter(), + std::iter::once(TypeImpl::Display), ), ); let output = generate_formatted(&mut generator, &spec); expectorate::assert_contents( - format!("tests/output/src/{}_builder.rs", openapi_stem), + format!("tests/output/src/{openapi_stem}_builder.rs"), &output, ); @@ -89,7 +86,7 @@ fn verify_apis(openapi_file: &str) { ); let output = generate_formatted(&mut generator, &spec); expectorate::assert_contents( - format!("tests/output/src/{}_builder_tagged.rs", openapi_stem), + format!("tests/output/src/{openapi_stem}_builder_tagged.rs"), &output, ); @@ -99,7 +96,7 @@ fn verify_apis(openapi_file: &str) { .unwrap(); let output = reformat_code(tokens); - expectorate::assert_contents(format!("tests/output/src/{}_cli.rs", openapi_stem), &output); + expectorate::assert_contents(format!("tests/output/src/{openapi_stem}_cli.rs"), &output); // httpmock generation. let code = generator @@ -116,9 +113,9 @@ fn verify_apis(openapi_file: &str) { ) .unwrap(); - let output = progenitor_impl::space_out_items(output).unwrap(); + let output = progenitor_impl::space_out_items(&output).unwrap(); expectorate::assert_contents( - format!("tests/output/src/{}_httpmock.rs", openapi_stem), + format!("tests/output/src/{openapi_stem}_httpmock.rs"), &output, ); } @@ -165,7 +162,7 @@ fn test_cli_gen() { #[test] fn test_nexus_with_different_timeout() { - const OPENAPI_FILE: &'static str = "nexus.json"; + const OPENAPI_FILE: &str = "nexus.json"; let mut in_path = PathBuf::from("../sample_openapi"); in_path.push(OPENAPI_FILE); @@ -176,7 +173,7 @@ fn test_nexus_with_different_timeout() { let mut generator = Generator::new(GenerationSettings::default().with_timeout(75)); let output = generate_formatted(&mut generator, &spec); expectorate::assert_contents( - format!("tests/output/src/{}_with_timeout.rs", openapi_stem), + format!("tests/output/src/{openapi_stem}_with_timeout.rs"), &output, ); } @@ -184,7 +181,7 @@ fn test_nexus_with_different_timeout() { // TODO this file is full of inconsistencies and incorrectly specified types. // It's an interesting test to consider whether we try to do our best to // interpret the intent or just fail. -#[ignore] +#[ignore = "sample contains inconsistent and invalid types"] #[test] fn test_github() { verify_apis("api.github.com.json"); diff --git a/progenitor-impl/tests/test_specific.rs b/progenitor-impl/tests/test_specific.rs index 1b623904..90d26a5d 100644 --- a/progenitor-impl/tests/test_specific.rs +++ b/progenitor-impl/tests/test_specific.rs @@ -24,7 +24,7 @@ fn generate_formatted(generator: &mut Generator, spec: &OpenAPI) -> String { wrap_comments: Some(true), ..Default::default() }; - space_out_items(rustfmt_wrapper::rustfmt_config(rustfmt_config, content).unwrap()).unwrap() + space_out_items(&rustfmt_wrapper::rustfmt_config(rustfmt_config, content).unwrap()).unwrap() } #[allow(dead_code)] @@ -83,7 +83,7 @@ fn test_renamed_parameters() { expectorate::assert_contents( format!("tests/output/src/{}.rs", "test_renamed_parameters"), &output, - ) + ); } #[endpoint { @@ -114,7 +114,7 @@ fn test_freeform_response() { expectorate::assert_contents( format!("tests/output/src/{}.rs", "test_freeform_response"), &output, - ) + ); } #[derive(Deserialize, JsonSchema)] @@ -129,11 +129,15 @@ struct BodyWithDefaults { something: Option, } -fn forty_two() -> u32 { +const fn forty_two() -> u32 { 42 } -fn yes_yes() -> Option { +#[allow( + clippy::unnecessary_wraps, + reason = "serde default must match the Option field type" +)] +const fn yes_yes() -> Option { Some(true) } @@ -268,6 +272,10 @@ async fn test_stream_pagination() { // Test the positional client. #[allow(dead_code)] + #[allow( + clippy::items_after_statements, + reason = "keeps the included snapshot next to its test phase" + )] mod gen_client_positional { // This is weird: we're now `include!`ing the file we just used to // confirm the generated code is what we expect. If changes are made to @@ -313,6 +321,10 @@ async fn test_stream_pagination() { server_ctx.page_pairs.lock().unwrap().clear(); #[allow(dead_code, unused_imports)] + #[allow( + clippy::items_after_statements, + reason = "keeps the included snapshot next to its test phase" + )] mod gen_client_builder { // This is weird: we're now `include!`ing the file we just used to // confirm the generated code is what we expect. If changes are made to diff --git a/progenitor-macro/src/lib.rs b/progenitor-macro/src/lib.rs index fb854317..91be76c8 100644 --- a/progenitor-macro/src/lib.rs +++ b/progenitor-macro/src/lib.rs @@ -1,10 +1,14 @@ // Copyright 2026 Oxide Computer Company -//! Macros for the progenitor OpenAPI client generator. +//! Macros for the progenitor `OpenAPI` client generator. #![deny(missing_docs)] -use std::{collections::HashMap, fs::File, path::PathBuf}; +use std::{ + collections::HashMap, + fs::File, + path::{Path, PathBuf}, +}; use openapiv3::OpenAPI; use proc_macro::TokenStream; @@ -23,13 +27,13 @@ mod token_utils; /// Where to resolve the spec path relative to. #[derive(Debug, Clone, Copy, Deserialize)] enum RelativeTo { - /// Resolve relative to CARGO_MANIFEST_DIR (the default). + /// Resolve relative to `CARGO_MANIFEST_DIR` (the default). ManifestDir, - /// Resolve relative to OUT_DIR. + /// Resolve relative to `OUT_DIR`. OutDir, } -/// Specification of where to find the OpenAPI document. +/// Specification of where to find the `OpenAPI` document. #[derive(Debug)] struct SpecSource { /// The path to the spec file. @@ -40,7 +44,7 @@ struct SpecSource { impl syn::parse::Parse for SpecSource { fn parse(input: syn::parse::ParseStream) -> syn::Result { - /// Helper struct for deserializing the struct form of SpecSource. + /// Helper struct for deserializing the struct form of `SpecSource`. #[derive(Deserialize)] struct SpecSourceStruct { path: ParseWrapper, @@ -51,7 +55,7 @@ impl syn::parse::Parse for SpecSource { if lookahead.peek(LitStr) { // spec = "path/to/spec.json" let path: LitStr = input.parse()?; - Ok(SpecSource { + Ok(Self { path, relative_to: RelativeTo::ManifestDir, }) @@ -62,7 +66,7 @@ impl syn::parse::Parse for SpecSource { let stream: proc_macro2::TokenStream = content.parse()?; let helper: SpecSourceStruct = serde_tokenstream::from_tokenstream_spanned(&brace_token.span, &stream)?; - Ok(SpecSource { + Ok(Self { path: helper.path.into_inner(), relative_to: helper.relative_to, }) @@ -72,10 +76,10 @@ impl syn::parse::Parse for SpecSource { } } -/// Generates a client from the given OpenAPI document +/// Generates a client from the given `OpenAPI` document /// /// `generate_api!` can be invoked in two ways. The simple form, takes a path -/// to the OpenAPI document: +/// to the `OpenAPI` document: /// ```ignore /// generate_api!("path/to/spec.json"); /// ``` @@ -106,7 +110,7 @@ impl syn::parse::Parse for SpecSource { /// ); /// ``` /// -/// The `spec` key is required; it is the OpenAPI document (JSON or YAML) from +/// The `spec` key is required; it is the `OpenAPI` document (JSON or YAML) from /// which the client is derived. It can be specified as a simple string path, or /// as a struct with `path` and `relative_to` fields. The `relative_to` /// field controls where the path is resolved from: @@ -322,13 +326,17 @@ fn is_crate(s: &str) -> bool { !s.contains(|cc: char| !cc.is_alphanumeric() && cc != '_' && cc != '-') } -fn open_file(path: PathBuf, span: proc_macro2::Span) -> Result { - File::open(path.clone()).map_err(|e| { +fn open_file(path: &Path, span: proc_macro2::Span) -> Result { + File::open(path).map_err(|e| { let path_str = path.to_string_lossy(); - syn::Error::new(span, format!("couldn't read file {}: {}", path_str, e)) + syn::Error::new(span, format!("couldn't read file {path_str}: {e}")) }) } +#[allow( + clippy::too_many_lines, + reason = "keeps macro expansion stages together" +)] fn do_generate_api(item: TokenStream) -> Result { let (spec_source, settings) = if let Ok(spec) = syn::parse::(item.clone()) { let spec_source = SpecSource { @@ -371,31 +379,29 @@ fn do_generate_api(item: TokenStream) -> Result { map_type.map(|map_type| settings.with_map_type(map_type.to_token_stream())); settings.with_unknown_crates(unknown_crates); - crates.into_iter().for_each( - |(CrateName(crate_name), MacroCrateSpec { original, version })| { - if let Some(original_crate) = original { - settings.with_crate(original_crate, version, Some(&crate_name)); - } else { - settings.with_crate(crate_name, version, None); - } - }, - ); - - derives.into_iter().for_each(|derive| { + for (CrateName(crate_name), MacroCrateSpec { original, version }) in crates { + if let Some(original_crate) = original { + settings.with_crate(original_crate, version, Some(&crate_name)); + } else { + settings.with_crate(crate_name, version, None); + } + } + + for derive in derives { settings.with_derive(derive.to_token_stream()); - }); - patch.into_iter().for_each(|(type_name, patch)| { + } + for (type_name, patch) in patch { settings.with_patch(type_name.to_token_stream().to_string(), &patch.into()); - }); - replace.into_iter().for_each(|(type_name, type_and_impls)| { + } + for (type_name, type_and_impls) in replace { let type_name = type_name.to_token_stream(); let (replace_name, impls) = type_and_impls.into_inner().into_name_and_impls(); settings.with_replacement(type_name, replace_name, impls); - }); - convert.into_iter().for_each(|(schema, type_and_impls)| { + } + for (schema, type_and_impls) in convert { let (type_name, impls) = type_and_impls.into_inner().into_name_and_impls(); settings.with_conversion(schema, type_name, impls); - }); + } if let Some(timeout) = timeout { settings.with_timeout(timeout); } @@ -421,18 +427,14 @@ fn do_generate_api(item: TokenStream) -> Result { let path = base_dir.join(spec_path.value()); let path_str = path.to_string_lossy(); - let mut f = open_file(path.clone(), spec_path.span())?; - let oapi: OpenAPI = match serde_json::from_reader(f) { - Ok(json_value) => json_value, - _ => { - f = open_file(path.clone(), spec_path.span())?; - serde_yaml::from_reader(f).map_err(|e| { - syn::Error::new( - spec_path.span(), - format!("failed to parse {}: {}", path_str, e), - ) - })? - } + let mut f = open_file(&path, spec_path.span())?; + let oapi: OpenAPI = if let Ok(json_value) = serde_json::from_reader(f) { + json_value + } else { + f = open_file(&path, spec_path.span())?; + serde_yaml::from_reader(f).map_err(|e| { + syn::Error::new(spec_path.span(), format!("failed to parse {path_str}: {e}")) + })? }; let mut builder = Generator::new(&settings); diff --git a/progenitor/src/lib.rs b/progenitor/src/lib.rs index 52cd7b3b..e7751ea6 100644 --- a/progenitor/src/lib.rs +++ b/progenitor/src/lib.rs @@ -1,11 +1,11 @@ // Copyright 2024 Oxide Computer Company //! Progenitor is a Rust crate for generating opinionated clients from API -//! descriptions specified in the OpenAPI 3.0.x format. It makes use of Rust +//! descriptions specified in the `OpenAPI` 3.0.x format. It makes use of Rust //! futures for async API calls and `Streams` for paginated interfaces. //! //! It generates a type called `Client` with methods that correspond to the -//! operations specified in the OpenAPI document. +//! operations specified in the `OpenAPI` document. //! //! For details see the [repo //! README](https://github.com/oxidecomputer/progenitor/blob/main/README.md) diff --git a/progenitor/tests/build_buildomat.rs b/progenitor/tests/build_buildomat.rs index aea37474..073adbf0 100644 --- a/progenitor/tests/build_buildomat.rs +++ b/progenitor/tests/build_buildomat.rs @@ -4,7 +4,8 @@ mod positional { progenitor::generate_api!("../sample_openapi/buildomat.json"); fn _ignore() { - let _ = Client::new("").worker_task_upload_chunk("task", vec![0]); + let client = Client::new(""); + let _future = client.worker_task_upload_chunk("task", vec![0]); } } @@ -16,7 +17,8 @@ mod builder_untagged { ); fn _ignore() { - let _ = Client::new("") + let client = Client::new(""); + let _future = client .worker_task_upload_chunk() .task("task") .body(vec![0]) @@ -32,7 +34,8 @@ mod builder_tagged { ); fn _ignore() { - let _ = Client::new("") + let client = Client::new(""); + let _future = client .worker_task_upload_chunk() .task("task") .body(vec![0]) diff --git a/progenitor/tests/build_keeper.rs b/progenitor/tests/build_keeper.rs index 8ed63341..6b3d8d96 100644 --- a/progenitor/tests/build_keeper.rs +++ b/progenitor/tests/build_keeper.rs @@ -4,13 +4,12 @@ mod positional { progenitor::generate_api!("../sample_openapi/keeper.json"); fn _ignore() { - let _ = Client::new("").enrol( - "auth token", - &types::EnrolBody { - host: "".to_string(), - key: "".to_string(), - }, - ); + let body = types::EnrolBody { + host: String::new(), + key: String::new(), + }; + let client = Client::new(""); + let _future = client.enrol("auth token", &body); } } @@ -22,12 +21,13 @@ mod builder_untagged { ); fn _ignore() { - let _ = Client::new("") + let client = Client::new(""); + let _future = client .enrol() .authorization("") .body(types::EnrolBody { - host: "".to_string(), - key: "".to_string(), + host: String::new(), + key: String::new(), }) .send(); } @@ -41,12 +41,13 @@ mod builder_tagged { ); fn _ignore() { - let _ = Client::new("") + let client = Client::new(""); + let _future = client .enrol() .authorization("") .body(types::EnrolBody { - host: "".to_string(), - key: "".to_string(), + host: String::new(), + key: String::new(), }) .send(); } diff --git a/progenitor/tests/build_nexus.rs b/progenitor/tests/build_nexus.rs index fa1643b4..93c600b7 100644 --- a/progenitor/tests/build_nexus.rs +++ b/progenitor/tests/build_nexus.rs @@ -10,14 +10,15 @@ mod positional { use nexus_client::{Client, types}; fn _ignore() { - let _ = async { + let future = async { let client = Client::new(""); let org = types::Name::try_from("org").unwrap(); let project = types::Name::try_from("project").unwrap(); let instance = types::Name::try_from("instance").unwrap(); let stream = client.instance_disk_list_stream(&org, &project, &instance, None, None); - let _ = stream.collect::>(); + let _collect_future = stream.collect::>(); }; + std::mem::drop(future); } } @@ -68,7 +69,7 @@ mod builder_untagged { .project_name("project") .instance_name("instance") .stream(); - let _ = stream.collect::>(); + let _future = stream.collect::>(); } } @@ -95,7 +96,7 @@ mod builder_tagged { .project_name("project") .instance_name("instance") .stream(); - let _ = stream.collect::>(); + let _future = stream.collect::>(); let _ = client .instance_create() diff --git a/progenitor/tests/build_propolis.rs b/progenitor/tests/build_propolis.rs index 360e39b2..be0fa689 100644 --- a/progenitor/tests/build_propolis.rs +++ b/progenitor/tests/build_propolis.rs @@ -11,8 +11,8 @@ mod propolis_client { use propolis_client::Client; -pub fn _ignore() { - let _ = async { +fn _ignore() { + let future = async { let _upgraded: reqwest::Upgraded = Client::new("") .instance_serial() .send() @@ -20,4 +20,5 @@ pub fn _ignore() { .unwrap() .into_inner(); }; + std::mem::drop(future); } diff --git a/progenitor/tests/load_yaml.rs b/progenitor/tests/load_yaml.rs index 558dbd66..428e8f98 100644 --- a/progenitor/tests/load_yaml.rs +++ b/progenitor/tests/load_yaml.rs @@ -2,6 +2,7 @@ mod load_yaml { progenitor::generate_api!("../sample_openapi/param-overrides.yaml"); fn _ignore() { - let _ = Client::new("").key_get(None, None); + let client = Client::new(""); + let _future = client.key_get(None, None); } }