Prefix internal variable names to help avoid collisions (#599)
This commit is contained in:
parent
f367c43961
commit
233cb80d94
|
@ -792,6 +792,16 @@ impl Generator {
|
|||
method: &OperationMethod,
|
||||
client: TokenStream,
|
||||
) -> Result<MethodSigBody> {
|
||||
// We prefix internal variable names to mitigate possible name
|
||||
// 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");
|
||||
|
||||
// Generate code for query parameters.
|
||||
let query_items = method
|
||||
.params
|
||||
|
@ -802,12 +812,12 @@ impl Generator {
|
|||
let qn_ident = format_ident!("{}", ¶m.name);
|
||||
let res = if *required {
|
||||
quote! {
|
||||
query.push((#qn, #qn_ident .to_string()));
|
||||
#query_var.push((#qn, #qn_ident .to_string()));
|
||||
}
|
||||
} else {
|
||||
quote! {
|
||||
if let Some(v) = & #qn_ident {
|
||||
query.push((#qn, v.to_string()));
|
||||
#query_var.push((#qn, v.to_string()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -823,11 +833,11 @@ impl Generator {
|
|||
} else {
|
||||
let size = query_items.len();
|
||||
let query_build = quote! {
|
||||
let mut query = Vec::with_capacity(#size);
|
||||
let mut #query_var = Vec::with_capacity(#size);
|
||||
#(#query_items)*
|
||||
};
|
||||
let query_use = quote! {
|
||||
.query(&query)
|
||||
.query(&#query_var)
|
||||
};
|
||||
|
||||
(query_build, query_use)
|
||||
|
@ -903,6 +913,9 @@ impl Generator {
|
|||
.collect();
|
||||
|
||||
let url_path = method.path.compile(url_renames, client.clone());
|
||||
let url_path = quote! {
|
||||
let #url_var = #url_path;
|
||||
};
|
||||
|
||||
// Generate code to handle the body param.
|
||||
let body_func = method.params.iter().filter_map(|param| {
|
||||
|
@ -963,22 +976,22 @@ impl Generator {
|
|||
let decode = match &response.typ {
|
||||
OperationResponseType::Type(_) => {
|
||||
quote! {
|
||||
ResponseValue::from_response(response).await
|
||||
ResponseValue::from_response(#response_var).await
|
||||
}
|
||||
}
|
||||
OperationResponseType::None => {
|
||||
quote! {
|
||||
Ok(ResponseValue::empty(response))
|
||||
Ok(ResponseValue::empty(#response_var))
|
||||
}
|
||||
}
|
||||
OperationResponseType::Raw => {
|
||||
quote! {
|
||||
Ok(ResponseValue::stream(response))
|
||||
Ok(ResponseValue::stream(#response_var))
|
||||
}
|
||||
}
|
||||
OperationResponseType::Upgrade => {
|
||||
quote! {
|
||||
ResponseValue::upgrade(response).await
|
||||
ResponseValue::upgrade(#response_var).await
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1013,7 +1026,7 @@ impl Generator {
|
|||
OperationResponseType::Type(_) => {
|
||||
quote! {
|
||||
Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response)
|
||||
ResponseValue::from_response(#response_var)
|
||||
.await?
|
||||
))
|
||||
}
|
||||
|
@ -1021,14 +1034,14 @@ impl Generator {
|
|||
OperationResponseType::None => {
|
||||
quote! {
|
||||
Err(Error::ErrorResponse(
|
||||
ResponseValue::empty(response)
|
||||
ResponseValue::empty(#response_var)
|
||||
))
|
||||
}
|
||||
}
|
||||
OperationResponseType::Raw => {
|
||||
quote! {
|
||||
Err(Error::ErrorResponse(
|
||||
ResponseValue::stream(response)
|
||||
ResponseValue::stream(#response_var)
|
||||
))
|
||||
}
|
||||
}
|
||||
|
@ -1073,17 +1086,19 @@ impl Generator {
|
|||
// API description.
|
||||
let default_response = match method.responses.iter().last() {
|
||||
Some(response) if response.status_code.is_default() => quote! {},
|
||||
_ => quote! { _ => Err(Error::UnexpectedResponse(response)), },
|
||||
_ => {
|
||||
quote! { _ => Err(Error::UnexpectedResponse(#response_var)), }
|
||||
}
|
||||
};
|
||||
|
||||
let pre_hook = self.settings.pre_hook.as_ref().map(|hook| {
|
||||
quote! {
|
||||
(#hook)(&#client.inner, &request);
|
||||
(#hook)(&#client.inner, &#request_var);
|
||||
}
|
||||
});
|
||||
let post_hook = self.settings.post_hook.as_ref().map(|hook| {
|
||||
quote! {
|
||||
(#hook)(&#client.inner, &result);
|
||||
(#hook)(&#client.inner, &#result_var);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1095,8 +1110,8 @@ impl Generator {
|
|||
|
||||
#headers_build
|
||||
|
||||
let request = #client.client
|
||||
. #method_func (url)
|
||||
let #request_var = #client.client
|
||||
. #method_func (#url_var)
|
||||
#accept_header
|
||||
#(#body_func)*
|
||||
#query_use
|
||||
|
@ -1105,14 +1120,14 @@ impl Generator {
|
|||
.build()?;
|
||||
|
||||
#pre_hook
|
||||
let result = #client.client
|
||||
.execute(request)
|
||||
let #result_var = #client.client
|
||||
.execute(#request_var)
|
||||
.await;
|
||||
#post_hook
|
||||
|
||||
let response = result?;
|
||||
let #response_var = #result_var?;
|
||||
|
||||
match response.status().as_u16() {
|
||||
match #response_var.status().as_u16() {
|
||||
// These will be of the form...
|
||||
// 201 => ResponseValue::from_response(response).await,
|
||||
// 200..299 => ResponseValue::empty(response),
|
||||
|
|
|
@ -50,7 +50,7 @@ impl PathTemplate {
|
|||
});
|
||||
|
||||
quote! {
|
||||
let url = format!(#fmt, #client.baseurl, #(#components,)*);
|
||||
format!(#fmt, #client.baseurl, #(#components,)*)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,10 +306,10 @@ mod tests {
|
|||
let t = parse("/measure/{number}").unwrap();
|
||||
let out = t.compile(rename, quote::quote! { self });
|
||||
let want = quote::quote! {
|
||||
let url = format!("{}/measure/{}",
|
||||
format!("{}/measure/{}",
|
||||
self.baseurl,
|
||||
encode_path(&number.to_string()),
|
||||
);
|
||||
)
|
||||
};
|
||||
assert_eq!(want.to_string(), out.to_string());
|
||||
}
|
||||
|
@ -326,12 +326,12 @@ mod tests {
|
|||
let t = parse("/abc/def:{one}:jkl/{two}/a:{three}").unwrap();
|
||||
let out = t.compile(rename, quote::quote! { self });
|
||||
let want = quote::quote! {
|
||||
let url = format!("{}/abc/def:{}:jkl/{}/a:{}",
|
||||
format!("{}/abc/def:{}:jkl/{}/a:{}",
|
||||
self.baseurl,
|
||||
encode_path(&one.to_string()),
|
||||
encode_path(&two.to_string()),
|
||||
encode_path(&three.to_string()),
|
||||
);
|
||||
)
|
||||
};
|
||||
assert_eq!(want.to_string(), out.to_string());
|
||||
}
|
||||
|
|
|
@ -1874,20 +1874,20 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/v1/control/hold`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/control/hold", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/control/hold", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1908,13 +1908,13 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/v1/control/resume`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/control/resume", client.baseurl,);
|
||||
let request = client.client.post(url).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
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 __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1950,24 +1950,24 @@ pub mod builder {
|
|||
pub async fn send(self) -> Result<ResponseValue<types::Task>, Error<()>> {
|
||||
let Self { client, task } = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/task/{}",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1988,20 +1988,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/tasks`
|
||||
pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2048,21 +2048,21 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::TaskSubmit>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2116,29 +2116,29 @@ pub mod builder {
|
|||
} = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let minseq = minseq.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/events",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let mut query = Vec::with_capacity(1usize);
|
||||
let mut __progenitor_query = Vec::with_capacity(1usize);
|
||||
if let Some(v) = &minseq {
|
||||
query.push(("minseq", v.to_string()));
|
||||
__progenitor_query.push(("minseq", v.to_string()));
|
||||
}
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.query(&query)
|
||||
.query(&__progenitor_query)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2174,24 +2174,24 @@ pub mod builder {
|
|||
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskOutput>>, Error<()>> {
|
||||
let Self { client, task } = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2244,18 +2244,18 @@ pub mod builder {
|
|||
} = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let output = output.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs/{}",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
encode_path(&output.to_string()),
|
||||
);
|
||||
let request = client.client.get(url).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2302,21 +2302,21 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::UserCreate>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/v1/users", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/users", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2337,20 +2337,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/whoami`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/whoami", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/whoami", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2397,21 +2397,21 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/v1/worker/bootstrap", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/worker/bootstrap", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2432,20 +2432,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/worker/ping`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/worker/ping", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/worker/ping", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2507,17 +2507,17 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/append",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client.client.post(url).json(&body).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2566,14 +2566,14 @@ pub mod builder {
|
|||
let Self { client, task, body } = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let body = body.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/chunk",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -2584,11 +2584,11 @@ pub mod builder {
|
|||
)
|
||||
.body(body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2650,17 +2650,17 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/complete",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client.client.post(url).json(&body).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2720,17 +2720,17 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/output",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client.client.post(url).json(&body).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2751,20 +2751,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/workers`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/workers", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/workers", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2785,13 +2785,13 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/v1/workers/recycle`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/workers/recycle", client.baseurl,);
|
||||
let request = client.client.post(url).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
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 __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1874,20 +1874,20 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/v1/control/hold`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/control/hold", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/control/hold", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1908,13 +1908,13 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/v1/control/resume`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/control/resume", client.baseurl,);
|
||||
let request = client.client.post(url).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
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 __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1950,24 +1950,24 @@ pub mod builder {
|
|||
pub async fn send(self) -> Result<ResponseValue<types::Task>, Error<()>> {
|
||||
let Self { client, task } = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/task/{}",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1988,20 +1988,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/tasks`
|
||||
pub async fn send(self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2048,21 +2048,21 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::TaskSubmit>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/tasks", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2116,29 +2116,29 @@ pub mod builder {
|
|||
} = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let minseq = minseq.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/events",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let mut query = Vec::with_capacity(1usize);
|
||||
let mut __progenitor_query = Vec::with_capacity(1usize);
|
||||
if let Some(v) = &minseq {
|
||||
query.push(("minseq", v.to_string()));
|
||||
__progenitor_query.push(("minseq", v.to_string()));
|
||||
}
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.query(&query)
|
||||
.query(&__progenitor_query)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2174,24 +2174,24 @@ pub mod builder {
|
|||
pub async fn send(self) -> Result<ResponseValue<Vec<types::TaskOutput>>, Error<()>> {
|
||||
let Self { client, task } = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2244,18 +2244,18 @@ pub mod builder {
|
|||
} = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let output = output.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs/{}",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
encode_path(&output.to_string()),
|
||||
);
|
||||
let request = client.client.get(url).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2302,21 +2302,21 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::UserCreate>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/v1/users", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/users", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2337,20 +2337,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/whoami`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/whoami", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/whoami", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2397,21 +2397,21 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerBootstrap>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/v1/worker/bootstrap", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/worker/bootstrap", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2432,20 +2432,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/worker/ping`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/worker/ping", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/worker/ping", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2507,17 +2507,17 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAppendTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/append",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client.client.post(url).json(&body).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2566,14 +2566,14 @@ pub mod builder {
|
|||
let Self { client, task, body } = self;
|
||||
let task = task.map_err(Error::InvalidRequest)?;
|
||||
let body = body.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/chunk",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -2584,11 +2584,11 @@ pub mod builder {
|
|||
)
|
||||
.body(body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2650,17 +2650,17 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerCompleteTask>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/complete",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client.client.post(url).json(&body).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2720,17 +2720,17 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::WorkerAddOutput>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/output",
|
||||
client.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = client.client.post(url).json(&body).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2751,20 +2751,20 @@ pub mod builder {
|
|||
///Sends a `GET` request to `/v1/workers`
|
||||
pub async fn send(self) -> Result<ResponseValue<types::WorkersResult>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/workers", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/v1/workers", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2785,13 +2785,13 @@ pub mod builder {
|
|||
///Sends a `POST` request to `/v1/workers/recycle`
|
||||
pub async fn send(self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/v1/workers/recycle", client.baseurl,);
|
||||
let request = client.client.post(url).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
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 __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,32 +313,32 @@ impl Client {
|
|||
impl Client {
|
||||
///Sends a `POST` request to `/v1/control/hold`
|
||||
pub async fn control_hold<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!("{}/v1/control/hold", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/control/hold", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/control/resume`
|
||||
pub async fn control_resume<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!("{}/v1/control/resume", self.baseurl,);
|
||||
let request = self.client.post(url).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_url = format!("{}/v1/control/resume", self.baseurl,);
|
||||
let __progenitor_request = self.client.post(__progenitor_url).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,43 +347,43 @@ impl Client {
|
|||
&'a self,
|
||||
task: &'a str,
|
||||
) -> Result<ResponseValue<types::Task>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/task/{}",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/tasks`
|
||||
pub async fn tasks_get<'a>(&'a self) -> Result<ResponseValue<Vec<types::Task>>, Error<()>> {
|
||||
let url = format!("{}/v1/tasks", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/tasks", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -392,21 +392,21 @@ impl Client {
|
|||
&'a self,
|
||||
body: &'a types::TaskSubmit,
|
||||
) -> Result<ResponseValue<types::TaskSubmitResult>, Error<()>> {
|
||||
let url = format!("{}/v1/tasks", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/tasks", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -416,30 +416,30 @@ impl Client {
|
|||
task: &'a str,
|
||||
minseq: Option<u32>,
|
||||
) -> Result<ResponseValue<Vec<types::TaskEvent>>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/events",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let mut query = Vec::with_capacity(1usize);
|
||||
let mut __progenitor_query = Vec::with_capacity(1usize);
|
||||
if let Some(v) = &minseq {
|
||||
query.push(("minseq", v.to_string()));
|
||||
__progenitor_query.push(("minseq", v.to_string()));
|
||||
}
|
||||
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.query(&query)
|
||||
.query(&__progenitor_query)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -448,24 +448,24 @@ impl Client {
|
|||
&'a self,
|
||||
task: &'a str,
|
||||
) -> Result<ResponseValue<Vec<types::TaskOutput>>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -475,18 +475,18 @@ impl Client {
|
|||
task: &'a str,
|
||||
output: &'a str,
|
||||
) -> Result<ResponseValue<ByteStream>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/tasks/{}/outputs/{}",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
encode_path(&output.to_string()),
|
||||
);
|
||||
let request = self.client.get(url).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = self.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -495,40 +495,40 @@ impl Client {
|
|||
&'a self,
|
||||
body: &'a types::UserCreate,
|
||||
) -> Result<ResponseValue<types::UserCreateResult>, Error<()>> {
|
||||
let url = format!("{}/v1/users", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/users", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `GET` request to `/v1/whoami`
|
||||
pub async fn whoami<'a>(&'a self) -> Result<ResponseValue<types::WhoamiResult>, Error<()>> {
|
||||
let url = format!("{}/v1/whoami", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/whoami", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -537,21 +537,21 @@ impl Client {
|
|||
&'a self,
|
||||
body: &'a types::WorkerBootstrap,
|
||||
) -> Result<ResponseValue<types::WorkerBootstrapResult>, Error<()>> {
|
||||
let url = format!("{}/v1/worker/bootstrap", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/worker/bootstrap", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -559,20 +559,20 @@ impl Client {
|
|||
pub async fn worker_ping<'a>(
|
||||
&'a self,
|
||||
) -> Result<ResponseValue<types::WorkerPingResult>, Error<()>> {
|
||||
let url = format!("{}/v1/worker/ping", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/worker/ping", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -582,17 +582,17 @@ impl Client {
|
|||
task: &'a str,
|
||||
body: &'a types::WorkerAppendTask,
|
||||
) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/append",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = self.client.post(url).json(&body).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = self.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -602,14 +602,14 @@ impl Client {
|
|||
task: &'a str,
|
||||
body: B,
|
||||
) -> Result<ResponseValue<types::UploadedChunk>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/chunk",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -620,11 +620,11 @@ impl Client {
|
|||
)
|
||||
.body(body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -634,17 +634,17 @@ impl Client {
|
|||
task: &'a str,
|
||||
body: &'a types::WorkerCompleteTask,
|
||||
) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/complete",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = self.client.post(url).json(&body).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = self.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -654,17 +654,17 @@ impl Client {
|
|||
task: &'a str,
|
||||
body: &'a types::WorkerAddOutput,
|
||||
) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/v1/worker/task/{}/output",
|
||||
self.baseurl,
|
||||
encode_path(&task.to_string()),
|
||||
);
|
||||
let request = self.client.post(url).json(&body).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = self.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -672,32 +672,32 @@ impl Client {
|
|||
pub async fn workers_list<'a>(
|
||||
&'a self,
|
||||
) -> Result<ResponseValue<types::WorkersResult>, Error<()>> {
|
||||
let url = format!("{}/v1/workers", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/v1/workers", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
///Sends a `POST` request to `/v1/workers/recycle`
|
||||
pub async fn workers_recycle<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!("{}/v1/workers/recycle", self.baseurl,);
|
||||
let request = self.client.post(url).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_url = format!("{}/v1/workers/recycle", self.baseurl,);
|
||||
let __progenitor_request = self.client.post(__progenitor_url).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1119,20 +1119,20 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::EnrolBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/enrol", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/enrol", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1171,23 +1171,23 @@ pub mod builder {
|
|||
authorization,
|
||||
} = self;
|
||||
let authorization = authorization.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/global/jobs", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/global/jobs", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1226,23 +1226,23 @@ pub mod builder {
|
|||
authorization,
|
||||
} = self;
|
||||
let authorization = authorization.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/ping", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/ping", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1308,12 +1308,12 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/report/finish", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/finish", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -1321,11 +1321,11 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1391,12 +1391,12 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/report/output", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/output", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -1404,11 +1404,11 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1472,12 +1472,12 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportStartBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/report/start", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/start", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -1485,11 +1485,11 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1119,20 +1119,20 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::EnrolBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/enrol", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/enrol", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1171,23 +1171,23 @@ pub mod builder {
|
|||
authorization,
|
||||
} = self;
|
||||
let authorization = authorization.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/global/jobs", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/global/jobs", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1226,23 +1226,23 @@ pub mod builder {
|
|||
authorization,
|
||||
} = self;
|
||||
let authorization = authorization.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/ping", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/ping", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1308,12 +1308,12 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportFinishBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/report/finish", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/finish", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -1321,11 +1321,11 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1391,12 +1391,12 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportOutputBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/report/output", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/output", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -1404,11 +1404,11 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1472,12 +1472,12 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::ReportStartBody>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/report/start", client.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/start", client.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -1485,11 +1485,11 @@ pub mod builder {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,20 +210,20 @@ impl Client {
|
|||
authorization: &'a str,
|
||||
body: &'a types::EnrolBody,
|
||||
) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!("{}/enrol", self.baseurl,);
|
||||
let __progenitor_url = format!("{}/enrol", self.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,23 +235,23 @@ impl Client {
|
|||
&'a self,
|
||||
authorization: &'a str,
|
||||
) -> Result<ResponseValue<types::GlobalJobsResult>, Error<()>> {
|
||||
let url = format!("{}/global/jobs", self.baseurl,);
|
||||
let __progenitor_url = format!("{}/global/jobs", self.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,23 +263,23 @@ impl Client {
|
|||
&'a self,
|
||||
authorization: &'a str,
|
||||
) -> Result<ResponseValue<types::PingResult>, Error<()>> {
|
||||
let url = format!("{}/ping", self.baseurl,);
|
||||
let __progenitor_url = format!("{}/ping", self.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,12 +293,12 @@ impl Client {
|
|||
authorization: &'a str,
|
||||
body: &'a types::ReportFinishBody,
|
||||
) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let url = format!("{}/report/finish", self.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/finish", self.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -306,11 +306,11 @@ impl Client {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -324,12 +324,12 @@ impl Client {
|
|||
authorization: &'a str,
|
||||
body: &'a types::ReportOutputBody,
|
||||
) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let url = format!("{}/report/output", self.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/output", self.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -337,11 +337,11 @@ impl Client {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -355,12 +355,12 @@ impl Client {
|
|||
authorization: &'a str,
|
||||
body: &'a types::ReportStartBody,
|
||||
) -> Result<ResponseValue<types::ReportResult>, Error<()>> {
|
||||
let url = format!("{}/report/start", self.baseurl,);
|
||||
let __progenitor_url = format!("{}/report/start", self.baseurl,);
|
||||
let mut header_map = HeaderMap::with_capacity(1usize);
|
||||
header_map.append("Authorization", HeaderValue::try_from(authorization)?);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
|
@ -368,11 +368,11 @@ impl Client {
|
|||
.json(&body)
|
||||
.headers(header_map)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -149,20 +149,24 @@ pub mod builder {
|
|||
} = self;
|
||||
let key = key.map_err(Error::InvalidRequest)?;
|
||||
let unique_key = unique_key.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/key", client.baseurl,);
|
||||
let mut query = Vec::with_capacity(2usize);
|
||||
let __progenitor_url = format!("{}/key", client.baseurl,);
|
||||
let mut __progenitor_query = Vec::with_capacity(2usize);
|
||||
if let Some(v) = &key {
|
||||
query.push(("key", v.to_string()));
|
||||
__progenitor_query.push(("key", v.to_string()));
|
||||
}
|
||||
if let Some(v) = &unique_key {
|
||||
query.push(("uniqueKey", v.to_string()));
|
||||
__progenitor_query.push(("uniqueKey", v.to_string()));
|
||||
}
|
||||
let request = client.client.get(url).query(&query).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.query(&__progenitor_query)
|
||||
.build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,20 +149,24 @@ pub mod builder {
|
|||
} = self;
|
||||
let key = key.map_err(Error::InvalidRequest)?;
|
||||
let unique_key = unique_key.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/key", client.baseurl,);
|
||||
let mut query = Vec::with_capacity(2usize);
|
||||
let __progenitor_url = format!("{}/key", client.baseurl,);
|
||||
let mut __progenitor_query = Vec::with_capacity(2usize);
|
||||
if let Some(v) = &key {
|
||||
query.push(("key", v.to_string()));
|
||||
__progenitor_query.push(("key", v.to_string()));
|
||||
}
|
||||
if let Some(v) = &unique_key {
|
||||
query.push(("uniqueKey", v.to_string()));
|
||||
__progenitor_query.push(("uniqueKey", v.to_string()));
|
||||
}
|
||||
let request = client.client.get(url).query(&query).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.query(&__progenitor_query)
|
||||
.build()?;
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,22 +86,26 @@ impl Client {
|
|||
key: Option<bool>,
|
||||
unique_key: Option<&'a str>,
|
||||
) -> Result<ResponseValue<()>, Error<()>> {
|
||||
let url = format!("{}/key", self.baseurl,);
|
||||
let mut query = Vec::with_capacity(2usize);
|
||||
let __progenitor_url = format!("{}/key", self.baseurl,);
|
||||
let mut __progenitor_query = Vec::with_capacity(2usize);
|
||||
if let Some(v) = &key {
|
||||
query.push(("key", v.to_string()));
|
||||
__progenitor_query.push(("key", v.to_string()));
|
||||
}
|
||||
|
||||
if let Some(v) = &unique_key {
|
||||
query.push(("uniqueKey", v.to_string()));
|
||||
__progenitor_query.push(("uniqueKey", v.to_string()));
|
||||
}
|
||||
|
||||
let request = self.client.get(url).query(&query).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(response)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(__progenitor_url)
|
||||
.query(&__progenitor_query)
|
||||
.build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2126,26 +2126,26 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/instance", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2196,27 +2196,27 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.put(url)
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2270,31 +2270,31 @@ pub mod builder {
|
|||
} = self;
|
||||
let id = id.map_err(Error::InvalidRequest)?;
|
||||
let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/instance/disk/{}/snapshot/{}",
|
||||
client.baseurl,
|
||||
encode_path(&id.to_string()),
|
||||
encode_path(&snapshot_id.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2345,27 +2345,27 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance/migrate/status", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/migrate/status", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2388,10 +2388,10 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/instance/serial", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/serial", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(reqwest::header::CONNECTION, "Upgrade")
|
||||
.header(reqwest::header::UPGRADE, "websocket")
|
||||
.header(reqwest::header::SEC_WEBSOCKET_VERSION, "13")
|
||||
|
@ -2403,12 +2403,12 @@ pub mod builder {
|
|||
),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(response).await,
|
||||
200..=299 => ResponseValue::upgrade(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
200..=299 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2444,27 +2444,27 @@ pub mod builder {
|
|||
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
|
||||
let Self { client, body } = self;
|
||||
let body = body.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance/state", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/state", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.put(url)
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2515,27 +2515,27 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance/state-monitor", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/state-monitor", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2132,26 +2132,26 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/instance", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2202,27 +2202,27 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceEnsureRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.put(url)
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2276,31 +2276,31 @@ pub mod builder {
|
|||
} = self;
|
||||
let id = id.map_err(Error::InvalidRequest)?;
|
||||
let snapshot_id = snapshot_id.map_err(Error::InvalidRequest)?;
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/instance/disk/{}/snapshot/{}",
|
||||
client.baseurl,
|
||||
encode_path(&id.to_string()),
|
||||
encode_path(&snapshot_id.to_string()),
|
||||
);
|
||||
let request = client
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2351,27 +2351,27 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceMigrateStatusRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance/migrate/status", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/migrate/status", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2394,10 +2394,10 @@ pub mod builder {
|
|||
self,
|
||||
) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> {
|
||||
let Self { client } = self;
|
||||
let url = format!("{}/instance/serial", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/serial", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(reqwest::header::CONNECTION, "Upgrade")
|
||||
.header(reqwest::header::UPGRADE, "websocket")
|
||||
.header(reqwest::header::SEC_WEBSOCKET_VERSION, "13")
|
||||
|
@ -2409,12 +2409,12 @@ pub mod builder {
|
|||
),
|
||||
)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(response).await,
|
||||
200..=299 => ResponseValue::upgrade(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
200..=299 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2450,27 +2450,27 @@ pub mod builder {
|
|||
pub async fn send(self) -> Result<ResponseValue<()>, Error<types::Error>> {
|
||||
let Self { client, body } = self;
|
||||
let body = body.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance/state", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/state", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.put(url)
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(response)),
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2521,27 +2521,27 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::InstanceStateMonitorRequest>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/instance/state-monitor", client.baseurl,);
|
||||
let request = client
|
||||
let __progenitor_url = format!("{}/instance/state-monitor", client.baseurl,);
|
||||
let __progenitor_request = client
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = client.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -671,26 +671,26 @@ impl Client {
|
|||
pub async fn instance_get<'a>(
|
||||
&'a self,
|
||||
) -> Result<ResponseValue<types::InstanceGetResponse>, Error<types::Error>> {
|
||||
let url = format!("{}/instance", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/instance", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -699,27 +699,27 @@ impl Client {
|
|||
&'a self,
|
||||
body: &'a types::InstanceEnsureRequest,
|
||||
) -> Result<ResponseValue<types::InstanceEnsureResponse>, Error<types::Error>> {
|
||||
let url = format!("{}/instance", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/instance", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.put(url)
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
201u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -731,31 +731,31 @@ impl Client {
|
|||
id: &'a uuid::Uuid,
|
||||
snapshot_id: &'a uuid::Uuid,
|
||||
) -> Result<ResponseValue<()>, Error<types::Error>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/instance/disk/{}/snapshot/{}",
|
||||
self.baseurl,
|
||||
encode_path(&id.to_string()),
|
||||
encode_path(&snapshot_id.to_string()),
|
||||
);
|
||||
let request = self
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.post(url)
|
||||
.post(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -764,27 +764,27 @@ impl Client {
|
|||
&'a self,
|
||||
body: &'a types::InstanceMigrateStatusRequest,
|
||||
) -> Result<ResponseValue<types::InstanceMigrateStatusResponse>, Error<types::Error>> {
|
||||
let url = format!("{}/instance/migrate/status", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/instance/migrate/status", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -792,10 +792,10 @@ impl Client {
|
|||
pub async fn instance_serial<'a>(
|
||||
&'a self,
|
||||
) -> Result<ResponseValue<reqwest::Upgraded>, Error<reqwest::Upgraded>> {
|
||||
let url = format!("{}/instance/serial", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/instance/serial", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(reqwest::header::CONNECTION, "Upgrade")
|
||||
.header(reqwest::header::UPGRADE, "websocket")
|
||||
.header(reqwest::header::SEC_WEBSOCKET_VERSION, "13")
|
||||
|
@ -807,12 +807,12 @@ impl Client {
|
|||
),
|
||||
)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(response).await,
|
||||
200..=299 => ResponseValue::upgrade(response).await,
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
101u16 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
200..=299 => ResponseValue::upgrade(__progenitor_response).await,
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -821,27 +821,27 @@ impl Client {
|
|||
&'a self,
|
||||
body: types::InstanceStateRequested,
|
||||
) -> Result<ResponseValue<()>, Error<types::Error>> {
|
||||
let url = format!("{}/instance/state", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/instance/state", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.put(url)
|
||||
.put(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -850,27 +850,27 @@ impl Client {
|
|||
&'a self,
|
||||
body: &'a types::InstanceStateMonitorRequest,
|
||||
) -> Result<ResponseValue<types::InstanceStateMonitorResponse>, Error<types::Error>> {
|
||||
let url = format!("{}/instance/state-monitor", self.baseurl,);
|
||||
let request = self
|
||||
let __progenitor_url = format!("{}/instance/state-monitor", self.baseurl,);
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.json(&body)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(response).await,
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200u16 => ResponseValue::from_response(__progenitor_response).await,
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -348,13 +348,15 @@ pub mod builder {
|
|||
let body = body
|
||||
.and_then(std::convert::TryInto::<types::BodyWithDefaults>::try_into)
|
||||
.map_err(Error::InvalidRequest)?;
|
||||
let url = format!("{}/", client.baseurl,);
|
||||
let request = client.client.post(url).json(&body).build()?;
|
||||
let result = client.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(response)),
|
||||
_ => Err(Error::ErrorResponse(ResponseValue::stream(response))),
|
||||
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_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
_ => Err(Error::ErrorResponse(ResponseValue::stream(
|
||||
__progenitor_response,
|
||||
))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,13 +120,15 @@ impl Client {
|
|||
&'a self,
|
||||
body: &'a types::BodyWithDefaults,
|
||||
) -> Result<ResponseValue<ByteStream>, Error<ByteStream>> {
|
||||
let url = format!("{}/", self.baseurl,);
|
||||
let request = self.client.post(url).json(&body).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(response)),
|
||||
_ => Err(Error::ErrorResponse(ResponseValue::stream(response))),
|
||||
let __progenitor_url = format!("{}/", self.baseurl,);
|
||||
let __progenitor_request = self.client.post(__progenitor_url).json(&body).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
_ => Err(Error::ErrorResponse(ResponseValue::stream(
|
||||
__progenitor_response,
|
||||
))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,13 +88,15 @@ impl Client {
|
|||
pub async fn freeform_response<'a>(
|
||||
&'a self,
|
||||
) -> Result<ResponseValue<ByteStream>, Error<ByteStream>> {
|
||||
let url = format!("{}/", self.baseurl,);
|
||||
let request = self.client.get(url).build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(response)),
|
||||
_ => Err(Error::ErrorResponse(ResponseValue::stream(response))),
|
||||
let __progenitor_url = format!("{}/", self.baseurl,);
|
||||
let __progenitor_request = self.client.get(__progenitor_url).build()?;
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
200..=299 => Ok(ResponseValue::stream(__progenitor_response)),
|
||||
_ => Err(Error::ErrorResponse(ResponseValue::stream(
|
||||
__progenitor_response,
|
||||
))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,37 +94,37 @@ impl Client {
|
|||
in_: &'a str,
|
||||
use_: &'a str,
|
||||
) -> Result<ResponseValue<()>, Error<types::Error>> {
|
||||
let url = format!(
|
||||
let __progenitor_url = format!(
|
||||
"{}/{}/{}/{}",
|
||||
self.baseurl,
|
||||
encode_path(&ref_.to_string()),
|
||||
encode_path(&type_.to_string()),
|
||||
encode_path(&trait_.to_string()),
|
||||
);
|
||||
let mut query = Vec::with_capacity(3usize);
|
||||
query.push(("if", if_.to_string()));
|
||||
query.push(("in", in_.to_string()));
|
||||
query.push(("use", use_.to_string()));
|
||||
let request = self
|
||||
let mut __progenitor_query = Vec::with_capacity(3usize);
|
||||
__progenitor_query.push(("if", if_.to_string()));
|
||||
__progenitor_query.push(("in", in_.to_string()));
|
||||
__progenitor_query.push(("use", use_.to_string()));
|
||||
let __progenitor_request = self
|
||||
.client
|
||||
.get(url)
|
||||
.get(__progenitor_url)
|
||||
.header(
|
||||
reqwest::header::ACCEPT,
|
||||
reqwest::header::HeaderValue::from_static("application/json"),
|
||||
)
|
||||
.query(&query)
|
||||
.query(&__progenitor_query)
|
||||
.build()?;
|
||||
let result = self.client.execute(request).await;
|
||||
let response = result?;
|
||||
match response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(response)),
|
||||
let __progenitor_result = self.client.execute(__progenitor_request).await;
|
||||
let __progenitor_response = __progenitor_result?;
|
||||
match __progenitor_response.status().as_u16() {
|
||||
204u16 => Ok(ResponseValue::empty(__progenitor_response)),
|
||||
400u16..=499u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
500u16..=599u16 => Err(Error::ErrorResponse(
|
||||
ResponseValue::from_response(response).await?,
|
||||
ResponseValue::from_response(__progenitor_response).await?,
|
||||
)),
|
||||
_ => Err(Error::UnexpectedResponse(response)),
|
||||
_ => Err(Error::UnexpectedResponse(__progenitor_response)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue