Rename internal `client` variable to help avoid collisions with input specs. (#600)
This commit is contained in:
parent
233cb80d94
commit
d5f92a0e46
|
@ -796,11 +796,11 @@ impl Generator {
|
|||
// collisions with the input spec. See:
|
||||
// https://github.com/oxidecomputer/progenitor/issues/288
|
||||
let internal_prefix = "__progenitor";
|
||||
let url_var = format_ident!("{internal_prefix}_url");
|
||||
let query_var = format_ident!("{internal_prefix}_query");
|
||||
let request_var = format_ident!("{internal_prefix}_request");
|
||||
let response_var = format_ident!("{internal_prefix}_response");
|
||||
let result_var = format_ident!("{internal_prefix}_result");
|
||||
let url_ident = format_ident!("{internal_prefix}_url");
|
||||
let query_ident = format_ident!("{internal_prefix}_query");
|
||||
let request_ident = format_ident!("{internal_prefix}_request");
|
||||
let response_ident = format_ident!("{internal_prefix}_response");
|
||||
let result_ident = format_ident!("{internal_prefix}_result");
|
||||
|
||||
// Generate code for query parameters.
|
||||
let query_items = method
|
||||
|
@ -812,12 +812,12 @@ impl Generator {
|
|||
let qn_ident = format_ident!("{}", ¶m.name);
|
||||
let res = if *required {
|
||||
quote! {
|
||||
#query_var.push((#qn, #qn_ident .to_string()));
|
||||
#query_ident.push((#qn, #qn_ident .to_string()));
|
||||
}
|
||||
} else {
|
||||
quote! {
|
||||
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 {
|
||||
let size = query_items.len();
|
||||
let query_build = quote! {
|
||||
let mut #query_var = Vec::with_capacity(#size);
|
||||
let mut #query_ident = Vec::with_capacity(#size);
|
||||
#(#query_items)*
|
||||
};
|
||||
let query_use = quote! {
|
||||
.query(&#query_var)
|
||||
.query(&#query_ident)
|
||||
};
|
||||
|
||||
(query_build, query_use)
|
||||
|
@ -914,7 +914,7 @@ impl Generator {
|
|||
|
||||
let url_path = method.path.compile(url_renames, client.clone());
|
||||
let url_path = quote! {
|
||||
let #url_var = #url_path;
|
||||
let #url_ident = #url_path;
|
||||
};
|
||||
|
||||
// Generate code to handle the body param.
|
||||
|
@ -976,22 +976,22 @@ impl Generator {
|
|||
let decode = match &response.typ {
|
||||
OperationResponseType::Type(_) => {
|
||||
quote! {
|
||||
ResponseValue::from_response(#response_var).await
|
||||
ResponseValue::from_response(#response_ident).await
|
||||
}
|
||||
}
|
||||
OperationResponseType::None => {
|
||||
quote! {
|
||||
Ok(ResponseValue::empty(#response_var))
|
||||
Ok(ResponseValue::empty(#response_ident))
|
||||
}
|
||||
}
|
||||
OperationResponseType::Raw => {
|
||||
quote! {
|
||||
Ok(ResponseValue::stream(#response_var))
|
||||
Ok(ResponseValue::stream(#response_ident))
|
||||
}
|
||||
}
|
||||
OperationResponseType::Upgrade => {
|
||||
quote! {
|
||||
ResponseValue::upgrade(#response_var).await
|
||||
ResponseValue::upgrade(#response_ident).await
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1026,7 +1026,7 @@ impl Generator {
|
|||
OperationResponseType::Type(_) => {
|
||||
quote! {
|
||||
Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(#response_var)
|
||||
ResponseValue::from_response(#response_ident)
|
||||
.await?
|
||||
))
|
||||
}
|
||||
|
@ -1034,14 +1034,14 @@ impl Generator {
|
|||
OperationResponseType::None => {
|
||||
quote! {
|
||||
Err(Error::ErrorResponse(
|
||||
ResponseValue::empty(#response_var)
|
||||
ResponseValue::empty(#response_ident)
|
||||
))
|
||||
}
|
||||
}
|
||||
OperationResponseType::Raw => {
|
||||
quote! {
|
||||
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() {
|
||||
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| {
|
||||
quote! {
|
||||
(#hook)(&#client.inner, &#request_var);
|
||||
(#hook)(&#client.inner, &#request_ident);
|
||||
}
|
||||
});
|
||||
let post_hook = self.settings.post_hook.as_ref().map(|hook| {
|
||||
quote! {
|
||||
(#hook)(&#client.inner, &#result_var);
|
||||
(#hook)(&#client.inner, &#result_ident);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1110,8 +1110,8 @@ impl Generator {
|
|||
|
||||
#headers_build
|
||||
|
||||
let #request_var = #client.client
|
||||
. #method_func (#url_var)
|
||||
let #request_ident = #client.client
|
||||
. #method_func (#url_ident)
|
||||
#accept_header
|
||||
#(#body_func)*
|
||||
#query_use
|
||||
|
@ -1120,14 +1120,14 @@ impl Generator {
|
|||
.build()?;
|
||||
|
||||
#pre_hook
|
||||
let #result_var = #client.client
|
||||
.execute(#request_var)
|
||||
let #result_ident = #client.client
|
||||
.execute(#request_ident)
|
||||
.await;
|
||||
#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...
|
||||
// 201 => ResponseValue::from_response(response).await,
|
||||
// 200..299 => ResponseValue::empty(response),
|
||||
|
@ -1429,6 +1429,7 @@ impl Generator {
|
|||
) -> Result<TokenStream> {
|
||||
let struct_name = sanitize(&method.operation_id, Case::Pascal);
|
||||
let struct_ident = format_ident!("{}", struct_name);
|
||||
let client_ident = format_ident!("__progenitor_client");
|
||||
|
||||
// Generate an ident for each parameter.
|
||||
let param_names = method
|
||||
|
@ -1646,7 +1647,7 @@ impl Generator {
|
|||
success,
|
||||
error,
|
||||
body,
|
||||
} = self.method_sig_body(method, quote! { client})?;
|
||||
} = self.method_sig_body(method, quote! { #client_ident })?;
|
||||
|
||||
let send_doc = format!(
|
||||
"Sends a `{}` request to `{}`",
|
||||
|
@ -1661,7 +1662,7 @@ impl Generator {
|
|||
> {
|
||||
// Destructure the builder for convenience.
|
||||
let Self {
|
||||
client,
|
||||
#client_ident,
|
||||
#( #param_names, )*
|
||||
} = self;
|
||||
|
||||
|
@ -1863,14 +1864,14 @@ impl Generator {
|
|||
#[doc = #struct_doc]
|
||||
#derive
|
||||
pub struct #struct_ident<'a> {
|
||||
client: &'a super::Client,
|
||||
#client_ident: &'a super::Client,
|
||||
#( #param_names: #param_types, )*
|
||||
}
|
||||
|
||||
impl<'a> #struct_ident<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
#client_ident: client,
|
||||
#( #param_names: #param_values, )*
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1863,19 +1863,23 @@ pub mod builder {
|
|||
///[`Client::control_hold`]: super::Client::control_hold
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ControlHold<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> ControlHold<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/control/hold`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/control/hold", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/control/hold", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1883,7 +1887,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1897,20 +1904,27 @@ pub mod builder {
|
|||
///[`Client::control_resume`]: super::Client::control_resume
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ControlResume<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> ControlResume<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/control/resume`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/control/resume", client.baseurl,);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -1924,14 +1938,14 @@ pub mod builder {
|
|||
///[`Client::task_get`]: super::Client::task_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> TaskGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -1948,14 +1962,17 @@ pub mod builder {
|
|||
|
||||
///Sends a `GET` request to `/v1/task/{task}`
|
||||
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 __progenitor_url = format!(
|
||||
"{}/v1/task/{}",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1963,7 +1980,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1977,19 +1997,23 @@ pub mod builder {
|
|||
///[`Client::tasks_get`]: super::Client::tasks_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TasksGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> TasksGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/tasks`
|
||||
pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1997,7 +2021,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2011,14 +2038,14 @@ pub mod builder {
|
|||
///[`Client::task_submit`]: super::Client::task_submit
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskSubmit<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::TaskSubmit, String>,
|
||||
}
|
||||
|
||||
impl<'a> TaskSubmit<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::TaskSubmit::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2044,12 +2071,15 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/tasks`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::TaskSubmitResult>, Error<()>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::TaskSubmit>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2058,7 +2088,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2072,7 +2105,7 @@ pub mod builder {
|
|||
///[`Client::task_events_get`]: super::Client::task_events_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskEventsGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
minseq: Result<Option<u32>, String>,
|
||||
}
|
||||
|
@ -2080,7 +2113,7 @@ pub mod builder {
|
|||
impl<'a> TaskEventsGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
minseq: Ok(None),
|
||||
}
|
||||
|
@ -2110,7 +2143,7 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/tasks/{task}/events`
|
||||
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskEvent>>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
task,
|
||||
minseq,
|
||||
} = self;
|
||||
|
@ -2118,14 +2151,14 @@ pub mod builder {
|
|||
let minseq = minseq.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/events",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let mut __progenitor_query = Vec::with_capacity(1usize);
|
||||
if let Some(v) = &minseq {
|
||||
__progenitor_query.push(("minseq", v.to_string()));
|
||||
}
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2134,7 +2167,10 @@ pub mod builder {
|
|||
)
|
||||
.query(&__progenitor_query)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2148,14 +2184,14 @@ pub mod builder {
|
|||
///[`Client::task_outputs_get`]: super::Client::task_outputs_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskOutputsGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> TaskOutputsGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -2172,14 +2208,17 @@ pub mod builder {
|
|||
|
||||
///Sends a `GET` request to `/v1/tasks/{task}/outputs`
|
||||
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 __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2187,7 +2226,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2201,7 +2243,7 @@ pub mod builder {
|
|||
///[`Client::task_output_download`]: super::Client::task_output_download
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskOutputDownload<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
output: Result<String, String>,
|
||||
}
|
||||
|
@ -2209,7 +2251,7 @@ pub mod builder {
|
|||
impl<'a> TaskOutputDownload<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task 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}`
|
||||
pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
task,
|
||||
output,
|
||||
} = self;
|
||||
|
@ -2246,12 +2288,15 @@ pub mod builder {
|
|||
let output = output.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs/{}",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
encode_path(&output.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
|
@ -2265,14 +2310,14 @@ pub mod builder {
|
|||
///[`Client::user_create`]: super::Client::user_create
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct UserCreate<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::UserCreate, String>,
|
||||
}
|
||||
|
||||
impl<'a> UserCreate<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::UserCreate::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2298,12 +2343,15 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/users`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::UserCreateResult>, Error<()>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::UserCreate>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/v1/users", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/v1/users", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2312,7 +2360,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2326,19 +2377,23 @@ pub mod builder {
|
|||
///[`Client::whoami`]: super::Client::whoami
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Whoami<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> Whoami<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/whoami`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/whoami", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/whoami", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2346,7 +2401,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2360,14 +2418,14 @@ pub mod builder {
|
|||
///[`Client::worker_bootstrap`]: super::Client::worker_bootstrap
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerBootstrap<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::WorkerBootstrap, String>,
|
||||
}
|
||||
|
||||
impl<'a> WorkerBootstrap<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::WorkerBootstrap::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2393,12 +2451,15 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/bootstrap`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkerBootstrapResult>, Error<()>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/v1/worker/bootstrap", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/v1/worker/bootstrap", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2407,7 +2468,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2421,19 +2485,23 @@ pub mod builder {
|
|||
///[`Client::worker_ping`]: super::Client::worker_ping
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerPing<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> WorkerPing<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/worker/ping`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/worker/ping", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/worker/ping", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2441,7 +2509,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2455,7 +2526,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_append`]: super::Client::worker_task_append
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerTaskAppend<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<types::builder::WorkerAppendTask, String>,
|
||||
}
|
||||
|
@ -2463,7 +2534,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskAppend<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
body: Ok(types::builder::WorkerAppendTask::default()),
|
||||
}
|
||||
|
@ -2502,18 +2573,29 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/task/{task}/append`
|
||||
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 body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/append",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2527,7 +2609,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_upload_chunk`]: super::Client::worker_task_upload_chunk
|
||||
#[derive(Debug)]
|
||||
pub struct WorkerTaskUploadChunk<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<reqwest::Body, String>,
|
||||
}
|
||||
|
@ -2535,7 +2617,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskUploadChunk<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task 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`
|
||||
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 body = body.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/chunk",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2584,7 +2670,10 @@ pub mod builder {
|
|||
)
|
||||
.body(body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2598,7 +2687,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_complete`]: super::Client::worker_task_complete
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerTaskComplete<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<types::builder::WorkerCompleteTask, String>,
|
||||
}
|
||||
|
@ -2606,7 +2695,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskComplete<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
body: Ok(types::builder::WorkerCompleteTask::default()),
|
||||
}
|
||||
|
@ -2645,18 +2734,29 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/task/{task}/complete`
|
||||
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 body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/complete",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2670,7 +2770,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_add_output`]: super::Client::worker_task_add_output
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerTaskAddOutput<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<types::builder::WorkerAddOutput, String>,
|
||||
}
|
||||
|
@ -2678,7 +2778,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskAddOutput<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
body: Ok(types::builder::WorkerAddOutput::default()),
|
||||
}
|
||||
|
@ -2715,18 +2815,29 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/task/{task}/output`
|
||||
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 body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/output",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2740,19 +2851,23 @@ pub mod builder {
|
|||
///[`Client::workers_list`]: super::Client::workers_list
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkersList<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> WorkersList<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/workers`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/workers", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/workers", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2760,7 +2875,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2774,20 +2892,27 @@ pub mod builder {
|
|||
///[`Client::workers_recycle`]: super::Client::workers_recycle
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkersRecycle<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> WorkersRecycle<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/workers/recycle`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/workers/recycle", client.baseurl,);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
|
|
@ -1863,19 +1863,23 @@ pub mod builder {
|
|||
///[`Client::control_hold`]: super::Client::control_hold
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ControlHold<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> ControlHold<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/control/hold`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/control/hold", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/control/hold", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1883,7 +1887,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1897,20 +1904,27 @@ pub mod builder {
|
|||
///[`Client::control_resume`]: super::Client::control_resume
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ControlResume<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> ControlResume<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/control/resume`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/control/resume", client.baseurl,);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -1924,14 +1938,14 @@ pub mod builder {
|
|||
///[`Client::task_get`]: super::Client::task_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> TaskGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -1948,14 +1962,17 @@ pub mod builder {
|
|||
|
||||
///Sends a `GET` request to `/v1/task/{task}`
|
||||
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 __progenitor_url = format!(
|
||||
"{}/v1/task/{}",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1963,7 +1980,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1977,19 +1997,23 @@ pub mod builder {
|
|||
///[`Client::tasks_get`]: super::Client::tasks_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TasksGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> TasksGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/tasks`
|
||||
pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1997,7 +2021,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2011,14 +2038,14 @@ pub mod builder {
|
|||
///[`Client::task_submit`]: super::Client::task_submit
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskSubmit<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::TaskSubmit, String>,
|
||||
}
|
||||
|
||||
impl<'a> TaskSubmit<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::TaskSubmit::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2044,12 +2071,15 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/tasks`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::TaskSubmitResult>, Error<()>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::TaskSubmit>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/v1/tasks", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2058,7 +2088,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2072,7 +2105,7 @@ pub mod builder {
|
|||
///[`Client::task_events_get`]: super::Client::task_events_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskEventsGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
minseq: Result<Option<u32>, String>,
|
||||
}
|
||||
|
@ -2080,7 +2113,7 @@ pub mod builder {
|
|||
impl<'a> TaskEventsGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
minseq: Ok(None),
|
||||
}
|
||||
|
@ -2110,7 +2143,7 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/tasks/{task}/events`
|
||||
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskEvent>>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
task,
|
||||
minseq,
|
||||
} = self;
|
||||
|
@ -2118,14 +2151,14 @@ pub mod builder {
|
|||
let minseq = minseq.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/events",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let mut __progenitor_query = Vec::with_capacity(1usize);
|
||||
if let Some(v) = &minseq {
|
||||
__progenitor_query.push(("minseq", v.to_string()));
|
||||
}
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2134,7 +2167,10 @@ pub mod builder {
|
|||
)
|
||||
.query(&__progenitor_query)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2148,14 +2184,14 @@ pub mod builder {
|
|||
///[`Client::task_outputs_get`]: super::Client::task_outputs_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskOutputsGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> TaskOutputsGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -2172,14 +2208,17 @@ pub mod builder {
|
|||
|
||||
///Sends a `GET` request to `/v1/tasks/{task}/outputs`
|
||||
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 __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2187,7 +2226,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2201,7 +2243,7 @@ pub mod builder {
|
|||
///[`Client::task_output_download`]: super::Client::task_output_download
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TaskOutputDownload<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
output: Result<String, String>,
|
||||
}
|
||||
|
@ -2209,7 +2251,7 @@ pub mod builder {
|
|||
impl<'a> TaskOutputDownload<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task 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}`
|
||||
pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
task,
|
||||
output,
|
||||
} = self;
|
||||
|
@ -2246,12 +2288,15 @@ pub mod builder {
|
|||
let output = output.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs/{}",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
encode_path(&output.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
|
@ -2265,14 +2310,14 @@ pub mod builder {
|
|||
///[`Client::user_create`]: super::Client::user_create
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct UserCreate<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::UserCreate, String>,
|
||||
}
|
||||
|
||||
impl<'a> UserCreate<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::UserCreate::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2298,12 +2343,15 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/users`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::UserCreateResult>, Error<()>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::UserCreate>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/v1/users", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/v1/users", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2312,7 +2360,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2326,19 +2377,23 @@ pub mod builder {
|
|||
///[`Client::whoami`]: super::Client::whoami
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Whoami<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> Whoami<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/whoami`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/whoami", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/whoami", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2346,7 +2401,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2360,14 +2418,14 @@ pub mod builder {
|
|||
///[`Client::worker_bootstrap`]: super::Client::worker_bootstrap
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerBootstrap<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::WorkerBootstrap, String>,
|
||||
}
|
||||
|
||||
impl<'a> WorkerBootstrap<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::WorkerBootstrap::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2393,12 +2451,15 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/bootstrap`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkerBootstrapResult>, Error<()>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/v1/worker/bootstrap", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/v1/worker/bootstrap", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2407,7 +2468,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2421,19 +2485,23 @@ pub mod builder {
|
|||
///[`Client::worker_ping`]: super::Client::worker_ping
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerPing<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> WorkerPing<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/worker/ping`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/worker/ping", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/worker/ping", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2441,7 +2509,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2455,7 +2526,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_append`]: super::Client::worker_task_append
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerTaskAppend<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<types::builder::WorkerAppendTask, String>,
|
||||
}
|
||||
|
@ -2463,7 +2534,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskAppend<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
body: Ok(types::builder::WorkerAppendTask::default()),
|
||||
}
|
||||
|
@ -2502,18 +2573,29 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/task/{task}/append`
|
||||
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 body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/append",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2527,7 +2609,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_upload_chunk`]: super::Client::worker_task_upload_chunk
|
||||
#[derive(Debug)]
|
||||
pub struct WorkerTaskUploadChunk<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<reqwest::Body, String>,
|
||||
}
|
||||
|
@ -2535,7 +2617,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskUploadChunk<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task 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`
|
||||
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 body = body.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/chunk",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2584,7 +2670,10 @@ pub mod builder {
|
|||
)
|
||||
.body(body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2598,7 +2687,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_complete`]: super::Client::worker_task_complete
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerTaskComplete<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<types::builder::WorkerCompleteTask, String>,
|
||||
}
|
||||
|
@ -2606,7 +2695,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskComplete<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
body: Ok(types::builder::WorkerCompleteTask::default()),
|
||||
}
|
||||
|
@ -2645,18 +2734,29 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/task/{task}/complete`
|
||||
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 body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/complete",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2670,7 +2770,7 @@ pub mod builder {
|
|||
///[`Client::worker_task_add_output`]: super::Client::worker_task_add_output
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkerTaskAddOutput<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
task: Result<String, String>,
|
||||
body: Result<types::builder::WorkerAddOutput, String>,
|
||||
}
|
||||
|
@ -2678,7 +2778,7 @@ pub mod builder {
|
|||
impl<'a> WorkerTaskAddOutput<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
task: Err("task was not initialized".to_string()),
|
||||
body: Ok(types::builder::WorkerAddOutput::default()),
|
||||
}
|
||||
|
@ -2715,18 +2815,29 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/v1/worker/task/{task}/output`
|
||||
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 body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/output",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2740,19 +2851,23 @@ pub mod builder {
|
|||
///[`Client::workers_list`]: super::Client::workers_list
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkersList<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> WorkersList<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/workers`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/workers", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/v1/workers", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2760,7 +2875,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2774,20 +2892,27 @@ pub mod builder {
|
|||
///[`Client::workers_recycle`]: super::Client::workers_recycle
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WorkersRecycle<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> WorkersRecycle<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/workers/recycle`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/v1/workers/recycle", client.baseurl,);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
|
|
@ -1065,7 +1065,7 @@ pub mod builder {
|
|||
///[`Client::enrol`]: super::Client::enrol
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Enrol<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::EnrolBody, String>,
|
||||
}
|
||||
|
@ -1073,7 +1073,7 @@ pub mod builder {
|
|||
impl<'a> Enrol<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::EnrolBody::default()),
|
||||
}
|
||||
|
@ -1111,7 +1111,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/enrol`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1119,16 +1119,19 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::EnrolBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -1142,14 +1145,14 @@ pub mod builder {
|
|||
///[`Client::global_jobs`]: super::Client::global_jobs
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct GlobalJobs<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> GlobalJobs<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -1167,14 +1170,14 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/global/jobs`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::GlobalJobsResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
} = self;
|
||||
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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1183,7 +1186,10 @@ pub mod builder {
|
|||
)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1197,14 +1203,14 @@ pub mod builder {
|
|||
///[`Client::ping`]: super::Client::ping
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Ping<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> Ping<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -1222,14 +1228,14 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/ping`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::PingResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
} = self;
|
||||
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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1238,7 +1244,10 @@ pub mod builder {
|
|||
)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1252,7 +1261,7 @@ pub mod builder {
|
|||
///[`Client::report_finish`]: super::Client::report_finish
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ReportFinish<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::ReportFinishBody, String>,
|
||||
}
|
||||
|
@ -1260,7 +1269,7 @@ pub mod builder {
|
|||
impl<'a> ReportFinish<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::ReportFinishBody::default()),
|
||||
}
|
||||
|
@ -1300,7 +1309,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/report/finish`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1308,10 +1317,10 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1321,7 +1330,10 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1335,7 +1347,7 @@ pub mod builder {
|
|||
///[`Client::report_output`]: super::Client::report_output
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ReportOutput<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::ReportOutputBody, String>,
|
||||
}
|
||||
|
@ -1343,7 +1355,7 @@ pub mod builder {
|
|||
impl<'a> ReportOutput<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::ReportOutputBody::default()),
|
||||
}
|
||||
|
@ -1383,7 +1395,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/report/output`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1391,10 +1403,10 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1404,7 +1416,10 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1418,7 +1433,7 @@ pub mod builder {
|
|||
///[`Client::report_start`]: super::Client::report_start
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ReportStart<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::ReportStartBody, String>,
|
||||
}
|
||||
|
@ -1426,7 +1441,7 @@ pub mod builder {
|
|||
impl<'a> ReportStart<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::ReportStartBody::default()),
|
||||
}
|
||||
|
@ -1464,7 +1479,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/report/start`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1472,10 +1487,10 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportStartBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1485,7 +1500,10 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
|
|
@ -1065,7 +1065,7 @@ pub mod builder {
|
|||
///[`Client::enrol`]: super::Client::enrol
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Enrol<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::EnrolBody, String>,
|
||||
}
|
||||
|
@ -1073,7 +1073,7 @@ pub mod builder {
|
|||
impl<'a> Enrol<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::EnrolBody::default()),
|
||||
}
|
||||
|
@ -1111,7 +1111,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/enrol`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1119,16 +1119,19 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::EnrolBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -1142,14 +1145,14 @@ pub mod builder {
|
|||
///[`Client::global_jobs`]: super::Client::global_jobs
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct GlobalJobs<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> GlobalJobs<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -1167,14 +1170,14 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/global/jobs`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::GlobalJobsResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
} = self;
|
||||
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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1183,7 +1186,10 @@ pub mod builder {
|
|||
)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1197,14 +1203,14 @@ pub mod builder {
|
|||
///[`Client::ping`]: super::Client::ping
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Ping<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
}
|
||||
|
||||
impl<'a> Ping<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -1222,14 +1228,14 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/ping`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::PingResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
} = self;
|
||||
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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1238,7 +1244,10 @@ pub mod builder {
|
|||
)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1252,7 +1261,7 @@ pub mod builder {
|
|||
///[`Client::report_finish`]: super::Client::report_finish
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ReportFinish<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::ReportFinishBody, String>,
|
||||
}
|
||||
|
@ -1260,7 +1269,7 @@ pub mod builder {
|
|||
impl<'a> ReportFinish<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::ReportFinishBody::default()),
|
||||
}
|
||||
|
@ -1300,7 +1309,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/report/finish`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1308,10 +1317,10 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1321,7 +1330,10 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1335,7 +1347,7 @@ pub mod builder {
|
|||
///[`Client::report_output`]: super::Client::report_output
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ReportOutput<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::ReportOutputBody, String>,
|
||||
}
|
||||
|
@ -1343,7 +1355,7 @@ pub mod builder {
|
|||
impl<'a> ReportOutput<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::ReportOutputBody::default()),
|
||||
}
|
||||
|
@ -1383,7 +1395,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/report/output`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1391,10 +1403,10 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1404,7 +1416,10 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -1418,7 +1433,7 @@ pub mod builder {
|
|||
///[`Client::report_start`]: super::Client::report_start
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ReportStart<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
authorization: Result<String, String>,
|
||||
body: Result<types::builder::ReportStartBody, String>,
|
||||
}
|
||||
|
@ -1426,7 +1441,7 @@ pub mod builder {
|
|||
impl<'a> ReportStart<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
authorization: Err("authorization was not initialized".to_string()),
|
||||
body: Ok(types::builder::ReportStartBody::default()),
|
||||
}
|
||||
|
@ -1464,7 +1479,7 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/report/start`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
authorization,
|
||||
body,
|
||||
} = self;
|
||||
|
@ -1472,10 +1487,10 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportStartBody>::try_into)
|
||||
.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);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -1485,7 +1500,10 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
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
|
@ -104,7 +104,7 @@ pub mod builder {
|
|||
///[`Client::key_get`]: super::Client::key_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct KeyGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
key: Result<Option<bool>, String>,
|
||||
unique_key: Result<Option<String>, String>,
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ pub mod builder {
|
|||
impl<'a> KeyGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
key: Ok(None),
|
||||
unique_key: Ok(None),
|
||||
}
|
||||
|
@ -143,13 +143,13 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/key`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
key,
|
||||
unique_key,
|
||||
} = self;
|
||||
let key = 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);
|
||||
if let Some(v) = &key {
|
||||
__progenitor_query.push(("key", v.to_string()));
|
||||
|
@ -157,12 +157,15 @@ pub mod builder {
|
|||
if let Some(v) = &unique_key {
|
||||
__progenitor_query.push(("uniqueKey", v.to_string()));
|
||||
}
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.query(&__progenitor_query)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
|
|
@ -104,7 +104,7 @@ pub mod builder {
|
|||
///[`Client::key_get`]: super::Client::key_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct KeyGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
key: Result<Option<bool>, String>,
|
||||
unique_key: Result<Option<String>, String>,
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ pub mod builder {
|
|||
impl<'a> KeyGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
key: Ok(None),
|
||||
unique_key: Ok(None),
|
||||
}
|
||||
|
@ -143,13 +143,13 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/key`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
key,
|
||||
unique_key,
|
||||
} = self;
|
||||
let key = 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);
|
||||
if let Some(v) = &key {
|
||||
__progenitor_query.push(("key", v.to_string()));
|
||||
|
@ -157,12 +157,15 @@ pub mod builder {
|
|||
if let Some(v) = &unique_key {
|
||||
__progenitor_query.push(("uniqueKey", v.to_string()));
|
||||
}
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.query(&__progenitor_query)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
|
|
@ -2113,21 +2113,25 @@ pub mod builder {
|
|||
///[`Client::instance_get`]: super::Client::instance_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> InstanceGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/instance`
|
||||
pub async fn send(
|
||||
self,
|
||||
) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2135,7 +2139,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2155,14 +2162,14 @@ pub mod builder {
|
|||
///[`Client::instance_ensure`]: super::Client::instance_ensure
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceEnsure<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::InstanceEnsureRequest, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceEnsure<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::InstanceEnsureRequest::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2192,12 +2199,15 @@ pub mod builder {
|
|||
pub async fn send(
|
||||
self,
|
||||
) -> Result<ResponseValue<types::InstanceEnsureResponse>, Error<types::Error>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2206,7 +2216,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
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
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceIssueCrucibleSnapshotRequest<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
id: Result<uuid::Uuid, String>,
|
||||
snapshot_id: Result<uuid::Uuid, String>,
|
||||
}
|
||||
|
@ -2234,7 +2247,7 @@ pub mod builder {
|
|||
impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
id: Err("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}`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
id,
|
||||
snapshot_id,
|
||||
} = self;
|
||||
|
@ -2272,11 +2285,11 @@ pub mod builder {
|
|||
let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/instance/disk/{}/snapshot/{}",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&id.to_string()),
|
||||
encode_path(&snapshot_id.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2284,7 +2297,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2304,14 +2320,14 @@ pub mod builder {
|
|||
///[`Client::instance_migrate_status`]: super::Client::instance_migrate_status
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceMigrateStatus<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::InstanceMigrateStatusRequest, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceMigrateStatus<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::InstanceMigrateStatusRequest::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2341,12 +2357,16 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<types::InstanceMigrateStatusResponse>, Error<types::Error>>
|
||||
{
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/instance/migrate/status", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url =
|
||||
format!("{}/instance/migrate/status", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2355,7 +2375,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2375,21 +2398,25 @@ pub mod builder {
|
|||
///[`Client::instance_serial`]: super::Client::instance_serial
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceSerial<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> InstanceSerial<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/instance/serial`
|
||||
pub async fn send(
|
||||
self,
|
||||
) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/instance/serial", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/instance/serial", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(reqwest::header::CONNECTION, "Upgrade")
|
||||
|
@ -2403,7 +2430,10 @@ pub mod builder {
|
|||
),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
|
@ -2418,14 +2448,14 @@ pub mod builder {
|
|||
///[`Client::instance_state_put`]: super::Client::instance_state_put
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceStatePut<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::InstanceStateRequested, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceStatePut<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Err("body was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -2442,10 +2472,13 @@ pub mod builder {
|
|||
|
||||
///Sends a `PUT` request to `/instance/state`
|
||||
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 __progenitor_url = format!("{}/instance/state", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/instance/state", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2454,7 +2487,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2474,14 +2510,14 @@ pub mod builder {
|
|||
///[`Client::instance_state_monitor`]: super::Client::instance_state_monitor
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceStateMonitor<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::InstanceStateMonitorRequest, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceStateMonitor<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::InstanceStateMonitorRequest::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2511,12 +2547,16 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<types::InstanceStateMonitorResponse>, Error<types::Error>>
|
||||
{
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/instance/state-monitor", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url =
|
||||
format!("{}/instance/state-monitor", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2525,7 +2565,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
|
|
@ -2119,21 +2119,25 @@ pub mod builder {
|
|||
///[`Client::instance_get`]: super::Client::instance_get
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceGet<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> InstanceGet<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/instance`
|
||||
pub async fn send(
|
||||
self,
|
||||
) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2141,7 +2145,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2161,14 +2168,14 @@ pub mod builder {
|
|||
///[`Client::instance_ensure`]: super::Client::instance_ensure
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceEnsure<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::InstanceEnsureRequest, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceEnsure<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::InstanceEnsureRequest::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2198,12 +2205,15 @@ pub mod builder {
|
|||
pub async fn send(
|
||||
self,
|
||||
) -> Result<ResponseValue<types::InstanceEnsureResponse>, Error<types::Error>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/instance", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2212,7 +2222,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
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
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceIssueCrucibleSnapshotRequest<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
id: Result<uuid::Uuid, String>,
|
||||
snapshot_id: Result<uuid::Uuid, String>,
|
||||
}
|
||||
|
@ -2240,7 +2253,7 @@ pub mod builder {
|
|||
impl<'a> InstanceIssueCrucibleSnapshotRequest<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
id: Err("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}`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
|
||||
let Self {
|
||||
client,
|
||||
__progenitor_client,
|
||||
id,
|
||||
snapshot_id,
|
||||
} = self;
|
||||
|
@ -2278,11 +2291,11 @@ pub mod builder {
|
|||
let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!(
|
||||
"{}/instance/disk/{}/snapshot/{}",
|
||||
client.baseurl,
|
||||
__progenitor_client.baseurl,
|
||||
encode_path(&id.to_string()),
|
||||
encode_path(&snapshot_id.to_string()),
|
||||
);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2290,7 +2303,10 @@ pub mod builder {
|
|||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2310,14 +2326,14 @@ pub mod builder {
|
|||
///[`Client::instance_migrate_status`]: super::Client::instance_migrate_status
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceMigrateStatus<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::InstanceMigrateStatusRequest, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceMigrateStatus<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::InstanceMigrateStatusRequest::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2347,12 +2363,16 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<types::InstanceMigrateStatusResponse>, Error<types::Error>>
|
||||
{
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/instance/migrate/status", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url =
|
||||
format!("{}/instance/migrate/status", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2361,7 +2381,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
@ -2381,21 +2404,25 @@ pub mod builder {
|
|||
///[`Client::instance_serial`]: super::Client::instance_serial
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceSerial<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
}
|
||||
|
||||
impl<'a> InstanceSerial<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self { client }
|
||||
Self {
|
||||
__progenitor_client: client,
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/instance/serial`
|
||||
pub async fn send(
|
||||
self,
|
||||
) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> {
|
||||
let Self { client } = self;
|
||||
let __progenitor_url = format!("{}/instance/serial", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
} = self;
|
||||
let __progenitor_url = format!("{}/instance/serial", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(reqwest::header::CONNECTION, "Upgrade")
|
||||
|
@ -2409,7 +2436,10 @@ pub mod builder {
|
|||
),
|
||||
)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
|
@ -2424,14 +2454,14 @@ pub mod builder {
|
|||
///[`Client::instance_state_put`]: super::Client::instance_state_put
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceStatePut<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::InstanceStateRequested, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceStatePut<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Err("body was not initialized".to_string()),
|
||||
}
|
||||
}
|
||||
|
@ -2448,10 +2478,13 @@ pub mod builder {
|
|||
|
||||
///Sends a `PUT` request to `/instance/state`
|
||||
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 __progenitor_url = format!("{}/instance/state", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url = format!("{}/instance/state", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2460,7 +2493,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
|
@ -2480,14 +2516,14 @@ pub mod builder {
|
|||
///[`Client::instance_state_monitor`]: super::Client::instance_state_monitor
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InstanceStateMonitor<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::InstanceStateMonitorRequest, String>,
|
||||
}
|
||||
|
||||
impl<'a> InstanceStateMonitor<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::InstanceStateMonitorRequest::default()),
|
||||
}
|
||||
}
|
||||
|
@ -2517,12 +2553,16 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<types::InstanceStateMonitorResponse>, Error<types::Error>>
|
||||
{
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/instance/state-monitor", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
let __progenitor_url =
|
||||
format!("{}/instance/state-monitor", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
|
@ -2531,7 +2571,10 @@ pub mod builder {
|
|||
)
|
||||
.json(&body)
|
||||
.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?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
|
|
|
@ -309,14 +309,14 @@ pub mod builder {
|
|||
///[`Client::default_params`]: super::Client::default_params
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DefaultParams<'a> {
|
||||
client: &'a super::Client,
|
||||
__progenitor_client: &'a super::Client,
|
||||
body: Result<types::builder::BodyWithDefaults, String>,
|
||||
}
|
||||
|
||||
impl<'a> DefaultParams<'a> {
|
||||
pub fn new(client: &'a super::Client) -> Self {
|
||||
Self {
|
||||
client,
|
||||
__progenitor_client: client,
|
||||
body: Ok(types::builder::BodyWithDefaults::default()),
|
||||
}
|
||||
}
|
||||
|
@ -344,13 +344,23 @@ pub mod builder {
|
|||
|
||||
///Sends a `POST` request to `/`
|
||||
pub async fn send(self) -> Result<ResponseValue<ByteStream>, Error<ByteStream>> {
|
||||
let Self { client, body } = self;
|
||||
let Self {
|
||||
__progenitor_client,
|
||||
body,
|
||||
} = self;
|
||||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::BodyWithDefaults>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let __progenitor_url = format!("{}/", client.baseurl,);
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_url = format!("{}/", __progenitor_client.baseurl,);
|
||||
let __progenitor_request = __progenitor_client
|
||||
.client
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let __progenitor_result = __progenitor_client
|
||||
.client
|
||||
.execute(__progenitor_request)
|
||||
.await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
|
|
Loading…
Reference in New Issue