use super::types;
use crate::{
ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt,
ResponseValue, encode_path,
};
#[derive(Debug, Clone)]
pub struct WorGetWorkflowDetails<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorGetWorkflowDetailsWorkflowName, String>,
}
impl<'a> WorGetWorkflowDetails<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorGetWorkflowDetailsWorkflowName>,
{
self.workflow_name = value.try_into().map_err(|_| {
"conversion to `WorGetWorkflowDetailsWorkflowName` for workflow_name failed"
.to_string()
});
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_get_workflow_details",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorCreateOrModifyWorkflow<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorCreateOrModifyWorkflowWorkflowName, String>,
body: Result<types::builder::WorCreateOrModifyWorkflowBody, String>,
}
impl<'a> WorCreateOrModifyWorkflow<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
body: Ok(::std::default::Default::default()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorCreateOrModifyWorkflowWorkflowName>,
{
self.workflow_name = value.try_into().map_err(|_| {
"conversion to `WorCreateOrModifyWorkflowWorkflowName` for workflow_name failed"
.to_string()
});
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorCreateOrModifyWorkflowBody>,
<V as std::convert::TryInto<types::WorCreateOrModifyWorkflowBody>>::Error:
std::fmt::Display,
{
self.body = value.try_into().map(From::from).map_err(|s| {
format!(
"conversion to `WorCreateOrModifyWorkflowBody` for body failed: {}",
s
)
});
self
}
pub fn body<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::WorCreateOrModifyWorkflowBody,
) -> types::builder::WorCreateOrModifyWorkflowBody,
{
self.body = self.body.map(f);
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let body = body
.and_then(|v| {
types::WorCreateOrModifyWorkflowBody::try_from(v).map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_create_or_modify_workflow",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorDeleteWorkflow<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorDeleteWorkflowWorkflowName, String>,
}
impl<'a> WorDeleteWorkflow<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorDeleteWorkflowWorkflowName>,
{
self.workflow_name = value.try_into().map_err(|_| {
"conversion to `WorDeleteWorkflowWorkflowName` for workflow_name failed".to_string()
});
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_delete_workflow",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorListWorkflowInstances<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorListWorkflowInstancesWorkflowName, String>,
cursor: Result<::std::string::String, String>,
date_end: Result<::chrono::DateTime<::chrono::offset::Utc>, String>,
date_start: Result<::chrono::DateTime<::chrono::offset::Utc>, String>,
direction: Result<types::WorListWorkflowInstancesDirection, String>,
page: Result<f64, String>,
per_page: Result<f64, String>,
status: Result<types::WorListWorkflowInstancesStatus, String>,
}
impl<'a> WorListWorkflowInstances<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
cursor: Err("cursor was not initialized".to_string()),
date_end: Err("date_end was not initialized".to_string()),
date_start: Err("date_start was not initialized".to_string()),
direction: Err("direction was not initialized".to_string()),
page: Err("page was not initialized".to_string()),
per_page: Err("per_page was not initialized".to_string()),
status: Err("status was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorListWorkflowInstancesWorkflowName>,
{
self.workflow_name = value.try_into().map_err(|_| {
"conversion to `WorListWorkflowInstancesWorkflowName` for workflow_name failed"
.to_string()
});
self
}
pub fn cursor<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.cursor = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for cursor failed".to_string()
});
self
}
pub fn date_end<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
{
self . date_end = value . try_into () . map_err (| _ | "conversion to `:: chrono :: DateTime < :: chrono :: offset :: Utc >` for date_end failed" . to_string ()) ;
self
}
pub fn date_start<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
{
self . date_start = value . try_into () . map_err (| _ | "conversion to `:: chrono :: DateTime < :: chrono :: offset :: Utc >` for date_start failed" . to_string ()) ;
self
}
pub fn direction<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorListWorkflowInstancesDirection>,
{
self.direction = value.try_into().map_err(|_| {
"conversion to `WorListWorkflowInstancesDirection` for direction failed".to_string()
});
self
}
pub fn page<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<f64>,
{
self.page = value
.try_into()
.map_err(|_| "conversion to `f64` for page failed".to_string());
self
}
pub fn per_page<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<f64>,
{
self.per_page = value
.try_into()
.map_err(|_| "conversion to `f64` for per_page failed".to_string());
self
}
pub fn status<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorListWorkflowInstancesStatus>,
{
self.status = value.try_into().map_err(|_| {
"conversion to `WorListWorkflowInstancesStatus` for status failed".to_string()
});
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
cursor,
date_end,
date_start,
direction,
page,
per_page,
status,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let cursor = cursor.map_err(Error::InvalidRequest)?;
let date_end = date_end.map_err(Error::InvalidRequest)?;
let date_start = date_start.map_err(Error::InvalidRequest)?;
let direction = direction.map_err(Error::InvalidRequest)?;
let page = page.map_err(Error::InvalidRequest)?;
let per_page = per_page.map_err(Error::InvalidRequest)?;
let status = status.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("cursor", &cursor))
.query(&progenitor_client::QueryParam::new("date_end", &date_end))
.query(&progenitor_client::QueryParam::new(
"date_start",
&date_start,
))
.query(&progenitor_client::QueryParam::new("direction", &direction))
.query(&progenitor_client::QueryParam::new("page", &page))
.query(&progenitor_client::QueryParam::new("per_page", &per_page))
.query(&progenitor_client::QueryParam::new("status", &status))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_list_workflow_instances",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorCreateNewWorkflowInstance<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorCreateNewWorkflowInstanceWorkflowName, String>,
body: Result<types::builder::WorCreateNewWorkflowInstanceBody, String>,
}
impl<'a> WorCreateNewWorkflowInstance<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
body: Ok(::std::default::Default::default()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorCreateNewWorkflowInstanceWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorCreateNewWorkflowInstanceWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorCreateNewWorkflowInstanceBody>,
<V as std::convert::TryInto<types::WorCreateNewWorkflowInstanceBody>>::Error:
std::fmt::Display,
{
self.body = value.try_into().map(From::from).map_err(|s| {
format!(
"conversion to `WorCreateNewWorkflowInstanceBody` for body failed: {}",
s
)
});
self
}
pub fn body<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::WorCreateNewWorkflowInstanceBody,
) -> types::builder::WorCreateNewWorkflowInstanceBody,
{
self.body = self.body.map(f);
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let body = body
.and_then(|v| {
types::WorCreateNewWorkflowInstanceBody::try_from(v).map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_create_new_workflow_instance",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorDescribeWorkflowInstance<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorDescribeWorkflowInstanceWorkflowName, String>,
instance_id: Result<types::WorDescribeWorkflowInstanceInstanceId, String>,
}
impl<'a> WorDescribeWorkflowInstance<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
instance_id: Err("instance_id was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorDescribeWorkflowInstanceWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorDescribeWorkflowInstanceWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn instance_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorDescribeWorkflowInstanceInstanceId>,
{
self.instance_id = value.try_into().map_err(|_| {
"conversion to `WorDescribeWorkflowInstanceInstanceId` for instance_id failed"
.to_string()
});
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
instance_id,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let instance_id = instance_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
encode_path(&instance_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_describe_workflow_instance",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorSendEventWorkflowInstance<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorSendEventWorkflowInstanceWorkflowName, String>,
instance_id: Result<types::WorSendEventWorkflowInstanceInstanceId, String>,
event_type: Result<types::WorSendEventWorkflowInstanceEventType, String>,
body: Result<::serde_json::Map<::std::string::String, ::serde_json::Value>, String>,
}
impl<'a> WorSendEventWorkflowInstance<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
instance_id: Err("instance_id was not initialized".to_string()),
event_type: Err("event_type was not initialized".to_string()),
body: Err("body was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorSendEventWorkflowInstanceWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorSendEventWorkflowInstanceWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn instance_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorSendEventWorkflowInstanceInstanceId>,
{
self.instance_id = value.try_into().map_err(|_| {
"conversion to `WorSendEventWorkflowInstanceInstanceId` for instance_id failed"
.to_string()
});
self
}
pub fn event_type<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorSendEventWorkflowInstanceEventType>,
{
self.event_type = value.try_into().map_err(|_| {
"conversion to `WorSendEventWorkflowInstanceEventType` for event_type failed"
.to_string()
});
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
{
self . body = value . try_into () . map_err (| _ | "conversion to `:: serde_json :: Map < :: std :: string :: String , :: serde_json :: Value >` for body failed" . to_string ()) ;
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
instance_id,
event_type,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let instance_id = instance_id.map_err(Error::InvalidRequest)?;
let event_type = event_type.map_err(Error::InvalidRequest)?;
let body = body.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances/{}/events/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
encode_path(&instance_id.to_string()),
encode_path(&event_type.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_send_event_workflow_instance",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorChangeStatusWorkflowInstance<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorChangeStatusWorkflowInstanceWorkflowName, String>,
instance_id: Result<types::WorChangeStatusWorkflowInstanceInstanceId, String>,
body: Result<types::builder::WorChangeStatusWorkflowInstanceBody, String>,
}
impl<'a> WorChangeStatusWorkflowInstance<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
instance_id: Err("instance_id was not initialized".to_string()),
body: Ok(::std::default::Default::default()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorChangeStatusWorkflowInstanceWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorChangeStatusWorkflowInstanceWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn instance_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorChangeStatusWorkflowInstanceInstanceId>,
{
self . instance_id = value . try_into () . map_err (| _ | "conversion to `WorChangeStatusWorkflowInstanceInstanceId` for instance_id failed" . to_string ()) ;
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorChangeStatusWorkflowInstanceBody>,
<V as std::convert::TryInto<types::WorChangeStatusWorkflowInstanceBody>>::Error:
std::fmt::Display,
{
self.body = value.try_into().map(From::from).map_err(|s| {
format!(
"conversion to `WorChangeStatusWorkflowInstanceBody` for body failed: {}",
s
)
});
self
}
pub fn body<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::WorChangeStatusWorkflowInstanceBody,
) -> types::builder::WorChangeStatusWorkflowInstanceBody,
{
self.body = self.body.map(f);
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
instance_id,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let instance_id = instance_id.map_err(Error::InvalidRequest)?;
let body = body
.and_then(|v| {
types::WorChangeStatusWorkflowInstanceBody::try_from(v)
.map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances/{}/status",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
encode_path(&instance_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_change_status_workflow_instance",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorBatchCreateWorkflowInstance<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorBatchCreateWorkflowInstanceWorkflowName, String>,
body: Result<::std::vec::Vec<types::WorBatchCreateWorkflowInstanceBodyItem>, String>,
}
impl<'a> WorBatchCreateWorkflowInstance<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
body: Err("body was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorBatchCreateWorkflowInstanceWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorBatchCreateWorkflowInstanceWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<
::std::vec::Vec<types::WorBatchCreateWorkflowInstanceBodyItem>,
>,
{
self . body = value . try_into () . map_err (| _ | "conversion to `:: std :: vec :: Vec < WorBatchCreateWorkflowInstanceBodyItem >` for body failed" . to_string ()) ;
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let body = body.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances/batch",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_batch_create_workflow_instance",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorBatchTerminateWorkflowInstances<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorBatchTerminateWorkflowInstancesWorkflowName, String>,
body: Result<::std::vec::Vec<types::WorBatchTerminateWorkflowInstancesBodyItem>, String>,
}
impl<'a> WorBatchTerminateWorkflowInstances<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
body: Err("body was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorBatchTerminateWorkflowInstancesWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorBatchTerminateWorkflowInstancesWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<
::std::vec::Vec<types::WorBatchTerminateWorkflowInstancesBodyItem>,
>,
{
self . body = value . try_into () . map_err (| _ | "conversion to `:: std :: vec :: Vec < WorBatchTerminateWorkflowInstancesBodyItem >` for body failed" . to_string ()) ;
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let body = body.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances/batch/terminate",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_batch_terminate_workflow_instances",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorStatusTerminateWorkflowInstances<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorStatusTerminateWorkflowInstancesWorkflowName, String>,
}
impl<'a> WorStatusTerminateWorkflowInstances<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorStatusTerminateWorkflowInstancesWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorStatusTerminateWorkflowInstancesWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/instances/terminate",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_status_terminate_workflow_instances",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorListWorkflowVersions<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorListWorkflowVersionsWorkflowName, String>,
page: Result<f64, String>,
per_page: Result<f64, String>,
}
impl<'a> WorListWorkflowVersions<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
page: Err("page was not initialized".to_string()),
per_page: Err("per_page was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorListWorkflowVersionsWorkflowName>,
{
self.workflow_name = value.try_into().map_err(|_| {
"conversion to `WorListWorkflowVersionsWorkflowName` for workflow_name failed"
.to_string()
});
self
}
pub fn page<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<f64>,
{
self.page = value
.try_into()
.map_err(|_| "conversion to `f64` for page failed".to_string());
self
}
pub fn per_page<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<f64>,
{
self.per_page = value
.try_into()
.map_err(|_| "conversion to `f64` for per_page failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
page,
per_page,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let page = page.map_err(Error::InvalidRequest)?;
let per_page = per_page.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/versions",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("page", &page))
.query(&progenitor_client::QueryParam::new("per_page", &per_page))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_list_workflow_versions",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorDescribeWorkflowVersions<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorDescribeWorkflowVersionsWorkflowName, String>,
version_id: Result<::uuid::Uuid, String>,
}
impl<'a> WorDescribeWorkflowVersions<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
version_id: Err("version_id was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorDescribeWorkflowVersionsWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorDescribeWorkflowVersionsWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn version_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.version_id = value
.try_into()
.map_err(|_| "conversion to `:: uuid :: Uuid` for version_id failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
version_id,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let version_id = version_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/versions/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
encode_path(&version_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_describe_workflow_versions",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorDescribeWorkflowVersionsDag<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorDescribeWorkflowVersionsDagWorkflowName, String>,
version_id: Result<::uuid::Uuid, String>,
}
impl<'a> WorDescribeWorkflowVersionsDag<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
version_id: Err("version_id was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorDescribeWorkflowVersionsDagWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorDescribeWorkflowVersionsDagWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn version_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.version_id = value
.try_into()
.map_err(|_| "conversion to `:: uuid :: Uuid` for version_id failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
version_id,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let version_id = version_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/versions/{}/dag",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
encode_path(&version_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_describe_workflow_versions_dag",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct WorDescribeWorkflowVersionsGraph<'a> {
client: &'a crate::Client,
account_id: Result<::std::string::String, String>,
workflow_name: Result<types::WorDescribeWorkflowVersionsGraphWorkflowName, String>,
version_id: Result<::uuid::Uuid, String>,
}
impl<'a> WorDescribeWorkflowVersionsGraph<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
workflow_name: Err("workflow_name was not initialized".to_string()),
version_id: Err("version_id was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.account_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for account_id failed".to_string()
});
self
}
pub fn workflow_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::WorDescribeWorkflowVersionsGraphWorkflowName>,
{
self . workflow_name = value . try_into () . map_err (| _ | "conversion to `WorDescribeWorkflowVersionsGraphWorkflowName` for workflow_name failed" . to_string ()) ;
self
}
pub fn version_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::uuid::Uuid>,
{
self.version_id = value
.try_into()
.map_err(|_| "conversion to `:: uuid :: Uuid` for version_id failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
workflow_name,
version_id,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let workflow_name = workflow_name.map_err(Error::InvalidRequest)?;
let version_id = version_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/workflows/{}/versions/{}/graph",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&workflow_name.to_string()),
encode_path(&version_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "wor_describe_workflow_versions_graph",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}