Rename internal `client` variable to help avoid collisions with input specs. (#600)

This commit is contained in:
Ian Nickles 2023-10-12 15:39:06 -07:00 committed by GitHub
parent 233cb80d94
commit d5f92a0e46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 4655 additions and 2728 deletions

View File

@ -796,11 +796,11 @@ impl Generator {
// collisions with the input spec. See: // collisions with the input spec. See:
// https://github.com/oxidecomputer/progenitor/issues/288 // https://github.com/oxidecomputer/progenitor/issues/288
let internal_prefix = "__progenitor"; let internal_prefix = "__progenitor";
let url_var = format_ident!("{internal_prefix}_url"); let url_ident = format_ident!("{internal_prefix}_url");
let query_var = format_ident!("{internal_prefix}_query"); let query_ident = format_ident!("{internal_prefix}_query");
let request_var = format_ident!("{internal_prefix}_request"); let request_ident = format_ident!("{internal_prefix}_request");
let response_var = format_ident!("{internal_prefix}_response"); let response_ident = format_ident!("{internal_prefix}_response");
let result_var = format_ident!("{internal_prefix}_result"); let result_ident = format_ident!("{internal_prefix}_result");
// Generate code for query parameters. // Generate code for query parameters.
let query_items = method let query_items = method
@ -812,12 +812,12 @@ impl Generator {
let qn_ident = format_ident!("{}", &param.name); let qn_ident = format_ident!("{}", &param.name);
let res = if *required { let res = if *required {
quote! { quote! {
#query_var.push((#qn, #qn_ident .to_string())); #query_ident.push((#qn, #qn_ident .to_string()));
} }
} else { } else {
quote! { quote! {
if let Some(v) = & #qn_ident { if let Some(v) = & #qn_ident {
#query_var.push((#qn, v.to_string())); #query_ident.push((#qn, v.to_string()));
} }
} }
}; };
@ -833,11 +833,11 @@ impl Generator {
} else { } else {
let size = query_items.len(); let size = query_items.len();
let query_build = quote! { let query_build = quote! {
let mut #query_var = Vec::with_capacity(#size); let mut #query_ident = Vec::with_capacity(#size);
#(#query_items)* #(#query_items)*
}; };
let query_use = quote! { let query_use = quote! {
.query(&#query_var) .query(&#query_ident)
}; };
(query_build, query_use) (query_build, query_use)
@ -914,7 +914,7 @@ impl Generator {
let url_path = method.path.compile(url_renames, client.clone()); let url_path = method.path.compile(url_renames, client.clone());
let url_path = quote! { let url_path = quote! {
let #url_var = #url_path; let #url_ident = #url_path;
}; };
// Generate code to handle the body param. // Generate code to handle the body param.
@ -976,22 +976,22 @@ impl Generator {
let decode = match &response.typ { let decode = match &response.typ {
OperationResponseType::Type(_) => { OperationResponseType::Type(_) => {
quote! { quote! {
ResponseValue::from_response(#response_var).await ResponseValue::from_response(#response_ident).await
} }
} }
OperationResponseType::None => { OperationResponseType::None => {
quote! { quote! {
Ok(ResponseValue::empty(#response_var)) Ok(ResponseValue::empty(#response_ident))
} }
} }
OperationResponseType::Raw => { OperationResponseType::Raw => {
quote! { quote! {
Ok(ResponseValue::stream(#response_var)) Ok(ResponseValue::stream(#response_ident))
} }
} }
OperationResponseType::Upgrade => { OperationResponseType::Upgrade => {
quote! { quote! {
ResponseValue::upgrade(#response_var).await ResponseValue::upgrade(#response_ident).await
} }
} }
}; };
@ -1026,7 +1026,7 @@ impl Generator {
OperationResponseType::Type(_) => { OperationResponseType::Type(_) => {
quote! { quote! {
Err(Error::ErrorResponse( Err(Error::ErrorResponse(
ResponseValue::from_response(#response_var) ResponseValue::from_response(#response_ident)
.await? .await?
)) ))
} }
@ -1034,14 +1034,14 @@ impl Generator {
OperationResponseType::None => { OperationResponseType::None => {
quote! { quote! {
Err(Error::ErrorResponse( Err(Error::ErrorResponse(
ResponseValue::empty(#response_var) ResponseValue::empty(#response_ident)
)) ))
} }
} }
OperationResponseType::Raw => { OperationResponseType::Raw => {
quote! { quote! {
Err(Error::ErrorResponse( Err(Error::ErrorResponse(
ResponseValue::stream(#response_var) ResponseValue::stream(#response_ident)
)) ))
} }
} }
@ -1087,18 +1087,18 @@ impl Generator {
let default_response = match method.responses.iter().last() { let default_response = match method.responses.iter().last() {
Some(response) if response.status_code.is_default() => quote! {}, Some(response) if response.status_code.is_default() => quote! {},
_ => { _ => {
quote! { _ => Err(Error::UnexpectedResponse(#response_var)), } quote! { _ => Err(Error::UnexpectedResponse(#response_ident)), }
} }
}; };
let pre_hook = self.settings.pre_hook.as_ref().map(|hook| { let pre_hook = self.settings.pre_hook.as_ref().map(|hook| {
quote! { quote! {
(#hook)(&#client.inner, &#request_var); (#hook)(&#client.inner, &#request_ident);
} }
}); });
let post_hook = self.settings.post_hook.as_ref().map(|hook| { let post_hook = self.settings.post_hook.as_ref().map(|hook| {
quote! { quote! {
(#hook)(&#client.inner, &#result_var); (#hook)(&#client.inner, &#result_ident);
} }
}); });
@ -1110,8 +1110,8 @@ impl Generator {
#headers_build #headers_build
let #request_var = #client.client let #request_ident = #client.client
. #method_func (#url_var) . #method_func (#url_ident)
#accept_header #accept_header
#(#body_func)* #(#body_func)*
#query_use #query_use
@ -1120,14 +1120,14 @@ impl Generator {
.build()?; .build()?;
#pre_hook #pre_hook
let #result_var = #client.client let #result_ident = #client.client
.execute(#request_var) .execute(#request_ident)
.await; .await;
#post_hook #post_hook
let #response_var = #result_var?; let #response_ident = #result_ident?;
match #response_var.status().as_u16() { match #response_ident.status().as_u16() {
// These will be of the form... // These will be of the form...
// 201 => ResponseValue::from_response(response).await, // 201 => ResponseValue::from_response(response).await,
// 200..299 => ResponseValue::empty(response), // 200..299 => ResponseValue::empty(response),
@ -1429,6 +1429,7 @@ impl Generator {
) -> Result<TokenStream> { ) -> Result<TokenStream> {
let struct_name = sanitize(&method.operation_id, Case::Pascal); let struct_name = sanitize(&method.operation_id, Case::Pascal);
let struct_ident = format_ident!("{}", struct_name); let struct_ident = format_ident!("{}", struct_name);
let client_ident = format_ident!("__progenitor_client");
// Generate an ident for each parameter. // Generate an ident for each parameter.
let param_names = method let param_names = method
@ -1646,7 +1647,7 @@ impl Generator {
success, success,
error, error,
body, body,
} = self.method_sig_body(method, quote! { client})?; } = self.method_sig_body(method, quote! { #client_ident })?;
let send_doc = format!( let send_doc = format!(
"Sends a `{}` request to `{}`", "Sends a `{}` request to `{}`",
@ -1661,7 +1662,7 @@ impl Generator {
> { > {
// Destructure the builder for convenience. // Destructure the builder for convenience.
let Self { let Self {
client, #client_ident,
#( #param_names, )* #( #param_names, )*
} = self; } = self;
@ -1863,14 +1864,14 @@ impl Generator {
#[doc = #struct_doc] #[doc = #struct_doc]
#derive #derive
pub struct #struct_ident<'a> { pub struct #struct_ident<'a> {
client: &'a super::Client, #client_ident: &'a super::Client,
#( #param_names: #param_types, )* #( #param_names: #param_types, )*
} }
impl<'a> #struct_ident<'a> { impl<'a> #struct_ident<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, #client_ident: client,
#( #param_names: #param_values, )* #( #param_names: #param_values, )*
} }
} }

View File

@ -1863,19 +1863,23 @@ pub mod builder {
///[`Client::control_hold`]: super::Client::control_hold ///[`Client::control_hold`]: super::Client::control_hold
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ControlHold<'a> { pub struct ControlHold<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> ControlHold<'a> { impl<'a> ControlHold<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `POST` request to `/v1/control/hold` ///Sends a `POST` request to `/v1/control/hold`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/control/hold", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/control/hold", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1883,7 +1887,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1897,20 +1904,27 @@ pub mod builder {
///[`Client::control_resume`]: super::Client::control_resume ///[`Client::control_resume`]: super::Client::control_resume
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ControlResume<'a> { pub struct ControlResume<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> ControlResume<'a> { impl<'a> ControlResume<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `POST` request to `/v1/control/resume` ///Sends a `POST` request to `/v1/control/resume`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/control/resume", client.baseurl,); __progenitor_client,
let __progenitor_request = client.client.post(__progenitor_url).build()?; } = self;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_url = format!("{}/v1/control/resume", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client.client.post(__progenitor_url).build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -1924,14 +1938,14 @@ pub mod builder {
///[`Client::task_get`]: super::Client::task_get ///[`Client::task_get`]: super::Client::task_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskGet<'a> { pub struct TaskGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
} }
impl<'a> TaskGet<'a> { impl<'a> TaskGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
} }
} }
@ -1948,14 +1962,17 @@ pub mod builder {
///Sends a `GET` request to `/v1/task/{task}` ///Sends a `GET` request to `/v1/task/{task}`
pub async fn send(self) -> Result<ResponseValue<types::Task>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::Task>, Error<()>> {
let Self { client, task } = self; let Self {
__progenitor_client,
task,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/task/{}", "{}/v1/task/{}",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1963,7 +1980,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1977,19 +1997,23 @@ pub mod builder {
///[`Client::tasks_get`]: super::Client::tasks_get ///[`Client::tasks_get`]: super::Client::tasks_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TasksGet<'a> { pub struct TasksGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> TasksGet<'a> { impl<'a> TasksGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/tasks` ///Sends a `GET` request to `/v1/tasks`
pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1997,7 +2021,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2011,14 +2038,14 @@ pub mod builder {
///[`Client::task_submit`]: super::Client::task_submit ///[`Client::task_submit`]: super::Client::task_submit
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskSubmit<'a> { pub struct TaskSubmit<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::TaskSubmit, String>, body: Result<types::builder::TaskSubmit, String>,
} }
impl<'a> TaskSubmit<'a> { impl<'a> TaskSubmit<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::TaskSubmit::default()), body: Ok(types::builder::TaskSubmit::default()),
} }
} }
@ -2044,12 +2071,15 @@ pub mod builder {
///Sends a `POST` request to `/v1/tasks` ///Sends a `POST` request to `/v1/tasks`
pub async fn send(self) -> Result<ResponseValue<types::TaskSubmitResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::TaskSubmitResult>, Error<()>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::TaskSubmit>::try_into) .and_then(std::convert::TryInto::<types::TaskSubmit>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,); let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2058,7 +2088,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2072,7 +2105,7 @@ pub mod builder {
///[`Client::task_events_get`]: super::Client::task_events_get ///[`Client::task_events_get`]: super::Client::task_events_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskEventsGet<'a> { pub struct TaskEventsGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
minseq: Result<Option<u32>, String>, minseq: Result<Option<u32>, String>,
} }
@ -2080,7 +2113,7 @@ pub mod builder {
impl<'a> TaskEventsGet<'a> { impl<'a> TaskEventsGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
minseq: Ok(None), minseq: Ok(None),
} }
@ -2110,7 +2143,7 @@ pub mod builder {
///Sends a `GET` request to `/v1/tasks/{task}/events` ///Sends a `GET` request to `/v1/tasks/{task}/events`
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskEvent>>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskEvent>>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
task, task,
minseq, minseq,
} = self; } = self;
@ -2118,14 +2151,14 @@ pub mod builder {
let minseq = minseq.map_err(Error::InvalidRequest)?; let minseq = minseq.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/tasks/{}/events", "{}/v1/tasks/{}/events",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let mut __progenitor_query = Vec::with_capacity(1usize); let mut __progenitor_query = Vec::with_capacity(1usize);
if let Some(v) = &minseq { if let Some(v) = &minseq {
__progenitor_query.push(("minseq", v.to_string())); __progenitor_query.push(("minseq", v.to_string()));
} }
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2134,7 +2167,10 @@ pub mod builder {
) )
.query(&__progenitor_query) .query(&__progenitor_query)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2148,14 +2184,14 @@ pub mod builder {
///[`Client::task_outputs_get`]: super::Client::task_outputs_get ///[`Client::task_outputs_get`]: super::Client::task_outputs_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskOutputsGet<'a> { pub struct TaskOutputsGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
} }
impl<'a> TaskOutputsGet<'a> { impl<'a> TaskOutputsGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
} }
} }
@ -2172,14 +2208,17 @@ pub mod builder {
///Sends a `GET` request to `/v1/tasks/{task}/outputs` ///Sends a `GET` request to `/v1/tasks/{task}/outputs`
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskOutput>>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskOutput>>, Error<()>> {
let Self { client, task } = self; let Self {
__progenitor_client,
task,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/tasks/{}/outputs", "{}/v1/tasks/{}/outputs",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2187,7 +2226,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2201,7 +2243,7 @@ pub mod builder {
///[`Client::task_output_download`]: super::Client::task_output_download ///[`Client::task_output_download`]: super::Client::task_output_download
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskOutputDownload<'a> { pub struct TaskOutputDownload<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
output: Result<String, String>, output: Result<String, String>,
} }
@ -2209,7 +2251,7 @@ pub mod builder {
impl<'a> TaskOutputDownload<'a> { impl<'a> TaskOutputDownload<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
output: Err("output was not initialized".to_string()), output: Err("output was not initialized".to_string()),
} }
@ -2238,7 +2280,7 @@ pub mod builder {
///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}`
pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
task, task,
output, output,
} = self; } = self;
@ -2246,12 +2288,15 @@ pub mod builder {
let output = output.map_err(Error::InvalidRequest)?; let output = output.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/tasks/{}/outputs/{}", "{}/v1/tasks/{}/outputs/{}",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
encode_path(&output.to_string()), encode_path(&output.to_string()),
); );
let __progenitor_request = client.client.get(__progenitor_url).build()?; let __progenitor_request = __progenitor_client.client.get(__progenitor_url).build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200..=299 => Ok(ResponseValue::stream(__progenitor_response)), 200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
@ -2265,14 +2310,14 @@ pub mod builder {
///[`Client::user_create`]: super::Client::user_create ///[`Client::user_create`]: super::Client::user_create
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct UserCreate<'a> { pub struct UserCreate<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::UserCreate, String>, body: Result<types::builder::UserCreate, String>,
} }
impl<'a> UserCreate<'a> { impl<'a> UserCreate<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::UserCreate::default()), body: Ok(types::builder::UserCreate::default()),
} }
} }
@ -2298,12 +2343,15 @@ pub mod builder {
///Sends a `POST` request to `/v1/users` ///Sends a `POST` request to `/v1/users`
pub async fn send(self) -> Result<ResponseValue<types::UserCreateResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::UserCreateResult>, Error<()>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::UserCreate>::try_into) .and_then(std::convert::TryInto::<types::UserCreate>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/v1/users", client.baseurl,); let __progenitor_url = format!("{}/v1/users", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2312,7 +2360,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2326,19 +2377,23 @@ pub mod builder {
///[`Client::whoami`]: super::Client::whoami ///[`Client::whoami`]: super::Client::whoami
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Whoami<'a> { pub struct Whoami<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> Whoami<'a> { impl<'a> Whoami<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/whoami` ///Sends a `GET` request to `/v1/whoami`
pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/whoami", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/whoami", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2346,7 +2401,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2360,14 +2418,14 @@ pub mod builder {
///[`Client::worker_bootstrap`]: super::Client::worker_bootstrap ///[`Client::worker_bootstrap`]: super::Client::worker_bootstrap
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerBootstrap<'a> { pub struct WorkerBootstrap<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::WorkerBootstrap, String>, body: Result<types::builder::WorkerBootstrap, String>,
} }
impl<'a> WorkerBootstrap<'a> { impl<'a> WorkerBootstrap<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::WorkerBootstrap::default()), body: Ok(types::builder::WorkerBootstrap::default()),
} }
} }
@ -2393,12 +2451,15 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/bootstrap` ///Sends a `POST` request to `/v1/worker/bootstrap`
pub async fn send(self) -> Result<ResponseValue<types::WorkerBootstrapResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WorkerBootstrapResult>, Error<()>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into) .and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/v1/worker/bootstrap", client.baseurl,); let __progenitor_url = format!("{}/v1/worker/bootstrap", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2407,7 +2468,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2421,19 +2485,23 @@ pub mod builder {
///[`Client::worker_ping`]: super::Client::worker_ping ///[`Client::worker_ping`]: super::Client::worker_ping
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerPing<'a> { pub struct WorkerPing<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> WorkerPing<'a> { impl<'a> WorkerPing<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/worker/ping` ///Sends a `GET` request to `/v1/worker/ping`
pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/worker/ping", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/worker/ping", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2441,7 +2509,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2455,7 +2526,7 @@ pub mod builder {
///[`Client::worker_task_append`]: super::Client::worker_task_append ///[`Client::worker_task_append`]: super::Client::worker_task_append
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerTaskAppend<'a> { pub struct WorkerTaskAppend<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<types::builder::WorkerAppendTask, String>, body: Result<types::builder::WorkerAppendTask, String>,
} }
@ -2463,7 +2534,7 @@ pub mod builder {
impl<'a> WorkerTaskAppend<'a> { impl<'a> WorkerTaskAppend<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Ok(types::builder::WorkerAppendTask::default()), body: Ok(types::builder::WorkerAppendTask::default()),
} }
@ -2502,18 +2573,29 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/append` ///Sends a `POST` request to `/v1/worker/task/{task}/append`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into) .and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/append", "{}/v1/worker/task/{}/append",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?; let __progenitor_request = __progenitor_client
let __progenitor_result = client.client.execute(__progenitor_request).await; .client
.post(__progenitor_url)
.json(&body)
.build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(__progenitor_response)), 201u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2527,7 +2609,7 @@ pub mod builder {
///[`Client::worker_task_upload_chunk`]: super::Client::worker_task_upload_chunk ///[`Client::worker_task_upload_chunk`]: super::Client::worker_task_upload_chunk
#[derive(Debug)] #[derive(Debug)]
pub struct WorkerTaskUploadChunk<'a> { pub struct WorkerTaskUploadChunk<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<reqwest::Body, String>, body: Result<reqwest::Body, String>,
} }
@ -2535,7 +2617,7 @@ pub mod builder {
impl<'a> WorkerTaskUploadChunk<'a> { impl<'a> WorkerTaskUploadChunk<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Err("body was not initialized".to_string()), body: Err("body was not initialized".to_string()),
} }
@ -2563,15 +2645,19 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/chunk` ///Sends a `POST` request to `/v1/worker/task/{task}/chunk`
pub async fn send(self) -> Result<ResponseValue<types::UploadedChunk>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::UploadedChunk>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/chunk", "{}/v1/worker/task/{}/chunk",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2584,7 +2670,10 @@ pub mod builder {
) )
.body(body) .body(body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2598,7 +2687,7 @@ pub mod builder {
///[`Client::worker_task_complete`]: super::Client::worker_task_complete ///[`Client::worker_task_complete`]: super::Client::worker_task_complete
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerTaskComplete<'a> { pub struct WorkerTaskComplete<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<types::builder::WorkerCompleteTask, String>, body: Result<types::builder::WorkerCompleteTask, String>,
} }
@ -2606,7 +2695,7 @@ pub mod builder {
impl<'a> WorkerTaskComplete<'a> { impl<'a> WorkerTaskComplete<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Ok(types::builder::WorkerCompleteTask::default()), body: Ok(types::builder::WorkerCompleteTask::default()),
} }
@ -2645,18 +2734,29 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/complete` ///Sends a `POST` request to `/v1/worker/task/{task}/complete`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into) .and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/complete", "{}/v1/worker/task/{}/complete",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?; let __progenitor_request = __progenitor_client
let __progenitor_result = client.client.execute(__progenitor_request).await; .client
.post(__progenitor_url)
.json(&body)
.build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2670,7 +2770,7 @@ pub mod builder {
///[`Client::worker_task_add_output`]: super::Client::worker_task_add_output ///[`Client::worker_task_add_output`]: super::Client::worker_task_add_output
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerTaskAddOutput<'a> { pub struct WorkerTaskAddOutput<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<types::builder::WorkerAddOutput, String>, body: Result<types::builder::WorkerAddOutput, String>,
} }
@ -2678,7 +2778,7 @@ pub mod builder {
impl<'a> WorkerTaskAddOutput<'a> { impl<'a> WorkerTaskAddOutput<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Ok(types::builder::WorkerAddOutput::default()), body: Ok(types::builder::WorkerAddOutput::default()),
} }
@ -2715,18 +2815,29 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/output` ///Sends a `POST` request to `/v1/worker/task/{task}/output`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into) .and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/output", "{}/v1/worker/task/{}/output",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?; let __progenitor_request = __progenitor_client
let __progenitor_result = client.client.execute(__progenitor_request).await; .client
.post(__progenitor_url)
.json(&body)
.build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(__progenitor_response)), 201u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2740,19 +2851,23 @@ pub mod builder {
///[`Client::workers_list`]: super::Client::workers_list ///[`Client::workers_list`]: super::Client::workers_list
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkersList<'a> { pub struct WorkersList<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> WorkersList<'a> { impl<'a> WorkersList<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/workers` ///Sends a `GET` request to `/v1/workers`
pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/workers", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/workers", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2760,7 +2875,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2774,20 +2892,27 @@ pub mod builder {
///[`Client::workers_recycle`]: super::Client::workers_recycle ///[`Client::workers_recycle`]: super::Client::workers_recycle
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkersRecycle<'a> { pub struct WorkersRecycle<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> WorkersRecycle<'a> { impl<'a> WorkersRecycle<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `POST` request to `/v1/workers/recycle` ///Sends a `POST` request to `/v1/workers/recycle`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/workers/recycle", client.baseurl,); __progenitor_client,
let __progenitor_request = client.client.post(__progenitor_url).build()?; } = self;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_url = format!("{}/v1/workers/recycle", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client.client.post(__progenitor_url).build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),

View File

@ -1863,19 +1863,23 @@ pub mod builder {
///[`Client::control_hold`]: super::Client::control_hold ///[`Client::control_hold`]: super::Client::control_hold
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ControlHold<'a> { pub struct ControlHold<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> ControlHold<'a> { impl<'a> ControlHold<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `POST` request to `/v1/control/hold` ///Sends a `POST` request to `/v1/control/hold`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/control/hold", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/control/hold", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1883,7 +1887,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1897,20 +1904,27 @@ pub mod builder {
///[`Client::control_resume`]: super::Client::control_resume ///[`Client::control_resume`]: super::Client::control_resume
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ControlResume<'a> { pub struct ControlResume<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> ControlResume<'a> { impl<'a> ControlResume<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `POST` request to `/v1/control/resume` ///Sends a `POST` request to `/v1/control/resume`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/control/resume", client.baseurl,); __progenitor_client,
let __progenitor_request = client.client.post(__progenitor_url).build()?; } = self;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_url = format!("{}/v1/control/resume", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client.client.post(__progenitor_url).build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -1924,14 +1938,14 @@ pub mod builder {
///[`Client::task_get`]: super::Client::task_get ///[`Client::task_get`]: super::Client::task_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskGet<'a> { pub struct TaskGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
} }
impl<'a> TaskGet<'a> { impl<'a> TaskGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
} }
} }
@ -1948,14 +1962,17 @@ pub mod builder {
///Sends a `GET` request to `/v1/task/{task}` ///Sends a `GET` request to `/v1/task/{task}`
pub async fn send(self) -> Result<ResponseValue<types::Task>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::Task>, Error<()>> {
let Self { client, task } = self; let Self {
__progenitor_client,
task,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/task/{}", "{}/v1/task/{}",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1963,7 +1980,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1977,19 +1997,23 @@ pub mod builder {
///[`Client::tasks_get`]: super::Client::tasks_get ///[`Client::tasks_get`]: super::Client::tasks_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TasksGet<'a> { pub struct TasksGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> TasksGet<'a> { impl<'a> TasksGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/tasks` ///Sends a `GET` request to `/v1/tasks`
pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1997,7 +2021,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2011,14 +2038,14 @@ pub mod builder {
///[`Client::task_submit`]: super::Client::task_submit ///[`Client::task_submit`]: super::Client::task_submit
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskSubmit<'a> { pub struct TaskSubmit<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::TaskSubmit, String>, body: Result<types::builder::TaskSubmit, String>,
} }
impl<'a> TaskSubmit<'a> { impl<'a> TaskSubmit<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::TaskSubmit::default()), body: Ok(types::builder::TaskSubmit::default()),
} }
} }
@ -2044,12 +2071,15 @@ pub mod builder {
///Sends a `POST` request to `/v1/tasks` ///Sends a `POST` request to `/v1/tasks`
pub async fn send(self) -> Result<ResponseValue<types::TaskSubmitResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::TaskSubmitResult>, Error<()>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::TaskSubmit>::try_into) .and_then(std::convert::TryInto::<types::TaskSubmit>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,); let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2058,7 +2088,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2072,7 +2105,7 @@ pub mod builder {
///[`Client::task_events_get`]: super::Client::task_events_get ///[`Client::task_events_get`]: super::Client::task_events_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskEventsGet<'a> { pub struct TaskEventsGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
minseq: Result<Option<u32>, String>, minseq: Result<Option<u32>, String>,
} }
@ -2080,7 +2113,7 @@ pub mod builder {
impl<'a> TaskEventsGet<'a> { impl<'a> TaskEventsGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
minseq: Ok(None), minseq: Ok(None),
} }
@ -2110,7 +2143,7 @@ pub mod builder {
///Sends a `GET` request to `/v1/tasks/{task}/events` ///Sends a `GET` request to `/v1/tasks/{task}/events`
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskEvent>>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskEvent>>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
task, task,
minseq, minseq,
} = self; } = self;
@ -2118,14 +2151,14 @@ pub mod builder {
let minseq = minseq.map_err(Error::InvalidRequest)?; let minseq = minseq.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/tasks/{}/events", "{}/v1/tasks/{}/events",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let mut __progenitor_query = Vec::with_capacity(1usize); let mut __progenitor_query = Vec::with_capacity(1usize);
if let Some(v) = &minseq { if let Some(v) = &minseq {
__progenitor_query.push(("minseq", v.to_string())); __progenitor_query.push(("minseq", v.to_string()));
} }
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2134,7 +2167,10 @@ pub mod builder {
) )
.query(&__progenitor_query) .query(&__progenitor_query)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2148,14 +2184,14 @@ pub mod builder {
///[`Client::task_outputs_get`]: super::Client::task_outputs_get ///[`Client::task_outputs_get`]: super::Client::task_outputs_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskOutputsGet<'a> { pub struct TaskOutputsGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
} }
impl<'a> TaskOutputsGet<'a> { impl<'a> TaskOutputsGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
} }
} }
@ -2172,14 +2208,17 @@ pub mod builder {
///Sends a `GET` request to `/v1/tasks/{task}/outputs` ///Sends a `GET` request to `/v1/tasks/{task}/outputs`
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskOutput>>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskOutput>>, Error<()>> {
let Self { client, task } = self; let Self {
__progenitor_client,
task,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/tasks/{}/outputs", "{}/v1/tasks/{}/outputs",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2187,7 +2226,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2201,7 +2243,7 @@ pub mod builder {
///[`Client::task_output_download`]: super::Client::task_output_download ///[`Client::task_output_download`]: super::Client::task_output_download
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TaskOutputDownload<'a> { pub struct TaskOutputDownload<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
output: Result<String, String>, output: Result<String, String>,
} }
@ -2209,7 +2251,7 @@ pub mod builder {
impl<'a> TaskOutputDownload<'a> { impl<'a> TaskOutputDownload<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
output: Err("output was not initialized".to_string()), output: Err("output was not initialized".to_string()),
} }
@ -2238,7 +2280,7 @@ pub mod builder {
///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}` ///Sends a `GET` request to `/v1/tasks/{task}/outputs/{output}`
pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
task, task,
output, output,
} = self; } = self;
@ -2246,12 +2288,15 @@ pub mod builder {
let output = output.map_err(Error::InvalidRequest)?; let output = output.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/tasks/{}/outputs/{}", "{}/v1/tasks/{}/outputs/{}",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
encode_path(&output.to_string()), encode_path(&output.to_string()),
); );
let __progenitor_request = client.client.get(__progenitor_url).build()?; let __progenitor_request = __progenitor_client.client.get(__progenitor_url).build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200..=299 => Ok(ResponseValue::stream(__progenitor_response)), 200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
@ -2265,14 +2310,14 @@ pub mod builder {
///[`Client::user_create`]: super::Client::user_create ///[`Client::user_create`]: super::Client::user_create
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct UserCreate<'a> { pub struct UserCreate<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::UserCreate, String>, body: Result<types::builder::UserCreate, String>,
} }
impl<'a> UserCreate<'a> { impl<'a> UserCreate<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::UserCreate::default()), body: Ok(types::builder::UserCreate::default()),
} }
} }
@ -2298,12 +2343,15 @@ pub mod builder {
///Sends a `POST` request to `/v1/users` ///Sends a `POST` request to `/v1/users`
pub async fn send(self) -> Result<ResponseValue<types::UserCreateResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::UserCreateResult>, Error<()>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::UserCreate>::try_into) .and_then(std::convert::TryInto::<types::UserCreate>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/v1/users", client.baseurl,); let __progenitor_url = format!("{}/v1/users", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2312,7 +2360,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2326,19 +2377,23 @@ pub mod builder {
///[`Client::whoami`]: super::Client::whoami ///[`Client::whoami`]: super::Client::whoami
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Whoami<'a> { pub struct Whoami<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> Whoami<'a> { impl<'a> Whoami<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/whoami` ///Sends a `GET` request to `/v1/whoami`
pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/whoami", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/whoami", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2346,7 +2401,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2360,14 +2418,14 @@ pub mod builder {
///[`Client::worker_bootstrap`]: super::Client::worker_bootstrap ///[`Client::worker_bootstrap`]: super::Client::worker_bootstrap
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerBootstrap<'a> { pub struct WorkerBootstrap<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::WorkerBootstrap, String>, body: Result<types::builder::WorkerBootstrap, String>,
} }
impl<'a> WorkerBootstrap<'a> { impl<'a> WorkerBootstrap<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::WorkerBootstrap::default()), body: Ok(types::builder::WorkerBootstrap::default()),
} }
} }
@ -2393,12 +2451,15 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/bootstrap` ///Sends a `POST` request to `/v1/worker/bootstrap`
pub async fn send(self) -> Result<ResponseValue<types::WorkerBootstrapResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WorkerBootstrapResult>, Error<()>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into) .and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/v1/worker/bootstrap", client.baseurl,); let __progenitor_url = format!("{}/v1/worker/bootstrap", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2407,7 +2468,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2421,19 +2485,23 @@ pub mod builder {
///[`Client::worker_ping`]: super::Client::worker_ping ///[`Client::worker_ping`]: super::Client::worker_ping
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerPing<'a> { pub struct WorkerPing<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> WorkerPing<'a> { impl<'a> WorkerPing<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/worker/ping` ///Sends a `GET` request to `/v1/worker/ping`
pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/worker/ping", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/worker/ping", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2441,7 +2509,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2455,7 +2526,7 @@ pub mod builder {
///[`Client::worker_task_append`]: super::Client::worker_task_append ///[`Client::worker_task_append`]: super::Client::worker_task_append
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerTaskAppend<'a> { pub struct WorkerTaskAppend<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<types::builder::WorkerAppendTask, String>, body: Result<types::builder::WorkerAppendTask, String>,
} }
@ -2463,7 +2534,7 @@ pub mod builder {
impl<'a> WorkerTaskAppend<'a> { impl<'a> WorkerTaskAppend<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Ok(types::builder::WorkerAppendTask::default()), body: Ok(types::builder::WorkerAppendTask::default()),
} }
@ -2502,18 +2573,29 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/append` ///Sends a `POST` request to `/v1/worker/task/{task}/append`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into) .and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/append", "{}/v1/worker/task/{}/append",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?; let __progenitor_request = __progenitor_client
let __progenitor_result = client.client.execute(__progenitor_request).await; .client
.post(__progenitor_url)
.json(&body)
.build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(__progenitor_response)), 201u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2527,7 +2609,7 @@ pub mod builder {
///[`Client::worker_task_upload_chunk`]: super::Client::worker_task_upload_chunk ///[`Client::worker_task_upload_chunk`]: super::Client::worker_task_upload_chunk
#[derive(Debug)] #[derive(Debug)]
pub struct WorkerTaskUploadChunk<'a> { pub struct WorkerTaskUploadChunk<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<reqwest::Body, String>, body: Result<reqwest::Body, String>,
} }
@ -2535,7 +2617,7 @@ pub mod builder {
impl<'a> WorkerTaskUploadChunk<'a> { impl<'a> WorkerTaskUploadChunk<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Err("body was not initialized".to_string()), body: Err("body was not initialized".to_string()),
} }
@ -2563,15 +2645,19 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/chunk` ///Sends a `POST` request to `/v1/worker/task/{task}/chunk`
pub async fn send(self) -> Result<ResponseValue<types::UploadedChunk>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::UploadedChunk>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/chunk", "{}/v1/worker/task/{}/chunk",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2584,7 +2670,10 @@ pub mod builder {
) )
.body(body) .body(body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2598,7 +2687,7 @@ pub mod builder {
///[`Client::worker_task_complete`]: super::Client::worker_task_complete ///[`Client::worker_task_complete`]: super::Client::worker_task_complete
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerTaskComplete<'a> { pub struct WorkerTaskComplete<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<types::builder::WorkerCompleteTask, String>, body: Result<types::builder::WorkerCompleteTask, String>,
} }
@ -2606,7 +2695,7 @@ pub mod builder {
impl<'a> WorkerTaskComplete<'a> { impl<'a> WorkerTaskComplete<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Ok(types::builder::WorkerCompleteTask::default()), body: Ok(types::builder::WorkerCompleteTask::default()),
} }
@ -2645,18 +2734,29 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/complete` ///Sends a `POST` request to `/v1/worker/task/{task}/complete`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into) .and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/complete", "{}/v1/worker/task/{}/complete",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?; let __progenitor_request = __progenitor_client
let __progenitor_result = client.client.execute(__progenitor_request).await; .client
.post(__progenitor_url)
.json(&body)
.build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2670,7 +2770,7 @@ pub mod builder {
///[`Client::worker_task_add_output`]: super::Client::worker_task_add_output ///[`Client::worker_task_add_output`]: super::Client::worker_task_add_output
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkerTaskAddOutput<'a> { pub struct WorkerTaskAddOutput<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
task: Result<String, String>, task: Result<String, String>,
body: Result<types::builder::WorkerAddOutput, String>, body: Result<types::builder::WorkerAddOutput, String>,
} }
@ -2678,7 +2778,7 @@ pub mod builder {
impl<'a> WorkerTaskAddOutput<'a> { impl<'a> WorkerTaskAddOutput<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
task: Err("task was not initialized".to_string()), task: Err("task was not initialized".to_string()),
body: Ok(types::builder::WorkerAddOutput::default()), body: Ok(types::builder::WorkerAddOutput::default()),
} }
@ -2715,18 +2815,29 @@ pub mod builder {
///Sends a `POST` request to `/v1/worker/task/{task}/output` ///Sends a `POST` request to `/v1/worker/task/{task}/output`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client, task, body } = self; let Self {
__progenitor_client,
task,
body,
} = self;
let task = task.map_err(Error::InvalidRequest)?; let task = task.map_err(Error::InvalidRequest)?;
let body = body let body = body
.and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into) .and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/v1/worker/task/{}/output", "{}/v1/worker/task/{}/output",
client.baseurl, __progenitor_client.baseurl,
encode_path(&task.to_string()), encode_path(&task.to_string()),
); );
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?; let __progenitor_request = __progenitor_client
let __progenitor_result = client.client.execute(__progenitor_request).await; .client
.post(__progenitor_url)
.json(&body)
.build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(__progenitor_response)), 201u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2740,19 +2851,23 @@ pub mod builder {
///[`Client::workers_list`]: super::Client::workers_list ///[`Client::workers_list`]: super::Client::workers_list
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkersList<'a> { pub struct WorkersList<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> WorkersList<'a> { impl<'a> WorkersList<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/v1/workers` ///Sends a `GET` request to `/v1/workers`
pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/workers", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/v1/workers", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2760,7 +2875,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2774,20 +2892,27 @@ pub mod builder {
///[`Client::workers_recycle`]: super::Client::workers_recycle ///[`Client::workers_recycle`]: super::Client::workers_recycle
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct WorkersRecycle<'a> { pub struct WorkersRecycle<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> WorkersRecycle<'a> { impl<'a> WorkersRecycle<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `POST` request to `/v1/workers/recycle` ///Sends a `POST` request to `/v1/workers/recycle`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/v1/workers/recycle", client.baseurl,); __progenitor_client,
let __progenitor_request = client.client.post(__progenitor_url).build()?; } = self;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_url = format!("{}/v1/workers/recycle", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client.client.post(__progenitor_url).build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),

View File

@ -1065,7 +1065,7 @@ pub mod builder {
///[`Client::enrol`]: super::Client::enrol ///[`Client::enrol`]: super::Client::enrol
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Enrol<'a> { pub struct Enrol<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::EnrolBody, String>, body: Result<types::builder::EnrolBody, String>,
} }
@ -1073,7 +1073,7 @@ pub mod builder {
impl<'a> Enrol<'a> { impl<'a> Enrol<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::EnrolBody::default()), body: Ok(types::builder::EnrolBody::default()),
} }
@ -1111,7 +1111,7 @@ pub mod builder {
///Sends a `POST` request to `/enrol` ///Sends a `POST` request to `/enrol`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1119,16 +1119,19 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::EnrolBody>::try_into) .and_then(std::convert::TryInto::<types::EnrolBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/enrol", client.baseurl,); let __progenitor_url = format!("{}/enrol", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(__progenitor_response)), 201u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -1142,14 +1145,14 @@ pub mod builder {
///[`Client::global_jobs`]: super::Client::global_jobs ///[`Client::global_jobs`]: super::Client::global_jobs
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct GlobalJobs<'a> { pub struct GlobalJobs<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
} }
impl<'a> GlobalJobs<'a> { impl<'a> GlobalJobs<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
} }
} }
@ -1167,14 +1170,14 @@ pub mod builder {
///Sends a `GET` request to `/global/jobs` ///Sends a `GET` request to `/global/jobs`
pub async fn send(self) -> Result<ResponseValue<types::GlobalJobsResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::GlobalJobsResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
} = self; } = self;
let authorization = authorization.map_err(Error::InvalidRequest)?; let authorization = authorization.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/global/jobs", client.baseurl,); let __progenitor_url = format!("{}/global/jobs", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1183,7 +1186,10 @@ pub mod builder {
) )
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1197,14 +1203,14 @@ pub mod builder {
///[`Client::ping`]: super::Client::ping ///[`Client::ping`]: super::Client::ping
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Ping<'a> { pub struct Ping<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
} }
impl<'a> Ping<'a> { impl<'a> Ping<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
} }
} }
@ -1222,14 +1228,14 @@ pub mod builder {
///Sends a `GET` request to `/ping` ///Sends a `GET` request to `/ping`
pub async fn send(self) -> Result<ResponseValue<types::PingResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::PingResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
} = self; } = self;
let authorization = authorization.map_err(Error::InvalidRequest)?; let authorization = authorization.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/ping", client.baseurl,); let __progenitor_url = format!("{}/ping", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1238,7 +1244,10 @@ pub mod builder {
) )
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1252,7 +1261,7 @@ pub mod builder {
///[`Client::report_finish`]: super::Client::report_finish ///[`Client::report_finish`]: super::Client::report_finish
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ReportFinish<'a> { pub struct ReportFinish<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::ReportFinishBody, String>, body: Result<types::builder::ReportFinishBody, String>,
} }
@ -1260,7 +1269,7 @@ pub mod builder {
impl<'a> ReportFinish<'a> { impl<'a> ReportFinish<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::ReportFinishBody::default()), body: Ok(types::builder::ReportFinishBody::default()),
} }
@ -1300,7 +1309,7 @@ pub mod builder {
///Sends a `POST` request to `/report/finish` ///Sends a `POST` request to `/report/finish`
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1308,10 +1317,10 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into) .and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/report/finish", client.baseurl,); let __progenitor_url = format!("{}/report/finish", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1321,7 +1330,10 @@ pub mod builder {
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1335,7 +1347,7 @@ pub mod builder {
///[`Client::report_output`]: super::Client::report_output ///[`Client::report_output`]: super::Client::report_output
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ReportOutput<'a> { pub struct ReportOutput<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::ReportOutputBody, String>, body: Result<types::builder::ReportOutputBody, String>,
} }
@ -1343,7 +1355,7 @@ pub mod builder {
impl<'a> ReportOutput<'a> { impl<'a> ReportOutput<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::ReportOutputBody::default()), body: Ok(types::builder::ReportOutputBody::default()),
} }
@ -1383,7 +1395,7 @@ pub mod builder {
///Sends a `POST` request to `/report/output` ///Sends a `POST` request to `/report/output`
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1391,10 +1403,10 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into) .and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/report/output", client.baseurl,); let __progenitor_url = format!("{}/report/output", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1404,7 +1416,10 @@ pub mod builder {
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1418,7 +1433,7 @@ pub mod builder {
///[`Client::report_start`]: super::Client::report_start ///[`Client::report_start`]: super::Client::report_start
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ReportStart<'a> { pub struct ReportStart<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::ReportStartBody, String>, body: Result<types::builder::ReportStartBody, String>,
} }
@ -1426,7 +1441,7 @@ pub mod builder {
impl<'a> ReportStart<'a> { impl<'a> ReportStart<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::ReportStartBody::default()), body: Ok(types::builder::ReportStartBody::default()),
} }
@ -1464,7 +1479,7 @@ pub mod builder {
///Sends a `POST` request to `/report/start` ///Sends a `POST` request to `/report/start`
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1472,10 +1487,10 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::ReportStartBody>::try_into) .and_then(std::convert::TryInto::<types::ReportStartBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/report/start", client.baseurl,); let __progenitor_url = format!("{}/report/start", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1485,7 +1500,10 @@ pub mod builder {
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,

View File

@ -1065,7 +1065,7 @@ pub mod builder {
///[`Client::enrol`]: super::Client::enrol ///[`Client::enrol`]: super::Client::enrol
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Enrol<'a> { pub struct Enrol<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::EnrolBody, String>, body: Result<types::builder::EnrolBody, String>,
} }
@ -1073,7 +1073,7 @@ pub mod builder {
impl<'a> Enrol<'a> { impl<'a> Enrol<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::EnrolBody::default()), body: Ok(types::builder::EnrolBody::default()),
} }
@ -1111,7 +1111,7 @@ pub mod builder {
///Sends a `POST` request to `/enrol` ///Sends a `POST` request to `/enrol`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1119,16 +1119,19 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::EnrolBody>::try_into) .and_then(std::convert::TryInto::<types::EnrolBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/enrol", client.baseurl,); let __progenitor_url = format!("{}/enrol", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(__progenitor_response)), 201u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -1142,14 +1145,14 @@ pub mod builder {
///[`Client::global_jobs`]: super::Client::global_jobs ///[`Client::global_jobs`]: super::Client::global_jobs
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct GlobalJobs<'a> { pub struct GlobalJobs<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
} }
impl<'a> GlobalJobs<'a> { impl<'a> GlobalJobs<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
} }
} }
@ -1167,14 +1170,14 @@ pub mod builder {
///Sends a `GET` request to `/global/jobs` ///Sends a `GET` request to `/global/jobs`
pub async fn send(self) -> Result<ResponseValue<types::GlobalJobsResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::GlobalJobsResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
} = self; } = self;
let authorization = authorization.map_err(Error::InvalidRequest)?; let authorization = authorization.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/global/jobs", client.baseurl,); let __progenitor_url = format!("{}/global/jobs", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1183,7 +1186,10 @@ pub mod builder {
) )
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1197,14 +1203,14 @@ pub mod builder {
///[`Client::ping`]: super::Client::ping ///[`Client::ping`]: super::Client::ping
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Ping<'a> { pub struct Ping<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
} }
impl<'a> Ping<'a> { impl<'a> Ping<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
} }
} }
@ -1222,14 +1228,14 @@ pub mod builder {
///Sends a `GET` request to `/ping` ///Sends a `GET` request to `/ping`
pub async fn send(self) -> Result<ResponseValue<types::PingResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::PingResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
} = self; } = self;
let authorization = authorization.map_err(Error::InvalidRequest)?; let authorization = authorization.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/ping", client.baseurl,); let __progenitor_url = format!("{}/ping", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -1238,7 +1244,10 @@ pub mod builder {
) )
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1252,7 +1261,7 @@ pub mod builder {
///[`Client::report_finish`]: super::Client::report_finish ///[`Client::report_finish`]: super::Client::report_finish
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ReportFinish<'a> { pub struct ReportFinish<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::ReportFinishBody, String>, body: Result<types::builder::ReportFinishBody, String>,
} }
@ -1260,7 +1269,7 @@ pub mod builder {
impl<'a> ReportFinish<'a> { impl<'a> ReportFinish<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::ReportFinishBody::default()), body: Ok(types::builder::ReportFinishBody::default()),
} }
@ -1300,7 +1309,7 @@ pub mod builder {
///Sends a `POST` request to `/report/finish` ///Sends a `POST` request to `/report/finish`
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1308,10 +1317,10 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into) .and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/report/finish", client.baseurl,); let __progenitor_url = format!("{}/report/finish", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1321,7 +1330,10 @@ pub mod builder {
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1335,7 +1347,7 @@ pub mod builder {
///[`Client::report_output`]: super::Client::report_output ///[`Client::report_output`]: super::Client::report_output
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ReportOutput<'a> { pub struct ReportOutput<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::ReportOutputBody, String>, body: Result<types::builder::ReportOutputBody, String>,
} }
@ -1343,7 +1355,7 @@ pub mod builder {
impl<'a> ReportOutput<'a> { impl<'a> ReportOutput<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::ReportOutputBody::default()), body: Ok(types::builder::ReportOutputBody::default()),
} }
@ -1383,7 +1395,7 @@ pub mod builder {
///Sends a `POST` request to `/report/output` ///Sends a `POST` request to `/report/output`
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1391,10 +1403,10 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into) .and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/report/output", client.baseurl,); let __progenitor_url = format!("{}/report/output", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1404,7 +1416,10 @@ pub mod builder {
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -1418,7 +1433,7 @@ pub mod builder {
///[`Client::report_start`]: super::Client::report_start ///[`Client::report_start`]: super::Client::report_start
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct ReportStart<'a> { pub struct ReportStart<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
authorization: Result<String, String>, authorization: Result<String, String>,
body: Result<types::builder::ReportStartBody, String>, body: Result<types::builder::ReportStartBody, String>,
} }
@ -1426,7 +1441,7 @@ pub mod builder {
impl<'a> ReportStart<'a> { impl<'a> ReportStart<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
authorization: Err("authorization was not initialized".to_string()), authorization: Err("authorization was not initialized".to_string()),
body: Ok(types::builder::ReportStartBody::default()), body: Ok(types::builder::ReportStartBody::default()),
} }
@ -1464,7 +1479,7 @@ pub mod builder {
///Sends a `POST` request to `/report/start` ///Sends a `POST` request to `/report/start`
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
authorization, authorization,
body, body,
} = self; } = self;
@ -1472,10 +1487,10 @@ pub mod builder {
let body = body let body = body
.and_then(std::convert::TryInto::<types::ReportStartBody>::try_into) .and_then(std::convert::TryInto::<types::ReportStartBody>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/report/start", client.baseurl,); let __progenitor_url = format!("{}/report/start", __progenitor_client.baseurl,);
let mut header_map = HeaderMap::with_capacity(1usize); let mut header_map = HeaderMap::with_capacity(1usize);
header_map.append("Authorization", HeaderValue::try_from(authorization)?); header_map.append("Authorization", HeaderValue::try_from(authorization)?);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -1485,7 +1500,10 @@ pub mod builder {
.json(&body) .json(&body)
.headers(header_map) .headers(header_map)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -104,7 +104,7 @@ pub mod builder {
///[`Client::key_get`]: super::Client::key_get ///[`Client::key_get`]: super::Client::key_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct KeyGet<'a> { pub struct KeyGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
key: Result<Option<bool>, String>, key: Result<Option<bool>, String>,
unique_key: Result<Option<String>, String>, unique_key: Result<Option<String>, String>,
} }
@ -112,7 +112,7 @@ pub mod builder {
impl<'a> KeyGet<'a> { impl<'a> KeyGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
key: Ok(None), key: Ok(None),
unique_key: Ok(None), unique_key: Ok(None),
} }
@ -143,13 +143,13 @@ pub mod builder {
///Sends a `GET` request to `/key` ///Sends a `GET` request to `/key`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
key, key,
unique_key, unique_key,
} = self; } = self;
let key = key.map_err(Error::InvalidRequest)?; let key = key.map_err(Error::InvalidRequest)?;
let unique_key = unique_key.map_err(Error::InvalidRequest)?; let unique_key = unique_key.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/key", client.baseurl,); let __progenitor_url = format!("{}/key", __progenitor_client.baseurl,);
let mut __progenitor_query = Vec::with_capacity(2usize); let mut __progenitor_query = Vec::with_capacity(2usize);
if let Some(v) = &key { if let Some(v) = &key {
__progenitor_query.push(("key", v.to_string())); __progenitor_query.push(("key", v.to_string()));
@ -157,12 +157,15 @@ pub mod builder {
if let Some(v) = &unique_key { if let Some(v) = &unique_key {
__progenitor_query.push(("uniqueKey", v.to_string())); __progenitor_query.push(("uniqueKey", v.to_string()));
} }
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.query(&__progenitor_query) .query(&__progenitor_query)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),

View File

@ -104,7 +104,7 @@ pub mod builder {
///[`Client::key_get`]: super::Client::key_get ///[`Client::key_get`]: super::Client::key_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct KeyGet<'a> { pub struct KeyGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
key: Result<Option<bool>, String>, key: Result<Option<bool>, String>,
unique_key: Result<Option<String>, String>, unique_key: Result<Option<String>, String>,
} }
@ -112,7 +112,7 @@ pub mod builder {
impl<'a> KeyGet<'a> { impl<'a> KeyGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
key: Ok(None), key: Ok(None),
unique_key: Ok(None), unique_key: Ok(None),
} }
@ -143,13 +143,13 @@ pub mod builder {
///Sends a `GET` request to `/key` ///Sends a `GET` request to `/key`
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
let Self { let Self {
client, __progenitor_client,
key, key,
unique_key, unique_key,
} = self; } = self;
let key = key.map_err(Error::InvalidRequest)?; let key = key.map_err(Error::InvalidRequest)?;
let unique_key = unique_key.map_err(Error::InvalidRequest)?; let unique_key = unique_key.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/key", client.baseurl,); let __progenitor_url = format!("{}/key", __progenitor_client.baseurl,);
let mut __progenitor_query = Vec::with_capacity(2usize); let mut __progenitor_query = Vec::with_capacity(2usize);
if let Some(v) = &key { if let Some(v) = &key {
__progenitor_query.push(("key", v.to_string())); __progenitor_query.push(("key", v.to_string()));
@ -157,12 +157,15 @@ pub mod builder {
if let Some(v) = &unique_key { if let Some(v) = &unique_key {
__progenitor_query.push(("uniqueKey", v.to_string())); __progenitor_query.push(("uniqueKey", v.to_string()));
} }
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.query(&__progenitor_query) .query(&__progenitor_query)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(__progenitor_response)), 200u16 => Ok(ResponseValue::empty(__progenitor_response)),

View File

@ -2113,21 +2113,25 @@ pub mod builder {
///[`Client::instance_get`]: super::Client::instance_get ///[`Client::instance_get`]: super::Client::instance_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceGet<'a> { pub struct InstanceGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> InstanceGet<'a> { impl<'a> InstanceGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/instance` ///Sends a `GET` request to `/instance`
pub async fn send( pub async fn send(
self, self,
) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> { ) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/instance", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2135,7 +2139,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2155,14 +2162,14 @@ pub mod builder {
///[`Client::instance_ensure`]: super::Client::instance_ensure ///[`Client::instance_ensure`]: super::Client::instance_ensure
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceEnsure<'a> { pub struct InstanceEnsure<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::InstanceEnsureRequest, String>, body: Result<types::builder::InstanceEnsureRequest, String>,
} }
impl<'a> InstanceEnsure<'a> { impl<'a> InstanceEnsure<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::InstanceEnsureRequest::default()), body: Ok(types::builder::InstanceEnsureRequest::default()),
} }
} }
@ -2192,12 +2199,15 @@ pub mod builder {
pub async fn send( pub async fn send(
self, self,
) -> Result<ResponseValue<types::InstanceEnsureResponse>, Error<types::Error>> { ) -> Result<ResponseValue<types::InstanceEnsureResponse>, Error<types::Error>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into) .and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance", client.baseurl,); let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.put(__progenitor_url) .put(__progenitor_url)
.header( .header(
@ -2206,7 +2216,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2226,7 +2239,7 @@ pub mod builder {
///[`Client::instance_issue_crucible_snapshot_request`]: super::Client::instance_issue_crucible_snapshot_request ///[`Client::instance_issue_crucible_snapshot_request`]: super::Client::instance_issue_crucible_snapshot_request
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceIssueCrucibleSnapshotRequest<'a> { pub struct InstanceIssueCrucibleSnapshotRequest<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
id: Result<uuid::Uuid, String>, id: Result<uuid::Uuid, String>,
snapshot_id: Result<uuid::Uuid, String>, snapshot_id: Result<uuid::Uuid, String>,
} }
@ -2234,7 +2247,7 @@ pub mod builder {
impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> { impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
id: Err("id was not initialized".to_string()), id: Err("id was not initialized".to_string()),
snapshot_id: Err("snapshot_id was not initialized".to_string()), snapshot_id: Err("snapshot_id was not initialized".to_string()),
} }
@ -2264,7 +2277,7 @@ pub mod builder {
/// `/instance/disk/{id}/snapshot/{snapshot_id}` /// `/instance/disk/{id}/snapshot/{snapshot_id}`
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
let Self { let Self {
client, __progenitor_client,
id, id,
snapshot_id, snapshot_id,
} = self; } = self;
@ -2272,11 +2285,11 @@ pub mod builder {
let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?; let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/instance/disk/{}/snapshot/{}", "{}/instance/disk/{}/snapshot/{}",
client.baseurl, __progenitor_client.baseurl,
encode_path(&id.to_string()), encode_path(&id.to_string()),
encode_path(&snapshot_id.to_string()), encode_path(&snapshot_id.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2284,7 +2297,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2304,14 +2320,14 @@ pub mod builder {
///[`Client::instance_migrate_status`]: super::Client::instance_migrate_status ///[`Client::instance_migrate_status`]: super::Client::instance_migrate_status
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceMigrateStatus<'a> { pub struct InstanceMigrateStatus<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::InstanceMigrateStatusRequest, String>, body: Result<types::builder::InstanceMigrateStatusRequest, String>,
} }
impl<'a> InstanceMigrateStatus<'a> { impl<'a> InstanceMigrateStatus<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::InstanceMigrateStatusRequest::default()), body: Ok(types::builder::InstanceMigrateStatusRequest::default()),
} }
} }
@ -2341,12 +2357,16 @@ pub mod builder {
self, self,
) -> Result<ResponseValue<types::InstanceMigrateStatusResponse>, Error<types::Error>> ) -> Result<ResponseValue<types::InstanceMigrateStatusResponse>, Error<types::Error>>
{ {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into) .and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance/migrate/status", client.baseurl,); let __progenitor_url =
let __progenitor_request = client format!("{}/instance/migrate/status", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2355,7 +2375,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2375,21 +2398,25 @@ pub mod builder {
///[`Client::instance_serial`]: super::Client::instance_serial ///[`Client::instance_serial`]: super::Client::instance_serial
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceSerial<'a> { pub struct InstanceSerial<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> InstanceSerial<'a> { impl<'a> InstanceSerial<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/instance/serial` ///Sends a `GET` request to `/instance/serial`
pub async fn send( pub async fn send(
self, self,
) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> { ) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/instance/serial", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/instance/serial", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header(reqwest::header::CONNECTION, "Upgrade") .header(reqwest::header::CONNECTION, "Upgrade")
@ -2403,7 +2430,10 @@ pub mod builder {
), ),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
101u16 => ResponseValue::upgrade(__progenitor_response).await, 101u16 => ResponseValue::upgrade(__progenitor_response).await,
@ -2418,14 +2448,14 @@ pub mod builder {
///[`Client::instance_state_put`]: super::Client::instance_state_put ///[`Client::instance_state_put`]: super::Client::instance_state_put
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceStatePut<'a> { pub struct InstanceStatePut<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::InstanceStateRequested, String>, body: Result<types::InstanceStateRequested, String>,
} }
impl<'a> InstanceStatePut<'a> { impl<'a> InstanceStatePut<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Err("body was not initialized".to_string()), body: Err("body was not initialized".to_string()),
} }
} }
@ -2442,10 +2472,13 @@ pub mod builder {
///Sends a `PUT` request to `/instance/state` ///Sends a `PUT` request to `/instance/state`
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance/state", client.baseurl,); let __progenitor_url = format!("{}/instance/state", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.put(__progenitor_url) .put(__progenitor_url)
.header( .header(
@ -2454,7 +2487,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(__progenitor_response)), 204u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2474,14 +2510,14 @@ pub mod builder {
///[`Client::instance_state_monitor`]: super::Client::instance_state_monitor ///[`Client::instance_state_monitor`]: super::Client::instance_state_monitor
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceStateMonitor<'a> { pub struct InstanceStateMonitor<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::InstanceStateMonitorRequest, String>, body: Result<types::builder::InstanceStateMonitorRequest, String>,
} }
impl<'a> InstanceStateMonitor<'a> { impl<'a> InstanceStateMonitor<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::InstanceStateMonitorRequest::default()), body: Ok(types::builder::InstanceStateMonitorRequest::default()),
} }
} }
@ -2511,12 +2547,16 @@ pub mod builder {
self, self,
) -> Result<ResponseValue<types::InstanceStateMonitorResponse>, Error<types::Error>> ) -> Result<ResponseValue<types::InstanceStateMonitorResponse>, Error<types::Error>>
{ {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into) .and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance/state-monitor", client.baseurl,); let __progenitor_url =
let __progenitor_request = client format!("{}/instance/state-monitor", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2525,7 +2565,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,

View File

@ -2119,21 +2119,25 @@ pub mod builder {
///[`Client::instance_get`]: super::Client::instance_get ///[`Client::instance_get`]: super::Client::instance_get
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceGet<'a> { pub struct InstanceGet<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> InstanceGet<'a> { impl<'a> InstanceGet<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/instance` ///Sends a `GET` request to `/instance`
pub async fn send( pub async fn send(
self, self,
) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> { ) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/instance", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2141,7 +2145,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2161,14 +2168,14 @@ pub mod builder {
///[`Client::instance_ensure`]: super::Client::instance_ensure ///[`Client::instance_ensure`]: super::Client::instance_ensure
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceEnsure<'a> { pub struct InstanceEnsure<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::InstanceEnsureRequest, String>, body: Result<types::builder::InstanceEnsureRequest, String>,
} }
impl<'a> InstanceEnsure<'a> { impl<'a> InstanceEnsure<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::InstanceEnsureRequest::default()), body: Ok(types::builder::InstanceEnsureRequest::default()),
} }
} }
@ -2198,12 +2205,15 @@ pub mod builder {
pub async fn send( pub async fn send(
self, self,
) -> Result<ResponseValue<types::InstanceEnsureResponse>, Error<types::Error>> { ) -> Result<ResponseValue<types::InstanceEnsureResponse>, Error<types::Error>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into) .and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance", client.baseurl,); let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.put(__progenitor_url) .put(__progenitor_url)
.header( .header(
@ -2212,7 +2222,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
201u16 => ResponseValue::from_response(__progenitor_response).await, 201u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2232,7 +2245,7 @@ pub mod builder {
///[`Client::instance_issue_crucible_snapshot_request`]: super::Client::instance_issue_crucible_snapshot_request ///[`Client::instance_issue_crucible_snapshot_request`]: super::Client::instance_issue_crucible_snapshot_request
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceIssueCrucibleSnapshotRequest<'a> { pub struct InstanceIssueCrucibleSnapshotRequest<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
id: Result<uuid::Uuid, String>, id: Result<uuid::Uuid, String>,
snapshot_id: Result<uuid::Uuid, String>, snapshot_id: Result<uuid::Uuid, String>,
} }
@ -2240,7 +2253,7 @@ pub mod builder {
impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> { impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
id: Err("id was not initialized".to_string()), id: Err("id was not initialized".to_string()),
snapshot_id: Err("snapshot_id was not initialized".to_string()), snapshot_id: Err("snapshot_id was not initialized".to_string()),
} }
@ -2270,7 +2283,7 @@ pub mod builder {
/// `/instance/disk/{id}/snapshot/{snapshot_id}` /// `/instance/disk/{id}/snapshot/{snapshot_id}`
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
let Self { let Self {
client, __progenitor_client,
id, id,
snapshot_id, snapshot_id,
} = self; } = self;
@ -2278,11 +2291,11 @@ pub mod builder {
let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?; let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!( let __progenitor_url = format!(
"{}/instance/disk/{}/snapshot/{}", "{}/instance/disk/{}/snapshot/{}",
client.baseurl, __progenitor_client.baseurl,
encode_path(&id.to_string()), encode_path(&id.to_string()),
encode_path(&snapshot_id.to_string()), encode_path(&snapshot_id.to_string()),
); );
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.post(__progenitor_url) .post(__progenitor_url)
.header( .header(
@ -2290,7 +2303,10 @@ pub mod builder {
reqwest::header::HeaderValue::from_static("application/json"), reqwest::header::HeaderValue::from_static("application/json"),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2310,14 +2326,14 @@ pub mod builder {
///[`Client::instance_migrate_status`]: super::Client::instance_migrate_status ///[`Client::instance_migrate_status`]: super::Client::instance_migrate_status
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceMigrateStatus<'a> { pub struct InstanceMigrateStatus<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::InstanceMigrateStatusRequest, String>, body: Result<types::builder::InstanceMigrateStatusRequest, String>,
} }
impl<'a> InstanceMigrateStatus<'a> { impl<'a> InstanceMigrateStatus<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::InstanceMigrateStatusRequest::default()), body: Ok(types::builder::InstanceMigrateStatusRequest::default()),
} }
} }
@ -2347,12 +2363,16 @@ pub mod builder {
self, self,
) -> Result<ResponseValue<types::InstanceMigrateStatusResponse>, Error<types::Error>> ) -> Result<ResponseValue<types::InstanceMigrateStatusResponse>, Error<types::Error>>
{ {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into) .and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance/migrate/status", client.baseurl,); let __progenitor_url =
let __progenitor_request = client format!("{}/instance/migrate/status", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2361,7 +2381,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,
@ -2381,21 +2404,25 @@ pub mod builder {
///[`Client::instance_serial`]: super::Client::instance_serial ///[`Client::instance_serial`]: super::Client::instance_serial
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceSerial<'a> { pub struct InstanceSerial<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
} }
impl<'a> InstanceSerial<'a> { impl<'a> InstanceSerial<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { client } Self {
__progenitor_client: client,
}
} }
///Sends a `GET` request to `/instance/serial` ///Sends a `GET` request to `/instance/serial`
pub async fn send( pub async fn send(
self, self,
) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> { ) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> {
let Self { client } = self; let Self {
let __progenitor_url = format!("{}/instance/serial", client.baseurl,); __progenitor_client,
let __progenitor_request = client } = self;
let __progenitor_url = format!("{}/instance/serial", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header(reqwest::header::CONNECTION, "Upgrade") .header(reqwest::header::CONNECTION, "Upgrade")
@ -2409,7 +2436,10 @@ pub mod builder {
), ),
) )
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
101u16 => ResponseValue::upgrade(__progenitor_response).await, 101u16 => ResponseValue::upgrade(__progenitor_response).await,
@ -2424,14 +2454,14 @@ pub mod builder {
///[`Client::instance_state_put`]: super::Client::instance_state_put ///[`Client::instance_state_put`]: super::Client::instance_state_put
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceStatePut<'a> { pub struct InstanceStatePut<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::InstanceStateRequested, String>, body: Result<types::InstanceStateRequested, String>,
} }
impl<'a> InstanceStatePut<'a> { impl<'a> InstanceStatePut<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Err("body was not initialized".to_string()), body: Err("body was not initialized".to_string()),
} }
} }
@ -2448,10 +2478,13 @@ pub mod builder {
///Sends a `PUT` request to `/instance/state` ///Sends a `PUT` request to `/instance/state`
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> { pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body.map_err(Error::InvalidRequest)?; let body = body.map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance/state", client.baseurl,); let __progenitor_url = format!("{}/instance/state", __progenitor_client.baseurl,);
let __progenitor_request = client let __progenitor_request = __progenitor_client
.client .client
.put(__progenitor_url) .put(__progenitor_url)
.header( .header(
@ -2460,7 +2493,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(__progenitor_response)), 204u16 => Ok(ResponseValue::empty(__progenitor_response)),
@ -2480,14 +2516,14 @@ pub mod builder {
///[`Client::instance_state_monitor`]: super::Client::instance_state_monitor ///[`Client::instance_state_monitor`]: super::Client::instance_state_monitor
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InstanceStateMonitor<'a> { pub struct InstanceStateMonitor<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::InstanceStateMonitorRequest, String>, body: Result<types::builder::InstanceStateMonitorRequest, String>,
} }
impl<'a> InstanceStateMonitor<'a> { impl<'a> InstanceStateMonitor<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::InstanceStateMonitorRequest::default()), body: Ok(types::builder::InstanceStateMonitorRequest::default()),
} }
} }
@ -2517,12 +2553,16 @@ pub mod builder {
self, self,
) -> Result<ResponseValue<types::InstanceStateMonitorResponse>, Error<types::Error>> ) -> Result<ResponseValue<types::InstanceStateMonitorResponse>, Error<types::Error>>
{ {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into) .and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/instance/state-monitor", client.baseurl,); let __progenitor_url =
let __progenitor_request = client format!("{}/instance/state-monitor", __progenitor_client.baseurl,);
let __progenitor_request = __progenitor_client
.client .client
.get(__progenitor_url) .get(__progenitor_url)
.header( .header(
@ -2531,7 +2571,10 @@ pub mod builder {
) )
.json(&body) .json(&body)
.build()?; .build()?;
let __progenitor_result = client.client.execute(__progenitor_request).await; let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200u16 => ResponseValue::from_response(__progenitor_response).await, 200u16 => ResponseValue::from_response(__progenitor_response).await,

View File

@ -309,14 +309,14 @@ pub mod builder {
///[`Client::default_params`]: super::Client::default_params ///[`Client::default_params`]: super::Client::default_params
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct DefaultParams<'a> { pub struct DefaultParams<'a> {
client: &'a super::Client, __progenitor_client: &'a super::Client,
body: Result<types::builder::BodyWithDefaults, String>, body: Result<types::builder::BodyWithDefaults, String>,
} }
impl<'a> DefaultParams<'a> { impl<'a> DefaultParams<'a> {
pub fn new(client: &'a super::Client) -> Self { pub fn new(client: &'a super::Client) -> Self {
Self { Self {
client, __progenitor_client: client,
body: Ok(types::builder::BodyWithDefaults::default()), body: Ok(types::builder::BodyWithDefaults::default()),
} }
} }
@ -344,13 +344,23 @@ pub mod builder {
///Sends a `POST` request to `/` ///Sends a `POST` request to `/`
pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<ByteStream>> { pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<ByteStream>> {
let Self { client, body } = self; let Self {
__progenitor_client,
body,
} = self;
let body = body let body = body
.and_then(std::convert::TryInto::<types::BodyWithDefaults>::try_into) .and_then(std::convert::TryInto::<types::BodyWithDefaults>::try_into)
.map_err(Error::InvalidRequest)?; .map_err(Error::InvalidRequest)?;
let __progenitor_url = format!("{}/", client.baseurl,); let __progenitor_url = format!("{}/", __progenitor_client.baseurl,);
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?; let __progenitor_request = __progenitor_client
let __progenitor_result = client.client.execute(__progenitor_request).await; .client
.post(__progenitor_url)
.json(&body)
.build()?;
let __progenitor_result = __progenitor_client
.client
.execute(__progenitor_request)
.await;
let __progenitor_response = __progenitor_result?; let __progenitor_response = __progenitor_result?;
match __progenitor_response.status().as_u16() { match __progenitor_response.status().as_u16() {
200..=299 => Ok(ResponseValue::stream(__progenitor_response)), 200..=299 => Ok(ResponseValue::stream(__progenitor_response)),