diff --git a/progenitor-impl/src/lib.rs b/progenitor-impl/src/lib.rs index e6b7c383..28738d87 100644 --- a/progenitor-impl/src/lib.rs +++ b/progenitor-impl/src/lib.rs @@ -539,16 +539,22 @@ impl Generator { input_methods: &[method::OperationMethod], has_inner: bool, ) -> Result { - let builder_struct = input_methods + let (builder_struct, built_struct): (Vec, Vec) = input_methods .iter() .map(|method| self.builder_struct(method, TagStyle::Merged, has_inner)) - .collect::>>()?; + .collect::>>()? + .into_iter() + .unzip(); let builder_methods = input_methods .iter() .map(|method| self.builder_impl(method)) .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 + // crate. + let out = quote! { impl Client { #(#builder_methods)* @@ -570,6 +576,22 @@ impl Generator { ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, + ByteStream, + ClientInfo, + ClientHooks, + Error, + OperationInfo, + RequestBuilderExt, + ResponseValue, + }; + #(#built_struct)* + } + #(#builder_struct)* } @@ -588,10 +610,12 @@ impl Generator { tag_info: BTreeMap<&String, &openapiv3::Tag>, has_inner: bool, ) -> Result { - let builder_struct = input_methods + let (builder_struct, built_struct): (Vec, Vec) = input_methods .iter() - .map(|method| self.builder_struct(method, TagStyle::Separate, has_inner)) - .collect::>>()?; + .map(|method| self.builder_struct(method, TagStyle::Merged, has_inner)) + .collect::>>()? + .into_iter() + .unzip(); let (traits_and_impls, trait_preludes) = self.builder_tags(input_methods, &tag_info); @@ -618,6 +642,22 @@ impl Generator { ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, + ByteStream, + ClientInfo, + ClientHooks, + Error, + OperationInfo, + RequestBuilderExt, + ResponseValue, + }; + #(#built_struct)* + } + #(#builder_struct)* } diff --git a/progenitor-impl/src/method.rs b/progenitor-impl/src/method.rs index c14a3c6d..19c0efc7 100644 --- a/progenitor-impl/src/method.rs +++ b/progenitor-impl/src/method.rs @@ -78,7 +78,8 @@ impl HttpMethod { struct MethodSigBody { success: TokenStream, error: TokenStream, - body: TokenStream, + build: TokenStream, + send: TokenStream, } struct BuilderImpl { @@ -608,7 +609,8 @@ impl Generator { let MethodSigBody { success: success_type, error: error_type, - body, + build, + send, } = self.method_sig_body(method, quote! { Self }, quote! { self }, has_inner)?; let method_impl = quote! { @@ -620,7 +622,11 @@ impl Generator { ResponseValue<#success_type>, Error<#error_type>, > { - #body + #[allow(unused_mut)] + let mut request = { + #build + }.build()?; + #send } }; @@ -778,7 +784,6 @@ impl Generator { // Generate a unique Ident for internal variables let url_ident = unique_ident_from("url", ¶m_names); - let request_ident = unique_ident_from("request", ¶m_names); let response_ident = unique_ident_from("response", ¶m_names); let result_ident = unique_ident_from("result", ¶m_names); @@ -1057,12 +1062,12 @@ impl Generator { }; let pre_hook = self.settings.pre_hook.as_ref().map(|hook| { quote! { - (#hook)(#inner &#request_ident); + (#hook)(#inner &request); } }); let pre_hook_async = self.settings.pre_hook_async.as_ref().map(|hook| { quote! { - match (#hook)(#inner &mut #request_ident).await { + match (#hook)(#inner &mut request).await { Ok(_) => (), Err(e) => return Err(Error::Custom(e.to_string())), } @@ -1085,21 +1090,22 @@ impl Generator { let operation_id = &method.operation_id; let method_func = format_ident!("{}", method.method.as_str()); - let body_impl = quote! { + let build_impl = quote! { #url_path #headers_build - #[allow(unused_mut)] - let mut #request_ident = #client_value.client + #client_value.client . #method_func (#url_ident) #accept_header #(#body_func)* #( .query(#query_params) )* #headers_use #websock_hdrs - .build()?; + }; + // Assumes `request: reqwest::Request` + let send_impl = quote! { let info = OperationInfo { operation_id: #operation_id, }; @@ -1107,11 +1113,11 @@ impl Generator { #pre_hook #pre_hook_async #client_value - .pre(&mut #request_ident, &info) + .pre(&mut request, &info) .await?; let #result_ident = #client_value - .exec(#request_ident, &info) + .exec(request, &info) .await; #client_value @@ -1161,7 +1167,8 @@ impl Generator { Ok(MethodSigBody { success: response_type.into_tokens(&self.type_space), error: error_type.into_tokens(&self.type_space), - body: body_impl, + build: build_impl, + send: send_impl, }) } @@ -1353,14 +1360,14 @@ impl Generator { /// also has a corresponding method: /// ```ignore /// impl<'a> OperationId<'a> { - /// pub fn param_1(self, value: V) + /// pub fn param_1(self, value: V) -> Self /// where V: std::convert::TryInto /// { /// self.param_1 = value.try_into() /// .map_err(|_| #err_msg.to_string()); /// self /// } - /// pub fn param_2(self, value: V) + /// pub fn param_2(self, value: V) -> Self /// where V: std::convert::TryInto /// { /// self.param_2 = value.try_into() @@ -1416,7 +1423,7 @@ impl Generator { method: &OperationMethod, tag_style: TagStyle, has_inner: bool, - ) -> Result { + ) -> Result<(TokenStream, TokenStream)> { let struct_name = sanitize(&method.operation_id, Case::Pascal); let struct_ident = format_ident!("{}", struct_name); @@ -1652,11 +1659,12 @@ impl Generator { let MethodSigBody { success, error, - body, + build, + send, } = self.method_sig_body( method, quote! { super::Client }, - quote! { #client_ident }, + quote! { client }, has_inner, )?; @@ -1671,6 +1679,14 @@ impl Generator { ResponseValue<#success>, Error<#error>, > { + self.build()?.send().await + } + }; + + let build_impl = quote! { + pub fn build(self) + -> Result, Error<#error>> + { // Destructure the builder for convenience. let Self { #client_ident, @@ -1690,8 +1706,11 @@ impl Generator { .map_err(Error::InvalidRequest)?; )* - // Do the work. - #body + let request = {#build}; + Ok(built::#struct_ident { + client: #client_ident, + request, + }) } }; @@ -1856,7 +1875,7 @@ impl Generator { } }; - Ok(quote! { + let builder = quote! { #[doc = #struct_doc] #derive pub struct #struct_ident<'a> { @@ -1874,9 +1893,46 @@ impl Generator { #( #param_impls )* #send_impl + #build_impl #stream_impl } - }) + }; + + let built = quote! { + pub struct #struct_ident<'a> { + pub (crate) client: &'a super::super::Client, + pub (crate) request: reqwest::RequestBuilder, + } + + impl<'a> #struct_ident<'a> { + pub async fn send(self) -> Result< + ResponseValue<#success>, + Error<#error>, + > { + let Self { + client, + request + } = self; + + #[allow(unused_mut)] + let mut request = request.build()?; + + #send + } + + pub fn map_request(self, f: F) -> Self + where F: Fn(reqwest::RequestBuilder) + -> reqwest::RequestBuilder + { + Self { + client: self.client, + request: f(self.request) + } + } + } + }; + + Ok((builder, built)) } fn builder_helper(&self, method: &OperationMethod) -> BuilderImpl { diff --git a/progenitor-impl/tests/output/src/buildomat_builder.rs b/progenitor-impl/tests/output/src/buildomat_builder.rs index 5514fe81..9be37f46 100644 --- a/progenitor-impl/tests/output/src/buildomat_builder.rs +++ b/progenitor-impl/tests/output/src/buildomat_builder.rs @@ -2801,6 +2801,715 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct ControlHold<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ControlHold<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "control_hold", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ControlResume<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ControlResume<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "control_resume", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskGet<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TasksGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TasksGet<'a> { + pub async fn send( + self, + ) -> Result>, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "tasks_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskSubmit<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskSubmit<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_submit", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskEventsGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskEventsGet<'a> { + pub async fn send( + self, + ) -> Result>, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_events_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskOutputsGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskOutputsGet<'a> { + pub async fn send( + self, + ) -> Result>, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_outputs_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskOutputDownload<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskOutputDownload<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_output_download", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UserCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UserCreate<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "user_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct Whoami<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Whoami<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "whoami", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WhoamiPutName<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WhoamiPutName<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "whoami_put_name", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerBootstrap<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerBootstrap<'a> { + pub async fn send( + self, + ) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_bootstrap", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerPing<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerPing<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_ping", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskAppend<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskAppend<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_append", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskUploadChunk<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskUploadChunk<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_upload_chunk", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskComplete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskComplete<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_complete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskAddOutput<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskAddOutput<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_add_output", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkersList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkersList<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "workers_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkersRecycle<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkersRecycle<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "workers_recycle", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct GetThingOrThings<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> GetThingOrThings<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "get_thing_or_things", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct HeaderArg<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> HeaderArg<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "header_arg", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + 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))), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::control_hold`] /// ///[`Client::control_hold`]: super::Client::control_hold @@ -2816,34 +3525,31 @@ pub mod builder { ///Sends a `POST` request to `/v1/control/hold` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "control_hold", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ControlHold { + client: client, + request, + }) } } @@ -2862,26 +3568,24 @@ pub mod builder { ///Sends a `POST` request to `/v1/control/resume` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.post(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "control_resume", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ControlResume { + client: client, + request, + }) } } @@ -2914,39 +3618,36 @@ pub mod builder { ///Sends a `GET` request to `/v1/task/{Task}` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_get", + let request = { + let url = format!( + "{}/v1/task/{}", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskGet { + client: client, + request, + }) } } @@ -2965,34 +3666,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/tasks` pub async fn send(self) -> Result>, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "tasks_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TasksGet { + client: client, + request, + }) } } @@ -3035,38 +3733,35 @@ pub mod builder { ///Sends a `POST` request to `/v1/tasks` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_submit", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskSubmit { + client: client, + request, + }) } } @@ -3114,6 +3809,10 @@ pub mod builder { pub async fn send( self, ) -> Result>, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, @@ -3121,38 +3820,31 @@ pub mod builder { } = self; let task = task.map_err(Error::InvalidRequest)?; let minseq = minseq.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/tasks/{}/events", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("minseq", &minseq)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_events_get", + let request = { + let url = format!( + "{}/v1/tasks/{}/events", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("minseq", &minseq)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskEventsGet { + client: client, + request, + }) } } @@ -3187,39 +3879,36 @@ pub mod builder { pub async fn send( self, ) -> Result>, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task } = self; let task = task.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/tasks/{}/outputs", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_outputs_get", + let request = { + let url = format!( + "{}/v1/tasks/{}/outputs", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskOutputsGet { + client: client, + request, + }) } } @@ -3264,6 +3953,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, @@ -3271,30 +3964,24 @@ pub mod builder { } = self; let task = task.map_err(Error::InvalidRequest)?; let output = output.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/tasks/{}/outputs/{}", - client.baseurl, - encode_path(&task.to_string()), - encode_path(&output.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.get(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "task_output_download", + let request = { + let url = format!( + "{}/v1/tasks/{}/outputs/{}", + client.baseurl, + encode_path(&task.to_string()), + encode_path(&output.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.get(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskOutputDownload { + client: client, + request, + }) } } @@ -3337,38 +4024,35 @@ pub mod builder { ///Sends a `POST` request to `/v1/users` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "user_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UserCreate { + client: client, + request, + }) } } @@ -3387,34 +4071,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/whoami` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "whoami", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Whoami { + client: client, + request, + }) } } @@ -3448,36 +4129,33 @@ pub mod builder { ///Sends a `PUT` request to `/v1/whoami/name` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("text/plain"), - ) - .body(body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "whoami_put_name", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("text/plain"), + ) + .body(body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WhoamiPutName { + client: client, + request, + }) } } @@ -3520,38 +4198,35 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/bootstrap` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_bootstrap", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerBootstrap { + client: client, + request, + }) } } @@ -3570,34 +4245,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/worker/ping` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_ping", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerPing { + client: client, + request, + }) } } @@ -3654,39 +4326,32 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/append` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body .and_then(|v| types::WorkerAppendTask::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/append", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_append", + let request = { + let url = format!( + "{}/v1/worker/task/{}/append", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskAppend { + client: client, + request, + }) } } @@ -3731,45 +4396,42 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/chunk` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/chunk", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("application/octet-stream"), - ) - .body(body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_upload_chunk", + let request = { + let url = format!( + "{}/v1/worker/task/{}/chunk", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("application/octet-stream"), + ) + .body(body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskUploadChunk { + client: client, + request, + }) } } @@ -3826,39 +4488,32 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/complete` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body .and_then(|v| types::WorkerCompleteTask::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/complete", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_complete", + let request = { + let url = format!( + "{}/v1/worker/task/{}/complete", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskComplete { + client: client, + request, + }) } } @@ -3913,39 +4568,32 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/output` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body .and_then(|v| types::WorkerAddOutput::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/output", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_add_output", + let request = { + let url = format!( + "{}/v1/worker/task/{}/output", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskAddOutput { + client: client, + request, + }) } } @@ -3964,34 +4612,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/workers` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "workers_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkersList { + client: client, + request, + }) } } @@ -4010,26 +4655,24 @@ pub mod builder { ///Sends a `POST` request to `/v1/workers/recycle` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.post(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "workers_recycle", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkersRecycle { + client: client, + request, + }) } } @@ -4063,36 +4706,33 @@ pub mod builder { ///Sends a `GET` request to `/v1/things` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("id", &id)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "get_thing_or_things", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("id", &id)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::GetThingOrThings { + client: client, + request, + }) } } @@ -4125,33 +4765,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/header-arg` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - if let Some(value) = accept_language { - header_map.append("accept-language", value.to_string().try_into()?); - } - #[allow(unused_mut)] - let mut request = client.client.get(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "header_arg", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + if let Some(value) = accept_language { + header_map.append("accept-language", value.to_string().try_into()?); + } + client.client.get(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - 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))), - } + Ok(built::HeaderArg { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs b/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs index 406eaf8d..b3767677 100644 --- a/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/buildomat_builder_tagged.rs @@ -2758,6 +2758,715 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct ControlHold<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ControlHold<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "control_hold", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ControlResume<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ControlResume<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "control_resume", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskGet<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TasksGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TasksGet<'a> { + pub async fn send( + self, + ) -> Result>, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "tasks_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskSubmit<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskSubmit<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_submit", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskEventsGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskEventsGet<'a> { + pub async fn send( + self, + ) -> Result>, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_events_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskOutputsGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskOutputsGet<'a> { + pub async fn send( + self, + ) -> Result>, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_outputs_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TaskOutputDownload<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TaskOutputDownload<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "task_output_download", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UserCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UserCreate<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "user_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct Whoami<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Whoami<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "whoami", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WhoamiPutName<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WhoamiPutName<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "whoami_put_name", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerBootstrap<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerBootstrap<'a> { + pub async fn send( + self, + ) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_bootstrap", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerPing<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerPing<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_ping", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskAppend<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskAppend<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_append", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskUploadChunk<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskUploadChunk<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_upload_chunk", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskComplete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskComplete<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_complete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkerTaskAddOutput<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkerTaskAddOutput<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "worker_task_add_output", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkersList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkersList<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "workers_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct WorkersRecycle<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> WorkersRecycle<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "workers_recycle", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct GetThingOrThings<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> GetThingOrThings<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "get_thing_or_things", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct HeaderArg<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> HeaderArg<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "header_arg", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + 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))), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::control_hold`] /// ///[`Client::control_hold`]: super::Client::control_hold @@ -2773,34 +3482,31 @@ pub mod builder { ///Sends a `POST` request to `/v1/control/hold` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "control_hold", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ControlHold { + client: client, + request, + }) } } @@ -2819,26 +3525,24 @@ pub mod builder { ///Sends a `POST` request to `/v1/control/resume` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.post(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "control_resume", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ControlResume { + client: client, + request, + }) } } @@ -2871,39 +3575,36 @@ pub mod builder { ///Sends a `GET` request to `/v1/task/{Task}` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_get", + let request = { + let url = format!( + "{}/v1/task/{}", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskGet { + client: client, + request, + }) } } @@ -2922,34 +3623,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/tasks` pub async fn send(self) -> Result>, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "tasks_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TasksGet { + client: client, + request, + }) } } @@ -2992,38 +3690,35 @@ pub mod builder { ///Sends a `POST` request to `/v1/tasks` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_submit", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskSubmit { + client: client, + request, + }) } } @@ -3071,6 +3766,10 @@ pub mod builder { pub async fn send( self, ) -> Result>, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, @@ -3078,38 +3777,31 @@ pub mod builder { } = self; let task = task.map_err(Error::InvalidRequest)?; let minseq = minseq.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/tasks/{}/events", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("minseq", &minseq)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_events_get", + let request = { + let url = format!( + "{}/v1/tasks/{}/events", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("minseq", &minseq)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskEventsGet { + client: client, + request, + }) } } @@ -3144,39 +3836,36 @@ pub mod builder { pub async fn send( self, ) -> Result>, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task } = self; let task = task.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/tasks/{}/outputs", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "task_outputs_get", + let request = { + let url = format!( + "{}/v1/tasks/{}/outputs", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskOutputsGet { + client: client, + request, + }) } } @@ -3221,6 +3910,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, @@ -3228,30 +3921,24 @@ pub mod builder { } = self; let task = task.map_err(Error::InvalidRequest)?; let output = output.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/tasks/{}/outputs/{}", - client.baseurl, - encode_path(&task.to_string()), - encode_path(&output.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.get(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "task_output_download", + let request = { + let url = format!( + "{}/v1/tasks/{}/outputs/{}", + client.baseurl, + encode_path(&task.to_string()), + encode_path(&output.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.get(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TaskOutputDownload { + client: client, + request, + }) } } @@ -3294,38 +3981,35 @@ pub mod builder { ///Sends a `POST` request to `/v1/users` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "user_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UserCreate { + client: client, + request, + }) } } @@ -3344,34 +4028,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/whoami` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "whoami", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Whoami { + client: client, + request, + }) } } @@ -3405,36 +4086,33 @@ pub mod builder { ///Sends a `PUT` request to `/v1/whoami/name` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("text/plain"), - ) - .body(body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "whoami_put_name", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("text/plain"), + ) + .body(body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WhoamiPutName { + client: client, + request, + }) } } @@ -3477,38 +4155,35 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/bootstrap` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_bootstrap", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerBootstrap { + client: client, + request, + }) } } @@ -3527,34 +4202,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/worker/ping` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_ping", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerPing { + client: client, + request, + }) } } @@ -3611,39 +4283,32 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/append` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body .and_then(|v| types::WorkerAppendTask::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/append", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_append", + let request = { + let url = format!( + "{}/v1/worker/task/{}/append", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskAppend { + client: client, + request, + }) } } @@ -3688,45 +4353,42 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/chunk` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/chunk", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("application/octet-stream"), - ) - .body(body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_upload_chunk", + let request = { + let url = format!( + "{}/v1/worker/task/{}/chunk", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("application/octet-stream"), + ) + .body(body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskUploadChunk { + client: client, + request, + }) } } @@ -3783,39 +4445,32 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/complete` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body .and_then(|v| types::WorkerCompleteTask::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/complete", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_complete", + let request = { + let url = format!( + "{}/v1/worker/task/{}/complete", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskComplete { + client: client, + request, + }) } } @@ -3870,39 +4525,32 @@ pub mod builder { ///Sends a `POST` request to `/v1/worker/task/{task}/output` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, task, body } = self; let task = task.map_err(Error::InvalidRequest)?; let body = body .and_then(|v| types::WorkerAddOutput::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/worker/task/{}/output", - client.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "worker_task_add_output", + let request = { + let url = format!( + "{}/v1/worker/task/{}/output", + client.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkerTaskAddOutput { + client: client, + request, + }) } } @@ -3921,34 +4569,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/workers` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "workers_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkersList { + client: client, + request, + }) } } @@ -3967,26 +4612,24 @@ pub mod builder { ///Sends a `POST` request to `/v1/workers/recycle` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.post(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "workers_recycle", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::WorkersRecycle { + client: client, + request, + }) } } @@ -4020,36 +4663,33 @@ pub mod builder { ///Sends a `GET` request to `/v1/things` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("id", &id)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "get_thing_or_things", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("id", &id)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::GetThingOrThings { + client: client, + request, + }) } } @@ -4082,33 +4722,31 @@ pub mod builder { ///Sends a `GET` request to `/v1/header-arg` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - if let Some(value) = accept_language { - header_map.append("accept-language", value.to_string().try_into()?); - } - #[allow(unused_mut)] - let mut request = client.client.get(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "header_arg", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + if let Some(value) = accept_language { + header_map.append("accept-language", value.to_string().try_into()?); + } + client.client.get(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - 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))), - } + Ok(built::HeaderArg { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/buildomat_positional.rs b/progenitor-impl/tests/output/src/buildomat_positional.rs index 4cb3d858..4ccd63e4 100644 --- a/progenitor-impl/tests/output/src/buildomat_positional.rs +++ b/progenitor-impl/tests/output/src/buildomat_positional.rs @@ -1026,22 +1026,24 @@ impl ClientHooks<()> for &Client {} impl Client { ///Sends a `POST` request to `/v1/control/hold` pub async fn control_hold<'a>(&'a self) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "control_hold", }; @@ -1057,14 +1059,18 @@ impl Client { ///Sends a `POST` request to `/v1/control/resume` pub async fn control_resume<'a>(&'a self) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self.client.post(url).headers(header_map).build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.post(url).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "control_resume", }; @@ -1083,26 +1089,28 @@ impl Client { &'a self, task: &'a str, ) -> Result, Error<()>> { - let url = format!( - "{}/v1/task/{}", - self.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/task/{}", + self.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "task_get", }; @@ -1120,22 +1128,24 @@ impl Client { pub async fn tasks_get<'a>( &'a self, ) -> Result>, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "tasks_get", }; @@ -1154,23 +1164,25 @@ impl Client { &'a self, body: &'a types::TaskSubmit, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "task_submit", }; @@ -1190,27 +1202,29 @@ impl Client { task: &'a str, minseq: Option, ) -> Result>, Error<()>> { - let url = format!( - "{}/v1/tasks/{}/events", - self.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("minseq", &minseq)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/tasks/{}/events", + self.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("minseq", &minseq)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "task_events_get", }; @@ -1229,26 +1243,28 @@ impl Client { &'a self, task: &'a str, ) -> Result>, Error<()>> { - let url = format!( - "{}/v1/tasks/{}/outputs", - self.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/tasks/{}/outputs", + self.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "task_outputs_get", }; @@ -1268,19 +1284,23 @@ impl Client { task: &'a str, output: &'a str, ) -> Result, Error<()>> { - let url = format!( - "{}/v1/tasks/{}/outputs/{}", - self.baseurl, - encode_path(&task.to_string()), - encode_path(&output.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self.client.get(url).headers(header_map).build()?; + let mut request = { + let url = format!( + "{}/v1/tasks/{}/outputs/{}", + self.baseurl, + encode_path(&task.to_string()), + encode_path(&output.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.get(url).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "task_output_download", }; @@ -1299,23 +1319,25 @@ impl Client { &'a self, body: &'a types::UserCreate, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "user_create", }; @@ -1331,22 +1353,24 @@ impl Client { ///Sends a `GET` request to `/v1/whoami` pub async fn whoami<'a>(&'a self) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "whoami", }; @@ -1365,23 +1389,25 @@ impl Client { &'a self, body: String, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("text/plain"), - ) - .body(body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("text/plain"), + ) + .body(body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "whoami_put_name", }; @@ -1400,23 +1426,25 @@ impl Client { &'a self, body: &'a types::WorkerBootstrap, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "worker_bootstrap", }; @@ -1434,22 +1462,24 @@ impl Client { pub async fn worker_ping<'a>( &'a self, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "worker_ping", }; @@ -1469,23 +1499,22 @@ impl Client { task: &'a str, body: &'a types::WorkerAppendTask, ) -> Result, Error<()>> { - let url = format!( - "{}/v1/worker/task/{}/append", - self.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/worker/task/{}/append", + self.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.post(url).json(&body).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "worker_task_append", }; @@ -1505,31 +1534,33 @@ impl Client { task: &'a str, body: B, ) -> Result, Error<()>> { - let url = format!( - "{}/v1/worker/task/{}/chunk", - self.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("application/octet-stream"), - ) - .body(body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/worker/task/{}/chunk", + self.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("application/octet-stream"), + ) + .body(body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "worker_task_upload_chunk", }; @@ -1549,23 +1580,22 @@ impl Client { task: &'a str, body: &'a types::WorkerCompleteTask, ) -> Result, Error<()>> { - let url = format!( - "{}/v1/worker/task/{}/complete", - self.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/worker/task/{}/complete", + self.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.post(url).json(&body).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "worker_task_complete", }; @@ -1585,23 +1615,22 @@ impl Client { task: &'a str, body: &'a types::WorkerAddOutput, ) -> Result, Error<()>> { - let url = format!( - "{}/v1/worker/task/{}/output", - self.baseurl, - encode_path(&task.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/worker/task/{}/output", + self.baseurl, + encode_path(&task.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.post(url).json(&body).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "worker_task_add_output", }; @@ -1619,22 +1648,24 @@ impl Client { pub async fn workers_list<'a>( &'a self, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "workers_list", }; @@ -1650,14 +1681,18 @@ impl Client { ///Sends a `POST` request to `/v1/workers/recycle` pub async fn workers_recycle<'a>(&'a self) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self.client.post(url).headers(header_map).build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.post(url).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "workers_recycle", }; @@ -1676,23 +1711,25 @@ impl Client { &'a self, id: Option<&'a types::GetThingOrThingsId>, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("id", &id)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("id", &id)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "get_thing_or_things", }; @@ -1711,18 +1748,21 @@ impl Client { &'a self, accept_language: Option, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); - if let Some(value) = accept_language { - header_map.append("accept-language", value.to_string().try_into()?); + #[allow(unused_mut)] + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + if let Some(value) = accept_language { + header_map.append("accept-language", value.to_string().try_into()?); + } + self.client.get(url).headers(header_map) } - #[allow(unused_mut)] - let mut request = self.client.get(url).headers(header_map).build()?; + .build()?; let info = OperationInfo { operation_id: "header_arg", }; diff --git a/progenitor-impl/tests/output/src/cli_gen_builder.rs b/progenitor-impl/tests/output/src/cli_gen_builder.rs index 517965bd..e97029fa 100644 --- a/progenitor-impl/tests/output/src/cli_gen_builder.rs +++ b/progenitor-impl/tests/output/src/cli_gen_builder.rs @@ -227,6 +227,47 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct Uno<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Uno<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "uno", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::uno`] /// ///[`Client::uno`]: super::Client::uno @@ -278,6 +319,10 @@ pub mod builder { ///Sends a `GET` request to `/uno` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, gateway, @@ -287,31 +332,24 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .json(&body) - .query(&progenitor_client::QueryParam::new("gateway", &gateway)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "uno", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .json(&body) + .query(&progenitor_client::QueryParam::new("gateway", &gateway)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Uno { + client: client, + request, + }) } } } 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 3374d35e..33992028 100644 --- a/progenitor-impl/tests/output/src/cli_gen_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/cli_gen_builder_tagged.rs @@ -225,6 +225,47 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct Uno<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Uno<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "uno", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::uno`] /// ///[`Client::uno`]: super::Client::uno @@ -276,6 +317,10 @@ pub mod builder { ///Sends a `GET` request to `/uno` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, gateway, @@ -285,31 +330,24 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .json(&body) - .query(&progenitor_client::QueryParam::new("gateway", &gateway)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "uno", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .json(&body) + .query(&progenitor_client::QueryParam::new("gateway", &gateway)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Uno { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/cli_gen_positional.rs b/progenitor-impl/tests/output/src/cli_gen_positional.rs index 720c6d9b..826c6362 100644 --- a/progenitor-impl/tests/output/src/cli_gen_positional.rs +++ b/progenitor-impl/tests/output/src/cli_gen_positional.rs @@ -140,20 +140,22 @@ impl Client { gateway: &'a str, body: &'a types::UnoBody, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .json(&body) - .query(&progenitor_client::QueryParam::new("gateway", &gateway)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .json(&body) + .query(&progenitor_client::QueryParam::new("gateway", &gateway)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "uno", }; diff --git a/progenitor-impl/tests/output/src/keeper_builder.rs b/progenitor-impl/tests/output/src/keeper_builder.rs index d6c1aa16..33ba8782 100644 --- a/progenitor-impl/tests/output/src/keeper_builder.rs +++ b/progenitor-impl/tests/output/src/keeper_builder.rs @@ -1427,6 +1427,212 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct Enrol<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Enrol<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "enrol", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct GlobalJobs<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> GlobalJobs<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "global_jobs", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct Ping<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Ping<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ping", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ReportFinish<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ReportFinish<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "report_finish", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ReportOutput<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ReportOutput<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "report_output", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ReportStart<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ReportStart<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "report_start", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::enrol`] /// ///[`Client::enrol`]: super::Client::enrol @@ -1478,6 +1684,10 @@ pub mod builder { ///Sends a `POST` request to `/enrol` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1487,31 +1697,20 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "enrol", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Enrol { + client: client, + request, + }) } } @@ -1544,39 +1743,36 @@ pub mod builder { ///Sends a `GET` request to `/global/jobs` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "global_jobs", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::GlobalJobs { + client: client, + request, + }) } } @@ -1609,39 +1805,36 @@ pub mod builder { ///Sends a `GET` request to `/ping` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ping", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Ping { + client: client, + request, + }) } } @@ -1698,6 +1891,10 @@ pub mod builder { ///Sends a `POST` request to `/report/finish` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1707,35 +1904,28 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "report_finish", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ReportFinish { + client: client, + request, + }) } } @@ -1792,6 +1982,10 @@ pub mod builder { ///Sends a `POST` request to `/report/output` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1801,35 +1995,28 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "report_output", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ReportOutput { + client: client, + request, + }) } } @@ -1884,6 +2071,10 @@ pub mod builder { ///Sends a `POST` request to `/report/start` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1893,35 +2084,28 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "report_start", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ReportStart { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/keeper_builder_tagged.rs b/progenitor-impl/tests/output/src/keeper_builder_tagged.rs index ee0698fa..243208c5 100644 --- a/progenitor-impl/tests/output/src/keeper_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/keeper_builder_tagged.rs @@ -1407,6 +1407,212 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct Enrol<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Enrol<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "enrol", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct GlobalJobs<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> GlobalJobs<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "global_jobs", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct Ping<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Ping<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ping", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ReportFinish<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ReportFinish<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "report_finish", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ReportOutput<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ReportOutput<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "report_output", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ReportStart<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ReportStart<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "report_start", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::enrol`] /// ///[`Client::enrol`]: super::Client::enrol @@ -1458,6 +1664,10 @@ pub mod builder { ///Sends a `POST` request to `/enrol` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1467,31 +1677,20 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "enrol", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Enrol { + client: client, + request, + }) } } @@ -1524,39 +1723,36 @@ pub mod builder { ///Sends a `GET` request to `/global/jobs` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "global_jobs", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::GlobalJobs { + client: client, + request, + }) } } @@ -1589,39 +1785,36 @@ pub mod builder { ///Sends a `GET` request to `/ping` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, } = self; let authorization = authorization.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ping", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Ping { + client: client, + request, + }) } } @@ -1678,6 +1871,10 @@ pub mod builder { ///Sends a `POST` request to `/report/finish` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1687,35 +1884,28 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "report_finish", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ReportFinish { + client: client, + request, + }) } } @@ -1772,6 +1962,10 @@ pub mod builder { ///Sends a `POST` request to `/report/output` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1781,35 +1975,28 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "report_output", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ReportOutput { + client: client, + request, + }) } } @@ -1864,6 +2051,10 @@ pub mod builder { ///Sends a `POST` request to `/report/start` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, authorization, @@ -1873,35 +2064,28 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "report_start", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ReportStart { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/keeper_positional.rs b/progenitor-impl/tests/output/src/keeper_positional.rs index 90f7c02c..c3c8304f 100644 --- a/progenitor-impl/tests/output/src/keeper_positional.rs +++ b/progenitor-impl/tests/output/src/keeper_positional.rs @@ -520,20 +520,19 @@ impl Client { authorization: &'a str, body: &'a types::EnrolBody, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + self.client.post(url).json(&body).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "enrol", }; @@ -555,23 +554,25 @@ impl Client { &'a self, authorization: &'a str, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "global_jobs", }; @@ -593,23 +594,25 @@ impl Client { &'a self, authorization: &'a str, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ping", }; @@ -633,24 +636,26 @@ impl Client { authorization: &'a str, body: &'a types::ReportFinishBody, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "report_finish", }; @@ -674,24 +679,26 @@ impl Client { authorization: &'a str, body: &'a types::ReportOutputBody, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "report_output", }; @@ -715,24 +722,26 @@ impl Client { authorization: &'a str, body: &'a types::ReportStartBody, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); - header_map.append("Authorization", authorization.to_string().try_into()?); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + header_map.append("Authorization", authorization.to_string().try_into()?); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "report_start", }; diff --git a/progenitor-impl/tests/output/src/nexus_builder.rs b/progenitor-impl/tests/output/src/nexus_builder.rs index 5fb67385..3c0c202c 100644 --- a/progenitor-impl/tests/output/src/nexus_builder.rs +++ b/progenitor-impl/tests/output/src/nexus_builder.rs @@ -30027,6 +30027,7718 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct DiskViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DeviceAuthRequest<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DeviceAuthRequest<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "device_auth_request", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DeviceAuthConfirm<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DeviceAuthConfirm<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "device_auth_confirm", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DeviceAccessToken<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DeviceAccessToken<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "device_access_token", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct GroupList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> GroupList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "group_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginSpoof<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginSpoof<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_spoof", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginLocal<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginLocal<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_local", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginSamlBegin<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginSamlBegin<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_saml_begin", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginSaml<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginSaml<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_saml", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct Logout<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Logout<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "logout", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectUpdate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskMetricsList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskMetricsList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_metrics_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskAttach<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskAttach<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_attach", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskDetach<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskDetach<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_detach", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceExternalIpList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceExternalIpList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_external_ip_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceMigrate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceMigrate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_migrate", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceReboot<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceReboot<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_reboot", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsole<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsole<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsoleStream<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsoleStream<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console_stream", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 101u16 => ResponseValue::upgrade(response).await, + 200..=299 => ResponseValue::upgrade(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStart<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStart<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_start", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStop<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStop<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_stop", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcUpdate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcFirewallRulesView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcFirewallRulesView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_firewall_rules_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcFirewallRulesUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcFirewallRulesUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_firewall_rules_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetListNetworkInterfaces<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetListNetworkInterfaces<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_list_network_interfaces", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct PolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> PolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct PolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> PolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RoleList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RoleList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "role_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RoleView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RoleView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "role_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionMe<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionMe<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_me", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionMeGroups<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionMeGroups<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_me_groups", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct PhysicalDiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> PhysicalDiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "physical_disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RackList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RackList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "rack_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RackView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RackView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "rack_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SledList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SledList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "sled_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SledView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SledView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "sled_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SledPhysicalDiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SledPhysicalDiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "sled_physical_disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolUpdate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolRangeList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolRangeList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_range_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolRangeAdd<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolRangeAdd<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_range_add", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolRangeRemove<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolRangeRemove<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_range_remove", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceRangeList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceRangeList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_range_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceRangeAdd<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceRangeAdd<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_range_add", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceRangeRemove<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceRangeRemove<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_range_remove", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemMetric<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemMetric<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_metric", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SagaList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SagaList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saga_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SagaView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SagaView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saga_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloIdentityProviderList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloIdentityProviderList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_identity_provider_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LocalIdpUserCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LocalIdpUserCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "local_idp_user_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LocalIdpUserDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LocalIdpUserDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "local_idp_user_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LocalIdpUserSetPassword<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LocalIdpUserSetPassword<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "local_idp_user_set_password", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SamlIdentityProviderCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SamlIdentityProviderCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saml_identity_provider_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SamlIdentityProviderView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SamlIdentityProviderView<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saml_identity_provider_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloUsersList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloUsersList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_users_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloUserView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloUserView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_user_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUserList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUserList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_user_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUserView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUserView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_user_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TimeseriesSchemaGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TimeseriesSchemaGet<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "timeseries_schema_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UserList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UserList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "user_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskCreateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskViewV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceCreateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceViewV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskAttachV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskAttachV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_attach_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskDetachV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskDetachV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_detach_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceMigrateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceMigrateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_migrate_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceRebootV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceRebootV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_reboot_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsoleV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsoleV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsoleStreamV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsoleStreamV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console_stream_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 101u16 => ResponseValue::upgrade(response).await, + 200..=299 => ResponseValue::upgrade(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStartV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStartV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_start_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStopV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStopV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_stop_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationCreateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationViewV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationUpdateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyViewV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyUpdateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectCreateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectViewV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectUpdateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyViewV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyUpdateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemComponentVersionList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemComponentVersionList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_component_version_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UpdateDeploymentsList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UpdateDeploymentsList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "update_deployments_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UpdateDeploymentView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UpdateDeploymentView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "update_deployment_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateRefresh<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateRefresh<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_refresh", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateStart<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateStart<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_start", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateStop<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateStop<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_stop", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateComponentsList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateComponentsList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_components_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemVersion<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemVersion<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_version", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::disk_view_by_id`] /// ///[`Client::disk_view_by_id`]: super::Client::disk_view_by_id @@ -30056,45 +37768,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/disks/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_view_by_id", + let request = { + let url = format!( + "{}/by-id/disks/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskViewById { + client: client, + request, + }) } } @@ -30127,45 +37830,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/images/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_view_by_id", + let request = { + let url = format!( + "{}/by-id/images/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageViewById { + client: client, + request, + }) } } @@ -30198,45 +37892,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/instances/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_view_by_id", + let request = { + let url = format!( + "{}/by-id/instances/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceViewById { + client: client, + request, + }) } } @@ -30271,45 +37956,38 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/by-id/network-interfaces/{}", - client.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_view_by_id", + let request = { + let url = format!( + "{}/by-id/network-interfaces/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceViewById { + client: client, + request, + }) } } @@ -30342,45 +38020,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/organizations/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_view_by_id", + let request = { + let url = format!( + "{}/by-id/organizations/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationViewById { + client: client, + request, + }) } } @@ -30413,45 +38082,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/projects/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_view_by_id", + let request = { + let url = format!( + "{}/by-id/projects/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectViewById { + client: client, + request, + }) } } @@ -30484,45 +38144,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/snapshots/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_view_by_id", + let request = { + let url = format!( + "{}/by-id/snapshots/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotViewById { + client: client, + request, + }) } } @@ -30555,45 +38206,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpc-router-routes/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteViewById { + client: client, + request, + }) } } @@ -30626,45 +38268,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpc-routers/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpc-routers/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterViewById { + client: client, + request, + }) } } @@ -30697,45 +38330,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpc-subnets/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetViewById { + client: client, + request, + }) } } @@ -30768,45 +38392,36 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpcs/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpcs/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcViewById { + client: client, + request, + }) } } @@ -30851,34 +38466,31 @@ pub mod builder { ///Sends a `POST` request to `/device/auth` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .form_urlencoded(&body)? - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "device_auth_request", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .form_urlencoded(&body)? + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), - } + Ok(built::DeviceAuthRequest { + client: client, + request, + }) } } @@ -30923,44 +38535,35 @@ pub mod builder { ///Sends a `POST` request to `/device/confirm` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "device_auth_confirm", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DeviceAuthConfirm { + client: client, + request, + }) } } @@ -31007,36 +38610,33 @@ pub mod builder { ///Sends a `POST` request to `/device/token` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| { types::DeviceAccessTokenRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .form_urlencoded(&body)? - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "device_access_token", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .form_urlencoded(&body)? + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), - } + Ok(built::DeviceAccessToken { + client: client, + request, + }) } } @@ -31096,6 +38696,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -31105,45 +38709,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "group_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::GroupList { + client: client, + request, + }) } ///Streams `GET` requests to `/groups` @@ -31232,44 +38823,35 @@ pub mod builder { ///Sends a `POST` request to `/login` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "login_spoof", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginSpoof { + client: client, + request, + }) } } @@ -31329,6 +38911,10 @@ pub mod builder { ///Sends a `POST` request to `/login/{silo_name}/local` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -31340,40 +38926,23 @@ pub mod builder { types::UsernamePasswordCredentials::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/login/{}/local", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "login_local", + let request = { + let url = format!( + "{}/login/{}/local", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginLocal { + client: client, + request, + }) } } @@ -31418,6 +38987,10 @@ pub mod builder { ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -31425,36 +38998,24 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let provider_name = provider_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/login/{}/saml/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.get(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "login_saml_begin", + let request = { + let url = format!( + "{}/login/{}/saml/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.get(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginSamlBegin { + client: client, + request, + }) } } @@ -31511,6 +39072,10 @@ pub mod builder { ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -31520,45 +39085,32 @@ pub mod builder { let silo_name = silo_name.map_err(Error::InvalidRequest)?; let provider_name = provider_name.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/login/{}/saml/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("application/octet-stream"), - ) - .body(body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "login_saml", + let request = { + let url = format!( + "{}/login/{}/saml/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("application/octet-stream"), + ) + .body(body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginSaml { + client: client, + request, + }) } } @@ -31577,40 +39129,31 @@ pub mod builder { ///Sends a `POST` request to `/logout` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "logout", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Logout { + client: client, + request, + }) } } @@ -31670,6 +39213,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -31679,45 +39226,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationList { + client: client, + request, + }) } ///Streams `GET` requests to `/organizations` @@ -31808,44 +39342,35 @@ pub mod builder { ///Sends a `POST` request to `/organizations` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationCreate { + client: client, + request, + }) } } @@ -31878,48 +39403,39 @@ pub mod builder { ///Sends a `GET` request to `/organizations/{organization_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_view", + let request = { + let url = format!( + "{}/organizations/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationView { + client: client, + request, + }) } } @@ -31976,6 +39492,10 @@ pub mod builder { ///Sends a `PUT` request to `/organizations/{organization_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -31985,44 +39505,31 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_update", + let request = { + let url = format!( + "{}/organizations/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationUpdate { + client: client, + request, + }) } } @@ -32055,48 +39562,39 @@ pub mod builder { ///Sends a `DELETE` request to `/organizations/{organization_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_delete", + let request = { + let url = format!( + "{}/organizations/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationDelete { + client: client, + request, + }) } } @@ -32131,48 +39629,39 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_view", + let request = { + let url = format!( + "{}/organizations/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyView { + client: client, + request, + }) } } @@ -32233,6 +39722,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32242,44 +39735,31 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_update", + let request = { + let url = format!( + "{}/organizations/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyUpdate { + client: client, + request, + }) } } @@ -32352,6 +39832,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32363,49 +39847,36 @@ 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/{}/projects", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_list", + let request = { + let url = format!( + "{}/organizations/{}/projects", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -32508,6 +39979,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32517,44 +39992,31 @@ 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!( - "{}/organizations/{}/projects", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_create", + let request = { + let url = format!( + "{}/organizations/{}/projects", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectCreate { + client: client, + request, + }) } } @@ -32600,6 +40062,10 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32607,44 +40073,31 @@ pub mod builder { } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectView { + client: client, + request, + }) } } @@ -32712,6 +40165,10 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32723,45 +40180,32 @@ pub mod builder { let body = body .and_then(|v| types::ProjectUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectUpdate { + client: client, + request, + }) } } @@ -32807,6 +40251,10 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32814,44 +40262,31 @@ pub mod builder { } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectDelete { + client: client, + request, + }) } } @@ -32936,6 +40371,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32949,50 +40388,37 @@ 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/{}/projects/{}/disks", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -33107,6 +40533,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/disks` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33118,45 +40548,32 @@ 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!( - "{}/organizations/{}/projects/{}/disks", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskCreate { + client: client, + request, + }) } } @@ -33215,6 +40632,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33224,45 +40645,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let disk_name = disk_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskView { + client: client, + request, + }) } } @@ -33321,6 +40729,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33330,45 +40742,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let disk_name = disk_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskDelete { + client: client, + request, + }) } } @@ -33493,6 +40892,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33512,56 +40915,43 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let start_time = start_time.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}/metrics/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - encode_path(&metric_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("end_time", &end_time)) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new( - "start_time", - &start_time, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_metrics_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}/metrics/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + encode_path(&metric_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("end_time", &end_time)) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new( + "start_time", + &start_time, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskMetricsList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -33695,6 +41085,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33708,50 +41102,37 @@ 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/{}/projects/{}/images", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -33866,6 +41247,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/images` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33877,45 +41262,32 @@ pub mod builder { let body = body .and_then(|v| types::ImageCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/images", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageCreate { + client: client, + request, + }) } } @@ -33974,6 +41346,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33983,45 +41359,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let image_name = image_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/images/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageView { + client: client, + request, + }) } } @@ -34080,6 +41443,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34089,45 +41456,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let image_name = image_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/images/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageDelete { + client: client, + request, + }) } } @@ -34213,6 +41567,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34226,50 +41584,37 @@ 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/{}/projects/{}/instances", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -34386,6 +41731,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34397,45 +41746,32 @@ 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!( - "{}/organizations/{}/projects/{}/instances", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceCreate { + client: client, + request, + }) } } @@ -34494,6 +41830,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34503,45 +41843,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceView { + client: client, + request, + }) } } @@ -34600,6 +41927,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34609,45 +41940,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDelete { + client: client, + request, + }) } } @@ -34745,6 +42063,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34760,51 +42082,38 @@ 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/{}/projects/{}/instances/{}/disks", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -34933,6 +42242,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/attach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34946,46 +42259,33 @@ pub mod builder { let body = body .and_then(|v| types::DiskIdentifier::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/disks/attach", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_attach", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks/attach", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskAttach { + client: client, + request, + }) } } @@ -35066,6 +42366,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/detach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35079,46 +42383,33 @@ pub mod builder { let body = body .and_then(|v| types::DiskIdentifier::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/disks/detach", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_detach", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks/detach", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskDetach { + client: client, + request, + }) } } @@ -35179,6 +42470,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35188,45 +42483,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/external-ips", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_external_ip_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/external-ips", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceExternalIpList { + client: client, + request, + }) } } @@ -35307,6 +42589,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/migrate` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35320,46 +42606,33 @@ pub mod builder { let body = body .and_then(|v| types::InstanceMigrate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/migrate", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_migrate", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/migrate", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceMigrate { + client: client, + request, + }) } } @@ -35458,6 +42731,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35473,51 +42750,38 @@ 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/{}/projects/{}/instances/{}/network-interfaces", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -35652,6 +42916,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -35665,46 +42935,33 @@ pub mod builder { let body = body .and_then(|v| types::NetworkInterfaceCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceCreate { + client: client, + request, + }) } } @@ -35777,6 +43034,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35788,46 +43049,33 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; let interface_name = interface_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceView { + client: client, + request, + }) } } @@ -35926,6 +43174,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -35941,47 +43195,34 @@ pub mod builder { let body = body .and_then(|v| types::NetworkInterfaceUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceUpdate { + client: client, + request, + }) } } @@ -36052,6 +43293,12 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -36063,46 +43310,33 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; let interface_name = interface_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceDelete { + client: client, + request, + }) } } @@ -36161,6 +43395,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/reboot` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36170,45 +43408,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/reboot", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_reboot", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/reboot", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceReboot { + client: client, + request, + }) } } @@ -36308,6 +43533,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36323,54 +43552,41 @@ pub mod builder { let from_start = from_start.map_err(Error::InvalidRequest)?; let max_bytes = max_bytes.map_err(Error::InvalidRequest)?; let most_recent = most_recent.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/serial-console", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "from_start", - &from_start, - )) - .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) - .query(&progenitor_client::QueryParam::new( - "most_recent", - &most_recent, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/serial-console", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "from_start", + &from_start, + )) + .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) + .query(&progenitor_client::QueryParam::new( + "most_recent", + &most_recent, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsole { + client: client, + request, + }) } } @@ -36431,6 +43647,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -36440,46 +43662,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/serial-console/stream", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console_stream", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/serial-console/stream", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 101u16 => ResponseValue::upgrade(response).await, - 200..=299 => ResponseValue::upgrade(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsoleStream { + client: client, + request, + }) } } @@ -36538,6 +43752,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/start` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36547,45 +43765,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/start", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_start", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/start", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStart { + client: client, + request, + }) } } @@ -36644,6 +43849,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/stop` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36653,45 +43862,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/stop", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_stop", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/stop", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStop { + client: client, + request, + }) } } @@ -36739,6 +43935,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36746,44 +43946,31 @@ pub mod builder { } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyView { + client: client, + request, + }) } } @@ -36855,6 +44042,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36866,45 +44057,32 @@ pub mod builder { let body = body .and_then(|v| types::ProjectRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyUpdate { + client: client, + request, + }) } } @@ -36990,6 +44168,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37003,50 +44185,37 @@ 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/{}/projects/{}/snapshots", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -37163,6 +44332,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37174,45 +44347,32 @@ pub mod builder { let body = body .and_then(|v| types::SnapshotCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/snapshots", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotCreate { + client: client, + request, + }) } } @@ -37271,6 +44431,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37280,45 +44444,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let snapshot_name = snapshot_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/snapshots/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&snapshot_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotView { + client: client, + request, + }) } } @@ -37377,6 +44528,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37386,45 +44541,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let snapshot_name = snapshot_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/snapshots/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&snapshot_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotDelete { + client: client, + request, + }) } } @@ -37509,6 +44651,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37522,50 +44668,37 @@ 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/{}/projects/{}/vpcs", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -37680,6 +44813,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37691,45 +44828,32 @@ pub mod builder { let body = body .and_then(|v| types::VpcCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcCreate { + client: client, + request, + }) } } @@ -37788,6 +44912,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37797,45 +44925,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcView { + client: client, + request, + }) } } @@ -37916,6 +45031,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37929,46 +45048,33 @@ pub mod builder { let body = body .and_then(|v| types::VpcUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcUpdate { + client: client, + request, + }) } } @@ -38027,6 +45133,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38036,45 +45146,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcDelete { + client: client, + request, + }) } } @@ -38135,6 +45232,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38144,45 +45245,32 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_firewall_rules_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcFirewallRulesView { + client: client, + request, + }) } } @@ -38270,6 +45358,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38285,46 +45377,33 @@ pub mod builder { types::VpcFirewallRuleUpdateParams::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_firewall_rules_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcFirewallRulesUpdate { + client: client, + request, + }) } } @@ -38422,6 +45501,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38437,51 +45520,38 @@ 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/{}/projects/{}/vpcs/{}/routers", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -38610,6 +45680,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38623,46 +45697,33 @@ pub mod builder { let body = body .and_then(|v| types::VpcRouterCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterCreate { + client: client, + request, + }) } } @@ -38733,6 +45794,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38744,46 +45809,33 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterView { + client: client, + request, + }) } } @@ -38876,6 +45928,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38891,47 +45947,34 @@ pub mod builder { let body = body .and_then(|v| types::VpcRouterUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterUpdate { + client: client, + request, + }) } } @@ -39002,6 +46045,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39013,46 +46060,33 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterDelete { + client: client, + request, + }) } } @@ -39162,6 +46196,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39179,52 +46217,39 @@ 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/{}/projects/{}/vpcs/{}/routers/{}/routes", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -39369,6 +46394,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39386,47 +46415,34 @@ pub mod builder { types::RouterRouteCreateParams::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteCreate { + client: client, + request, + }) } } @@ -39509,6 +46525,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39522,47 +46542,34 @@ pub mod builder { let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; let route_name = route_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - client.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + client.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteView { + client: client, + request, + }) } } @@ -39671,6 +46678,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39690,48 +46701,35 @@ pub mod builder { types::RouterRouteUpdateParams::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - client.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + client.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteUpdate { + client: client, + request, + }) } } @@ -39814,6 +46812,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39827,47 +46829,34 @@ pub mod builder { let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; let route_name = route_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - client.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + client.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteDelete { + client: client, + request, + }) } } @@ -39965,6 +46954,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39980,51 +46973,38 @@ 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/{}/projects/{}/vpcs/{}/subnets", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -40153,6 +47133,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40166,46 +47150,33 @@ pub mod builder { let body = body .and_then(|v| types::VpcSubnetCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetCreate { + client: client, + request, + }) } } @@ -40276,6 +47247,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40287,46 +47262,33 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let subnet_name = subnet_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetView { + client: client, + request, + }) } } @@ -40419,6 +47381,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40434,47 +47400,34 @@ pub mod builder { let body = body .and_then(|v| types::VpcSubnetUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetUpdate { + client: client, + request, + }) } } @@ -40545,6 +47498,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40556,46 +47513,33 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let subnet_name = subnet_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetDelete { + client: client, + request, + }) } } @@ -40706,6 +47650,12 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -40723,52 +47673,39 @@ 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/{}/projects/{}/vpcs/{}/subnets/{}/network-interfaces", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_list_network_interfaces", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}/network-interfaces", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetListNetworkInterfaces { + client: client, + request, + }) } ///Streams `GET` requests to @@ -40837,40 +47774,31 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "policy_view", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::PolicyView { + client: client, + request, + }) } } @@ -40915,44 +47843,35 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "policy_update", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::PolicyUpdate { + client: client, + request, + }) } } @@ -40999,6 +47918,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -41006,44 +47929,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "role_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RoleList { + client: client, + request, + }) } ///Streams `GET` requests to `/roles` @@ -41121,45 +48031,36 @@ pub mod builder { ///Sends a `GET` request to `/roles/{role_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "role_view", + let request = { + let url = format!( + "{}/roles/{}", + client.baseurl, + encode_path(&role_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RoleView { + client: client, + request, + }) } } @@ -41178,40 +48079,31 @@ pub mod builder { ///Sends a `GET` request to `/session/me` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_me", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionMe { + client: client, + request, + }) } } @@ -41271,6 +48163,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -41280,45 +48176,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_me_groups", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionMeGroups { + client: client, + request, + }) } ///Streams `GET` requests to `/session/me/groups` @@ -41424,6 +48307,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -41433,45 +48320,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyList { + client: client, + request, + }) } ///Streams `GET` requests to `/session/me/sshkeys` @@ -41560,44 +48434,35 @@ pub mod builder { ///Sends a `POST` request to `/session/me/sshkeys` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyCreate { + client: client, + request, + }) } } @@ -41630,48 +48495,39 @@ pub mod builder { ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, ssh_key_name, } = self; let ssh_key_name = ssh_key_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/session/me/sshkeys/{}", - client.baseurl, - encode_path(&ssh_key_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_view", + let request = { + let url = format!( + "{}/session/me/sshkeys/{}", + client.baseurl, + encode_path(&ssh_key_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyView { + client: client, + request, + }) } } @@ -41704,48 +48560,39 @@ pub mod builder { ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, ssh_key_name, } = self; let ssh_key_name = ssh_key_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/session/me/sshkeys/{}", - client.baseurl, - encode_path(&ssh_key_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_delete", + let request = { + let url = format!( + "{}/session/me/sshkeys/{}", + client.baseurl, + encode_path(&ssh_key_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyDelete { + client: client, + request, + }) } } @@ -41778,45 +48625,36 @@ pub mod builder { ///Sends a `GET` request to `/system/by-id/images/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_view_by_id", + let request = { + let url = format!( + "{}/system/by-id/images/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageViewById { + client: client, + request, + }) } } @@ -41849,45 +48687,36 @@ pub mod builder { ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_view_by_id", + let request = { + let url = format!( + "{}/system/by-id/ip-pools/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolViewById { + client: client, + request, + }) } } @@ -41920,45 +48749,36 @@ pub mod builder { ///Sends a `GET` request to `/system/by-id/silos/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_view_by_id", + let request = { + let url = format!( + "{}/system/by-id/silos/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloViewById { + client: client, + request, + }) } } @@ -42018,6 +48838,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -42027,45 +48851,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/certificates` @@ -42156,44 +48967,35 @@ pub mod builder { ///Sends a `POST` request to `/system/certificates` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateCreate { + client: client, + request, + }) } } @@ -42226,48 +49028,39 @@ pub mod builder { ///Sends a `GET` request to `/system/certificates/{certificate}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, certificate, } = self; let certificate = certificate.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/certificates/{}", - client.baseurl, - encode_path(&certificate.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_view", + let request = { + let url = format!( + "{}/system/certificates/{}", + client.baseurl, + encode_path(&certificate.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateView { + client: client, + request, + }) } } @@ -42300,48 +49093,39 @@ pub mod builder { ///Sends a `DELETE` request to `/system/certificates/{certificate}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, certificate, } = self; let certificate = certificate.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/certificates/{}", - client.baseurl, - encode_path(&certificate.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_delete", + let request = { + let url = format!( + "{}/system/certificates/{}", + client.baseurl, + encode_path(&certificate.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateDelete { + client: client, + request, + }) } } @@ -42401,6 +49185,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -42410,45 +49198,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "physical_disk_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::PhysicalDiskList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/disks` @@ -42554,6 +49329,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -42563,45 +49342,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "rack_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RackList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/racks` @@ -42680,45 +49446,36 @@ pub mod builder { ///Sends a `GET` request to `/system/hardware/racks/{rack_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "rack_view", + let request = { + let url = format!( + "{}/system/hardware/racks/{}", + client.baseurl, + encode_path(&rack_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RackView { + client: client, + request, + }) } } @@ -42778,6 +49535,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -42787,45 +49548,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "sled_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SledList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/sleds` @@ -42904,45 +49652,36 @@ pub mod builder { ///Sends a `GET` request to `/system/hardware/sleds/{sled_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "sled_view", + let request = { + let url = format!( + "{}/system/hardware/sleds/{}", + client.baseurl, + encode_path(&sled_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SledView { + client: client, + request, + }) } } @@ -43014,6 +49753,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, sled_id, @@ -43025,49 +49768,36 @@ 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/{}/disks", - client.baseurl, - encode_path(&sled_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "sled_physical_disk_list", + let request = { + let url = format!( + "{}/system/hardware/sleds/{}/disks", + client.baseurl, + encode_path(&sled_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SledPhysicalDiskList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/sleds/{sled_id}/disks` @@ -43173,6 +49903,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -43182,45 +49916,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/images` @@ -43311,44 +50032,35 @@ pub mod builder { ///Sends a `POST` request to `/system/images` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageCreate { + client: client, + request, + }) } } @@ -43381,45 +50093,36 @@ pub mod builder { ///Sends a `GET` request to `/system/images/{image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_view", + let request = { + let url = format!( + "{}/system/images/{}", + client.baseurl, + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageView { + client: client, + request, + }) } } @@ -43452,45 +50155,36 @@ pub mod builder { ///Sends a `DELETE` request to `/system/images/{image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_delete", + let request = { + let url = format!( + "{}/system/images/{}", + client.baseurl, + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageDelete { + client: client, + request, + }) } } @@ -43550,6 +50244,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -43559,45 +50257,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/ip-pools` @@ -43686,44 +50371,35 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolCreate { + client: client, + request, + }) } } @@ -43756,45 +50432,36 @@ pub mod builder { ///Sends a `GET` request to `/system/ip-pools/{pool_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_view", + let request = { + let url = format!( + "{}/system/ip-pools/{}", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolView { + client: client, + request, + }) } } @@ -43849,6 +50516,10 @@ pub mod builder { ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -43858,44 +50529,31 @@ pub mod builder { let body = body .and_then(|v| types::IpPoolUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_update", + let request = { + let url = format!( + "{}/system/ip-pools/{}", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolUpdate { + client: client, + request, + }) } } @@ -43928,45 +50586,36 @@ pub mod builder { ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_delete", + let request = { + let url = format!( + "{}/system/ip-pools/{}", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolDelete { + client: client, + request, + }) } } @@ -44025,6 +50674,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -44034,48 +50687,35 @@ pub mod builder { let pool_name = pool_name.map_err(Error::InvalidRequest)?; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}/ranges", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_range_list", + let request = { + let url = format!( + "{}/system/ip-pools/{}/ranges", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolRangeList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/ip-pools/{pool_name}/ranges` @@ -44165,6 +50805,10 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -44172,44 +50816,31 @@ pub mod builder { } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}/ranges/add", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_range_add", + let request = { + let url = format!( + "{}/system/ip-pools/{}/ranges/add", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolRangeAdd { + client: client, + request, + }) } } @@ -44255,6 +50886,10 @@ pub mod builder { ///Sends a `POST` request to /// `/system/ip-pools/{pool_name}/ranges/remove` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -44262,44 +50897,31 @@ pub mod builder { } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}/ranges/remove", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_range_remove", + let request = { + let url = format!( + "{}/system/ip-pools/{}/ranges/remove", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolRangeRemove { + client: client, + request, + }) } } @@ -44318,40 +50940,31 @@ pub mod builder { ///Sends a `GET` request to `/system/ip-pools-service` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_view", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceView { + client: client, + request, + }) } } @@ -44398,6 +51011,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -44405,44 +51022,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_range_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceRangeList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/ip-pools-service/ranges` @@ -44520,42 +51124,33 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_range_add", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceRangeAdd { + client: client, + request, + }) } } @@ -44588,42 +51183,33 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_range_remove", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceRangeRemove { + client: client, + request, + }) } } @@ -44722,6 +51308,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, metric_name, @@ -44737,54 +51327,41 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let start_time = start_time.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/metrics/{}", - client.baseurl, - encode_path(&metric_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("end_time", &end_time)) - .query(&progenitor_client::QueryParam::new("id", &id)) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new( - "start_time", - &start_time, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_metric", + let request = { + let url = format!( + "{}/system/metrics/{}", + client.baseurl, + encode_path(&metric_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("end_time", &end_time)) + .query(&progenitor_client::QueryParam::new("id", &id)) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new( + "start_time", + &start_time, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemMetric { + client: client, + request, + }) } } @@ -44805,40 +51382,31 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_policy_view", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemPolicyView { + client: client, + request, + }) } } @@ -44883,44 +51451,35 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_policy_update", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemPolicyUpdate { + client: client, + request, + }) } } @@ -44980,6 +51539,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -44989,45 +51552,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saga_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SagaList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/sagas` @@ -45106,45 +51656,36 @@ pub mod builder { ///Sends a `GET` request to `/system/sagas/{saga_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saga_view", + let request = { + let url = format!( + "{}/system/sagas/{}", + client.baseurl, + encode_path(&saga_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SagaView { + client: client, + request, + }) } } @@ -45204,6 +51745,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -45213,45 +51758,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/silos` @@ -45340,44 +51872,35 @@ pub mod builder { ///Sends a `POST` request to `/system/silos` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloCreate { + client: client, + request, + }) } } @@ -45410,45 +51933,36 @@ pub mod builder { ///Sends a `GET` request to `/system/silos/{silo_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_view", + let request = { + let url = format!( + "{}/system/silos/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloView { + client: client, + request, + }) } } @@ -45481,45 +51995,36 @@ pub mod builder { ///Sends a `DELETE` request to `/system/silos/{silo_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_delete", + let request = { + let url = format!( + "{}/system/silos/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloDelete { + client: client, + request, + }) } } @@ -45593,6 +52098,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45604,49 +52113,36 @@ 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/{}/identity-providers", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_identity_provider_list", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloIdentityProviderList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -45749,6 +52245,10 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/local/users` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45758,44 +52258,31 @@ pub mod builder { let body = body .and_then(|v| types::UserCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/local/users", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "local_idp_user_create", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LocalIdpUserCreate { + client: client, + request, + }) } } @@ -45841,6 +52328,10 @@ pub mod builder { ///Sends a `DELETE` request to /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45848,44 +52339,31 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let user_id = user_id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/local/users/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "local_idp_user_delete", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LocalIdpUserDelete { + client: client, + request, + }) } } @@ -45944,6 +52422,10 @@ pub mod builder { /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}/ /// set-password` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45953,45 +52435,32 @@ pub mod builder { let silo_name = silo_name.map_err(Error::InvalidRequest)?; let user_id = user_id.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/local/users/{}/set-password", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "local_idp_user_set_password", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users/{}/set-password", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LocalIdpUserSetPassword { + client: client, + request, + }) } } @@ -46054,6 +52523,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46065,44 +52538,31 @@ pub mod builder { types::SamlIdentityProviderCreate::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/saml", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saml_identity_provider_create", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/saml", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SamlIdentityProviderCreate { + client: client, + request, + }) } } @@ -46150,6 +52610,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46157,44 +52621,31 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let provider_name = provider_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/saml/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saml_identity_provider_view", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/saml/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SamlIdentityProviderView { + client: client, + request, + }) } } @@ -46229,45 +52680,36 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/policy", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_policy_view", + let request = { + let url = format!( + "{}/system/silos/{}/policy", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloPolicyView { + client: client, + request, + }) } } @@ -46324,6 +52766,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46333,44 +52779,31 @@ 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!( - "{}/system/silos/{}/policy", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_policy_update", + let request = { + let url = format!( + "{}/system/silos/{}/policy", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloPolicyUpdate { + client: client, + request, + }) } } @@ -46442,6 +52875,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46453,49 +52890,36 @@ 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/{}/users/all", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_users_list", + let request = { + let url = format!( + "{}/system/silos/{}/users/all", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloUsersList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/silos/{silo_name}/users/all` @@ -46587,6 +53011,10 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/users/id/{user_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46594,44 +53022,31 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let user_id = user_id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/users/id/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_user_view", + let request = { + let url = format!( + "{}/system/silos/{}/users/id/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloUserView { + client: client, + request, + }) } } @@ -46691,6 +53106,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -46700,45 +53119,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_user_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUserList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/user` @@ -46817,45 +53223,36 @@ pub mod builder { ///Sends a `GET` request to `/system/user/{user_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_user_view", + let request = { + let url = format!( + "{}/system/user/{}", + client.baseurl, + encode_path(&user_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUserView { + client: client, + request, + }) } } @@ -46903,6 +53300,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -46910,44 +53311,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "timeseries_schema_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TimeseriesSchemaGet { + client: client, + request, + }) } ///Streams `GET` requests to `/timeseries/schema` @@ -47052,6 +53440,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -47061,45 +53453,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "user_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UserList { + client: client, + request, + }) } ///Streams `GET` requests to `/users` @@ -47231,6 +53610,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -47244,50 +53627,37 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/disks` @@ -47403,6 +53773,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/disks` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -47414,45 +53788,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskCreateV1 { + client: client, + request, + }) } } @@ -47511,6 +53872,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/disks/{disk}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, disk, @@ -47520,48 +53885,35 @@ pub mod builder { let disk = disk.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/disks/{}", - client.baseurl, - encode_path(&disk.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_view_v1", + let request = { + let url = format!( + "{}/v1/disks/{}", + client.baseurl, + encode_path(&disk.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskViewV1 { + client: client, + request, + }) } } @@ -47620,6 +53972,10 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/disks/{disk}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, disk, @@ -47629,48 +53985,35 @@ pub mod builder { let disk = disk.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/disks/{}", - client.baseurl, - encode_path(&disk.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_delete_v1", + let request = { + let url = format!( + "{}/v1/disks/{}", + client.baseurl, + encode_path(&disk.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskDeleteV1 { + client: client, + request, + }) } } @@ -47756,6 +54099,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -47769,50 +54116,37 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/instances` @@ -47928,6 +54262,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -47939,45 +54277,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceCreateV1 { + client: client, + request, + }) } } @@ -48036,6 +54361,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/instances/{instance}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48045,48 +54374,35 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_view_v1", + let request = { + let url = format!( + "{}/v1/instances/{}", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceViewV1 { + client: client, + request, + }) } } @@ -48145,6 +54461,10 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/instances/{instance}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48154,48 +54474,35 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_delete_v1", + let request = { + let url = format!( + "{}/v1/instances/{}", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDeleteV1 { + client: client, + request, + }) } } @@ -48293,6 +54600,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48308,54 +54619,41 @@ 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/{}/disks", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_list_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/disks", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/instances/{instance}/disks` @@ -48484,6 +54782,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48497,49 +54799,36 @@ pub mod builder { let body = body .and_then(|v| types::DiskPath::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/disks/attach", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_attach_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/disks/attach", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskAttachV1 { + client: client, + request, + }) } } @@ -48620,6 +54909,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48633,49 +54926,36 @@ pub mod builder { let body = body .and_then(|v| types::DiskPath::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/disks/detach", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_detach_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/disks/detach", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskDetachV1 { + client: client, + request, + }) } } @@ -48756,6 +55036,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/migrate` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48769,49 +55053,36 @@ pub mod builder { let body = body .and_then(|v| types::InstanceMigrate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/migrate", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_migrate_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/migrate", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceMigrateV1 { + client: client, + request, + }) } } @@ -48870,6 +55141,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/reboot` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48879,48 +55154,35 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/reboot", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_reboot_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/reboot", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceRebootV1 { + client: client, + request, + }) } } @@ -49020,6 +55282,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -49035,57 +55301,44 @@ pub mod builder { let most_recent = most_recent.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/serial-console", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "from_start", - &from_start, - )) - .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) - .query(&progenitor_client::QueryParam::new( - "most_recent", - &most_recent, - )) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/serial-console", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "from_start", + &from_start, + )) + .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) + .query(&progenitor_client::QueryParam::new( + "most_recent", + &most_recent, + )) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsoleV1 { + client: client, + request, + }) } } @@ -49147,6 +55400,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, instance, @@ -49156,49 +55415,41 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/serial-console/stream", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console_stream_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/serial-console/stream", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 101u16 => ResponseValue::upgrade(response).await, - 200..=299 => ResponseValue::upgrade(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsoleStreamV1 { + client: client, + request, + }) } } @@ -49257,6 +55508,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/start` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -49266,48 +55521,35 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/start", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_start_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/start", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStartV1 { + client: client, + request, + }) } } @@ -49366,6 +55608,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/stop` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -49375,48 +55621,35 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/stop", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_stop_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/stop", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStopV1 { + client: client, + request, + }) } } @@ -49476,6 +55709,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -49485,45 +55722,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/organizations` @@ -49614,44 +55838,35 @@ pub mod builder { ///Sends a `POST` request to `/v1/organizations` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationCreateV1 { + client: client, + request, + }) } } @@ -49684,48 +55899,39 @@ pub mod builder { ///Sends a `GET` request to `/v1/organizations/{organization}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, } = self; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_view_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationViewV1 { + client: client, + request, + }) } } @@ -49782,6 +55988,10 @@ pub mod builder { ///Sends a `PUT` request to `/v1/organizations/{organization}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -49791,44 +56001,31 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_update_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationUpdateV1 { + client: client, + request, + }) } } @@ -49861,48 +56058,39 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/organizations/{organization}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, } = self; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_delete_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationDeleteV1 { + client: client, + request, + }) } } @@ -49937,48 +56125,39 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, } = self; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}/policy", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_view_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}/policy", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyViewV1 { + client: client, + request, + }) } } @@ -50039,6 +56218,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -50048,44 +56231,31 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}/policy", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_update_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}/policy", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyUpdateV1 { + client: client, + request, + }) } } @@ -50158,6 +56328,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -50169,49 +56343,36 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/projects` @@ -50313,6 +56474,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/projects` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -50322,44 +56487,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectCreateV1 { + client: client, + request, + }) } } @@ -50405,6 +56557,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/projects/{project}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50412,47 +56568,34 @@ pub mod builder { } = self; let project = project.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_view_v1", + let request = { + let url = format!( + "{}/v1/projects/{}", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectViewV1 { + client: client, + request, + }) } } @@ -50520,6 +56663,10 @@ pub mod builder { ///Sends a `PUT` request to `/v1/projects/{project}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50531,48 +56678,35 @@ pub mod builder { let body = body .and_then(|v| types::ProjectUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_update_v1", + let request = { + let url = format!( + "{}/v1/projects/{}", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectUpdateV1 { + client: client, + request, + }) } } @@ -50618,6 +56752,10 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/projects/{project}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50625,47 +56763,34 @@ pub mod builder { } = self; let project = project.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_delete_v1", + let request = { + let url = format!( + "{}/v1/projects/{}", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectDeleteV1 { + client: client, + request, + }) } } @@ -50713,6 +56838,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50720,47 +56849,34 @@ pub mod builder { } = self; let project = project.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}/policy", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_view_v1", + let request = { + let url = format!( + "{}/v1/projects/{}/policy", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyViewV1 { + client: client, + request, + }) } } @@ -50832,6 +56948,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50843,48 +56963,35 @@ pub mod builder { let body = body .and_then(|v| types::ProjectRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}/policy", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_update_v1", + let request = { + let url = format!( + "{}/v1/projects/{}/policy", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyUpdateV1 { + client: client, + request, + }) } } @@ -50945,6 +57052,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -50954,45 +57065,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_component_version_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemComponentVersionList { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/system/update/components` @@ -51100,6 +57198,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -51109,45 +57211,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "update_deployments_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UpdateDeploymentsList { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/system/update/deployments` @@ -51228,45 +57317,36 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/system/update/deployments/{}", - client.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "update_deployment_view", + let request = { + let url = format!( + "{}/v1/system/update/deployments/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UpdateDeploymentView { + client: client, + request, + }) } } @@ -51285,40 +57365,31 @@ pub mod builder { ///Sends a `POST` request to `/v1/system/update/refresh` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_refresh", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateRefresh { + client: client, + request, + }) } } @@ -51365,44 +57436,35 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_start", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateStart { + client: client, + request, + }) } } @@ -51421,40 +57483,31 @@ pub mod builder { ///Sends a `POST` request to `/v1/system/update/stop` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_stop", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateStop { + client: client, + request, + }) } } @@ -51514,6 +57567,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -51523,45 +57580,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateList { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/system/update/updates` @@ -51640,45 +57684,36 @@ pub mod builder { ///Sends a `GET` request to `/v1/system/update/updates/{version}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_view", + let request = { + let url = format!( + "{}/v1/system/update/updates/{}", + client.baseurl, + encode_path(&version.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateView { + client: client, + request, + }) } } @@ -51714,45 +57749,36 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, version } = self; let version = version.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/system/update/updates/{}/components", - client.baseurl, - encode_path(&version.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_components_list", + let request = { + let url = format!( + "{}/v1/system/update/updates/{}/components", + client.baseurl, + encode_path(&version.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateComponentsList { + client: client, + request, + }) } } @@ -51773,40 +57799,31 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_version", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemVersion { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/nexus_builder_tagged.rs b/progenitor-impl/tests/output/src/nexus_builder_tagged.rs index afe02967..cb5d1c1d 100644 --- a/progenitor-impl/tests/output/src/nexus_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/nexus_builder_tagged.rs @@ -29876,9 +29876,7721 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; - ///Builder for [`ClientDisksExt::disk_view_by_id`] + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct DiskViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DeviceAuthRequest<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DeviceAuthRequest<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "device_auth_request", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DeviceAuthConfirm<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DeviceAuthConfirm<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "device_auth_confirm", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DeviceAccessToken<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DeviceAccessToken<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "device_access_token", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct GroupList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> GroupList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "group_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginSpoof<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginSpoof<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_spoof", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginLocal<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginLocal<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_local", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginSamlBegin<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginSamlBegin<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_saml_begin", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LoginSaml<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LoginSaml<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "login_saml", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct Logout<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> Logout<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "logout", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectUpdate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskMetricsList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskMetricsList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_metrics_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ImageDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ImageDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "image_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskAttach<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskAttach<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_attach", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskDetach<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskDetach<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_detach", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceExternalIpList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceExternalIpList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_external_ip_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceMigrate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceMigrate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_migrate", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceNetworkInterfaceDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceNetworkInterfaceDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_network_interface_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceReboot<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceReboot<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_reboot", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsole<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsole<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsoleStream<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsoleStream<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console_stream", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 101u16 => ResponseValue::upgrade(response).await, + 200..=299 => ResponseValue::upgrade(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStart<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStart<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_start", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStop<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStop<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_stop", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SnapshotDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SnapshotDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "snapshot_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcUpdate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcFirewallRulesView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcFirewallRulesView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_firewall_rules_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcFirewallRulesUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcFirewallRulesUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_firewall_rules_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcRouterRouteDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcRouterRouteDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_router_route_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct VpcSubnetListNetworkInterfaces<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> VpcSubnetListNetworkInterfaces<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "vpc_subnet_list_network_interfaces", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct PolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> PolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct PolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> PolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RoleList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RoleList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "role_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RoleView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RoleView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "role_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionMe<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionMe<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_me", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionMeGroups<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionMeGroups<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_me_groups", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SessionSshkeyDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SessionSshkeyDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "session_sshkey_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageViewById<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloViewById<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloViewById<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_view_by_id", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct CertificateDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> CertificateDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "certificate_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct PhysicalDiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> PhysicalDiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "physical_disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RackList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RackList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "rack_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct RackView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> RackView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "rack_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SledList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SledList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "sled_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SledView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SledView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "sled_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SledPhysicalDiskList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SledPhysicalDiskList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "sled_physical_disk_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemImageDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemImageDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_image_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolUpdate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolRangeList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolRangeList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_range_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolRangeAdd<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolRangeAdd<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_range_add", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolRangeRemove<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolRangeRemove<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_range_remove", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceRangeList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceRangeList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_range_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceRangeAdd<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceRangeAdd<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_range_add", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct IpPoolServiceRangeRemove<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> IpPoolServiceRangeRemove<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "ip_pool_service_range_remove", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemMetric<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemMetric<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_metric", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SagaList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SagaList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saga_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SagaView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SagaView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saga_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloIdentityProviderList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloIdentityProviderList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_identity_provider_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LocalIdpUserCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LocalIdpUserCreate<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "local_idp_user_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LocalIdpUserDelete<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LocalIdpUserDelete<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "local_idp_user_delete", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct LocalIdpUserSetPassword<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> LocalIdpUserSetPassword<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "local_idp_user_set_password", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SamlIdentityProviderCreate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SamlIdentityProviderCreate<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saml_identity_provider_create", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SamlIdentityProviderView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SamlIdentityProviderView<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "saml_identity_provider_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloPolicyView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloPolicyView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_policy_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloPolicyUpdate<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloPolicyUpdate<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_policy_update", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloUsersList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloUsersList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_users_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SiloUserView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SiloUserView<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "silo_user_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUserList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUserList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_user_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUserView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUserView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_user_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct TimeseriesSchemaGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> TimeseriesSchemaGet<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "timeseries_schema_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UserList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UserList<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "user_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskCreateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskViewV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct DiskDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DiskDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "disk_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceCreateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceViewV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskAttachV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskAttachV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_attach_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceDiskDetachV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceDiskDetachV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_disk_detach_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceMigrateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceMigrateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_migrate_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceRebootV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceRebootV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_reboot_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsoleV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsoleV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerialConsoleStreamV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerialConsoleStreamV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial_console_stream_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 101u16 => ResponseValue::upgrade(response).await, + 200..=299 => ResponseValue::upgrade(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStartV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStartV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_start_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStopV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStopV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_stop_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationCreateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationViewV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationUpdateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyViewV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct OrganizationPolicyUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> OrganizationPolicyUpdateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "organization_policy_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectListV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectListV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_list_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectCreateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectCreateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_create_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectViewV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectUpdateV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectDeleteV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectDeleteV1<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_delete_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyViewV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyViewV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_view_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct ProjectPolicyUpdateV1<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> ProjectPolicyUpdateV1<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "project_policy_update_v1", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemComponentVersionList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemComponentVersionList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_component_version_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UpdateDeploymentsList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UpdateDeploymentsList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "update_deployments_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct UpdateDeploymentView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> UpdateDeploymentView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "update_deployment_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateRefresh<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateRefresh<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_refresh", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateStart<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateStart<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_start", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 202u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateStop<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateStop<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_stop", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateView<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateView<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_view", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemUpdateComponentsList<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemUpdateComponentsList<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_update_components_list", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct SystemVersion<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> SystemVersion<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "system_version", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + + ///Builder for [`Client::disk_view_by_id`] /// - ///[`ClientDisksExt::disk_view_by_id`]: super::ClientDisksExt::disk_view_by_id + ///[`Client::disk_view_by_id`]: super::Client::disk_view_by_id #[derive(Debug, Clone)] pub struct DiskViewById<'a> { client: &'a super::Client, @@ -29905,51 +37617,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/disks/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_view_by_id", + let request = { + let url = format!( + "{}/by-id/disks/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskViewById { + client: client, + request, + }) } } - ///Builder for [`ClientImagesExt::image_view_by_id`] + ///Builder for [`Client::image_view_by_id`] /// - ///[`ClientImagesExt::image_view_by_id`]: super::ClientImagesExt::image_view_by_id + ///[`Client::image_view_by_id`]: super::Client::image_view_by_id #[derive(Debug, Clone)] pub struct ImageViewById<'a> { client: &'a super::Client, @@ -29976,51 +37679,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/images/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_view_by_id", + let request = { + let url = format!( + "{}/by-id/images/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageViewById { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_view_by_id`] + ///Builder for [`Client::instance_view_by_id`] /// - ///[`ClientInstancesExt::instance_view_by_id`]: super::ClientInstancesExt::instance_view_by_id + ///[`Client::instance_view_by_id`]: super::Client::instance_view_by_id #[derive(Debug, Clone)] pub struct InstanceViewById<'a> { client: &'a super::Client, @@ -30047,52 +37741,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/instances/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_view_by_id", + let request = { + let url = format!( + "{}/by-id/instances/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceViewById { + client: client, + request, + }) } } - ///Builder for - /// [`ClientInstancesExt::instance_network_interface_view_by_id`] + ///Builder for [`Client::instance_network_interface_view_by_id`] /// - ///[`ClientInstancesExt::instance_network_interface_view_by_id`]: super::ClientInstancesExt::instance_network_interface_view_by_id + ///[`Client::instance_network_interface_view_by_id`]: super::Client::instance_network_interface_view_by_id #[derive(Debug, Clone)] pub struct InstanceNetworkInterfaceViewById<'a> { client: &'a super::Client, @@ -30121,51 +37805,44 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/by-id/network-interfaces/{}", - client.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_view_by_id", + let request = { + let url = format!( + "{}/by-id/network-interfaces/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceViewById { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_view_by_id`] + ///Builder for [`Client::organization_view_by_id`] /// - ///[`ClientOrganizationsExt::organization_view_by_id`]: super::ClientOrganizationsExt::organization_view_by_id + ///[`Client::organization_view_by_id`]: super::Client::organization_view_by_id #[derive(Debug, Clone)] pub struct OrganizationViewById<'a> { client: &'a super::Client, @@ -30192,51 +37869,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/organizations/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_view_by_id", + let request = { + let url = format!( + "{}/by-id/organizations/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationViewById { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_view_by_id`] + ///Builder for [`Client::project_view_by_id`] /// - ///[`ClientProjectsExt::project_view_by_id`]: super::ClientProjectsExt::project_view_by_id + ///[`Client::project_view_by_id`]: super::Client::project_view_by_id #[derive(Debug, Clone)] pub struct ProjectViewById<'a> { client: &'a super::Client, @@ -30263,51 +37931,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/projects/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_view_by_id", + let request = { + let url = format!( + "{}/by-id/projects/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectViewById { + client: client, + request, + }) } } - ///Builder for [`ClientSnapshotsExt::snapshot_view_by_id`] + ///Builder for [`Client::snapshot_view_by_id`] /// - ///[`ClientSnapshotsExt::snapshot_view_by_id`]: super::ClientSnapshotsExt::snapshot_view_by_id + ///[`Client::snapshot_view_by_id`]: super::Client::snapshot_view_by_id #[derive(Debug, Clone)] pub struct SnapshotViewById<'a> { client: &'a super::Client, @@ -30334,51 +37993,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/snapshots/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_view_by_id", + let request = { + let url = format!( + "{}/by-id/snapshots/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotViewById { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_route_view_by_id`] + ///Builder for [`Client::vpc_router_route_view_by_id`] /// - ///[`ClientVpcsExt::vpc_router_route_view_by_id`]: super::ClientVpcsExt::vpc_router_route_view_by_id + ///[`Client::vpc_router_route_view_by_id`]: super::Client::vpc_router_route_view_by_id #[derive(Debug, Clone)] pub struct VpcRouterRouteViewById<'a> { client: &'a super::Client, @@ -30405,51 +38055,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpc-router-routes/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpc-router-routes/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteViewById { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_view_by_id`] + ///Builder for [`Client::vpc_router_view_by_id`] /// - ///[`ClientVpcsExt::vpc_router_view_by_id`]: super::ClientVpcsExt::vpc_router_view_by_id + ///[`Client::vpc_router_view_by_id`]: super::Client::vpc_router_view_by_id #[derive(Debug, Clone)] pub struct VpcRouterViewById<'a> { client: &'a super::Client, @@ -30476,51 +38117,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpc-routers/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpc-routers/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterViewById { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_subnet_view_by_id`] + ///Builder for [`Client::vpc_subnet_view_by_id`] /// - ///[`ClientVpcsExt::vpc_subnet_view_by_id`]: super::ClientVpcsExt::vpc_subnet_view_by_id + ///[`Client::vpc_subnet_view_by_id`]: super::Client::vpc_subnet_view_by_id #[derive(Debug, Clone)] pub struct VpcSubnetViewById<'a> { client: &'a super::Client, @@ -30547,51 +38179,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpc-subnets/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpc-subnets/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetViewById { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_view_by_id`] + ///Builder for [`Client::vpc_view_by_id`] /// - ///[`ClientVpcsExt::vpc_view_by_id`]: super::ClientVpcsExt::vpc_view_by_id + ///[`Client::vpc_view_by_id`]: super::Client::vpc_view_by_id #[derive(Debug, Clone)] pub struct VpcViewById<'a> { client: &'a super::Client, @@ -30618,51 +38241,42 @@ pub mod builder { ///Sends a `GET` request to `/by-id/vpcs/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_view_by_id", + let request = { + let url = format!( + "{}/by-id/vpcs/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcViewById { + client: client, + request, + }) } } - ///Builder for [`ClientHiddenExt::device_auth_request`] + ///Builder for [`Client::device_auth_request`] /// - ///[`ClientHiddenExt::device_auth_request`]: super::ClientHiddenExt::device_auth_request + ///[`Client::device_auth_request`]: super::Client::device_auth_request #[derive(Debug, Clone)] pub struct DeviceAuthRequest<'a> { client: &'a super::Client, @@ -30701,40 +38315,37 @@ pub mod builder { ///Sends a `POST` request to `/device/auth` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .form_urlencoded(&body)? - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "device_auth_request", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .form_urlencoded(&body)? + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), - } + Ok(built::DeviceAuthRequest { + client: client, + request, + }) } } - ///Builder for [`ClientHiddenExt::device_auth_confirm`] + ///Builder for [`Client::device_auth_confirm`] /// - ///[`ClientHiddenExt::device_auth_confirm`]: super::ClientHiddenExt::device_auth_confirm + ///[`Client::device_auth_confirm`]: super::Client::device_auth_confirm #[derive(Debug, Clone)] pub struct DeviceAuthConfirm<'a> { client: &'a super::Client, @@ -30773,50 +38384,41 @@ pub mod builder { ///Sends a `POST` request to `/device/confirm` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "device_auth_confirm", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DeviceAuthConfirm { + client: client, + request, + }) } } - ///Builder for [`ClientHiddenExt::device_access_token`] + ///Builder for [`Client::device_access_token`] /// - ///[`ClientHiddenExt::device_access_token`]: super::ClientHiddenExt::device_access_token + ///[`Client::device_access_token`]: super::Client::device_access_token #[derive(Debug, Clone)] pub struct DeviceAccessToken<'a> { client: &'a super::Client, @@ -30857,42 +38459,39 @@ pub mod builder { ///Sends a `POST` request to `/device/token` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| { types::DeviceAccessTokenRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .form_urlencoded(&body)? - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "device_access_token", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .form_urlencoded(&body)? + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), - } + Ok(built::DeviceAccessToken { + client: client, + request, + }) } } - ///Builder for [`ClientSilosExt::group_list`] + ///Builder for [`Client::group_list`] /// - ///[`ClientSilosExt::group_list`]: super::ClientSilosExt::group_list + ///[`Client::group_list`]: super::Client::group_list #[derive(Debug, Clone)] pub struct GroupList<'a> { client: &'a super::Client, @@ -30946,6 +38545,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -30955,45 +38558,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "group_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::GroupList { + client: client, + request, + }) } ///Streams `GET` requests to `/groups` @@ -31043,9 +38633,9 @@ pub mod builder { } } - ///Builder for [`ClientHiddenExt::login_spoof`] + ///Builder for [`Client::login_spoof`] /// - ///[`ClientHiddenExt::login_spoof`]: super::ClientHiddenExt::login_spoof + ///[`Client::login_spoof`]: super::Client::login_spoof #[derive(Debug, Clone)] pub struct LoginSpoof<'a> { client: &'a super::Client, @@ -31082,50 +38672,41 @@ pub mod builder { ///Sends a `POST` request to `/login` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "login_spoof", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginSpoof { + client: client, + request, + }) } } - ///Builder for [`ClientLoginExt::login_local`] + ///Builder for [`Client::login_local`] /// - ///[`ClientLoginExt::login_local`]: super::ClientLoginExt::login_local + ///[`Client::login_local`]: super::Client::login_local #[derive(Debug, Clone)] pub struct LoginLocal<'a> { client: &'a super::Client, @@ -31179,6 +38760,10 @@ pub mod builder { ///Sends a `POST` request to `/login/{silo_name}/local` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -31190,46 +38775,29 @@ pub mod builder { types::UsernamePasswordCredentials::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/login/{}/local", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "login_local", + let request = { + let url = format!( + "{}/login/{}/local", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginLocal { + client: client, + request, + }) } } - ///Builder for [`ClientLoginExt::login_saml_begin`] + ///Builder for [`Client::login_saml_begin`] /// - ///[`ClientLoginExt::login_saml_begin`]: super::ClientLoginExt::login_saml_begin + ///[`Client::login_saml_begin`]: super::Client::login_saml_begin #[derive(Debug, Clone)] pub struct LoginSamlBegin<'a> { client: &'a super::Client, @@ -31268,6 +38836,10 @@ pub mod builder { ///Sends a `GET` request to `/login/{silo_name}/saml/{provider_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -31275,42 +38847,30 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let provider_name = provider_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/login/{}/saml/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client.client.get(url).headers(header_map).build()?; - let info = OperationInfo { - operation_id: "login_saml_begin", + let request = { + let url = format!( + "{}/login/{}/saml/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.get(url).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginSamlBegin { + client: client, + request, + }) } } - ///Builder for [`ClientLoginExt::login_saml`] + ///Builder for [`Client::login_saml`] /// - ///[`ClientLoginExt::login_saml`]: super::ClientLoginExt::login_saml + ///[`Client::login_saml`]: super::Client::login_saml #[derive(Debug)] pub struct LoginSaml<'a> { client: &'a super::Client, @@ -31361,6 +38921,10 @@ pub mod builder { ///Sends a `POST` request to `/login/{silo_name}/saml/{provider_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -31370,51 +38934,38 @@ pub mod builder { let silo_name = silo_name.map_err(Error::InvalidRequest)?; let provider_name = provider_name.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/login/{}/saml/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("application/octet-stream"), - ) - .body(body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "login_saml", + let request = { + let url = format!( + "{}/login/{}/saml/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("application/octet-stream"), + ) + .body(body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LoginSaml { + client: client, + request, + }) } } - ///Builder for [`ClientHiddenExt::logout`] + ///Builder for [`Client::logout`] /// - ///[`ClientHiddenExt::logout`]: super::ClientHiddenExt::logout + ///[`Client::logout`]: super::Client::logout #[derive(Debug, Clone)] pub struct Logout<'a> { client: &'a super::Client, @@ -31427,46 +38978,37 @@ pub mod builder { ///Sends a `POST` request to `/logout` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "logout", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::Logout { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_list`] + ///Builder for [`Client::organization_list`] /// - ///[`ClientOrganizationsExt::organization_list`]: super::ClientOrganizationsExt::organization_list + ///[`Client::organization_list`]: super::Client::organization_list #[derive(Debug, Clone)] pub struct OrganizationList<'a> { client: &'a super::Client, @@ -31520,6 +39062,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -31529,45 +39075,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationList { + client: client, + request, + }) } ///Streams `GET` requests to `/organizations` @@ -31617,9 +39150,9 @@ pub mod builder { } } - ///Builder for [`ClientOrganizationsExt::organization_create`] + ///Builder for [`Client::organization_create`] /// - ///[`ClientOrganizationsExt::organization_create`]: super::ClientOrganizationsExt::organization_create + ///[`Client::organization_create`]: super::Client::organization_create #[derive(Debug, Clone)] pub struct OrganizationCreate<'a> { client: &'a super::Client, @@ -31658,50 +39191,41 @@ pub mod builder { ///Sends a `POST` request to `/organizations` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationCreate { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_view`] + ///Builder for [`Client::organization_view`] /// - ///[`ClientOrganizationsExt::organization_view`]: super::ClientOrganizationsExt::organization_view + ///[`Client::organization_view`]: super::Client::organization_view #[derive(Debug, Clone)] pub struct OrganizationView<'a> { client: &'a super::Client, @@ -31728,54 +39252,45 @@ pub mod builder { ///Sends a `GET` request to `/organizations/{organization_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_view", + let request = { + let url = format!( + "{}/organizations/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationView { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_update`] + ///Builder for [`Client::organization_update`] /// - ///[`ClientOrganizationsExt::organization_update`]: super::ClientOrganizationsExt::organization_update + ///[`Client::organization_update`]: super::Client::organization_update #[derive(Debug, Clone)] pub struct OrganizationUpdate<'a> { client: &'a super::Client, @@ -31826,6 +39341,10 @@ pub mod builder { ///Sends a `PUT` request to `/organizations/{organization_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -31835,50 +39354,37 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_update", + let request = { + let url = format!( + "{}/organizations/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_delete`] + ///Builder for [`Client::organization_delete`] /// - ///[`ClientOrganizationsExt::organization_delete`]: super::ClientOrganizationsExt::organization_delete + ///[`Client::organization_delete`]: super::Client::organization_delete #[derive(Debug, Clone)] pub struct OrganizationDelete<'a> { client: &'a super::Client, @@ -31905,54 +39411,45 @@ pub mod builder { ///Sends a `DELETE` request to `/organizations/{organization_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_delete", + let request = { + let url = format!( + "{}/organizations/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationDelete { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_policy_view`] + ///Builder for [`Client::organization_policy_view`] /// - ///[`ClientOrganizationsExt::organization_policy_view`]: super::ClientOrganizationsExt::organization_policy_view + ///[`Client::organization_policy_view`]: super::Client::organization_policy_view #[derive(Debug, Clone)] pub struct OrganizationPolicyView<'a> { client: &'a super::Client, @@ -31981,54 +39478,45 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_view", + let request = { + let url = format!( + "{}/organizations/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyView { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_policy_update`] + ///Builder for [`Client::organization_policy_update`] /// - ///[`ClientOrganizationsExt::organization_policy_update`]: super::ClientOrganizationsExt::organization_policy_update + ///[`Client::organization_policy_update`]: super::Client::organization_policy_update #[derive(Debug, Clone)] pub struct OrganizationPolicyUpdate<'a> { client: &'a super::Client, @@ -32083,6 +39571,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32092,50 +39584,37 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_update", + let request = { + let url = format!( + "{}/organizations/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_list`] + ///Builder for [`Client::project_list`] /// - ///[`ClientProjectsExt::project_list`]: super::ClientProjectsExt::project_list + ///[`Client::project_list`]: super::Client::project_list #[derive(Debug, Clone)] pub struct ProjectList<'a> { client: &'a super::Client, @@ -32202,6 +39681,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32213,49 +39696,36 @@ 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/{}/projects", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_list", + let request = { + let url = format!( + "{}/organizations/{}/projects", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -32306,9 +39776,9 @@ pub mod builder { } } - ///Builder for [`ClientProjectsExt::project_create`] + ///Builder for [`Client::project_create`] /// - ///[`ClientProjectsExt::project_create`]: super::ClientProjectsExt::project_create + ///[`Client::project_create`]: super::Client::project_create #[derive(Debug, Clone)] pub struct ProjectCreate<'a> { client: &'a super::Client, @@ -32358,6 +39828,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32367,50 +39841,37 @@ 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!( - "{}/organizations/{}/projects", - client.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_create", + let request = { + let url = format!( + "{}/organizations/{}/projects", + client.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectCreate { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_view`] + ///Builder for [`Client::project_view`] /// - ///[`ClientProjectsExt::project_view`]: super::ClientProjectsExt::project_view + ///[`Client::project_view`]: super::Client::project_view #[derive(Debug, Clone)] pub struct ProjectView<'a> { client: &'a super::Client, @@ -32450,6 +39911,10 @@ pub mod builder { ///Sends a `GET` request to /// `/organizations/{organization_name}/projects/{project_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32457,50 +39922,37 @@ pub mod builder { } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectView { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_update`] + ///Builder for [`Client::project_update`] /// - ///[`ClientProjectsExt::project_update`]: super::ClientProjectsExt::project_update + ///[`Client::project_update`]: super::Client::project_update #[derive(Debug, Clone)] pub struct ProjectUpdate<'a> { client: &'a super::Client, @@ -32562,6 +40014,10 @@ pub mod builder { ///Sends a `PUT` request to /// `/organizations/{organization_name}/projects/{project_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32573,51 +40029,38 @@ pub mod builder { let body = body .and_then(|v| types::ProjectUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_delete`] + ///Builder for [`Client::project_delete`] /// - ///[`ClientProjectsExt::project_delete`]: super::ClientProjectsExt::project_delete + ///[`Client::project_delete`]: super::Client::project_delete #[derive(Debug, Clone)] pub struct ProjectDelete<'a> { client: &'a super::Client, @@ -32657,6 +40100,10 @@ pub mod builder { ///Sends a `DELETE` request to /// `/organizations/{organization_name}/projects/{project_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32664,50 +40111,37 @@ pub mod builder { } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectDelete { + client: client, + request, + }) } } - ///Builder for [`ClientDisksExt::disk_list`] + ///Builder for [`Client::disk_list`] /// - ///[`ClientDisksExt::disk_list`]: super::ClientDisksExt::disk_list + ///[`Client::disk_list`]: super::Client::disk_list #[derive(Debug, Clone)] pub struct DiskList<'a> { client: &'a super::Client, @@ -32786,6 +40220,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32799,50 +40237,37 @@ 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/{}/projects/{}/disks", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -32893,9 +40318,9 @@ pub mod builder { } } - ///Builder for [`ClientDisksExt::disk_create`] + ///Builder for [`Client::disk_create`] /// - ///[`ClientDisksExt::disk_create`]: super::ClientDisksExt::disk_create + ///[`Client::disk_create`]: super::Client::disk_create #[derive(Debug, Clone)] pub struct DiskCreate<'a> { client: &'a super::Client, @@ -32957,6 +40382,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/disks` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -32968,51 +40397,38 @@ 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!( - "{}/organizations/{}/projects/{}/disks", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskCreate { + client: client, + request, + }) } } - ///Builder for [`ClientDisksExt::disk_view`] + ///Builder for [`Client::disk_view`] /// - ///[`ClientDisksExt::disk_view`]: super::ClientDisksExt::disk_view + ///[`Client::disk_view`]: super::Client::disk_view #[derive(Debug, Clone)] pub struct DiskView<'a> { client: &'a super::Client, @@ -33065,6 +40481,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33074,51 +40494,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let disk_name = disk_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskView { + client: client, + request, + }) } } - ///Builder for [`ClientDisksExt::disk_delete`] + ///Builder for [`Client::disk_delete`] /// - ///[`ClientDisksExt::disk_delete`]: super::ClientDisksExt::disk_delete + ///[`Client::disk_delete`]: super::Client::disk_delete #[derive(Debug, Clone)] pub struct DiskDelete<'a> { client: &'a super::Client, @@ -33171,6 +40578,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/disks/ /// {disk_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33180,51 +40591,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let disk_name = disk_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskDelete { + client: client, + request, + }) } } - ///Builder for [`ClientDisksExt::disk_metrics_list`] + ///Builder for [`Client::disk_metrics_list`] /// - ///[`ClientDisksExt::disk_metrics_list`]: super::ClientDisksExt::disk_metrics_list + ///[`Client::disk_metrics_list`]: super::Client::disk_metrics_list #[derive(Debug, Clone)] pub struct DiskMetricsList<'a> { client: &'a super::Client, @@ -33343,6 +40741,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33362,56 +40764,43 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let start_time = start_time.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}/metrics/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - encode_path(&metric_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("end_time", &end_time)) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new( - "start_time", - &start_time, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_metrics_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}/metrics/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + encode_path(&metric_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("end_time", &end_time)) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new( + "start_time", + &start_time, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskMetricsList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -33464,9 +40853,9 @@ pub mod builder { } } - ///Builder for [`ClientImagesExt::image_list`] + ///Builder for [`Client::image_list`] /// - ///[`ClientImagesExt::image_list`]: super::ClientImagesExt::image_list + ///[`Client::image_list`]: super::Client::image_list #[derive(Debug, Clone)] pub struct ImageList<'a> { client: &'a super::Client, @@ -33545,6 +40934,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33558,50 +40951,37 @@ 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/{}/projects/{}/images", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -33652,9 +41032,9 @@ pub mod builder { } } - ///Builder for [`ClientImagesExt::image_create`] + ///Builder for [`Client::image_create`] /// - ///[`ClientImagesExt::image_create`]: super::ClientImagesExt::image_create + ///[`Client::image_create`]: super::Client::image_create #[derive(Debug, Clone)] pub struct ImageCreate<'a> { client: &'a super::Client, @@ -33716,6 +41096,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/images` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33727,51 +41111,38 @@ pub mod builder { let body = body .and_then(|v| types::ImageCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/images", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageCreate { + client: client, + request, + }) } } - ///Builder for [`ClientImagesExt::image_view`] + ///Builder for [`Client::image_view`] /// - ///[`ClientImagesExt::image_view`]: super::ClientImagesExt::image_view + ///[`Client::image_view`]: super::Client::image_view #[derive(Debug, Clone)] pub struct ImageView<'a> { client: &'a super::Client, @@ -33824,6 +41195,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33833,51 +41208,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let image_name = image_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/images/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageView { + client: client, + request, + }) } } - ///Builder for [`ClientImagesExt::image_delete`] + ///Builder for [`Client::image_delete`] /// - ///[`ClientImagesExt::image_delete`]: super::ClientImagesExt::image_delete + ///[`Client::image_delete`]: super::Client::image_delete #[derive(Debug, Clone)] pub struct ImageDelete<'a> { client: &'a super::Client, @@ -33930,6 +41292,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/images/ /// {image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -33939,51 +41305,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let image_name = image_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/images/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "image_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/images/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ImageDelete { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_list`] + ///Builder for [`Client::instance_list`] /// - ///[`ClientInstancesExt::instance_list`]: super::ClientInstancesExt::instance_list + ///[`Client::instance_list`]: super::Client::instance_list #[derive(Debug, Clone)] pub struct InstanceList<'a> { client: &'a super::Client, @@ -34063,6 +41416,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34076,50 +41433,37 @@ 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/{}/projects/{}/instances", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -34171,9 +41515,9 @@ pub mod builder { } } - ///Builder for [`ClientInstancesExt::instance_create`] + ///Builder for [`Client::instance_create`] /// - ///[`ClientInstancesExt::instance_create`]: super::ClientInstancesExt::instance_create + ///[`Client::instance_create`]: super::Client::instance_create #[derive(Debug, Clone)] pub struct InstanceCreate<'a> { client: &'a super::Client, @@ -34236,6 +41580,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34247,51 +41595,38 @@ 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!( - "{}/organizations/{}/projects/{}/instances", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceCreate { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_view`] + ///Builder for [`Client::instance_view`] /// - ///[`ClientInstancesExt::instance_view`]: super::ClientInstancesExt::instance_view + ///[`Client::instance_view`]: super::Client::instance_view #[derive(Debug, Clone)] pub struct InstanceView<'a> { client: &'a super::Client, @@ -34344,6 +41679,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34353,51 +41692,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceView { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_delete`] + ///Builder for [`Client::instance_delete`] /// - ///[`ClientInstancesExt::instance_delete`]: super::ClientInstancesExt::instance_delete + ///[`Client::instance_delete`]: super::Client::instance_delete #[derive(Debug, Clone)] pub struct InstanceDelete<'a> { client: &'a super::Client, @@ -34450,6 +41776,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34459,51 +41789,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDelete { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_disk_list`] + ///Builder for [`Client::instance_disk_list`] /// - ///[`ClientInstancesExt::instance_disk_list`]: super::ClientInstancesExt::instance_disk_list + ///[`Client::instance_disk_list`]: super::Client::instance_disk_list #[derive(Debug, Clone)] pub struct InstanceDiskList<'a> { client: &'a super::Client, @@ -34595,6 +41912,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34610,51 +41931,38 @@ 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/{}/projects/{}/instances/{}/disks", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -34706,9 +42014,9 @@ pub mod builder { } } - ///Builder for [`ClientInstancesExt::instance_disk_attach`] + ///Builder for [`Client::instance_disk_attach`] /// - ///[`ClientInstancesExt::instance_disk_attach`]: super::ClientInstancesExt::instance_disk_attach + ///[`Client::instance_disk_attach`]: super::Client::instance_disk_attach #[derive(Debug, Clone)] pub struct InstanceDiskAttach<'a> { client: &'a super::Client, @@ -34783,6 +42091,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/attach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34796,52 +42108,39 @@ pub mod builder { let body = body .and_then(|v| types::DiskIdentifier::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/disks/attach", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_attach", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks/attach", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskAttach { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_disk_detach`] + ///Builder for [`Client::instance_disk_detach`] /// - ///[`ClientInstancesExt::instance_disk_detach`]: super::ClientInstancesExt::instance_disk_detach + ///[`Client::instance_disk_detach`]: super::Client::instance_disk_detach #[derive(Debug, Clone)] pub struct InstanceDiskDetach<'a> { client: &'a super::Client, @@ -34916,6 +42215,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/disks/detach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -34929,52 +42232,39 @@ pub mod builder { let body = body .and_then(|v| types::DiskIdentifier::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/disks/detach", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_detach", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks/detach", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskDetach { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_external_ip_list`] + ///Builder for [`Client::instance_external_ip_list`] /// - ///[`ClientInstancesExt::instance_external_ip_list`]: super::ClientInstancesExt::instance_external_ip_list + ///[`Client::instance_external_ip_list`]: super::Client::instance_external_ip_list #[derive(Debug, Clone)] pub struct InstanceExternalIpList<'a> { client: &'a super::Client, @@ -35029,6 +42319,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35038,51 +42332,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/external-ips", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_external_ip_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/external-ips", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceExternalIpList { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_migrate`] + ///Builder for [`Client::instance_migrate`] /// - ///[`ClientInstancesExt::instance_migrate`]: super::ClientInstancesExt::instance_migrate + ///[`Client::instance_migrate`]: super::Client::instance_migrate #[derive(Debug, Clone)] pub struct InstanceMigrate<'a> { client: &'a super::Client, @@ -35157,6 +42438,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/migrate` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35170,52 +42455,39 @@ pub mod builder { let body = body .and_then(|v| types::InstanceMigrate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/migrate", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_migrate", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/migrate", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceMigrate { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_network_interface_list`] + ///Builder for [`Client::instance_network_interface_list`] /// - ///[`ClientInstancesExt::instance_network_interface_list`]: super::ClientInstancesExt::instance_network_interface_list + ///[`Client::instance_network_interface_list`]: super::Client::instance_network_interface_list #[derive(Debug, Clone)] pub struct InstanceNetworkInterfaceList<'a> { client: &'a super::Client, @@ -35308,6 +42580,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35323,51 +42599,38 @@ 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/{}/projects/{}/instances/{}/network-interfaces", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -35419,9 +42682,9 @@ pub mod builder { } } - ///Builder for [`ClientInstancesExt::instance_network_interface_create`] + ///Builder for [`Client::instance_network_interface_create`] /// - ///[`ClientInstancesExt::instance_network_interface_create`]: super::ClientInstancesExt::instance_network_interface_create + ///[`Client::instance_network_interface_create`]: super::Client::instance_network_interface_create #[derive(Debug, Clone)] pub struct InstanceNetworkInterfaceCreate<'a> { client: &'a super::Client, @@ -35502,6 +42765,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -35515,52 +42784,39 @@ pub mod builder { let body = body .and_then(|v| types::NetworkInterfaceCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceCreate { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_network_interface_view`] + ///Builder for [`Client::instance_network_interface_view`] /// - ///[`ClientInstancesExt::instance_network_interface_view`]: super::ClientInstancesExt::instance_network_interface_view + ///[`Client::instance_network_interface_view`]: super::Client::instance_network_interface_view #[derive(Debug, Clone)] pub struct InstanceNetworkInterfaceView<'a> { client: &'a super::Client, @@ -35627,6 +42883,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -35638,52 +42898,39 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; let interface_name = interface_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceView { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_network_interface_update`] + ///Builder for [`Client::instance_network_interface_update`] /// - ///[`ClientInstancesExt::instance_network_interface_update`]: super::ClientInstancesExt::instance_network_interface_update + ///[`Client::instance_network_interface_update`]: super::Client::instance_network_interface_update #[derive(Debug, Clone)] pub struct InstanceNetworkInterfaceUpdate<'a> { client: &'a super::Client, @@ -35776,6 +43023,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -35791,53 +43044,40 @@ pub mod builder { let body = body .and_then(|v| types::NetworkInterfaceUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_network_interface_delete`] + ///Builder for [`Client::instance_network_interface_delete`] /// - ///[`ClientInstancesExt::instance_network_interface_delete`]: super::ClientInstancesExt::instance_network_interface_delete + ///[`Client::instance_network_interface_delete`]: super::Client::instance_network_interface_delete #[derive(Debug, Clone)] pub struct InstanceNetworkInterfaceDelete<'a> { client: &'a super::Client, @@ -35902,6 +43142,12 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/network-interfaces/{interface_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -35913,52 +43159,39 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; let interface_name = interface_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_network_interface_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceNetworkInterfaceDelete { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_reboot`] + ///Builder for [`Client::instance_reboot`] /// - ///[`ClientInstancesExt::instance_reboot`]: super::ClientInstancesExt::instance_reboot + ///[`Client::instance_reboot`]: super::Client::instance_reboot #[derive(Debug, Clone)] pub struct InstanceReboot<'a> { client: &'a super::Client, @@ -36011,6 +43244,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/reboot` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36020,51 +43257,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/reboot", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_reboot", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/reboot", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceReboot { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_serial_console`] + ///Builder for [`Client::instance_serial_console`] /// - ///[`ClientInstancesExt::instance_serial_console`]: super::ClientInstancesExt::instance_serial_console + ///[`Client::instance_serial_console`]: super::Client::instance_serial_console #[derive(Debug, Clone)] pub struct InstanceSerialConsole<'a> { client: &'a super::Client, @@ -36158,6 +43382,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36173,60 +43401,47 @@ pub mod builder { let from_start = from_start.map_err(Error::InvalidRequest)?; let max_bytes = max_bytes.map_err(Error::InvalidRequest)?; let most_recent = most_recent.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/serial-console", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "from_start", - &from_start, - )) - .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) - .query(&progenitor_client::QueryParam::new( - "most_recent", - &most_recent, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/serial-console", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "from_start", + &from_start, + )) + .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) + .query(&progenitor_client::QueryParam::new( + "most_recent", + &most_recent, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsole { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_serial_console_stream`] + ///Builder for [`Client::instance_serial_console_stream`] /// - ///[`ClientInstancesExt::instance_serial_console_stream`]: super::ClientInstancesExt::instance_serial_console_stream + ///[`Client::instance_serial_console_stream`]: super::Client::instance_serial_console_stream #[derive(Debug, Clone)] pub struct InstanceSerialConsoleStream<'a> { client: &'a super::Client, @@ -36281,6 +43496,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -36290,52 +43511,44 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/serial-console/stream", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console_stream", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/serial-console/stream", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 101u16 => ResponseValue::upgrade(response).await, - 200..=299 => ResponseValue::upgrade(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsoleStream { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_start`] + ///Builder for [`Client::instance_start`] /// - ///[`ClientInstancesExt::instance_start`]: super::ClientInstancesExt::instance_start + ///[`Client::instance_start`]: super::Client::instance_start #[derive(Debug, Clone)] pub struct InstanceStart<'a> { client: &'a super::Client, @@ -36388,6 +43601,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/start` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36397,51 +43614,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/start", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_start", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/start", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStart { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_stop`] + ///Builder for [`Client::instance_stop`] /// - ///[`ClientInstancesExt::instance_stop`]: super::ClientInstancesExt::instance_stop + ///[`Client::instance_stop`]: super::Client::instance_stop #[derive(Debug, Clone)] pub struct InstanceStop<'a> { client: &'a super::Client, @@ -36494,6 +43698,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// instances/{instance_name}/stop` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36503,51 +43711,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let instance_name = instance_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/stop", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_stop", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/stop", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStop { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_policy_view`] + ///Builder for [`Client::project_policy_view`] /// - ///[`ClientProjectsExt::project_policy_view`]: super::ClientProjectsExt::project_policy_view + ///[`Client::project_policy_view`]: super::Client::project_policy_view #[derive(Debug, Clone)] pub struct ProjectPolicyView<'a> { client: &'a super::Client, @@ -36589,6 +43784,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36596,50 +43795,37 @@ pub mod builder { } = self; let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyView { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_policy_update`] + ///Builder for [`Client::project_policy_update`] /// - ///[`ClientProjectsExt::project_policy_update`]: super::ClientProjectsExt::project_policy_update + ///[`Client::project_policy_update`]: super::Client::project_policy_update #[derive(Debug, Clone)] pub struct ProjectPolicyUpdate<'a> { client: &'a super::Client, @@ -36705,6 +43891,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36716,51 +43906,38 @@ pub mod builder { let body = body .and_then(|v| types::ProjectRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/policy", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/policy", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientSnapshotsExt::snapshot_list`] + ///Builder for [`Client::snapshot_list`] /// - ///[`ClientSnapshotsExt::snapshot_list`]: super::ClientSnapshotsExt::snapshot_list + ///[`Client::snapshot_list`]: super::Client::snapshot_list #[derive(Debug, Clone)] pub struct SnapshotList<'a> { client: &'a super::Client, @@ -36840,6 +44017,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -36853,50 +44034,37 @@ 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/{}/projects/{}/snapshots", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -36948,9 +44116,9 @@ pub mod builder { } } - ///Builder for [`ClientSnapshotsExt::snapshot_create`] + ///Builder for [`Client::snapshot_create`] /// - ///[`ClientSnapshotsExt::snapshot_create`]: super::ClientSnapshotsExt::snapshot_create + ///[`Client::snapshot_create`]: super::Client::snapshot_create #[derive(Debug, Clone)] pub struct SnapshotCreate<'a> { client: &'a super::Client, @@ -37013,6 +44181,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37024,51 +44196,38 @@ pub mod builder { let body = body .and_then(|v| types::SnapshotCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/snapshots", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSnapshotsExt::snapshot_view`] + ///Builder for [`Client::snapshot_view`] /// - ///[`ClientSnapshotsExt::snapshot_view`]: super::ClientSnapshotsExt::snapshot_view + ///[`Client::snapshot_view`]: super::Client::snapshot_view #[derive(Debug, Clone)] pub struct SnapshotView<'a> { client: &'a super::Client, @@ -37121,6 +44280,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37130,51 +44293,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let snapshot_name = snapshot_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/snapshots/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&snapshot_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotView { + client: client, + request, + }) } } - ///Builder for [`ClientSnapshotsExt::snapshot_delete`] + ///Builder for [`Client::snapshot_delete`] /// - ///[`ClientSnapshotsExt::snapshot_delete`]: super::ClientSnapshotsExt::snapshot_delete + ///[`Client::snapshot_delete`]: super::Client::snapshot_delete #[derive(Debug, Clone)] pub struct SnapshotDelete<'a> { client: &'a super::Client, @@ -37227,6 +44377,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/ /// snapshots/{snapshot_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37236,51 +44390,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let snapshot_name = snapshot_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/snapshots/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "snapshot_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&snapshot_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SnapshotDelete { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_list`] + ///Builder for [`Client::vpc_list`] /// - ///[`ClientVpcsExt::vpc_list`]: super::ClientVpcsExt::vpc_list + ///[`Client::vpc_list`]: super::Client::vpc_list #[derive(Debug, Clone)] pub struct VpcList<'a> { client: &'a super::Client, @@ -37359,6 +44500,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37372,50 +44517,37 @@ 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/{}/projects/{}/vpcs", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -37466,9 +44598,9 @@ pub mod builder { } } - ///Builder for [`ClientVpcsExt::vpc_create`] + ///Builder for [`Client::vpc_create`] /// - ///[`ClientVpcsExt::vpc_create`]: super::ClientVpcsExt::vpc_create + ///[`Client::vpc_create`]: super::Client::vpc_create #[derive(Debug, Clone)] pub struct VpcCreate<'a> { client: &'a super::Client, @@ -37530,6 +44662,10 @@ pub mod builder { ///Sends a `POST` request to /// `/organizations/{organization_name}/projects/{project_name}/vpcs` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37541,51 +44677,38 @@ pub mod builder { let body = body .and_then(|v| types::VpcCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcCreate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_view`] + ///Builder for [`Client::vpc_view`] /// - ///[`ClientVpcsExt::vpc_view`]: super::ClientVpcsExt::vpc_view + ///[`Client::vpc_view`]: super::Client::vpc_view #[derive(Debug, Clone)] pub struct VpcView<'a> { client: &'a super::Client, @@ -37638,6 +44761,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37647,51 +44774,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcView { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_update`] + ///Builder for [`Client::vpc_update`] /// - ///[`ClientVpcsExt::vpc_update`]: super::ClientVpcsExt::vpc_update + ///[`Client::vpc_update`]: super::Client::vpc_update #[derive(Debug, Clone)] pub struct VpcUpdate<'a> { client: &'a super::Client, @@ -37766,6 +44880,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37779,52 +44897,39 @@ pub mod builder { let body = body .and_then(|v| types::VpcUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_delete`] + ///Builder for [`Client::vpc_delete`] /// - ///[`ClientVpcsExt::vpc_delete`]: super::ClientVpcsExt::vpc_delete + ///[`Client::vpc_delete`]: super::Client::vpc_delete #[derive(Debug, Clone)] pub struct VpcDelete<'a> { client: &'a super::Client, @@ -37877,6 +44982,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37886,51 +44995,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcDelete { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_firewall_rules_view`] + ///Builder for [`Client::vpc_firewall_rules_view`] /// - ///[`ClientVpcsExt::vpc_firewall_rules_view`]: super::ClientVpcsExt::vpc_firewall_rules_view + ///[`Client::vpc_firewall_rules_view`]: super::Client::vpc_firewall_rules_view #[derive(Debug, Clone)] pub struct VpcFirewallRulesView<'a> { client: &'a super::Client, @@ -37985,6 +45081,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -37994,51 +45094,38 @@ pub mod builder { let organization_name = organization_name.map_err(Error::InvalidRequest)?; let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_firewall_rules_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcFirewallRulesView { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_firewall_rules_update`] + ///Builder for [`Client::vpc_firewall_rules_update`] /// - ///[`ClientVpcsExt::vpc_firewall_rules_update`]: super::ClientVpcsExt::vpc_firewall_rules_update + ///[`Client::vpc_firewall_rules_update`]: super::Client::vpc_firewall_rules_update #[derive(Debug, Clone)] pub struct VpcFirewallRulesUpdate<'a> { client: &'a super::Client, @@ -38120,6 +45207,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38135,52 +45226,39 @@ pub mod builder { types::VpcFirewallRuleUpdateParams::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_firewall_rules_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcFirewallRulesUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_list`] + ///Builder for [`Client::vpc_router_list`] /// - ///[`ClientVpcsExt::vpc_router_list`]: super::ClientVpcsExt::vpc_router_list + ///[`Client::vpc_router_list`]: super::Client::vpc_router_list #[derive(Debug, Clone)] pub struct VpcRouterList<'a> { client: &'a super::Client, @@ -38272,6 +45350,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38287,51 +45369,38 @@ 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/{}/projects/{}/vpcs/{}/routers", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -38383,9 +45452,9 @@ pub mod builder { } } - ///Builder for [`ClientVpcsExt::vpc_router_create`] + ///Builder for [`Client::vpc_router_create`] /// - ///[`ClientVpcsExt::vpc_router_create`]: super::ClientVpcsExt::vpc_router_create + ///[`Client::vpc_router_create`]: super::Client::vpc_router_create #[derive(Debug, Clone)] pub struct VpcRouterCreate<'a> { client: &'a super::Client, @@ -38460,6 +45529,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38473,52 +45546,39 @@ pub mod builder { let body = body .and_then(|v| types::VpcRouterCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterCreate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_view`] + ///Builder for [`Client::vpc_router_view`] /// - ///[`ClientVpcsExt::vpc_router_view`]: super::ClientVpcsExt::vpc_router_view + ///[`Client::vpc_router_view`]: super::Client::vpc_router_view #[derive(Debug, Clone)] pub struct VpcRouterView<'a> { client: &'a super::Client, @@ -38583,6 +45643,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38594,52 +45658,39 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterView { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_update`] + ///Builder for [`Client::vpc_router_update`] /// - ///[`ClientVpcsExt::vpc_router_update`]: super::ClientVpcsExt::vpc_router_update + ///[`Client::vpc_router_update`]: super::Client::vpc_router_update #[derive(Debug, Clone)] pub struct VpcRouterUpdate<'a> { client: &'a super::Client, @@ -38726,6 +45777,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38741,53 +45796,40 @@ pub mod builder { let body = body .and_then(|v| types::VpcRouterUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_delete`] + ///Builder for [`Client::vpc_router_delete`] /// - ///[`ClientVpcsExt::vpc_router_delete`]: super::ClientVpcsExt::vpc_router_delete + ///[`Client::vpc_router_delete`]: super::Client::vpc_router_delete #[derive(Debug, Clone)] pub struct VpcRouterDelete<'a> { client: &'a super::Client, @@ -38852,6 +45894,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -38863,52 +45909,39 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterDelete { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_route_list`] + ///Builder for [`Client::vpc_router_route_list`] /// - ///[`ClientVpcsExt::vpc_router_route_list`]: super::ClientVpcsExt::vpc_router_route_list + ///[`Client::vpc_router_route_list`]: super::Client::vpc_router_route_list #[derive(Debug, Clone)] pub struct VpcRouterRouteList<'a> { client: &'a super::Client, @@ -39012,6 +46045,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39029,52 +46066,39 @@ 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/{}/projects/{}/vpcs/{}/routers/{}/routes", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -39126,9 +46150,9 @@ pub mod builder { } } - ///Builder for [`ClientVpcsExt::vpc_router_route_create`] + ///Builder for [`Client::vpc_router_route_create`] /// - ///[`ClientVpcsExt::vpc_router_route_create`]: super::ClientVpcsExt::vpc_router_route_create + ///[`Client::vpc_router_route_create`]: super::Client::vpc_router_route_create #[derive(Debug, Clone)] pub struct VpcRouterRouteCreate<'a> { client: &'a super::Client, @@ -39219,6 +46243,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39236,53 +46264,40 @@ pub mod builder { types::RouterRouteCreateParams::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteCreate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_route_view`] + ///Builder for [`Client::vpc_router_route_view`] /// - ///[`ClientVpcsExt::vpc_router_route_view`]: super::ClientVpcsExt::vpc_router_route_view + ///[`Client::vpc_router_route_view`]: super::Client::vpc_router_route_view #[derive(Debug, Clone)] pub struct VpcRouterRouteView<'a> { client: &'a super::Client, @@ -39359,6 +46374,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39372,53 +46391,40 @@ pub mod builder { let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; let route_name = route_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - client.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + client.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteView { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_route_update`] + ///Builder for [`Client::vpc_router_route_update`] /// - ///[`ClientVpcsExt::vpc_router_route_update`]: super::ClientVpcsExt::vpc_router_route_update + ///[`Client::vpc_router_route_update`]: super::Client::vpc_router_route_update #[derive(Debug, Clone)] pub struct VpcRouterRouteUpdate<'a> { client: &'a super::Client, @@ -39521,6 +46527,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39540,54 +46550,41 @@ pub mod builder { types::RouterRouteUpdateParams::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - client.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + client.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_router_route_delete`] + ///Builder for [`Client::vpc_router_route_delete`] /// - ///[`ClientVpcsExt::vpc_router_route_delete`]: super::ClientVpcsExt::vpc_router_route_delete + ///[`Client::vpc_router_route_delete`]: super::Client::vpc_router_route_delete #[derive(Debug, Clone)] pub struct VpcRouterRouteDelete<'a> { client: &'a super::Client, @@ -39664,6 +46661,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/routers/{router_name}/routes/{route_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39677,53 +46678,40 @@ pub mod builder { let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let router_name = router_name.map_err(Error::InvalidRequest)?; let route_name = route_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - client.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_router_route_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + client.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcRouterRouteDelete { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_subnet_list`] + ///Builder for [`Client::vpc_subnet_list`] /// - ///[`ClientVpcsExt::vpc_subnet_list`]: super::ClientVpcsExt::vpc_subnet_list + ///[`Client::vpc_subnet_list`]: super::Client::vpc_subnet_list #[derive(Debug, Clone)] pub struct VpcSubnetList<'a> { client: &'a super::Client, @@ -39815,6 +46803,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -39830,51 +46822,38 @@ 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/{}/projects/{}/vpcs/{}/subnets", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_list", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -39926,9 +46905,9 @@ pub mod builder { } } - ///Builder for [`ClientVpcsExt::vpc_subnet_create`] + ///Builder for [`Client::vpc_subnet_create`] /// - ///[`ClientVpcsExt::vpc_subnet_create`]: super::ClientVpcsExt::vpc_subnet_create + ///[`Client::vpc_subnet_create`]: super::Client::vpc_subnet_create #[derive(Debug, Clone)] pub struct VpcSubnetCreate<'a> { client: &'a super::Client, @@ -40003,6 +46982,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40016,52 +46999,39 @@ pub mod builder { let body = body .and_then(|v| types::VpcSubnetCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_create", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetCreate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_subnet_view`] + ///Builder for [`Client::vpc_subnet_view`] /// - ///[`ClientVpcsExt::vpc_subnet_view`]: super::ClientVpcsExt::vpc_subnet_view + ///[`Client::vpc_subnet_view`]: super::Client::vpc_subnet_view #[derive(Debug, Clone)] pub struct VpcSubnetView<'a> { client: &'a super::Client, @@ -40126,6 +47096,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40137,52 +47111,39 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let subnet_name = subnet_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_view", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetView { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_subnet_update`] + ///Builder for [`Client::vpc_subnet_update`] /// - ///[`ClientVpcsExt::vpc_subnet_update`]: super::ClientVpcsExt::vpc_subnet_update + ///[`Client::vpc_subnet_update`]: super::Client::vpc_subnet_update #[derive(Debug, Clone)] pub struct VpcSubnetUpdate<'a> { client: &'a super::Client, @@ -40269,6 +47230,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40284,53 +47249,40 @@ pub mod builder { let body = body .and_then(|v| types::VpcSubnetUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_update", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_subnet_delete`] + ///Builder for [`Client::vpc_subnet_delete`] /// - ///[`ClientVpcsExt::vpc_subnet_delete`]: super::ClientVpcsExt::vpc_subnet_delete + ///[`Client::vpc_subnet_delete`]: super::Client::vpc_subnet_delete #[derive(Debug, Clone)] pub struct VpcSubnetDelete<'a> { client: &'a super::Client, @@ -40395,6 +47347,10 @@ pub mod builder { /// `/organizations/{organization_name}/projects/{project_name}/vpcs/ /// {vpc_name}/subnets/{subnet_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization_name, @@ -40406,52 +47362,39 @@ pub mod builder { let project_name = project_name.map_err(Error::InvalidRequest)?; let vpc_name = vpc_name.map_err(Error::InvalidRequest)?; let subnet_name = subnet_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_delete", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetDelete { + client: client, + request, + }) } } - ///Builder for [`ClientVpcsExt::vpc_subnet_list_network_interfaces`] + ///Builder for [`Client::vpc_subnet_list_network_interfaces`] /// - ///[`ClientVpcsExt::vpc_subnet_list_network_interfaces`]: super::ClientVpcsExt::vpc_subnet_list_network_interfaces + ///[`Client::vpc_subnet_list_network_interfaces`]: super::Client::vpc_subnet_list_network_interfaces #[derive(Debug, Clone)] pub struct VpcSubnetListNetworkInterfaces<'a> { client: &'a super::Client, @@ -40556,6 +47499,12 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, organization_name, @@ -40573,52 +47522,39 @@ 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/{}/projects/{}/vpcs/{}/subnets/{}/network-interfaces", - client.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "vpc_subnet_list_network_interfaces", + let request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}/network-interfaces", + client.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::VpcSubnetListNetworkInterfaces { + client: client, + request, + }) } ///Streams `GET` requests to @@ -40670,9 +47606,9 @@ pub mod builder { } } - ///Builder for [`ClientSilosExt::policy_view`] + ///Builder for [`Client::policy_view`] /// - ///[`ClientSilosExt::policy_view`]: super::ClientSilosExt::policy_view + ///[`Client::policy_view`]: super::Client::policy_view #[derive(Debug, Clone)] pub struct PolicyView<'a> { client: &'a super::Client, @@ -40687,46 +47623,37 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "policy_view", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::PolicyView { + client: client, + request, + }) } } - ///Builder for [`ClientSilosExt::policy_update`] + ///Builder for [`Client::policy_update`] /// - ///[`ClientSilosExt::policy_update`]: super::ClientSilosExt::policy_update + ///[`Client::policy_update`]: super::Client::policy_update #[derive(Debug, Clone)] pub struct PolicyUpdate<'a> { client: &'a super::Client, @@ -40765,50 +47692,41 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "policy_update", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::PolicyUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientRolesExt::role_list`] + ///Builder for [`Client::role_list`] /// - ///[`ClientRolesExt::role_list`]: super::ClientRolesExt::role_list + ///[`Client::role_list`]: super::Client::role_list #[derive(Debug, Clone)] pub struct RoleList<'a> { client: &'a super::Client, @@ -40849,6 +47767,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -40856,44 +47778,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "role_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RoleList { + client: client, + request, + }) } ///Streams `GET` requests to `/roles` @@ -40942,9 +47851,9 @@ pub mod builder { } } - ///Builder for [`ClientRolesExt::role_view`] + ///Builder for [`Client::role_view`] /// - ///[`ClientRolesExt::role_view`]: super::ClientRolesExt::role_view + ///[`Client::role_view`]: super::Client::role_view #[derive(Debug, Clone)] pub struct RoleView<'a> { client: &'a super::Client, @@ -40971,51 +47880,42 @@ pub mod builder { ///Sends a `GET` request to `/roles/{role_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "role_view", + let request = { + let url = format!( + "{}/roles/{}", + client.baseurl, + encode_path(&role_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RoleView { + client: client, + request, + }) } } - ///Builder for [`ClientHiddenExt::session_me`] + ///Builder for [`Client::session_me`] /// - ///[`ClientHiddenExt::session_me`]: super::ClientHiddenExt::session_me + ///[`Client::session_me`]: super::Client::session_me #[derive(Debug, Clone)] pub struct SessionMe<'a> { client: &'a super::Client, @@ -41028,46 +47928,37 @@ pub mod builder { ///Sends a `GET` request to `/session/me` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_me", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionMe { + client: client, + request, + }) } } - ///Builder for [`ClientHiddenExt::session_me_groups`] + ///Builder for [`Client::session_me_groups`] /// - ///[`ClientHiddenExt::session_me_groups`]: super::ClientHiddenExt::session_me_groups + ///[`Client::session_me_groups`]: super::Client::session_me_groups #[derive(Debug, Clone)] pub struct SessionMeGroups<'a> { client: &'a super::Client, @@ -41121,6 +48012,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -41130,45 +48025,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_me_groups", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionMeGroups { + client: client, + request, + }) } ///Streams `GET` requests to `/session/me/groups` @@ -41218,9 +48100,9 @@ pub mod builder { } } - ///Builder for [`ClientSessionExt::session_sshkey_list`] + ///Builder for [`Client::session_sshkey_list`] /// - ///[`ClientSessionExt::session_sshkey_list`]: super::ClientSessionExt::session_sshkey_list + ///[`Client::session_sshkey_list`]: super::Client::session_sshkey_list #[derive(Debug, Clone)] pub struct SessionSshkeyList<'a> { client: &'a super::Client, @@ -41274,6 +48156,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -41283,45 +48169,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyList { + client: client, + request, + }) } ///Streams `GET` requests to `/session/me/sshkeys` @@ -41371,9 +48244,9 @@ pub mod builder { } } - ///Builder for [`ClientSessionExt::session_sshkey_create`] + ///Builder for [`Client::session_sshkey_create`] /// - ///[`ClientSessionExt::session_sshkey_create`]: super::ClientSessionExt::session_sshkey_create + ///[`Client::session_sshkey_create`]: super::Client::session_sshkey_create #[derive(Debug, Clone)] pub struct SessionSshkeyCreate<'a> { client: &'a super::Client, @@ -41410,50 +48283,41 @@ pub mod builder { ///Sends a `POST` request to `/session/me/sshkeys` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSessionExt::session_sshkey_view`] + ///Builder for [`Client::session_sshkey_view`] /// - ///[`ClientSessionExt::session_sshkey_view`]: super::ClientSessionExt::session_sshkey_view + ///[`Client::session_sshkey_view`]: super::Client::session_sshkey_view #[derive(Debug, Clone)] pub struct SessionSshkeyView<'a> { client: &'a super::Client, @@ -41480,54 +48344,45 @@ pub mod builder { ///Sends a `GET` request to `/session/me/sshkeys/{ssh_key_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, ssh_key_name, } = self; let ssh_key_name = ssh_key_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/session/me/sshkeys/{}", - client.baseurl, - encode_path(&ssh_key_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_view", + let request = { + let url = format!( + "{}/session/me/sshkeys/{}", + client.baseurl, + encode_path(&ssh_key_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyView { + client: client, + request, + }) } } - ///Builder for [`ClientSessionExt::session_sshkey_delete`] + ///Builder for [`Client::session_sshkey_delete`] /// - ///[`ClientSessionExt::session_sshkey_delete`]: super::ClientSessionExt::session_sshkey_delete + ///[`Client::session_sshkey_delete`]: super::Client::session_sshkey_delete #[derive(Debug, Clone)] pub struct SessionSshkeyDelete<'a> { client: &'a super::Client, @@ -41554,54 +48409,45 @@ pub mod builder { ///Sends a `DELETE` request to `/session/me/sshkeys/{ssh_key_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, ssh_key_name, } = self; let ssh_key_name = ssh_key_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/session/me/sshkeys/{}", - client.baseurl, - encode_path(&ssh_key_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "session_sshkey_delete", + let request = { + let url = format!( + "{}/session/me/sshkeys/{}", + client.baseurl, + encode_path(&ssh_key_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SessionSshkeyDelete { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_image_view_by_id`] + ///Builder for [`Client::system_image_view_by_id`] /// - ///[`ClientSystemExt::system_image_view_by_id`]: super::ClientSystemExt::system_image_view_by_id + ///[`Client::system_image_view_by_id`]: super::Client::system_image_view_by_id #[derive(Debug, Clone)] pub struct SystemImageViewById<'a> { client: &'a super::Client, @@ -41628,51 +48474,42 @@ pub mod builder { ///Sends a `GET` request to `/system/by-id/images/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_view_by_id", + let request = { + let url = format!( + "{}/system/by-id/images/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageViewById { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_view_by_id`] + ///Builder for [`Client::ip_pool_view_by_id`] /// - ///[`ClientSystemExt::ip_pool_view_by_id`]: super::ClientSystemExt::ip_pool_view_by_id + ///[`Client::ip_pool_view_by_id`]: super::Client::ip_pool_view_by_id #[derive(Debug, Clone)] pub struct IpPoolViewById<'a> { client: &'a super::Client, @@ -41699,51 +48536,42 @@ pub mod builder { ///Sends a `GET` request to `/system/by-id/ip-pools/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_view_by_id", + let request = { + let url = format!( + "{}/system/by-id/ip-pools/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolViewById { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_view_by_id`] + ///Builder for [`Client::silo_view_by_id`] /// - ///[`ClientSystemExt::silo_view_by_id`]: super::ClientSystemExt::silo_view_by_id + ///[`Client::silo_view_by_id`]: super::Client::silo_view_by_id #[derive(Debug, Clone)] pub struct SiloViewById<'a> { client: &'a super::Client, @@ -41770,51 +48598,42 @@ pub mod builder { ///Sends a `GET` request to `/system/by-id/silos/{id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_view_by_id", + let request = { + let url = format!( + "{}/system/by-id/silos/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloViewById { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::certificate_list`] + ///Builder for [`Client::certificate_list`] /// - ///[`ClientSystemExt::certificate_list`]: super::ClientSystemExt::certificate_list + ///[`Client::certificate_list`]: super::Client::certificate_list #[derive(Debug, Clone)] pub struct CertificateList<'a> { client: &'a super::Client, @@ -41868,6 +48687,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -41877,45 +48700,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/certificates` @@ -41965,9 +48775,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::certificate_create`] + ///Builder for [`Client::certificate_create`] /// - ///[`ClientSystemExt::certificate_create`]: super::ClientSystemExt::certificate_create + ///[`Client::certificate_create`]: super::Client::certificate_create #[derive(Debug, Clone)] pub struct CertificateCreate<'a> { client: &'a super::Client, @@ -42006,50 +48816,41 @@ pub mod builder { ///Sends a `POST` request to `/system/certificates` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::certificate_view`] + ///Builder for [`Client::certificate_view`] /// - ///[`ClientSystemExt::certificate_view`]: super::ClientSystemExt::certificate_view + ///[`Client::certificate_view`]: super::Client::certificate_view #[derive(Debug, Clone)] pub struct CertificateView<'a> { client: &'a super::Client, @@ -42076,54 +48877,45 @@ pub mod builder { ///Sends a `GET` request to `/system/certificates/{certificate}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, certificate, } = self; let certificate = certificate.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/certificates/{}", - client.baseurl, - encode_path(&certificate.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_view", + let request = { + let url = format!( + "{}/system/certificates/{}", + client.baseurl, + encode_path(&certificate.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::certificate_delete`] + ///Builder for [`Client::certificate_delete`] /// - ///[`ClientSystemExt::certificate_delete`]: super::ClientSystemExt::certificate_delete + ///[`Client::certificate_delete`]: super::Client::certificate_delete #[derive(Debug, Clone)] pub struct CertificateDelete<'a> { client: &'a super::Client, @@ -42150,54 +48942,45 @@ pub mod builder { ///Sends a `DELETE` request to `/system/certificates/{certificate}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, certificate, } = self; let certificate = certificate.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/certificates/{}", - client.baseurl, - encode_path(&certificate.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "certificate_delete", + let request = { + let url = format!( + "{}/system/certificates/{}", + client.baseurl, + encode_path(&certificate.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::CertificateDelete { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::physical_disk_list`] + ///Builder for [`Client::physical_disk_list`] /// - ///[`ClientSystemExt::physical_disk_list`]: super::ClientSystemExt::physical_disk_list + ///[`Client::physical_disk_list`]: super::Client::physical_disk_list #[derive(Debug, Clone)] pub struct PhysicalDiskList<'a> { client: &'a super::Client, @@ -42251,6 +49034,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -42260,45 +49047,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "physical_disk_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::PhysicalDiskList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/disks` @@ -42348,9 +49122,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::rack_list`] + ///Builder for [`Client::rack_list`] /// - ///[`ClientSystemExt::rack_list`]: super::ClientSystemExt::rack_list + ///[`Client::rack_list`]: super::Client::rack_list #[derive(Debug, Clone)] pub struct RackList<'a> { client: &'a super::Client, @@ -42404,6 +49178,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -42413,45 +49191,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "rack_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RackList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/racks` @@ -42501,9 +49266,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::rack_view`] + ///Builder for [`Client::rack_view`] /// - ///[`ClientSystemExt::rack_view`]: super::ClientSystemExt::rack_view + ///[`Client::rack_view`]: super::Client::rack_view #[derive(Debug, Clone)] pub struct RackView<'a> { client: &'a super::Client, @@ -42530,51 +49295,42 @@ pub mod builder { ///Sends a `GET` request to `/system/hardware/racks/{rack_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "rack_view", + let request = { + let url = format!( + "{}/system/hardware/racks/{}", + client.baseurl, + encode_path(&rack_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::RackView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::sled_list`] + ///Builder for [`Client::sled_list`] /// - ///[`ClientSystemExt::sled_list`]: super::ClientSystemExt::sled_list + ///[`Client::sled_list`]: super::Client::sled_list #[derive(Debug, Clone)] pub struct SledList<'a> { client: &'a super::Client, @@ -42628,6 +49384,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -42637,45 +49397,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "sled_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SledList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/sleds` @@ -42725,9 +49472,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::sled_view`] + ///Builder for [`Client::sled_view`] /// - ///[`ClientSystemExt::sled_view`]: super::ClientSystemExt::sled_view + ///[`Client::sled_view`]: super::Client::sled_view #[derive(Debug, Clone)] pub struct SledView<'a> { client: &'a super::Client, @@ -42754,51 +49501,42 @@ pub mod builder { ///Sends a `GET` request to `/system/hardware/sleds/{sled_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "sled_view", + let request = { + let url = format!( + "{}/system/hardware/sleds/{}", + client.baseurl, + encode_path(&sled_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SledView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::sled_physical_disk_list`] + ///Builder for [`Client::sled_physical_disk_list`] /// - ///[`ClientSystemExt::sled_physical_disk_list`]: super::ClientSystemExt::sled_physical_disk_list + ///[`Client::sled_physical_disk_list`]: super::Client::sled_physical_disk_list #[derive(Debug, Clone)] pub struct SledPhysicalDiskList<'a> { client: &'a super::Client, @@ -42864,6 +49602,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, sled_id, @@ -42875,49 +49617,36 @@ 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/{}/disks", - client.baseurl, - encode_path(&sled_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "sled_physical_disk_list", + let request = { + let url = format!( + "{}/system/hardware/sleds/{}/disks", + client.baseurl, + encode_path(&sled_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SledPhysicalDiskList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/hardware/sleds/{sled_id}/disks` @@ -42967,9 +49696,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::system_image_list`] + ///Builder for [`Client::system_image_list`] /// - ///[`ClientSystemExt::system_image_list`]: super::ClientSystemExt::system_image_list + ///[`Client::system_image_list`]: super::Client::system_image_list #[derive(Debug, Clone)] pub struct SystemImageList<'a> { client: &'a super::Client, @@ -43023,6 +49752,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -43032,45 +49765,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/images` @@ -43120,9 +49840,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::system_image_create`] + ///Builder for [`Client::system_image_create`] /// - ///[`ClientSystemExt::system_image_create`]: super::ClientSystemExt::system_image_create + ///[`Client::system_image_create`]: super::Client::system_image_create #[derive(Debug, Clone)] pub struct SystemImageCreate<'a> { client: &'a super::Client, @@ -43161,50 +49881,41 @@ pub mod builder { ///Sends a `POST` request to `/system/images` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_image_view`] + ///Builder for [`Client::system_image_view`] /// - ///[`ClientSystemExt::system_image_view`]: super::ClientSystemExt::system_image_view + ///[`Client::system_image_view`]: super::Client::system_image_view #[derive(Debug, Clone)] pub struct SystemImageView<'a> { client: &'a super::Client, @@ -43231,51 +49942,42 @@ pub mod builder { ///Sends a `GET` request to `/system/images/{image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_view", + let request = { + let url = format!( + "{}/system/images/{}", + client.baseurl, + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_image_delete`] + ///Builder for [`Client::system_image_delete`] /// - ///[`ClientSystemExt::system_image_delete`]: super::ClientSystemExt::system_image_delete + ///[`Client::system_image_delete`]: super::Client::system_image_delete #[derive(Debug, Clone)] pub struct SystemImageDelete<'a> { client: &'a super::Client, @@ -43302,51 +50004,42 @@ pub mod builder { ///Sends a `DELETE` request to `/system/images/{image_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_image_delete", + let request = { + let url = format!( + "{}/system/images/{}", + client.baseurl, + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemImageDelete { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_list`] + ///Builder for [`Client::ip_pool_list`] /// - ///[`ClientSystemExt::ip_pool_list`]: super::ClientSystemExt::ip_pool_list + ///[`Client::ip_pool_list`]: super::Client::ip_pool_list #[derive(Debug, Clone)] pub struct IpPoolList<'a> { client: &'a super::Client, @@ -43400,6 +50093,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -43409,45 +50106,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/ip-pools` @@ -43497,9 +50181,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::ip_pool_create`] + ///Builder for [`Client::ip_pool_create`] /// - ///[`ClientSystemExt::ip_pool_create`]: super::ClientSystemExt::ip_pool_create + ///[`Client::ip_pool_create`]: super::Client::ip_pool_create #[derive(Debug, Clone)] pub struct IpPoolCreate<'a> { client: &'a super::Client, @@ -43536,50 +50220,41 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_view`] + ///Builder for [`Client::ip_pool_view`] /// - ///[`ClientSystemExt::ip_pool_view`]: super::ClientSystemExt::ip_pool_view + ///[`Client::ip_pool_view`]: super::Client::ip_pool_view #[derive(Debug, Clone)] pub struct IpPoolView<'a> { client: &'a super::Client, @@ -43606,51 +50281,42 @@ pub mod builder { ///Sends a `GET` request to `/system/ip-pools/{pool_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_view", + let request = { + let url = format!( + "{}/system/ip-pools/{}", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_update`] + ///Builder for [`Client::ip_pool_update`] /// - ///[`ClientSystemExt::ip_pool_update`]: super::ClientSystemExt::ip_pool_update + ///[`Client::ip_pool_update`]: super::Client::ip_pool_update #[derive(Debug, Clone)] pub struct IpPoolUpdate<'a> { client: &'a super::Client, @@ -43699,6 +50365,10 @@ pub mod builder { ///Sends a `PUT` request to `/system/ip-pools/{pool_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -43708,50 +50378,37 @@ pub mod builder { let body = body .and_then(|v| types::IpPoolUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_update", + let request = { + let url = format!( + "{}/system/ip-pools/{}", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_delete`] + ///Builder for [`Client::ip_pool_delete`] /// - ///[`ClientSystemExt::ip_pool_delete`]: super::ClientSystemExt::ip_pool_delete + ///[`Client::ip_pool_delete`]: super::Client::ip_pool_delete #[derive(Debug, Clone)] pub struct IpPoolDelete<'a> { client: &'a super::Client, @@ -43778,51 +50435,42 @@ pub mod builder { ///Sends a `DELETE` request to `/system/ip-pools/{pool_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_delete", + let request = { + let url = format!( + "{}/system/ip-pools/{}", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolDelete { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_range_list`] + ///Builder for [`Client::ip_pool_range_list`] /// - ///[`ClientSystemExt::ip_pool_range_list`]: super::ClientSystemExt::ip_pool_range_list + ///[`Client::ip_pool_range_list`]: super::Client::ip_pool_range_list #[derive(Debug, Clone)] pub struct IpPoolRangeList<'a> { client: &'a super::Client, @@ -43875,6 +50523,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -43884,48 +50536,35 @@ pub mod builder { let pool_name = pool_name.map_err(Error::InvalidRequest)?; let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}/ranges", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_range_list", + let request = { + let url = format!( + "{}/system/ip-pools/{}/ranges", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolRangeList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/ip-pools/{pool_name}/ranges` @@ -43974,9 +50613,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::ip_pool_range_add`] + ///Builder for [`Client::ip_pool_range_add`] /// - ///[`ClientSystemExt::ip_pool_range_add`]: super::ClientSystemExt::ip_pool_range_add + ///[`Client::ip_pool_range_add`]: super::Client::ip_pool_range_add #[derive(Debug, Clone)] pub struct IpPoolRangeAdd<'a> { client: &'a super::Client, @@ -44015,6 +50654,10 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools/{pool_name}/ranges/add` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -44022,50 +50665,37 @@ pub mod builder { } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}/ranges/add", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_range_add", + let request = { + let url = format!( + "{}/system/ip-pools/{}/ranges/add", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolRangeAdd { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_range_remove`] + ///Builder for [`Client::ip_pool_range_remove`] /// - ///[`ClientSystemExt::ip_pool_range_remove`]: super::ClientSystemExt::ip_pool_range_remove + ///[`Client::ip_pool_range_remove`]: super::Client::ip_pool_range_remove #[derive(Debug, Clone)] pub struct IpPoolRangeRemove<'a> { client: &'a super::Client, @@ -44105,6 +50735,10 @@ pub mod builder { ///Sends a `POST` request to /// `/system/ip-pools/{pool_name}/ranges/remove` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, pool_name, @@ -44112,50 +50746,37 @@ pub mod builder { } = self; let pool_name = pool_name.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/ip-pools/{}/ranges/remove", - client.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_range_remove", + let request = { + let url = format!( + "{}/system/ip-pools/{}/ranges/remove", + client.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolRangeRemove { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_service_view`] + ///Builder for [`Client::ip_pool_service_view`] /// - ///[`ClientSystemExt::ip_pool_service_view`]: super::ClientSystemExt::ip_pool_service_view + ///[`Client::ip_pool_service_view`]: super::Client::ip_pool_service_view #[derive(Debug, Clone)] pub struct IpPoolServiceView<'a> { client: &'a super::Client, @@ -44168,46 +50789,37 @@ pub mod builder { ///Sends a `GET` request to `/system/ip-pools-service` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_view", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_service_range_list`] + ///Builder for [`Client::ip_pool_service_range_list`] /// - ///[`ClientSystemExt::ip_pool_service_range_list`]: super::ClientSystemExt::ip_pool_service_range_list + ///[`Client::ip_pool_service_range_list`]: super::Client::ip_pool_service_range_list #[derive(Debug, Clone)] pub struct IpPoolServiceRangeList<'a> { client: &'a super::Client, @@ -44248,6 +50860,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -44255,44 +50871,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_range_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceRangeList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/ip-pools-service/ranges` @@ -44341,9 +50944,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::ip_pool_service_range_add`] + ///Builder for [`Client::ip_pool_service_range_add`] /// - ///[`ClientSystemExt::ip_pool_service_range_add`]: super::ClientSystemExt::ip_pool_service_range_add + ///[`Client::ip_pool_service_range_add`]: super::Client::ip_pool_service_range_add #[derive(Debug, Clone)] pub struct IpPoolServiceRangeAdd<'a> { client: &'a super::Client, @@ -44370,48 +50973,39 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools-service/ranges/add` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_range_add", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceRangeAdd { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::ip_pool_service_range_remove`] + ///Builder for [`Client::ip_pool_service_range_remove`] /// - ///[`ClientSystemExt::ip_pool_service_range_remove`]: super::ClientSystemExt::ip_pool_service_range_remove + ///[`Client::ip_pool_service_range_remove`]: super::Client::ip_pool_service_range_remove #[derive(Debug, Clone)] pub struct IpPoolServiceRangeRemove<'a> { client: &'a super::Client, @@ -44438,48 +51032,39 @@ pub mod builder { ///Sends a `POST` request to `/system/ip-pools-service/ranges/remove` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "ip_pool_service_range_remove", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::IpPoolServiceRangeRemove { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_metric`] + ///Builder for [`Client::system_metric`] /// - ///[`ClientSystemExt::system_metric`]: super::ClientSystemExt::system_metric + ///[`Client::system_metric`]: super::Client::system_metric #[derive(Debug, Clone)] pub struct SystemMetric<'a> { client: &'a super::Client, @@ -44572,6 +51157,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, metric_name, @@ -44587,60 +51176,47 @@ pub mod builder { let limit = limit.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; let start_time = start_time.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/metrics/{}", - client.baseurl, - encode_path(&metric_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("end_time", &end_time)) - .query(&progenitor_client::QueryParam::new("id", &id)) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new( - "start_time", - &start_time, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_metric", + let request = { + let url = format!( + "{}/system/metrics/{}", + client.baseurl, + encode_path(&metric_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("end_time", &end_time)) + .query(&progenitor_client::QueryParam::new("id", &id)) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new( + "start_time", + &start_time, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemMetric { + client: client, + request, + }) } } - ///Builder for [`ClientPolicyExt::system_policy_view`] + ///Builder for [`Client::system_policy_view`] /// - ///[`ClientPolicyExt::system_policy_view`]: super::ClientPolicyExt::system_policy_view + ///[`Client::system_policy_view`]: super::Client::system_policy_view #[derive(Debug, Clone)] pub struct SystemPolicyView<'a> { client: &'a super::Client, @@ -44655,46 +51231,37 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_policy_view", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemPolicyView { + client: client, + request, + }) } } - ///Builder for [`ClientPolicyExt::system_policy_update`] + ///Builder for [`Client::system_policy_update`] /// - ///[`ClientPolicyExt::system_policy_update`]: super::ClientPolicyExt::system_policy_update + ///[`Client::system_policy_update`]: super::Client::system_policy_update #[derive(Debug, Clone)] pub struct SystemPolicyUpdate<'a> { client: &'a super::Client, @@ -44733,50 +51300,41 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_policy_update", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemPolicyUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::saga_list`] + ///Builder for [`Client::saga_list`] /// - ///[`ClientSystemExt::saga_list`]: super::ClientSystemExt::saga_list + ///[`Client::saga_list`]: super::Client::saga_list #[derive(Debug, Clone)] pub struct SagaList<'a> { client: &'a super::Client, @@ -44830,6 +51388,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -44839,45 +51401,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saga_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SagaList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/sagas` @@ -44927,9 +51476,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::saga_view`] + ///Builder for [`Client::saga_view`] /// - ///[`ClientSystemExt::saga_view`]: super::ClientSystemExt::saga_view + ///[`Client::saga_view`]: super::Client::saga_view #[derive(Debug, Clone)] pub struct SagaView<'a> { client: &'a super::Client, @@ -44956,51 +51505,42 @@ pub mod builder { ///Sends a `GET` request to `/system/sagas/{saga_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saga_view", + let request = { + let url = format!( + "{}/system/sagas/{}", + client.baseurl, + encode_path(&saga_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SagaView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_list`] + ///Builder for [`Client::silo_list`] /// - ///[`ClientSystemExt::silo_list`]: super::ClientSystemExt::silo_list + ///[`Client::silo_list`]: super::Client::silo_list #[derive(Debug, Clone)] pub struct SiloList<'a> { client: &'a super::Client, @@ -45054,6 +51594,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -45063,45 +51607,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/silos` @@ -45151,9 +51682,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::silo_create`] + ///Builder for [`Client::silo_create`] /// - ///[`ClientSystemExt::silo_create`]: super::ClientSystemExt::silo_create + ///[`Client::silo_create`]: super::Client::silo_create #[derive(Debug, Clone)] pub struct SiloCreate<'a> { client: &'a super::Client, @@ -45190,50 +51721,41 @@ pub mod builder { ///Sends a `POST` request to `/system/silos` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_create", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_view`] + ///Builder for [`Client::silo_view`] /// - ///[`ClientSystemExt::silo_view`]: super::ClientSystemExt::silo_view + ///[`Client::silo_view`]: super::Client::silo_view #[derive(Debug, Clone)] pub struct SiloView<'a> { client: &'a super::Client, @@ -45260,51 +51782,42 @@ pub mod builder { ///Sends a `GET` request to `/system/silos/{silo_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_view", + let request = { + let url = format!( + "{}/system/silos/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_delete`] + ///Builder for [`Client::silo_delete`] /// - ///[`ClientSystemExt::silo_delete`]: super::ClientSystemExt::silo_delete + ///[`Client::silo_delete`]: super::Client::silo_delete #[derive(Debug, Clone)] pub struct SiloDelete<'a> { client: &'a super::Client, @@ -45331,51 +51844,42 @@ pub mod builder { ///Sends a `DELETE` request to `/system/silos/{silo_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_delete", + let request = { + let url = format!( + "{}/system/silos/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloDelete { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_identity_provider_list`] + ///Builder for [`Client::silo_identity_provider_list`] /// - ///[`ClientSystemExt::silo_identity_provider_list`]: super::ClientSystemExt::silo_identity_provider_list + ///[`Client::silo_identity_provider_list`]: super::Client::silo_identity_provider_list #[derive(Debug, Clone)] pub struct SiloIdentityProviderList<'a> { client: &'a super::Client, @@ -45443,6 +51947,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45454,49 +51962,36 @@ 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/{}/identity-providers", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_identity_provider_list", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloIdentityProviderList { + client: client, + request, + }) } ///Streams `GET` requests to @@ -45547,9 +52042,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::local_idp_user_create`] + ///Builder for [`Client::local_idp_user_create`] /// - ///[`ClientSystemExt::local_idp_user_create`]: super::ClientSystemExt::local_idp_user_create + ///[`Client::local_idp_user_create`]: super::Client::local_idp_user_create #[derive(Debug, Clone)] pub struct LocalIdpUserCreate<'a> { client: &'a super::Client, @@ -45599,6 +52094,10 @@ pub mod builder { ///Sends a `POST` request to /// `/system/silos/{silo_name}/identity-providers/local/users` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45608,50 +52107,37 @@ pub mod builder { let body = body .and_then(|v| types::UserCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/local/users", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "local_idp_user_create", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LocalIdpUserCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::local_idp_user_delete`] + ///Builder for [`Client::local_idp_user_delete`] /// - ///[`ClientSystemExt::local_idp_user_delete`]: super::ClientSystemExt::local_idp_user_delete + ///[`Client::local_idp_user_delete`]: super::Client::local_idp_user_delete #[derive(Debug, Clone)] pub struct LocalIdpUserDelete<'a> { client: &'a super::Client, @@ -45691,6 +52177,10 @@ pub mod builder { ///Sends a `DELETE` request to /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45698,50 +52188,37 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let user_id = user_id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/local/users/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "local_idp_user_delete", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LocalIdpUserDelete { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::local_idp_user_set_password`] + ///Builder for [`Client::local_idp_user_set_password`] /// - ///[`ClientSystemExt::local_idp_user_set_password`]: super::ClientSystemExt::local_idp_user_set_password + ///[`Client::local_idp_user_set_password`]: super::Client::local_idp_user_set_password #[derive(Debug, Clone)] pub struct LocalIdpUserSetPassword<'a> { client: &'a super::Client, @@ -45794,6 +52271,10 @@ pub mod builder { /// `/system/silos/{silo_name}/identity-providers/local/users/{user_id}/ /// set-password` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45803,51 +52284,38 @@ pub mod builder { let silo_name = silo_name.map_err(Error::InvalidRequest)?; let user_id = user_id.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/local/users/{}/set-password", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "local_idp_user_set_password", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users/{}/set-password", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::LocalIdpUserSetPassword { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::saml_identity_provider_create`] + ///Builder for [`Client::saml_identity_provider_create`] /// - ///[`ClientSystemExt::saml_identity_provider_create`]: super::ClientSystemExt::saml_identity_provider_create + ///[`Client::saml_identity_provider_create`]: super::Client::saml_identity_provider_create #[derive(Debug, Clone)] pub struct SamlIdentityProviderCreate<'a> { client: &'a super::Client, @@ -45904,6 +52372,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -45915,50 +52387,37 @@ pub mod builder { types::SamlIdentityProviderCreate::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/saml", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saml_identity_provider_create", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/saml", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SamlIdentityProviderCreate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::saml_identity_provider_view`] + ///Builder for [`Client::saml_identity_provider_view`] /// - ///[`ClientSystemExt::saml_identity_provider_view`]: super::ClientSystemExt::saml_identity_provider_view + ///[`Client::saml_identity_provider_view`]: super::Client::saml_identity_provider_view #[derive(Debug, Clone)] pub struct SamlIdentityProviderView<'a> { client: &'a super::Client, @@ -46000,6 +52459,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46007,50 +52470,37 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let provider_name = provider_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/identity-providers/saml/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "saml_identity_provider_view", + let request = { + let url = format!( + "{}/system/silos/{}/identity-providers/saml/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SamlIdentityProviderView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_policy_view`] + ///Builder for [`Client::silo_policy_view`] /// - ///[`ClientSystemExt::silo_policy_view`]: super::ClientSystemExt::silo_policy_view + ///[`Client::silo_policy_view`]: super::Client::silo_policy_view #[derive(Debug, Clone)] pub struct SiloPolicyView<'a> { client: &'a super::Client, @@ -46079,51 +52529,42 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/policy", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_policy_view", + let request = { + let url = format!( + "{}/system/silos/{}/policy", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloPolicyView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_policy_update`] + ///Builder for [`Client::silo_policy_update`] /// - ///[`ClientSystemExt::silo_policy_update`]: super::ClientSystemExt::silo_policy_update + ///[`Client::silo_policy_update`]: super::Client::silo_policy_update #[derive(Debug, Clone)] pub struct SiloPolicyUpdate<'a> { client: &'a super::Client, @@ -46174,6 +52615,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46183,50 +52628,37 @@ 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!( - "{}/system/silos/{}/policy", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_policy_update", + let request = { + let url = format!( + "{}/system/silos/{}/policy", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloPolicyUpdate { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::silo_users_list`] + ///Builder for [`Client::silo_users_list`] /// - ///[`ClientSystemExt::silo_users_list`]: super::ClientSystemExt::silo_users_list + ///[`Client::silo_users_list`]: super::Client::silo_users_list #[derive(Debug, Clone)] pub struct SiloUsersList<'a> { client: &'a super::Client, @@ -46292,6 +52724,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46303,49 +52739,36 @@ 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/{}/users/all", - client.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_users_list", + let request = { + let url = format!( + "{}/system/silos/{}/users/all", + client.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloUsersList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/silos/{silo_name}/users/all` @@ -46395,9 +52818,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::silo_user_view`] + ///Builder for [`Client::silo_user_view`] /// - ///[`ClientSystemExt::silo_user_view`]: super::ClientSystemExt::silo_user_view + ///[`Client::silo_user_view`]: super::Client::silo_user_view #[derive(Debug, Clone)] pub struct SiloUserView<'a> { client: &'a super::Client, @@ -46437,6 +52860,10 @@ pub mod builder { ///Sends a `GET` request to /// `/system/silos/{silo_name}/users/id/{user_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, silo_name, @@ -46444,50 +52871,37 @@ pub mod builder { } = self; let silo_name = silo_name.map_err(Error::InvalidRequest)?; let user_id = user_id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/system/silos/{}/users/id/{}", - client.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "silo_user_view", + let request = { + let url = format!( + "{}/system/silos/{}/users/id/{}", + client.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SiloUserView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_user_list`] + ///Builder for [`Client::system_user_list`] /// - ///[`ClientSystemExt::system_user_list`]: super::ClientSystemExt::system_user_list + ///[`Client::system_user_list`]: super::Client::system_user_list #[derive(Debug, Clone)] pub struct SystemUserList<'a> { client: &'a super::Client, @@ -46541,6 +52955,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -46550,45 +52968,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_user_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUserList { + client: client, + request, + }) } ///Streams `GET` requests to `/system/user` @@ -46638,9 +53043,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::system_user_view`] + ///Builder for [`Client::system_user_view`] /// - ///[`ClientSystemExt::system_user_view`]: super::ClientSystemExt::system_user_view + ///[`Client::system_user_view`]: super::Client::system_user_view #[derive(Debug, Clone)] pub struct SystemUserView<'a> { client: &'a super::Client, @@ -46667,51 +53072,42 @@ pub mod builder { ///Sends a `GET` request to `/system/user/{user_name}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_user_view", + let request = { + let url = format!( + "{}/system/user/{}", + client.baseurl, + encode_path(&user_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUserView { + client: client, + request, + }) } } - ///Builder for [`ClientMetricsExt::timeseries_schema_get`] + ///Builder for [`Client::timeseries_schema_get`] /// - ///[`ClientMetricsExt::timeseries_schema_get`]: super::ClientMetricsExt::timeseries_schema_get + ///[`Client::timeseries_schema_get`]: super::Client::timeseries_schema_get #[derive(Debug, Clone)] pub struct TimeseriesSchemaGet<'a> { client: &'a super::Client, @@ -46753,6 +53149,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -46760,44 +53160,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "timeseries_schema_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::TimeseriesSchemaGet { + client: client, + request, + }) } ///Streams `GET` requests to `/timeseries/schema` @@ -46846,9 +53233,9 @@ pub mod builder { } } - ///Builder for [`ClientSilosExt::user_list`] + ///Builder for [`Client::user_list`] /// - ///[`ClientSilosExt::user_list`]: super::ClientSilosExt::user_list + ///[`Client::user_list`]: super::Client::user_list #[derive(Debug, Clone)] pub struct UserList<'a> { client: &'a super::Client, @@ -46902,6 +53289,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -46911,45 +53302,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "user_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UserList { + client: client, + request, + }) } ///Streams `GET` requests to `/users` @@ -46999,9 +53377,9 @@ pub mod builder { } } - ///Builder for [`ClientDisksExt::disk_list_v1`] + ///Builder for [`Client::disk_list_v1`] /// - ///[`ClientDisksExt::disk_list_v1`]: super::ClientDisksExt::disk_list_v1 + ///[`Client::disk_list_v1`]: super::Client::disk_list_v1 #[derive(Debug, Clone)] pub struct DiskListV1<'a> { client: &'a super::Client, @@ -47081,6 +53459,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -47094,50 +53476,37 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/disks` @@ -47189,9 +53558,9 @@ pub mod builder { } } - ///Builder for [`ClientDisksExt::disk_create_v1`] + ///Builder for [`Client::disk_create_v1`] /// - ///[`ClientDisksExt::disk_create_v1`]: super::ClientDisksExt::disk_create_v1 + ///[`Client::disk_create_v1`]: super::Client::disk_create_v1 #[derive(Debug, Clone)] pub struct DiskCreateV1<'a> { client: &'a super::Client, @@ -47253,6 +53622,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/disks` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -47264,51 +53637,38 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskCreateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientDisksExt::disk_view_v1`] + ///Builder for [`Client::disk_view_v1`] /// - ///[`ClientDisksExt::disk_view_v1`]: super::ClientDisksExt::disk_view_v1 + ///[`Client::disk_view_v1`]: super::Client::disk_view_v1 #[derive(Debug, Clone)] pub struct DiskViewV1<'a> { client: &'a super::Client, @@ -47361,6 +53721,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/disks/{disk}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, disk, @@ -47370,54 +53734,41 @@ pub mod builder { let disk = disk.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/disks/{}", - client.baseurl, - encode_path(&disk.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_view_v1", + let request = { + let url = format!( + "{}/v1/disks/{}", + client.baseurl, + encode_path(&disk.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskViewV1 { + client: client, + request, + }) } } - ///Builder for [`ClientDisksExt::disk_delete_v1`] + ///Builder for [`Client::disk_delete_v1`] /// - ///[`ClientDisksExt::disk_delete_v1`]: super::ClientDisksExt::disk_delete_v1 + ///[`Client::disk_delete_v1`]: super::Client::disk_delete_v1 #[derive(Debug, Clone)] pub struct DiskDeleteV1<'a> { client: &'a super::Client, @@ -47470,6 +53821,10 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/disks/{disk}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, disk, @@ -47479,54 +53834,41 @@ pub mod builder { let disk = disk.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/disks/{}", - client.baseurl, - encode_path(&disk.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "disk_delete_v1", + let request = { + let url = format!( + "{}/v1/disks/{}", + client.baseurl, + encode_path(&disk.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::DiskDeleteV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_list_v1`] + ///Builder for [`Client::instance_list_v1`] /// - ///[`ClientInstancesExt::instance_list_v1`]: super::ClientInstancesExt::instance_list_v1 + ///[`Client::instance_list_v1`]: super::Client::instance_list_v1 #[derive(Debug, Clone)] pub struct InstanceListV1<'a> { client: &'a super::Client, @@ -47606,6 +53948,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -47619,50 +53965,37 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/instances` @@ -47714,9 +54047,9 @@ pub mod builder { } } - ///Builder for [`ClientInstancesExt::instance_create_v1`] + ///Builder for [`Client::instance_create_v1`] /// - ///[`ClientInstancesExt::instance_create_v1`]: super::ClientInstancesExt::instance_create_v1 + ///[`Client::instance_create_v1`]: super::Client::instance_create_v1 #[derive(Debug, Clone)] pub struct InstanceCreateV1<'a> { client: &'a super::Client, @@ -47778,6 +54111,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -47789,51 +54126,38 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceCreateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_view_v1`] + ///Builder for [`Client::instance_view_v1`] /// - ///[`ClientInstancesExt::instance_view_v1`]: super::ClientInstancesExt::instance_view_v1 + ///[`Client::instance_view_v1`]: super::Client::instance_view_v1 #[derive(Debug, Clone)] pub struct InstanceViewV1<'a> { client: &'a super::Client, @@ -47886,6 +54210,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/instances/{instance}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -47895,54 +54223,41 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_view_v1", + let request = { + let url = format!( + "{}/v1/instances/{}", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceViewV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_delete_v1`] + ///Builder for [`Client::instance_delete_v1`] /// - ///[`ClientInstancesExt::instance_delete_v1`]: super::ClientInstancesExt::instance_delete_v1 + ///[`Client::instance_delete_v1`]: super::Client::instance_delete_v1 #[derive(Debug, Clone)] pub struct InstanceDeleteV1<'a> { client: &'a super::Client, @@ -47995,6 +54310,10 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/instances/{instance}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48004,54 +54323,41 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_delete_v1", + let request = { + let url = format!( + "{}/v1/instances/{}", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDeleteV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_disk_list_v1`] + ///Builder for [`Client::instance_disk_list_v1`] /// - ///[`ClientInstancesExt::instance_disk_list_v1`]: super::ClientInstancesExt::instance_disk_list_v1 + ///[`Client::instance_disk_list_v1`]: super::Client::instance_disk_list_v1 #[derive(Debug, Clone)] pub struct InstanceDiskListV1<'a> { client: &'a super::Client, @@ -48143,6 +54449,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48158,54 +54468,41 @@ 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/{}/disks", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_list_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/disks", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/instances/{instance}/disks` @@ -48257,9 +54554,9 @@ pub mod builder { } } - ///Builder for [`ClientInstancesExt::instance_disk_attach_v1`] + ///Builder for [`Client::instance_disk_attach_v1`] /// - ///[`ClientInstancesExt::instance_disk_attach_v1`]: super::ClientInstancesExt::instance_disk_attach_v1 + ///[`Client::instance_disk_attach_v1`]: super::Client::instance_disk_attach_v1 #[derive(Debug, Clone)] pub struct InstanceDiskAttachV1<'a> { client: &'a super::Client, @@ -48334,6 +54631,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/disks/attach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48347,55 +54648,42 @@ pub mod builder { let body = body .and_then(|v| types::DiskPath::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/disks/attach", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_attach_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/disks/attach", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskAttachV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_disk_detach_v1`] + ///Builder for [`Client::instance_disk_detach_v1`] /// - ///[`ClientInstancesExt::instance_disk_detach_v1`]: super::ClientInstancesExt::instance_disk_detach_v1 + ///[`Client::instance_disk_detach_v1`]: super::Client::instance_disk_detach_v1 #[derive(Debug, Clone)] pub struct InstanceDiskDetachV1<'a> { client: &'a super::Client, @@ -48470,6 +54758,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/disks/detach` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48483,55 +54775,42 @@ pub mod builder { let body = body .and_then(|v| types::DiskPath::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/disks/detach", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_disk_detach_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/disks/detach", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceDiskDetachV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_migrate_v1`] + ///Builder for [`Client::instance_migrate_v1`] /// - ///[`ClientInstancesExt::instance_migrate_v1`]: super::ClientInstancesExt::instance_migrate_v1 + ///[`Client::instance_migrate_v1`]: super::Client::instance_migrate_v1 #[derive(Debug, Clone)] pub struct InstanceMigrateV1<'a> { client: &'a super::Client, @@ -48606,6 +54885,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/migrate` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48619,55 +54902,42 @@ pub mod builder { let body = body .and_then(|v| types::InstanceMigrate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/migrate", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_migrate_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/migrate", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceMigrateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_reboot_v1`] + ///Builder for [`Client::instance_reboot_v1`] /// - ///[`ClientInstancesExt::instance_reboot_v1`]: super::ClientInstancesExt::instance_reboot_v1 + ///[`Client::instance_reboot_v1`]: super::Client::instance_reboot_v1 #[derive(Debug, Clone)] pub struct InstanceRebootV1<'a> { client: &'a super::Client, @@ -48720,6 +54990,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/reboot` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48729,54 +55003,41 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/reboot", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_reboot_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/reboot", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceRebootV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_serial_console_v1`] + ///Builder for [`Client::instance_serial_console_v1`] /// - ///[`ClientInstancesExt::instance_serial_console_v1`]: super::ClientInstancesExt::instance_serial_console_v1 + ///[`Client::instance_serial_console_v1`]: super::Client::instance_serial_console_v1 #[derive(Debug, Clone)] pub struct InstanceSerialConsoleV1<'a> { client: &'a super::Client, @@ -48870,6 +55131,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -48885,63 +55150,50 @@ pub mod builder { let most_recent = most_recent.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/serial-console", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "from_start", - &from_start, - )) - .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) - .query(&progenitor_client::QueryParam::new( - "most_recent", - &most_recent, - )) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/serial-console", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "from_start", + &from_start, + )) + .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) + .query(&progenitor_client::QueryParam::new( + "most_recent", + &most_recent, + )) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsoleV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_serial_console_stream_v1`] + ///Builder for [`Client::instance_serial_console_stream_v1`] /// - ///[`ClientInstancesExt::instance_serial_console_stream_v1`]: super::ClientInstancesExt::instance_serial_console_stream_v1 + ///[`Client::instance_serial_console_stream_v1`]: super::Client::instance_serial_console_stream_v1 #[derive(Debug, Clone)] pub struct InstanceSerialConsoleStreamV1<'a> { client: &'a super::Client, @@ -48997,6 +55249,12 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, instance, @@ -49006,55 +55264,47 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/serial-console/stream", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial_console_stream_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/serial-console/stream", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 101u16 => ResponseValue::upgrade(response).await, - 200..=299 => ResponseValue::upgrade(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerialConsoleStreamV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_start_v1`] + ///Builder for [`Client::instance_start_v1`] /// - ///[`ClientInstancesExt::instance_start_v1`]: super::ClientInstancesExt::instance_start_v1 + ///[`Client::instance_start_v1`]: super::Client::instance_start_v1 #[derive(Debug, Clone)] pub struct InstanceStartV1<'a> { client: &'a super::Client, @@ -49107,6 +55357,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/start` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -49116,54 +55370,41 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/start", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_start_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/start", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStartV1 { + client: client, + request, + }) } } - ///Builder for [`ClientInstancesExt::instance_stop_v1`] + ///Builder for [`Client::instance_stop_v1`] /// - ///[`ClientInstancesExt::instance_stop_v1`]: super::ClientInstancesExt::instance_stop_v1 + ///[`Client::instance_stop_v1`]: super::Client::instance_stop_v1 #[derive(Debug, Clone)] pub struct InstanceStopV1<'a> { client: &'a super::Client, @@ -49216,6 +55457,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/instances/{instance}/stop` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, instance, @@ -49225,54 +55470,41 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/instances/{}/stop", - client.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_stop_v1", + let request = { + let url = format!( + "{}/v1/instances/{}/stop", + client.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStopV1 { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_list_v1`] + ///Builder for [`Client::organization_list_v1`] /// - ///[`ClientOrganizationsExt::organization_list_v1`]: super::ClientOrganizationsExt::organization_list_v1 + ///[`Client::organization_list_v1`]: super::Client::organization_list_v1 #[derive(Debug, Clone)] pub struct OrganizationListV1<'a> { client: &'a super::Client, @@ -49326,6 +55558,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -49335,45 +55571,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/organizations` @@ -49423,9 +55646,9 @@ pub mod builder { } } - ///Builder for [`ClientOrganizationsExt::organization_create_v1`] + ///Builder for [`Client::organization_create_v1`] /// - ///[`ClientOrganizationsExt::organization_create_v1`]: super::ClientOrganizationsExt::organization_create_v1 + ///[`Client::organization_create_v1`]: super::Client::organization_create_v1 #[derive(Debug, Clone)] pub struct OrganizationCreateV1<'a> { client: &'a super::Client, @@ -49464,50 +55687,41 @@ pub mod builder { ///Sends a `POST` request to `/v1/organizations` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationCreateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_view_v1`] + ///Builder for [`Client::organization_view_v1`] /// - ///[`ClientOrganizationsExt::organization_view_v1`]: super::ClientOrganizationsExt::organization_view_v1 + ///[`Client::organization_view_v1`]: super::Client::organization_view_v1 #[derive(Debug, Clone)] pub struct OrganizationViewV1<'a> { client: &'a super::Client, @@ -49534,54 +55748,45 @@ pub mod builder { ///Sends a `GET` request to `/v1/organizations/{organization}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, } = self; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_view_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationViewV1 { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_update_v1`] + ///Builder for [`Client::organization_update_v1`] /// - ///[`ClientOrganizationsExt::organization_update_v1`]: super::ClientOrganizationsExt::organization_update_v1 + ///[`Client::organization_update_v1`]: super::Client::organization_update_v1 #[derive(Debug, Clone)] pub struct OrganizationUpdateV1<'a> { client: &'a super::Client, @@ -49632,6 +55837,10 @@ pub mod builder { ///Sends a `PUT` request to `/v1/organizations/{organization}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -49641,50 +55850,37 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_update_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationUpdateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_delete_v1`] + ///Builder for [`Client::organization_delete_v1`] /// - ///[`ClientOrganizationsExt::organization_delete_v1`]: super::ClientOrganizationsExt::organization_delete_v1 + ///[`Client::organization_delete_v1`]: super::Client::organization_delete_v1 #[derive(Debug, Clone)] pub struct OrganizationDeleteV1<'a> { client: &'a super::Client, @@ -49711,54 +55907,45 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/organizations/{organization}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, } = self; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_delete_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationDeleteV1 { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_policy_view_v1`] + ///Builder for [`Client::organization_policy_view_v1`] /// - ///[`ClientOrganizationsExt::organization_policy_view_v1`]: super::ClientOrganizationsExt::organization_policy_view_v1 + ///[`Client::organization_policy_view_v1`]: super::Client::organization_policy_view_v1 #[derive(Debug, Clone)] pub struct OrganizationPolicyViewV1<'a> { client: &'a super::Client, @@ -49787,54 +55974,45 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, } = self; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}/policy", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_view_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}/policy", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyViewV1 { + client: client, + request, + }) } } - ///Builder for [`ClientOrganizationsExt::organization_policy_update_v1`] + ///Builder for [`Client::organization_policy_update_v1`] /// - ///[`ClientOrganizationsExt::organization_policy_update_v1`]: super::ClientOrganizationsExt::organization_policy_update_v1 + ///[`Client::organization_policy_update_v1`]: super::Client::organization_policy_update_v1 #[derive(Debug, Clone)] pub struct OrganizationPolicyUpdateV1<'a> { client: &'a super::Client, @@ -49889,6 +56067,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -49898,50 +56080,37 @@ pub mod builder { let body = body .and_then(|v| types::OrganizationRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/organizations/{}/policy", - client.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "organization_policy_update_v1", + let request = { + let url = format!( + "{}/v1/organizations/{}/policy", + client.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::OrganizationPolicyUpdateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_list_v1`] + ///Builder for [`Client::project_list_v1`] /// - ///[`ClientProjectsExt::project_list_v1`]: super::ClientProjectsExt::project_list_v1 + ///[`Client::project_list_v1`]: super::Client::project_list_v1 #[derive(Debug, Clone)] pub struct ProjectListV1<'a> { client: &'a super::Client, @@ -50008,6 +56177,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -50019,49 +56192,36 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_list_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectListV1 { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/projects` @@ -50112,9 +56272,9 @@ pub mod builder { } } - ///Builder for [`ClientProjectsExt::project_create_v1`] + ///Builder for [`Client::project_create_v1`] /// - ///[`ClientProjectsExt::project_create_v1`]: super::ClientProjectsExt::project_create_v1 + ///[`Client::project_create_v1`]: super::Client::project_create_v1 #[derive(Debug, Clone)] pub struct ProjectCreateV1<'a> { client: &'a super::Client, @@ -50163,6 +56323,10 @@ pub mod builder { ///Sends a `POST` request to `/v1/projects` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, organization, @@ -50172,50 +56336,37 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_create_v1", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectCreateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_view_v1`] + ///Builder for [`Client::project_view_v1`] /// - ///[`ClientProjectsExt::project_view_v1`]: super::ClientProjectsExt::project_view_v1 + ///[`Client::project_view_v1`]: super::Client::project_view_v1 #[derive(Debug, Clone)] pub struct ProjectViewV1<'a> { client: &'a super::Client, @@ -50255,6 +56406,10 @@ pub mod builder { ///Sends a `GET` request to `/v1/projects/{project}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50262,53 +56417,40 @@ pub mod builder { } = self; let project = project.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_view_v1", + let request = { + let url = format!( + "{}/v1/projects/{}", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectViewV1 { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_update_v1`] + ///Builder for [`Client::project_update_v1`] /// - ///[`ClientProjectsExt::project_update_v1`]: super::ClientProjectsExt::project_update_v1 + ///[`Client::project_update_v1`]: super::Client::project_update_v1 #[derive(Debug, Clone)] pub struct ProjectUpdateV1<'a> { client: &'a super::Client, @@ -50370,6 +56512,10 @@ pub mod builder { ///Sends a `PUT` request to `/v1/projects/{project}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50381,54 +56527,41 @@ pub mod builder { let body = body .and_then(|v| types::ProjectUpdate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_update_v1", + let request = { + let url = format!( + "{}/v1/projects/{}", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectUpdateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_delete_v1`] + ///Builder for [`Client::project_delete_v1`] /// - ///[`ClientProjectsExt::project_delete_v1`]: super::ClientProjectsExt::project_delete_v1 + ///[`Client::project_delete_v1`]: super::Client::project_delete_v1 #[derive(Debug, Clone)] pub struct ProjectDeleteV1<'a> { client: &'a super::Client, @@ -50468,6 +56601,10 @@ pub mod builder { ///Sends a `DELETE` request to `/v1/projects/{project}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50475,53 +56612,40 @@ pub mod builder { } = self; let project = project.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_delete_v1", + let request = { + let url = format!( + "{}/v1/projects/{}", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectDeleteV1 { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_policy_view_v1`] + ///Builder for [`Client::project_policy_view_v1`] /// - ///[`ClientProjectsExt::project_policy_view_v1`]: super::ClientProjectsExt::project_policy_view_v1 + ///[`Client::project_policy_view_v1`]: super::Client::project_policy_view_v1 #[derive(Debug, Clone)] pub struct ProjectPolicyViewV1<'a> { client: &'a super::Client, @@ -50563,6 +56687,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50570,53 +56698,40 @@ pub mod builder { } = self; let project = project.map_err(Error::InvalidRequest)?; let organization = organization.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}/policy", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_view_v1", + let request = { + let url = format!( + "{}/v1/projects/{}/policy", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyViewV1 { + client: client, + request, + }) } } - ///Builder for [`ClientProjectsExt::project_policy_update_v1`] + ///Builder for [`Client::project_policy_update_v1`] /// - ///[`ClientProjectsExt::project_policy_update_v1`]: super::ClientProjectsExt::project_policy_update_v1 + ///[`Client::project_policy_update_v1`]: super::Client::project_policy_update_v1 #[derive(Debug, Clone)] pub struct ProjectPolicyUpdateV1<'a> { client: &'a super::Client, @@ -50682,6 +56797,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, project, @@ -50693,54 +56812,41 @@ pub mod builder { let body = body .and_then(|v| types::ProjectRolePolicy::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/projects/{}/policy", - client.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "project_policy_update_v1", + let request = { + let url = format!( + "{}/v1/projects/{}/policy", + client.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::ProjectPolicyUpdateV1 { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_component_version_list`] + ///Builder for [`Client::system_component_version_list`] /// - ///[`ClientSystemExt::system_component_version_list`]: super::ClientSystemExt::system_component_version_list + ///[`Client::system_component_version_list`]: super::Client::system_component_version_list #[derive(Debug, Clone)] pub struct SystemComponentVersionList<'a> { client: &'a super::Client, @@ -50795,6 +56901,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -50804,45 +56914,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_component_version_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemComponentVersionList { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/system/update/components` @@ -50893,9 +56990,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::update_deployments_list`] + ///Builder for [`Client::update_deployments_list`] /// - ///[`ClientSystemExt::update_deployments_list`]: super::ClientSystemExt::update_deployments_list + ///[`Client::update_deployments_list`]: super::Client::update_deployments_list #[derive(Debug, Clone)] pub struct UpdateDeploymentsList<'a> { client: &'a super::Client, @@ -50950,6 +57047,10 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -50959,45 +57060,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "update_deployments_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UpdateDeploymentsList { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/system/update/deployments` @@ -51047,9 +57135,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::update_deployment_view`] + ///Builder for [`Client::update_deployment_view`] /// - ///[`ClientSystemExt::update_deployment_view`]: super::ClientSystemExt::update_deployment_view + ///[`Client::update_deployment_view`]: super::Client::update_deployment_view #[derive(Debug, Clone)] pub struct UpdateDeploymentView<'a> { client: &'a super::Client, @@ -51078,51 +57166,42 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, id } = self; let id = id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/system/update/deployments/{}", - client.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "update_deployment_view", + let request = { + let url = format!( + "{}/v1/system/update/deployments/{}", + client.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::UpdateDeploymentView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_update_refresh`] + ///Builder for [`Client::system_update_refresh`] /// - ///[`ClientSystemExt::system_update_refresh`]: super::ClientSystemExt::system_update_refresh + ///[`Client::system_update_refresh`]: super::Client::system_update_refresh #[derive(Debug, Clone)] pub struct SystemUpdateRefresh<'a> { client: &'a super::Client, @@ -51135,46 +57214,37 @@ pub mod builder { ///Sends a `POST` request to `/v1/system/update/refresh` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_refresh", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateRefresh { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_update_start`] + ///Builder for [`Client::system_update_start`] /// - ///[`ClientSystemExt::system_update_start`]: super::ClientSystemExt::system_update_start + ///[`Client::system_update_start`]: super::Client::system_update_start #[derive(Debug, Clone)] pub struct SystemUpdateStart<'a> { client: &'a super::Client, @@ -51215,50 +57285,41 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_start", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 202u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateStart { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_update_stop`] + ///Builder for [`Client::system_update_stop`] /// - ///[`ClientSystemExt::system_update_stop`]: super::ClientSystemExt::system_update_stop + ///[`Client::system_update_stop`]: super::Client::system_update_stop #[derive(Debug, Clone)] pub struct SystemUpdateStop<'a> { client: &'a super::Client, @@ -51271,46 +57332,37 @@ pub mod builder { ///Sends a `POST` request to `/v1/system/update/stop` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_stop", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateStop { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_update_list`] + ///Builder for [`Client::system_update_list`] /// - ///[`ClientSystemExt::system_update_list`]: super::ClientSystemExt::system_update_list + ///[`Client::system_update_list`]: super::Client::system_update_list #[derive(Debug, Clone)] pub struct SystemUpdateList<'a> { client: &'a super::Client, @@ -51364,6 +57416,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -51373,45 +57429,32 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_list", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateList { + client: client, + request, + }) } ///Streams `GET` requests to `/v1/system/update/updates` @@ -51461,9 +57504,9 @@ pub mod builder { } } - ///Builder for [`ClientSystemExt::system_update_view`] + ///Builder for [`Client::system_update_view`] /// - ///[`ClientSystemExt::system_update_view`]: super::ClientSystemExt::system_update_view + ///[`Client::system_update_view`]: super::Client::system_update_view #[derive(Debug, Clone)] pub struct SystemUpdateView<'a> { client: &'a super::Client, @@ -51490,51 +57533,42 @@ pub mod builder { ///Sends a `GET` request to `/v1/system/update/updates/{version}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_view", + let request = { + let url = format!( + "{}/v1/system/update/updates/{}", + client.baseurl, + encode_path(&version.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateView { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_update_components_list`] + ///Builder for [`Client::system_update_components_list`] /// - ///[`ClientSystemExt::system_update_components_list`]: super::ClientSystemExt::system_update_components_list + ///[`Client::system_update_components_list`]: super::Client::system_update_components_list #[derive(Debug, Clone)] pub struct SystemUpdateComponentsList<'a> { client: &'a super::Client, @@ -51564,51 +57598,42 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, version } = self; let version = version.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/system/update/updates/{}/components", - client.baseurl, - encode_path(&version.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_update_components_list", + let request = { + let url = format!( + "{}/v1/system/update/updates/{}/components", + client.baseurl, + encode_path(&version.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemUpdateComponentsList { + client: client, + request, + }) } } - ///Builder for [`ClientSystemExt::system_version`] + ///Builder for [`Client::system_version`] /// - ///[`ClientSystemExt::system_version`]: super::ClientSystemExt::system_version + ///[`Client::system_version`]: super::Client::system_version #[derive(Debug, Clone)] pub struct SystemVersion<'a> { client: &'a super::Client, @@ -51623,40 +57648,31 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "system_version", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::SystemVersion { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/nexus_positional.rs b/progenitor-impl/tests/output/src/nexus_positional.rs index 0c1dc4e1..24ed11ae 100644 --- a/progenitor-impl/tests/output/src/nexus_positional.rs +++ b/progenitor-impl/tests/output/src/nexus_positional.rs @@ -14104,26 +14104,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/disks/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/disks/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_view_by_id", }; @@ -14150,26 +14152,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/images/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/images/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "image_view_by_id", }; @@ -14196,26 +14200,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/instances/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/instances/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_view_by_id", }; @@ -14242,26 +14248,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/network-interfaces/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/network-interfaces/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_network_interface_view_by_id", }; @@ -14290,26 +14298,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/organizations/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/organizations/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_view_by_id", }; @@ -14338,26 +14348,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/projects/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/projects/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_view_by_id", }; @@ -14384,26 +14396,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/snapshots/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/snapshots/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "snapshot_view_by_id", }; @@ -14430,26 +14444,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/vpc-router-routes/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/vpc-router-routes/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_route_view_by_id", }; @@ -14476,26 +14492,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/vpc-routers/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/vpc-routers/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_view_by_id", }; @@ -14522,26 +14540,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/vpc-subnets/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/vpc-subnets/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_subnet_view_by_id", }; @@ -14568,26 +14588,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/by-id/vpcs/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/by-id/vpcs/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_view_by_id", }; @@ -14618,19 +14640,21 @@ impl Client { &'a self, body: &'a types::DeviceAuthRequest, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .form_urlencoded(&body)? - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .form_urlencoded(&body)? + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "device_auth_request", }; @@ -14656,23 +14680,25 @@ impl Client { &'a self, body: &'a types::DeviceAuthVerify, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "device_auth_confirm", }; @@ -14702,19 +14728,21 @@ impl Client { &'a self, body: &'a types::DeviceAccessTokenRequest, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .form_urlencoded(&body)? - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .form_urlencoded(&body)? + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "device_access_token", }; @@ -14743,28 +14771,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "group_list", }; @@ -14828,23 +14858,25 @@ impl Client { &'a self, body: &'a types::SpoofLoginBody, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "login_spoof", }; @@ -14872,23 +14904,22 @@ impl Client { silo_name: &'a types::Name, body: &'a types::UsernamePasswordCredentials, ) -> Result, Error> { - let url = format!( - "{}/login/{}/local", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/login/{}/local", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.post(url).json(&body).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "login_local", }; @@ -14919,19 +14950,23 @@ impl Client { silo_name: &'a types::Name, provider_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/login/{}/saml/{}", - self.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self.client.get(url).headers(header_map).build()?; + let mut request = { + let url = format!( + "{}/login/{}/saml/{}", + self.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.get(url).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "login_saml_begin", }; @@ -14960,28 +14995,30 @@ impl Client { provider_name: &'a types::Name, body: B, ) -> Result, Error> { - let url = format!( - "{}/login/{}/saml/{}", - self.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::CONTENT_TYPE, - ::reqwest::header::HeaderValue::from_static("application/octet-stream"), - ) - .body(body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/login/{}/saml/{}", + self.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::CONTENT_TYPE, + ::reqwest::header::HeaderValue::from_static("application/octet-stream"), + ) + .body(body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "login_saml", }; @@ -15003,22 +15040,24 @@ impl Client { ///Sends a `POST` request to `/logout` pub async fn logout<'a>(&'a self) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "logout", }; @@ -15055,28 +15094,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_list", }; @@ -15147,23 +15188,25 @@ impl Client { &'a self, body: &'a types::OrganizationCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_create", }; @@ -15195,26 +15238,28 @@ impl Client { &'a self, organization_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_view", }; @@ -15248,27 +15293,29 @@ impl Client { organization_name: &'a types::Name, body: &'a types::OrganizationUpdate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_update", }; @@ -15300,26 +15347,28 @@ impl Client { &'a self, organization_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_delete", }; @@ -15351,26 +15400,28 @@ impl Client { &'a self, organization_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/policy", - self.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/policy", + self.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_policy_view", }; @@ -15404,27 +15455,29 @@ impl Client { organization_name: &'a types::Name, body: &'a types::OrganizationRolePolicy, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/policy", - self.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/policy", + self.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_policy_update", }; @@ -15463,32 +15516,34 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects", - self.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects", + self.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_list", }; @@ -15566,27 +15621,29 @@ impl Client { organization_name: &'a types::Name, body: &'a types::ProjectCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects", - self.baseurl, - encode_path(&organization_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects", + self.baseurl, + encode_path(&organization_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_create", }; @@ -15621,27 +15678,29 @@ impl Client { organization_name: &'a types::Name, project_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_view", }; @@ -15678,28 +15737,30 @@ impl Client { project_name: &'a types::Name, body: &'a types::ProjectUpdate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_update", }; @@ -15734,27 +15795,29 @@ impl Client { organization_name: &'a types::Name, project_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_delete", }; @@ -15796,33 +15859,35 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/disks", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_list", }; @@ -15909,28 +15974,30 @@ impl Client { project_name: &'a types::Name, body: &'a types::DiskCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/disks", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_create", }; @@ -15963,28 +16030,30 @@ impl Client { project_name: &'a types::Name, disk_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_view", }; @@ -16015,28 +16084,30 @@ impl Client { project_name: &'a types::Name, disk_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_delete", }; @@ -16083,39 +16154,41 @@ impl Client { page_token: Option<&'a str>, start_time: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/disks/{}/metrics/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&disk_name.to_string()), - encode_path(&metric_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("end_time", &end_time)) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new( - "start_time", - &start_time, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/disks/{}/metrics/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&disk_name.to_string()), + encode_path(&metric_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("end_time", &end_time)) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new( + "start_time", + &start_time, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_metrics_list", }; @@ -16227,33 +16300,35 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/images", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/images", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "image_list", }; @@ -16343,28 +16418,30 @@ impl Client { project_name: &'a types::Name, body: &'a types::ImageCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/images", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/images", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "image_create", }; @@ -16397,28 +16474,30 @@ impl Client { project_name: &'a types::Name, image_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/images/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/images/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "image_view", }; @@ -16453,28 +16532,30 @@ impl Client { project_name: &'a types::Name, image_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/images/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/images/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "image_delete", }; @@ -16514,33 +16595,35 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_list", }; @@ -16628,28 +16711,30 @@ impl Client { project_name: &'a types::Name, body: &'a types::InstanceCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_create", }; @@ -16682,28 +16767,30 @@ impl Client { project_name: &'a types::Name, instance_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_view", }; @@ -16734,28 +16821,30 @@ impl Client { project_name: &'a types::Name, instance_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_delete", }; @@ -16800,34 +16889,36 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/disks", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_disk_list", }; @@ -16923,29 +17014,31 @@ impl Client { instance_name: &'a types::Name, body: &'a types::DiskIdentifier, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/disks/attach", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks/attach", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_disk_attach", }; @@ -16979,29 +17072,31 @@ impl Client { instance_name: &'a types::Name, body: &'a types::DiskIdentifier, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/disks/detach", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/disks/detach", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_disk_detach", }; @@ -17032,28 +17127,30 @@ impl Client { project_name: &'a types::Name, instance_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/external-ips", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/external-ips", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_external_ip_list", }; @@ -17087,29 +17184,31 @@ impl Client { instance_name: &'a types::Name, body: &'a types::InstanceMigrate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/migrate", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/migrate", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_migrate", }; @@ -17152,34 +17251,36 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_network_interface_list", }; @@ -17272,29 +17373,31 @@ impl Client { instance_name: &'a types::Name, body: &'a types::NetworkInterfaceCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_network_interface_create", }; @@ -17326,29 +17429,31 @@ impl Client { instance_name: &'a types::Name, interface_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_network_interface_view", }; @@ -17381,30 +17486,32 @@ impl Client { interface_name: &'a types::Name, body: &'a types::NetworkInterfaceUpdate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_network_interface_update", }; @@ -17441,29 +17548,31 @@ impl Client { instance_name: &'a types::Name, interface_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - encode_path(&interface_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/network-interfaces/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + encode_path(&interface_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_network_interface_delete", }; @@ -17496,28 +17605,30 @@ impl Client { project_name: &'a types::Name, instance_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/reboot", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/reboot", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_reboot", }; @@ -17569,37 +17680,39 @@ impl Client { max_bytes: Option, most_recent: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/serial-console", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "from_start", - &from_start, - )) - .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) - .query(&progenitor_client::QueryParam::new( - "most_recent", - &most_recent, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/serial-console", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "from_start", + &from_start, + )) + .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) + .query(&progenitor_client::QueryParam::new( + "most_recent", + &most_recent, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_serial_console", }; @@ -17632,34 +17745,36 @@ impl Client { project_name: &'a types::Name, instance_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/serial-console/stream", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/serial-console/stream", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) + } + + .build()?; let info = OperationInfo { operation_id: "instance_serial_console_stream", }; @@ -17687,28 +17802,30 @@ impl Client { project_name: &'a types::Name, instance_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/start", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/start", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_start", }; @@ -17741,28 +17858,30 @@ impl Client { project_name: &'a types::Name, instance_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/instances/{}/stop", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&instance_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/instances/{}/stop", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&instance_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_stop", }; @@ -17797,27 +17916,29 @@ impl Client { organization_name: &'a types::Name, project_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/policy", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/policy", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_policy_view", }; @@ -17852,28 +17973,30 @@ impl Client { project_name: &'a types::Name, body: &'a types::ProjectRolePolicy, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/policy", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/policy", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_policy_update", }; @@ -17913,33 +18036,35 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/snapshots", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "snapshot_list", }; @@ -18027,28 +18152,30 @@ impl Client { project_name: &'a types::Name, body: &'a types::SnapshotCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/snapshots", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "snapshot_create", }; @@ -18079,28 +18206,30 @@ impl Client { project_name: &'a types::Name, snapshot_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/snapshots/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&snapshot_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "snapshot_view", }; @@ -18131,28 +18260,30 @@ impl Client { project_name: &'a types::Name, snapshot_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/snapshots/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&snapshot_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/snapshots/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&snapshot_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "snapshot_delete", }; @@ -18192,33 +18323,35 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_list", }; @@ -18303,28 +18436,30 @@ impl Client { project_name: &'a types::Name, body: &'a types::VpcCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_create", }; @@ -18355,28 +18490,30 @@ impl Client { project_name: &'a types::Name, vpc_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_view", }; @@ -18408,29 +18545,31 @@ impl Client { vpc_name: &'a types::Name, body: &'a types::VpcUpdate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_update", }; @@ -18461,28 +18600,30 @@ impl Client { project_name: &'a types::Name, vpc_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_delete", }; @@ -18513,28 +18654,30 @@ impl Client { project_name: &'a types::Name, vpc_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_firewall_rules_view", }; @@ -18566,29 +18709,31 @@ impl Client { vpc_name: &'a types::Name, body: &'a types::VpcFirewallRuleUpdateParams, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/firewall/rules", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_firewall_rules_update", }; @@ -18631,34 +18776,36 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_list", }; @@ -18751,29 +18898,31 @@ impl Client { vpc_name: &'a types::Name, body: &'a types::VpcRouterCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_create", }; @@ -18805,29 +18954,31 @@ impl Client { vpc_name: &'a types::Name, router_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_view", }; @@ -18860,30 +19011,32 @@ impl Client { router_name: &'a types::Name, body: &'a types::VpcRouterUpdate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_update", }; @@ -18915,29 +19068,31 @@ impl Client { vpc_name: &'a types::Name, router_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_delete", }; @@ -18984,35 +19139,37 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_route_list", }; @@ -19113,30 +19270,32 @@ impl Client { router_name: &'a types::Name, body: &'a types::RouterRouteCreateParams, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&router_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&router_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_route_create", }; @@ -19169,30 +19328,32 @@ impl Client { router_name: &'a types::Name, route_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - self.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + self.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_route_view", }; @@ -19226,31 +19387,33 @@ impl Client { route_name: &'a types::Name, body: &'a types::RouterRouteUpdateParams, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - self.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + self.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_route_update", }; @@ -19283,30 +19446,32 @@ impl Client { router_name: &'a types::Name, route_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", - self.baseurl, - 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(&route_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/routers/{}/routes/{}", + self.baseurl, + 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(&route_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_router_route_delete", }; @@ -19349,34 +19514,36 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_subnet_list", }; @@ -19469,29 +19636,31 @@ impl Client { vpc_name: &'a types::Name, body: &'a types::VpcSubnetCreate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_subnet_create", }; @@ -19523,29 +19692,31 @@ impl Client { vpc_name: &'a types::Name, subnet_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_subnet_view", }; @@ -19578,30 +19749,32 @@ impl Client { subnet_name: &'a types::Name, body: &'a types::VpcSubnetUpdate, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_subnet_update", }; @@ -19633,29 +19806,31 @@ impl Client { vpc_name: &'a types::Name, subnet_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_subnet_delete", }; @@ -19700,35 +19875,37 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}/network-interfaces", - self.baseurl, - encode_path(&organization_name.to_string()), - encode_path(&project_name.to_string()), - encode_path(&vpc_name.to_string()), - encode_path(&subnet_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/organizations/{}/projects/{}/vpcs/{}/subnets/{}/network-interfaces", + self.baseurl, + encode_path(&organization_name.to_string()), + encode_path(&project_name.to_string()), + encode_path(&vpc_name.to_string()), + encode_path(&subnet_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "vpc_subnet_list_network_interfaces", }; @@ -19820,22 +19997,24 @@ impl Client { pub async fn policy_view<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "policy_view", }; @@ -19862,23 +20041,25 @@ impl Client { &'a self, body: &'a types::SiloRolePolicy, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "policy_update", }; @@ -19911,27 +20092,29 @@ impl Client { limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "role_list", }; @@ -19998,26 +20181,28 @@ impl Client { &'a self, role_name: &'a str, ) -> Result, Error> { - let url = format!( - "{}/roles/{}", - self.baseurl, - encode_path(&role_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/roles/{}", + self.baseurl, + encode_path(&role_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "role_view", }; @@ -20043,22 +20228,24 @@ impl Client { pub async fn session_me<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "session_me", }; @@ -20093,28 +20280,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "session_me_groups", }; @@ -20190,28 +20379,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "session_sshkey_list", }; @@ -20281,23 +20472,25 @@ impl Client { &'a self, body: &'a types::SshKeyCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "session_sshkey_create", }; @@ -20327,26 +20520,28 @@ impl Client { &'a self, ssh_key_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/session/me/sshkeys/{}", - self.baseurl, - encode_path(&ssh_key_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/session/me/sshkeys/{}", + self.baseurl, + encode_path(&ssh_key_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "session_sshkey_view", }; @@ -20376,26 +20571,28 @@ impl Client { &'a self, ssh_key_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/session/me/sshkeys/{}", - self.baseurl, - encode_path(&ssh_key_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/session/me/sshkeys/{}", + self.baseurl, + encode_path(&ssh_key_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "session_sshkey_delete", }; @@ -20422,26 +20619,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/by-id/images/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/by-id/images/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_image_view_by_id", }; @@ -20468,26 +20667,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/by-id/ip-pools/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/by-id/ip-pools/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_view_by_id", }; @@ -20514,26 +20715,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/by-id/silos/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/by-id/silos/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_view_by_id", }; @@ -20572,28 +20775,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "certificate_list", }; @@ -20667,23 +20872,25 @@ impl Client { &'a self, body: &'a types::CertificateCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "certificate_create", }; @@ -20712,26 +20919,28 @@ impl Client { &'a self, certificate: &'a types::NameOrId, ) -> Result, Error> { - let url = format!( - "{}/system/certificates/{}", - self.baseurl, - encode_path(&certificate.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/certificates/{}", + self.baseurl, + encode_path(&certificate.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "certificate_view", }; @@ -20760,26 +20969,28 @@ impl Client { &'a self, certificate: &'a types::NameOrId, ) -> Result, Error> { - let url = format!( - "{}/system/certificates/{}", - self.baseurl, - encode_path(&certificate.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/certificates/{}", + self.baseurl, + encode_path(&certificate.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "certificate_delete", }; @@ -20814,28 +21025,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "physical_disk_list", }; @@ -20910,28 +21123,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "rack_list", }; @@ -21000,26 +21215,28 @@ impl Client { &'a self, rack_id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/hardware/racks/{}", - self.baseurl, - encode_path(&rack_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/hardware/racks/{}", + self.baseurl, + encode_path(&rack_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "rack_view", }; @@ -21054,28 +21271,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "sled_list", }; @@ -21144,26 +21363,28 @@ impl Client { &'a self, sled_id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/hardware/sleds/{}", - self.baseurl, - encode_path(&sled_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/hardware/sleds/{}", + self.baseurl, + encode_path(&sled_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "sled_view", }; @@ -21200,32 +21421,34 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/system/hardware/sleds/{}/disks", - self.baseurl, - encode_path(&sled_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/hardware/sleds/{}/disks", + self.baseurl, + encode_path(&sled_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "sled_physical_disk_list", }; @@ -21307,28 +21530,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_image_list", }; @@ -21402,23 +21627,25 @@ impl Client { &'a self, body: &'a types::GlobalImageCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_image_create", }; @@ -21447,26 +21674,28 @@ impl Client { &'a self, image_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/images/{}", - self.baseurl, - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/images/{}", + self.baseurl, + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_image_view", }; @@ -21497,26 +21726,28 @@ impl Client { &'a self, image_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/images/{}", - self.baseurl, - encode_path(&image_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/images/{}", + self.baseurl, + encode_path(&image_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_image_delete", }; @@ -21551,28 +21782,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_list", }; @@ -21638,23 +21871,25 @@ impl Client { &'a self, body: &'a types::IpPoolCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_create", }; @@ -21681,26 +21916,28 @@ impl Client { &'a self, pool_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/ip-pools/{}", - self.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/ip-pools/{}", + self.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_view", }; @@ -21728,27 +21965,29 @@ impl Client { pool_name: &'a types::Name, body: &'a types::IpPoolUpdate, ) -> Result, Error> { - let url = format!( - "{}/system/ip-pools/{}", - self.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/ip-pools/{}", + self.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_update", }; @@ -21775,26 +22014,28 @@ impl Client { &'a self, pool_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/ip-pools/{}", - self.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/ip-pools/{}", + self.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_delete", }; @@ -21831,31 +22072,33 @@ impl Client { limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - let url = format!( - "{}/system/ip-pools/{}/ranges", - self.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/ip-pools/{}/ranges", + self.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_range_list", }; @@ -21925,27 +22168,29 @@ impl Client { pool_name: &'a types::Name, body: &'a types::IpRange, ) -> Result, Error> { - let url = format!( - "{}/system/ip-pools/{}/ranges/add", - self.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/ip-pools/{}/ranges/add", + self.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_range_add", }; @@ -21973,27 +22218,29 @@ impl Client { pool_name: &'a types::Name, body: &'a types::IpRange, ) -> Result, Error> { - let url = format!( - "{}/system/ip-pools/{}/ranges/remove", - self.baseurl, - encode_path(&pool_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/ip-pools/{}/ranges/remove", + self.baseurl, + encode_path(&pool_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_range_remove", }; @@ -22019,22 +22266,24 @@ impl Client { pub async fn ip_pool_service_view<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_service_view", }; @@ -22069,27 +22318,29 @@ impl Client { limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_service_range_list", }; @@ -22156,23 +22407,25 @@ impl Client { &'a self, body: &'a types::IpRange, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_service_range_add", }; @@ -22199,23 +22452,25 @@ impl Client { &'a self, body: &'a types::IpRange, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "ip_pool_service_range_remove", }; @@ -22256,37 +22511,39 @@ impl Client { page_token: Option<&'a str>, start_time: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>, ) -> Result, Error> { - let url = format!( - "{}/system/metrics/{}", - self.baseurl, - encode_path(&metric_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("end_time", &end_time)) - .query(&progenitor_client::QueryParam::new("id", &id)) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new( - "start_time", - &start_time, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/metrics/{}", + self.baseurl, + encode_path(&metric_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("end_time", &end_time)) + .query(&progenitor_client::QueryParam::new("id", &id)) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new( + "start_time", + &start_time, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_metric", }; @@ -22312,22 +22569,24 @@ impl Client { pub async fn system_policy_view<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_policy_view", }; @@ -22354,23 +22613,25 @@ impl Client { &'a self, body: &'a types::FleetRolePolicy, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_policy_update", }; @@ -22405,28 +22666,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "saga_list", }; @@ -22492,26 +22755,28 @@ impl Client { &'a self, saga_id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/sagas/{}", - self.baseurl, - encode_path(&saga_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/sagas/{}", + self.baseurl, + encode_path(&saga_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "saga_view", }; @@ -22548,28 +22813,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_list", }; @@ -22637,23 +22904,25 @@ impl Client { &'a self, body: &'a types::SiloCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_create", }; @@ -22685,26 +22954,28 @@ impl Client { &'a self, silo_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_view", }; @@ -22736,26 +23007,28 @@ impl Client { &'a self, silo_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_delete", }; @@ -22792,32 +23065,34 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/identity-providers", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/identity-providers", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_identity_provider_list", }; @@ -22897,27 +23172,29 @@ impl Client { silo_name: &'a types::Name, body: &'a types::UserCreate, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/identity-providers/local/users", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "local_idp_user_create", }; @@ -22950,27 +23227,29 @@ impl Client { silo_name: &'a types::Name, user_id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/identity-providers/local/users/{}", - self.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users/{}", + self.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "local_idp_user_delete", }; @@ -23009,28 +23288,30 @@ impl Client { user_id: &'a ::uuid::Uuid, body: &'a types::UserPassword, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/identity-providers/local/users/{}/set-password", - self.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/identity-providers/local/users/{}/set-password", + self.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "local_idp_user_set_password", }; @@ -23063,27 +23344,29 @@ impl Client { silo_name: &'a types::Name, body: &'a types::SamlIdentityProviderCreate, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/identity-providers/saml", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/identity-providers/saml", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "saml_identity_provider_create", }; @@ -23116,27 +23399,29 @@ impl Client { silo_name: &'a types::Name, provider_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/identity-providers/saml/{}", - self.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&provider_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/identity-providers/saml/{}", + self.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&provider_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "saml_identity_provider_view", }; @@ -23166,26 +23451,28 @@ impl Client { &'a self, silo_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/policy", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/policy", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_policy_view", }; @@ -23217,27 +23504,29 @@ impl Client { silo_name: &'a types::Name, body: &'a types::SiloRolePolicy, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/policy", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/policy", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_policy_update", }; @@ -23274,32 +23563,34 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/users/all", - self.baseurl, - encode_path(&silo_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/users/all", + self.baseurl, + encode_path(&silo_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_users_list", }; @@ -23372,27 +23663,29 @@ impl Client { silo_name: &'a types::Name, user_id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/system/silos/{}/users/id/{}", - self.baseurl, - encode_path(&silo_name.to_string()), - encode_path(&user_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/silos/{}/users/id/{}", + self.baseurl, + encode_path(&silo_name.to_string()), + encode_path(&user_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "silo_user_view", }; @@ -23427,28 +23720,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_user_list", }; @@ -23518,26 +23813,28 @@ impl Client { &'a self, user_name: &'a types::Name, ) -> Result, Error> { - let url = format!( - "{}/system/user/{}", - self.baseurl, - encode_path(&user_name.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/system/user/{}", + self.baseurl, + encode_path(&user_name.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_user_view", }; @@ -23570,27 +23867,29 @@ impl Client { limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "timeseries_schema_get", }; @@ -23663,28 +23962,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "user_list", }; @@ -23762,33 +24063,35 @@ impl Client { project: Option<&'a types::NameOrId>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_list_v1", }; @@ -23860,28 +24163,30 @@ impl Client { project: &'a types::NameOrId, body: &'a types::DiskCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_create_v1", }; @@ -23910,31 +24215,33 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/disks/{}", - self.baseurl, - encode_path(&disk.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/disks/{}", + self.baseurl, + encode_path(&disk.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_view_v1", }; @@ -23963,31 +24270,33 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/disks/{}", - self.baseurl, - encode_path(&disk.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/disks/{}", + self.baseurl, + encode_path(&disk.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "disk_delete_v1", }; @@ -24026,33 +24335,35 @@ impl Client { project: Option<&'a types::NameOrId>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_list_v1", }; @@ -24125,28 +24436,30 @@ impl Client { project: &'a types::NameOrId, body: &'a types::InstanceCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_create_v1", }; @@ -24175,31 +24488,33 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_view_v1", }; @@ -24228,31 +24543,33 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_delete_v1", }; @@ -24293,37 +24610,39 @@ impl Client { project: Option<&'a types::NameOrId>, sort_by: Option, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/disks", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/disks", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_disk_list_v1", }; @@ -24405,32 +24724,34 @@ impl Client { project: Option<&'a types::NameOrId>, body: &'a types::DiskPath, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/disks/attach", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/disks/attach", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_disk_attach_v1", }; @@ -24460,32 +24781,34 @@ impl Client { project: Option<&'a types::NameOrId>, body: &'a types::DiskPath, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/disks/detach", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/disks/detach", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_disk_detach_v1", }; @@ -24515,32 +24838,34 @@ impl Client { project: Option<&'a types::NameOrId>, body: &'a types::InstanceMigrate, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/migrate", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/migrate", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_migrate_v1", }; @@ -24569,31 +24894,33 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/reboot", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/reboot", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_reboot_v1", }; @@ -24641,40 +24968,42 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/serial-console", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "from_start", - &from_start, - )) - .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) - .query(&progenitor_client::QueryParam::new( - "most_recent", - &most_recent, - )) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/serial-console", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "from_start", + &from_start, + )) + .query(&progenitor_client::QueryParam::new("max_bytes", &max_bytes)) + .query(&progenitor_client::QueryParam::new( + "most_recent", + &most_recent, + )) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_serial_console_v1", }; @@ -24704,37 +25033,39 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/serial-console/stream", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/serial-console/stream", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) + } + + .build()?; let info = OperationInfo { operation_id: "instance_serial_console_stream_v1", }; @@ -24758,31 +25089,33 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/start", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/start", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_start_v1", }; @@ -24811,31 +25144,33 @@ impl Client { organization: Option<&'a types::NameOrId>, project: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/instances/{}/stop", - self.baseurl, - encode_path(&instance.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/instances/{}/stop", + self.baseurl, + encode_path(&instance.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_stop_v1", }; @@ -24870,28 +25205,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_list_v1", }; @@ -24958,23 +25295,25 @@ impl Client { &'a self, body: &'a types::OrganizationCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_create_v1", }; @@ -25001,26 +25340,28 @@ impl Client { &'a self, organization: &'a types::NameOrId, ) -> Result, Error> { - let url = format!( - "{}/v1/organizations/{}", - self.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/organizations/{}", + self.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_view_v1", }; @@ -25048,27 +25389,29 @@ impl Client { organization: &'a types::NameOrId, body: &'a types::OrganizationUpdate, ) -> Result, Error> { - let url = format!( - "{}/v1/organizations/{}", - self.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/organizations/{}", + self.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_update_v1", }; @@ -25095,26 +25438,28 @@ impl Client { &'a self, organization: &'a types::NameOrId, ) -> Result, Error> { - let url = format!( - "{}/v1/organizations/{}", - self.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/organizations/{}", + self.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_delete_v1", }; @@ -25141,26 +25486,28 @@ impl Client { &'a self, organization: &'a types::NameOrId, ) -> Result, Error> { - let url = format!( - "{}/v1/organizations/{}/policy", - self.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/organizations/{}/policy", + self.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_policy_view_v1", }; @@ -25188,27 +25535,29 @@ impl Client { organization: &'a types::NameOrId, body: &'a types::OrganizationRolePolicy, ) -> Result, Error> { - let url = format!( - "{}/v1/organizations/{}/policy", - self.baseurl, - encode_path(&organization.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/organizations/{}/policy", + self.baseurl, + encode_path(&organization.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "organization_policy_update_v1", }; @@ -25245,32 +25594,34 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_list_v1", }; @@ -25339,27 +25690,29 @@ impl Client { organization: &'a types::NameOrId, body: &'a types::ProjectCreate, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_create_v1", }; @@ -25387,30 +25740,32 @@ impl Client { project: &'a types::NameOrId, organization: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/projects/{}", - self.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/projects/{}", + self.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_view_v1", }; @@ -25439,31 +25794,33 @@ impl Client { organization: Option<&'a types::NameOrId>, body: &'a types::ProjectUpdate, ) -> Result, Error> { - let url = format!( - "{}/v1/projects/{}", - self.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/projects/{}", + self.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_update_v1", }; @@ -25491,30 +25848,32 @@ impl Client { project: &'a types::NameOrId, organization: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/projects/{}", - self.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .delete(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/projects/{}", + self.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_delete_v1", }; @@ -25542,30 +25901,32 @@ impl Client { project: &'a types::NameOrId, organization: Option<&'a types::NameOrId>, ) -> Result, Error> { - let url = format!( - "{}/v1/projects/{}/policy", - self.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/projects/{}/policy", + self.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_policy_view_v1", }; @@ -25594,31 +25955,33 @@ impl Client { organization: Option<&'a types::NameOrId>, body: &'a types::ProjectRolePolicy, ) -> Result, Error> { - let url = format!( - "{}/v1/projects/{}/policy", - self.baseurl, - encode_path(&project.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .query(&progenitor_client::QueryParam::new( - "organization", - &organization, - )) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/projects/{}/policy", + self.baseurl, + encode_path(&project.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new( + "organization", + &organization, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "project_policy_update_v1", }; @@ -25653,28 +26016,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_component_version_list", }; @@ -25749,28 +26114,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "update_deployments_list", }; @@ -25837,26 +26204,28 @@ impl Client { &'a self, id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/v1/system/update/deployments/{}", - self.baseurl, - encode_path(&id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/system/update/deployments/{}", + self.baseurl, + encode_path(&id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "update_deployment_view", }; @@ -25882,22 +26251,24 @@ impl Client { pub async fn system_update_refresh<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_update_refresh", }; @@ -25924,23 +26295,25 @@ impl Client { &'a self, body: &'a types::SystemUpdateStart, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_update_start", }; @@ -25968,22 +26341,24 @@ impl Client { pub async fn system_update_stop<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_update_stop", }; @@ -26018,28 +26393,30 @@ impl Client { page_token: Option<&'a str>, sort_by: Option, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_update_list", }; @@ -26106,26 +26483,28 @@ impl Client { &'a self, version: &'a types::SemverVersion, ) -> Result, Error> { - let url = format!( - "{}/v1/system/update/updates/{}", - self.baseurl, - encode_path(&version.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/system/update/updates/{}", + self.baseurl, + encode_path(&version.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_update_view", }; @@ -26153,26 +26532,28 @@ impl Client { &'a self, version: &'a types::SemverVersion, ) -> Result, Error> { - let url = format!( - "{}/v1/system/update/updates/{}/components", - self.baseurl, - encode_path(&version.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/v1/system/update/updates/{}/components", + self.baseurl, + encode_path(&version.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_update_components_list", }; @@ -26198,22 +26579,24 @@ impl Client { pub async fn system_version<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "system_version", }; diff --git a/progenitor-impl/tests/output/src/param_collision_builder.rs b/progenitor-impl/tests/output/src/param_collision_builder.rs index 84367601..6810989f 100644 --- a/progenitor-impl/tests/output/src/param_collision_builder.rs +++ b/progenitor-impl/tests/output/src/param_collision_builder.rs @@ -136,6 +136,47 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct KeyGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> KeyGet<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "key_get", + }; + client.pre(&mut request, &info).await?; + let _result = client.exec(request, &info).await; + client.post(&_result, &info).await?; + let _response = _result?; + match _response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(_response)), + _ => Err(Error::UnexpectedResponse(_response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::key_get`] /// ///[`Client::key_get`]: super::Client::key_get @@ -225,6 +266,10 @@ pub mod builder { ///Sends a `GET` request to `/key/{query}` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { _client, query, @@ -240,38 +285,27 @@ pub mod builder { let response = response.map_err(Error::InvalidRequest)?; let result = result.map_err(Error::InvalidRequest)?; let url = url.map_err(Error::InvalidRequest)?; - let _url = format!( - "{}/key/{}", - _client.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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut _request = _client - .client - .get(_url) - .query(&progenitor_client::QueryParam::new("client", &client)) - .query(&progenitor_client::QueryParam::new("request", &request)) - .query(&progenitor_client::QueryParam::new("response", &response)) - .query(&progenitor_client::QueryParam::new("result", &result)) - .query(&progenitor_client::QueryParam::new("url", &url)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "key_get", + let request = { + let _url = format!("{}/key/{}", client.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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(_url) + .query(&progenitor_client::QueryParam::new("client", &client)) + .query(&progenitor_client::QueryParam::new("request", &request)) + .query(&progenitor_client::QueryParam::new("response", &response)) + .query(&progenitor_client::QueryParam::new("result", &result)) + .query(&progenitor_client::QueryParam::new("url", &url)) + .headers(header_map) }; - _client.pre(&mut _request, &info).await?; - let _result = _client.exec(_request, &info).await; - _client.post(&_result, &info).await?; - let _response = _result?; - match _response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(_response)), - _ => Err(Error::UnexpectedResponse(_response)), - } + Ok(built::KeyGet { + client: _client, + request, + }) } } } 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 b7b3bc5d..d565bda5 100644 --- a/progenitor-impl/tests/output/src/param_collision_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/param_collision_builder_tagged.rs @@ -136,6 +136,47 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct KeyGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> KeyGet<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "key_get", + }; + client.pre(&mut request, &info).await?; + let _result = client.exec(request, &info).await; + client.post(&_result, &info).await?; + let _response = _result?; + match _response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(_response)), + _ => Err(Error::UnexpectedResponse(_response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::key_get`] /// ///[`Client::key_get`]: super::Client::key_get @@ -225,6 +266,10 @@ pub mod builder { ///Sends a `GET` request to `/key/{query}` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { _client, query, @@ -240,38 +285,27 @@ pub mod builder { let response = response.map_err(Error::InvalidRequest)?; let result = result.map_err(Error::InvalidRequest)?; let url = url.map_err(Error::InvalidRequest)?; - let _url = format!( - "{}/key/{}", - _client.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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut _request = _client - .client - .get(_url) - .query(&progenitor_client::QueryParam::new("client", &client)) - .query(&progenitor_client::QueryParam::new("request", &request)) - .query(&progenitor_client::QueryParam::new("response", &response)) - .query(&progenitor_client::QueryParam::new("result", &result)) - .query(&progenitor_client::QueryParam::new("url", &url)) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "key_get", + let request = { + let _url = format!("{}/key/{}", client.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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(_url) + .query(&progenitor_client::QueryParam::new("client", &client)) + .query(&progenitor_client::QueryParam::new("request", &request)) + .query(&progenitor_client::QueryParam::new("response", &response)) + .query(&progenitor_client::QueryParam::new("result", &result)) + .query(&progenitor_client::QueryParam::new("url", &url)) + .headers(header_map) }; - _client.pre(&mut _request, &info).await?; - let _result = _client.exec(_request, &info).await; - _client.post(&_result, &info).await?; - let _response = _result?; - match _response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(_response)), - _ => Err(Error::UnexpectedResponse(_response)), - } + Ok(built::KeyGet { + client: _client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/param_collision_positional.rs b/progenitor-impl/tests/output/src/param_collision_positional.rs index 951c3dd2..17f86f75 100644 --- a/progenitor-impl/tests/output/src/param_collision_positional.rs +++ b/progenitor-impl/tests/output/src/param_collision_positional.rs @@ -123,28 +123,30 @@ impl Client { result: bool, url: bool, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut _request = self - .client - .get(_url) - .query(&progenitor_client::QueryParam::new("client", &client)) - .query(&progenitor_client::QueryParam::new("request", &request)) - .query(&progenitor_client::QueryParam::new("response", &response)) - .query(&progenitor_client::QueryParam::new("result", &result)) - .query(&progenitor_client::QueryParam::new("url", &url)) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(_url) + .query(&progenitor_client::QueryParam::new("client", &client)) + .query(&progenitor_client::QueryParam::new("request", &request)) + .query(&progenitor_client::QueryParam::new("response", &response)) + .query(&progenitor_client::QueryParam::new("result", &result)) + .query(&progenitor_client::QueryParam::new("url", &url)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "key_get", }; - self.pre(&mut _request, &info).await?; - let _result = self.exec(_request, &info).await; + self.pre(&mut request, &info).await?; + let _result = self.exec(request, &info).await; self.post(&_result, &info).await?; let _response = _result?; match _response.status().as_u16() { diff --git a/progenitor-impl/tests/output/src/param_overrides_builder.rs b/progenitor-impl/tests/output/src/param_overrides_builder.rs index 0a32ec98..75d31f42 100644 --- a/progenitor-impl/tests/output/src/param_overrides_builder.rs +++ b/progenitor-impl/tests/output/src/param_overrides_builder.rs @@ -130,6 +130,47 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct KeyGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> KeyGet<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "key_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::key_get`] /// ///[`Client::key_get`]: super::Client::key_get @@ -172,6 +213,10 @@ pub mod builder { ///Sends a `GET` request to `/key` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, key, @@ -179,34 +224,27 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .query(&progenitor_client::QueryParam::new("key", &key)) - .query(&progenitor_client::QueryParam::new( - "uniqueKey", - &unique_key, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "key_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .query(&progenitor_client::QueryParam::new("key", &key)) + .query(&progenitor_client::QueryParam::new( + "uniqueKey", + &unique_key, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::KeyGet { + client: client, + request, + }) } } } 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 52daae95..0628d04a 100644 --- a/progenitor-impl/tests/output/src/param_overrides_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/param_overrides_builder_tagged.rs @@ -130,6 +130,47 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct KeyGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> KeyGet<'a> { + pub async fn send(self) -> Result, Error<()>> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "key_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::key_get`] /// ///[`Client::key_get`]: super::Client::key_get @@ -172,6 +213,10 @@ pub mod builder { ///Sends a `GET` request to `/key` pub async fn send(self) -> Result, Error<()>> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error<()>> { let Self { client, key, @@ -179,34 +224,27 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .query(&progenitor_client::QueryParam::new("key", &key)) - .query(&progenitor_client::QueryParam::new( - "uniqueKey", - &unique_key, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "key_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .query(&progenitor_client::QueryParam::new("key", &key)) + .query(&progenitor_client::QueryParam::new( + "uniqueKey", + &unique_key, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => Ok(ResponseValue::empty(response)), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::KeyGet { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/param_overrides_positional.rs b/progenitor-impl/tests/output/src/param_overrides_positional.rs index c3316622..41878a9f 100644 --- a/progenitor-impl/tests/output/src/param_overrides_positional.rs +++ b/progenitor-impl/tests/output/src/param_overrides_positional.rs @@ -117,23 +117,25 @@ impl Client { key: Option, unique_key: Option<&'a str>, ) -> Result, Error<()>> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .query(&progenitor_client::QueryParam::new("key", &key)) - .query(&progenitor_client::QueryParam::new( - "uniqueKey", - &unique_key, - )) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .query(&progenitor_client::QueryParam::new("key", &key)) + .query(&progenitor_client::QueryParam::new( + "uniqueKey", + &unique_key, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "key_get", }; diff --git a/progenitor-impl/tests/output/src/propolis_server_builder.rs b/progenitor-impl/tests/output/src/propolis_server_builder.rs index 3a75b674..7d38b731 100644 --- a/progenitor-impl/tests/output/src/propolis_server_builder.rs +++ b/progenitor-impl/tests/output/src/propolis_server_builder.rs @@ -3138,6 +3138,296 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct InstanceGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceGet<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceEnsure<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceEnsure<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_ensure", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceIssueCrucibleSnapshotRequest<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_issue_crucible_snapshot_request", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceMigrateStatus<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceMigrateStatus<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_migrate_status", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerial<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerial<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 101u16 => ResponseValue::upgrade(response).await, + 200..=299 => ResponseValue::upgrade(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStatePut<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStatePut<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_state_put", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStateMonitor<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStateMonitor<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_state_monitor", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::instance_get`] /// ///[`Client::instance_get`]: super::Client::instance_get @@ -3155,40 +3445,31 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceGet { + client: client, + request, + }) } } @@ -3237,44 +3518,35 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_ensure", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceEnsure { + client: client, + request, + }) } } @@ -3320,6 +3592,12 @@ pub mod builder { ///Sends a `POST` request to /// `/instance/disk/{id}/snapshot/{snapshot_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, id, @@ -3327,44 +3605,31 @@ pub mod builder { } = self; let id = id.map_err(Error::InvalidRequest)?; let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/instance/disk/{}/snapshot/{}", - client.baseurl, - encode_path(&id.to_string()), - encode_path(&snapshot_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_issue_crucible_snapshot_request", + let request = { + let url = format!( + "{}/instance/disk/{}/snapshot/{}", + client.baseurl, + encode_path(&id.to_string()), + encode_path(&snapshot_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceIssueCrucibleSnapshotRequest { + client: client, + request, + }) } } @@ -3415,46 +3680,37 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| { types::InstanceMigrateStatusRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_migrate_status", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceMigrateStatus { + client: client, + request, + }) } } @@ -3475,41 +3731,37 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 101u16 => ResponseValue::upgrade(response).await, - 200..=299 => ResponseValue::upgrade(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerial { + client: client, + request, + }) } } @@ -3542,42 +3794,33 @@ pub mod builder { ///Sends a `PUT` request to `/instance/state` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_state_put", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStatePut { + client: client, + request, + }) } } @@ -3628,46 +3871,37 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| { types::InstanceStateMonitorRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_state_monitor", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStateMonitor { + client: client, + request, + }) } } } 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 d37a619e..f1283b7b 100644 --- a/progenitor-impl/tests/output/src/propolis_server_builder_tagged.rs +++ b/progenitor-impl/tests/output/src/propolis_server_builder_tagged.rs @@ -3093,6 +3093,296 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct InstanceGet<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceGet<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_get", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceEnsure<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceEnsure<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_ensure", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceIssueCrucibleSnapshotRequest<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_issue_crucible_snapshot_request", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceMigrateStatus<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceMigrateStatus<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_migrate_status", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceSerial<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceSerial<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_serial", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 101u16 => ResponseValue::upgrade(response).await, + 200..=299 => ResponseValue::upgrade(response).await, + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStatePut<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStatePut<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_state_put", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + + pub struct InstanceStateMonitor<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> InstanceStateMonitor<'a> { + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "instance_state_monitor", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::instance_get`] /// ///[`Client::instance_get`]: super::Client::instance_get @@ -3110,40 +3400,31 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_get", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceGet { + client: client, + request, + }) } } @@ -3192,44 +3473,35 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_ensure", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceEnsure { + client: client, + request, + }) } } @@ -3275,6 +3547,12 @@ pub mod builder { ///Sends a `POST` request to /// `/instance/disk/{id}/snapshot/{snapshot_id}` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build( + self, + ) -> Result, Error> { let Self { client, id, @@ -3282,44 +3560,31 @@ pub mod builder { } = self; let id = id.map_err(Error::InvalidRequest)?; let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/instance/disk/{}/snapshot/{}", - client.baseurl, - encode_path(&id.to_string()), - encode_path(&snapshot_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_issue_crucible_snapshot_request", + let request = { + let url = format!( + "{}/instance/disk/{}/snapshot/{}", + client.baseurl, + encode_path(&id.to_string()), + encode_path(&snapshot_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceIssueCrucibleSnapshotRequest { + client: client, + request, + }) } } @@ -3370,46 +3635,37 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| { types::InstanceMigrateStatusRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_migrate_status", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceMigrateStatus { + client: client, + request, + }) } } @@ -3430,41 +3686,37 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client } = self; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; - let info = OperationInfo { - operation_id: "instance_serial", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 101u16 => ResponseValue::upgrade(response).await, - 200..=299 => ResponseValue::upgrade(response).await, - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceSerial { + client: client, + request, + }) } } @@ -3497,42 +3749,33 @@ pub mod builder { ///Sends a `PUT` request to `/instance/state` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body.map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_state_put", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 204u16 => Ok(ResponseValue::empty(response)), - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStatePut { + client: client, + request, + }) } } @@ -3583,46 +3826,37 @@ pub mod builder { self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, body } = self; let body = body .and_then(|v| { types::InstanceStateMonitorRequest::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; - 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"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "instance_state_monitor", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::InstanceStateMonitor { + client: client, + request, + }) } } } diff --git a/progenitor-impl/tests/output/src/propolis_server_positional.rs b/progenitor-impl/tests/output/src/propolis_server_positional.rs index 943ebd0b..4a668fd6 100644 --- a/progenitor-impl/tests/output/src/propolis_server_positional.rs +++ b/progenitor-impl/tests/output/src/propolis_server_positional.rs @@ -1567,22 +1567,24 @@ impl Client { pub async fn instance_get<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_get", }; @@ -1607,23 +1609,25 @@ impl Client { &'a self, body: &'a types::InstanceEnsureRequest, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_ensure", }; @@ -1651,27 +1655,29 @@ impl Client { id: &'a ::uuid::Uuid, snapshot_id: &'a ::uuid::Uuid, ) -> Result, Error> { - let url = format!( - "{}/instance/disk/{}/snapshot/{}", - self.baseurl, - encode_path(&id.to_string()), - encode_path(&snapshot_id.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/instance/disk/{}/snapshot/{}", + self.baseurl, + encode_path(&id.to_string()), + encode_path(&snapshot_id.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_issue_crucible_snapshot_request", }; @@ -1696,23 +1702,25 @@ impl Client { &'a self, body: &'a types::InstanceMigrateStatusRequest, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_migrate_status", }; @@ -1736,28 +1744,30 @@ impl Client { pub async fn instance_serial<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .headers(header_map) - .header(::reqwest::header::CONNECTION, "Upgrade") - .header(::reqwest::header::UPGRADE, "websocket") - .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") - .header( - ::reqwest::header::SEC_WEBSOCKET_KEY, - ::base64::Engine::encode( - &::base64::engine::general_purpose::STANDARD, - ::rand::random::<[u8; 16]>(), - ), - ) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .headers(header_map) + .header(::reqwest::header::CONNECTION, "Upgrade") + .header(::reqwest::header::UPGRADE, "websocket") + .header(::reqwest::header::SEC_WEBSOCKET_VERSION, "13") + .header( + ::reqwest::header::SEC_WEBSOCKET_KEY, + ::base64::Engine::encode( + &::base64::engine::general_purpose::STANDARD, + ::rand::random::<[u8; 16]>(), + ), + ) + } + + .build()?; let info = OperationInfo { operation_id: "instance_serial", }; @@ -1777,23 +1787,25 @@ impl Client { &'a self, body: types::InstanceStateRequested, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .put(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_state_put", }; @@ -1818,23 +1830,25 @@ impl Client { &'a self, body: &'a types::InstanceStateMonitorRequest, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "instance_state_monitor", }; 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 fe313627..dfe357f6 100644 --- a/progenitor-impl/tests/output/src/test_default_params_builder.rs +++ b/progenitor-impl/tests/output/src/test_default_params_builder.rs @@ -405,6 +405,47 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct DefaultParams<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> DefaultParams<'a> { + pub async fn send(self) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "default_params", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::default_params`] /// ///[`Client::default_params`]: super::Client::default_params @@ -446,34 +487,27 @@ pub mod builder { ///Sends a `POST` request to `/` pub async fn send(self) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "default_params", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client.client.post(url).json(&body).headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200..=299 => Ok(ResponseValue::stream(response)), - _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), - } + Ok(built::DefaultParams { + client: client, + request, + }) } } } 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 494c5a93..2a35c969 100644 --- a/progenitor-impl/tests/output/src/test_default_params_positional.rs +++ b/progenitor-impl/tests/output/src/test_default_params_positional.rs @@ -212,19 +212,18 @@ impl Client { &'a self, body: &'a types::BodyWithDefaults, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .post(url) - .json(&body) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.post(url).json(&body).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "default_params", }; diff --git a/progenitor-impl/tests/output/src/test_freeform_response.rs b/progenitor-impl/tests/output/src/test_freeform_response.rs index dc767920..c3a6161f 100644 --- a/progenitor-impl/tests/output/src/test_freeform_response.rs +++ b/progenitor-impl/tests/output/src/test_freeform_response.rs @@ -144,14 +144,18 @@ impl Client { pub async fn freeform_response<'a>( &'a self, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self.client.get(url).headers(header_map).build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client.get(url).headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "freeform_response", }; diff --git a/progenitor-impl/tests/output/src/test_renamed_parameters.rs b/progenitor-impl/tests/output/src/test_renamed_parameters.rs index 84fd4293..03f68418 100644 --- a/progenitor-impl/tests/output/src/test_renamed_parameters.rs +++ b/progenitor-impl/tests/output/src/test_renamed_parameters.rs @@ -150,31 +150,33 @@ impl Client { in_: &'a str, use_: &'a str, ) -> Result, Error> { - let url = format!( - "{}/{}/{}/{}", - self.baseurl, - encode_path(&ref_.to_string()), - encode_path(&type_.to_string()), - encode_path(&trait_.to_string()), - ); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("if", &if_)) - .query(&progenitor_client::QueryParam::new("in", &in_)) - .query(&progenitor_client::QueryParam::new("use", &use_)) - .headers(header_map) - .build()?; + let mut request = { + let url = format!( + "{}/{}/{}/{}", + self.baseurl, + encode_path(&ref_.to_string()), + encode_path(&type_.to_string()), + encode_path(&trait_.to_string()), + ); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("if", &if_)) + .query(&progenitor_client::QueryParam::new("in", &in_)) + .query(&progenitor_client::QueryParam::new("use", &use_)) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "renamed_parameters", }; 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 21b270d2..f7295aea 100644 --- a/progenitor-impl/tests/output/src/test_stream_pagination_builder.rs +++ b/progenitor-impl/tests/output/src/test_stream_pagination_builder.rs @@ -366,6 +366,55 @@ pub mod builder { encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, ResponseValue, }; + pub mod built { + use super::super::types; + #[allow(unused_imports)] + use super::super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, + RequestBuilderExt, ResponseValue, + }; + pub struct PaginatedU32s<'a> { + pub(crate) client: &'a super::super::Client, + pub(crate) request: reqwest::RequestBuilder, + } + + impl<'a> PaginatedU32s<'a> { + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, request } = self; + #[allow(unused_mut)] + let mut request = request.build()?; + let info = OperationInfo { + operation_id: "paginated_u32s", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + pub fn map_request(self, f: F) -> Self + where + F: Fn(reqwest::RequestBuilder) -> reqwest::RequestBuilder, + { + Self { + client: self.client, + request: f(self.request), + } + } + } + } + ///Builder for [`Client::paginated_u32s`] /// ///[`Client::paginated_u32s`]: super::Client::paginated_u32s @@ -409,6 +458,10 @@ pub mod builder { pub async fn send( self, ) -> Result, Error> { + self.build()?.send().await + } + + pub fn build(self) -> Result, Error> { let Self { client, limit, @@ -416,44 +469,31 @@ 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 mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "paginated_u32s", + let request = { + 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"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + client + .client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 200u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } + Ok(built::PaginatedU32s { + client: client, + request, + }) } ///Streams `GET` requests to `/` 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 8a5714fb..3c9d9f04 100644 --- a/progenitor-impl/tests/output/src/test_stream_pagination_positional.rs +++ b/progenitor-impl/tests/output/src/test_stream_pagination_positional.rs @@ -199,27 +199,29 @@ impl Client { limit: Option<::std::num::NonZeroU32>, page_token: Option<&'a str>, ) -> Result, Error> { - 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"), - ::reqwest::header::HeaderValue::from_static(Self::api_version()), - ); #[allow(unused_mut)] - let mut request = self - .client - .get(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new( - "page_token", - &page_token, - )) - .headers(header_map) - .build()?; + let mut request = { + 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"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + self.client + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) + } + + .build()?; let info = OperationInfo { operation_id: "paginated_u32s", };