/*
* Core
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2023-08-01
* Contact: core@stedi.com
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize, de::Error as _};
use crate::core::{apis::ResponseContent, models};
use super::{Error, configuration, ContentType};
/// struct for typed errors of method [`create_outbound_fragment`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateOutboundFragmentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`create_partnership_outbound_transaction`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreatePartnershipOutboundTransactionError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`create_transaction_group`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateTransactionGroupError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`generate_edi`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GenerateEdiError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`generate_transaction_group_edi`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GenerateTransactionGroupEdiError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_execution`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutionError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_execution_input_document`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutionInputDocumentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_execution_input_document_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutionInputDocumentUrlError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_execution_metadata_document`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutionMetadataDocumentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_execution_metadata_document_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutionMetadataDocumentUrlError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_execution_output_document`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutionOutputDocumentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_execution_output_document_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetExecutionOutputDocumentUrlError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_attachment_document`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionAttachmentDocumentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_attachment_document_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionAttachmentDocumentUrlError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_fragment`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionFragmentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_fragment_output_document`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionFragmentOutputDocumentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_fragment_output_document_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionFragmentOutputDocumentUrlError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_input_document`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionInputDocumentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_input_document_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionInputDocumentUrlError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_output_document`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionOutputDocumentError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_transaction_output_document_url`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTransactionOutputDocumentUrlError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_execution_faults`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListExecutionFaultsError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_execution_transactions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListExecutionTransactionsError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_executions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListExecutionsError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_polling_executions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListPollingExecutionsError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_polling_transactions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListPollingTransactionsError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_transactions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListTransactionsError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retry_event`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetryEventError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`retry_executions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetryExecutionsError {
Status400(models::BadRequestExceptionResponseContent),
Status401(models::UnauthorizedExceptionResponseContent),
Status403(models::AccessDeniedExceptionResponseContent),
Status404(models::ResourceNotFoundExceptionResponseContent),
Status409(models::ResourceUnderChangeExceptionResponseContent),
Status422(models::UnprocessableEntityExceptionResponseContent),
Status429(models::ThrottlingExceptionResponseContent),
Status500(models::ServiceExceptionResponseContent),
Status503(models::ServiceUnavailableExceptionResponseContent),
Status504(models::GatewayTimeoutExceptionResponseContent),
UnknownValue(serde_json::Value),
}
/// This endpoint stages a fragment for outbound delivery.
pub async fn create_outbound_fragment(configuration: &configuration::Configuration, fragment_group_id: &str, create_outbound_fragment_request_content: models::CreateOutboundFragmentRequestContent, idempotency_key: Option<&str>) -> Result<models::CreateOutboundFragmentResponseContent, Error<CreateOutboundFragmentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_fragment_group_id = fragment_group_id;
let p_body_create_outbound_fragment_request_content = create_outbound_fragment_request_content;
let p_header_idempotency_key = idempotency_key;
let uri_str = format!("{}/fragments/{fragmentGroupId}", configuration.base_path, fragmentGroupId=crate::core::apis::urlencode(p_path_fragment_group_id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_header_idempotency_key {
req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(&p_body_create_outbound_fragment_request_content);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateOutboundFragmentResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateOutboundFragmentResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateOutboundFragmentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint generates and delivers fully-formed EDI files containing a single transaction. It is the simplest way to generate EDI with Stedi.
pub async fn create_partnership_outbound_transaction(configuration: &configuration::Configuration, partnership_id: &str, transaction_setting_id: &str, create_partnership_outbound_transaction_request_content: models::CreatePartnershipOutboundTransactionRequestContent, idempotency_key: Option<&str>) -> Result<models::CreatePartnershipOutboundTransactionResponseContent, Error<CreatePartnershipOutboundTransactionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_partnership_id = partnership_id;
let p_path_transaction_setting_id = transaction_setting_id;
let p_body_create_partnership_outbound_transaction_request_content = create_partnership_outbound_transaction_request_content;
let p_header_idempotency_key = idempotency_key;
let uri_str = format!("{}/partnerships/{partnershipId}/transactions/{transactionSettingId}", configuration.base_path, partnershipId=crate::core::apis::urlencode(p_path_partnership_id), transactionSettingId=crate::core::apis::urlencode(p_path_transaction_setting_id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_header_idempotency_key {
req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(&p_body_create_partnership_outbound_transaction_request_content);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreatePartnershipOutboundTransactionResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreatePartnershipOutboundTransactionResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreatePartnershipOutboundTransactionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint stages a transaction for outbound delivery.
pub async fn create_transaction_group(configuration: &configuration::Configuration, partnership_id: &str, transaction_setting_id: &str, transaction_group_id: &str, idempotency_key: Option<&str>, create_transaction_group_request_content: Option<models::CreateTransactionGroupRequestContent>) -> Result<models::CreateTransactionGroupResponseContent, Error<CreateTransactionGroupError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_partnership_id = partnership_id;
let p_path_transaction_setting_id = transaction_setting_id;
let p_path_transaction_group_id = transaction_group_id;
let p_header_idempotency_key = idempotency_key;
let p_body_create_transaction_group_request_content = create_transaction_group_request_content;
let uri_str = format!("{}/partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/transactions/{transactionSettingId}", configuration.base_path, partnershipId=crate::core::apis::urlencode(p_path_partnership_id), transactionSettingId=crate::core::apis::urlencode(p_path_transaction_setting_id), transactionGroupId=crate::core::apis::urlencode(p_path_transaction_group_id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_header_idempotency_key {
req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(&p_body_create_transaction_group_request_content);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTransactionGroupResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateTransactionGroupResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateTransactionGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint generates and delivers fully-formed EDI files to your trading partners.
pub async fn generate_edi(configuration: &configuration::Configuration, partnership_id: &str, generate_edi_request_content: models::GenerateEdiRequestContent, idempotency_key: Option<&str>) -> Result<models::GenerateEdiResponseContent, Error<GenerateEdiError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_partnership_id = partnership_id;
let p_body_generate_edi_request_content = generate_edi_request_content;
let p_header_idempotency_key = idempotency_key;
let uri_str = format!("{}/x12/partnerships/{partnershipId}/generate-edi", configuration.base_path, partnershipId=crate::core::apis::urlencode(p_path_partnership_id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_header_idempotency_key {
req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(&p_body_generate_edi_request_content);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GenerateEdiResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GenerateEdiResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GenerateEdiError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint generates and delivers a fully-formed EDI file containing the staged transactions in the specified transaction group.
pub async fn generate_transaction_group_edi(configuration: &configuration::Configuration, partnership_id: &str, transaction_group_id: &str, idempotency_key: Option<&str>, generate_transaction_group_edi_request_content: Option<models::GenerateTransactionGroupEdiRequestContent>) -> Result<models::GenerateTransactionGroupEdiResponseContent, Error<GenerateTransactionGroupEdiError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_partnership_id = partnership_id;
let p_path_transaction_group_id = transaction_group_id;
let p_header_idempotency_key = idempotency_key;
let p_body_generate_transaction_group_edi_request_content = generate_transaction_group_edi_request_content;
let uri_str = format!("{}/partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/generate-edi", configuration.base_path, partnershipId=crate::core::apis::urlencode(p_path_partnership_id), transactionGroupId=crate::core::apis::urlencode(p_path_transaction_group_id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_header_idempotency_key {
req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(&p_body_generate_transaction_group_edi_request_content);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GenerateTransactionGroupEdiResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GenerateTransactionGroupEdiResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GenerateTransactionGroupEdiError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Retrieve the file execution details for a given `executionId`.
pub async fn get_execution(configuration: &configuration::Configuration, execution_id: &str) -> Result<models::GetExecutionResponseContent, Error<GetExecutionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let uri_str = format!("{}/executions/{executionId}", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExecutionResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetExecutionResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetExecutionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch a file execution's input document before any translation and mappings.
pub async fn get_execution_input_document(configuration: &configuration::Configuration, execution_id: &str) -> Result<(), Error<GetExecutionInputDocumentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let uri_str = format!("{}/executions/{executionId}/input", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetExecutionInputDocumentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint is used to retrieve an execution's input document before it passes through any translation and mappings. Generally, this will be EDI. This endpoint returns the document download URL, it must be then fetched for the actual document content. There are no size restrictions on documents when fetching from this endpoint.
pub async fn get_execution_input_document_url(configuration: &configuration::Configuration, execution_id: &str) -> Result<models::GetExecutionInputDocumentUrlResponseContent, Error<GetExecutionInputDocumentUrlError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let uri_str = format!("{}/executions/{executionId}/input-url", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExecutionInputDocumentUrlResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetExecutionInputDocumentUrlResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetExecutionInputDocumentUrlError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch a file execution's metadata document.
pub async fn get_execution_metadata_document(configuration: &configuration::Configuration, execution_id: &str) -> Result<(), Error<GetExecutionMetadataDocumentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let uri_str = format!("{}/executions/{executionId}/metadata", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetExecutionMetadataDocumentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint is used to retrieve a file execution's metadata document, limited to inbound/outbound x12 files. This endpoint returns the metadata document download URL, it must be then fetched for the actual document content. There are no size restrictions on documents when fetching from this endpoint.
pub async fn get_execution_metadata_document_url(configuration: &configuration::Configuration, execution_id: &str) -> Result<models::GetExecutionMetadataDocumentUrlResponseContent, Error<GetExecutionMetadataDocumentUrlError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let uri_str = format!("{}/executions/{executionId}/metadata-url", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExecutionMetadataDocumentUrlResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetExecutionMetadataDocumentUrlResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetExecutionMetadataDocumentUrlError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch a file execution's output document. Only available for outbound files.
pub async fn get_execution_output_document(configuration: &configuration::Configuration, execution_id: &str) -> Result<(), Error<GetExecutionOutputDocumentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let uri_str = format!("{}/executions/{executionId}/output", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetExecutionOutputDocumentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint is used to retrieve an execution's output document. This endpoint returns the document download URL, it must be then fetched for the actual document content. There are no size restrictions on documents when fetching from this endpoint.
pub async fn get_execution_output_document_url(configuration: &configuration::Configuration, execution_id: &str) -> Result<models::GetExecutionOutputDocumentUrlResponseContent, Error<GetExecutionOutputDocumentUrlError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let uri_str = format!("{}/executions/{executionId}/output-url", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetExecutionOutputDocumentUrlResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetExecutionOutputDocumentUrlResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetExecutionOutputDocumentUrlError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch details for a specific transaction.
pub async fn get_transaction(configuration: &configuration::Configuration, transaction_id: &str) -> Result<models::GetTransactionResponseContent, Error<GetTransactionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let uri_str = format!("{}/transactions/{transactionId}", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTransactionResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTransactionResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Retrieve a transaction's output document.
pub async fn get_transaction_attachment_document(configuration: &configuration::Configuration, transaction_id: &str, artifact_id: &str) -> Result<(), Error<GetTransactionAttachmentDocumentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let p_path_artifact_id = artifact_id;
let uri_str = format!("{}/transactions/{transactionId}/attachment/{artifactId}", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id), artifactId=crate::core::apis::urlencode(p_path_artifact_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionAttachmentDocumentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint is used to retrieve a transaction's attachment document url. This endpoint returns the document download URL, it must be then fetched for the actual document content. There are no size restrictions on documents when fetching from this endpoint.
pub async fn get_transaction_attachment_document_url(configuration: &configuration::Configuration, transaction_id: &str, artifact_id: &str) -> Result<models::GetTransactionAttachmentDocumentUrlResponseContent, Error<GetTransactionAttachmentDocumentUrlError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let p_path_artifact_id = artifact_id;
let uri_str = format!("{}/transactions/{transactionId}/attachment/{artifactId}/url", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id), artifactId=crate::core::apis::urlencode(p_path_artifact_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTransactionAttachmentDocumentUrlResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTransactionAttachmentDocumentUrlResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionAttachmentDocumentUrlError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Retrieve metadata for a fragment.
pub async fn get_transaction_fragment(configuration: &configuration::Configuration, transaction_id: &str, fragment_index: f64) -> Result<models::GetTransactionFragmentResponseContent, Error<GetTransactionFragmentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let p_path_fragment_index = fragment_index;
let uri_str = format!("{}/transactions/{transactionId}/fragments/{fragmentIndex}", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id), fragmentIndex=p_path_fragment_index);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTransactionFragmentResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTransactionFragmentResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionFragmentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Retrieve a transaction fragment's output document after it has been translated.
pub async fn get_transaction_fragment_output_document(configuration: &configuration::Configuration, transaction_id: &str, fragment_index: f64) -> Result<(), Error<GetTransactionFragmentOutputDocumentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let p_path_fragment_index = fragment_index;
let uri_str = format!("{}/transactions/{transactionId}/fragments/{fragmentIndex}/output", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id), fragmentIndex=p_path_fragment_index);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionFragmentOutputDocumentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint is used to retrieve a transaction fragment's output document URL after it has been translated via Core. This endpoint returns the document download URL, it must be then fetched for the actual document content. There are no size restrictions on documents when fetching from this endpoint, however they are generally smaller and consumable by nature of being a fragment.
pub async fn get_transaction_fragment_output_document_url(configuration: &configuration::Configuration, transaction_id: &str, fragment_index: f64) -> Result<models::GetTransactionFragmentOutputDocumentUrlResponseContent, Error<GetTransactionFragmentOutputDocumentUrlError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let p_path_fragment_index = fragment_index;
let uri_str = format!("{}/transactions/{transactionId}/fragments/{fragmentIndex}/output-url", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id), fragmentIndex=p_path_fragment_index);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTransactionFragmentOutputDocumentUrlResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTransactionFragmentOutputDocumentUrlResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionFragmentOutputDocumentUrlError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Retrieve a transaction's input document.
pub async fn get_transaction_input_document(configuration: &configuration::Configuration, transaction_id: &str) -> Result<(), Error<GetTransactionInputDocumentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let uri_str = format!("{}/transactions/{transactionId}/input", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionInputDocumentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint is used to retrieve a transaction's input document url before it passes through any translation and mappings, generally this will be EDI. This endpoint returns the document download URL, it must be then fetched for the actual document content. There are no size restrictions on documents when fetching from this endpoint.
pub async fn get_transaction_input_document_url(configuration: &configuration::Configuration, transaction_id: &str) -> Result<models::GetTransactionInputDocumentUrlResponseContent, Error<GetTransactionInputDocumentUrlError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let uri_str = format!("{}/transactions/{transactionId}/input-url", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTransactionInputDocumentUrlResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTransactionInputDocumentUrlResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionInputDocumentUrlError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Retrieve a transaction's output document.
pub async fn get_transaction_output_document(configuration: &configuration::Configuration, transaction_id: &str) -> Result<(), Error<GetTransactionOutputDocumentError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let uri_str = format!("{}/transactions/{transactionId}/output", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionOutputDocumentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint is used to retrieve a transaction's output document url after it has been translated via Core. This endpoint returns the document download URL, it must be then fetched for the actual document content. There are no size restrictions on documents when fetching from this endpoint.
pub async fn get_transaction_output_document_url(configuration: &configuration::Configuration, transaction_id: &str) -> Result<models::GetTransactionOutputDocumentUrlResponseContent, Error<GetTransactionOutputDocumentUrlError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_transaction_id = transaction_id;
let uri_str = format!("{}/transactions/{transactionId}/output-url", configuration.base_path, transactionId=crate::core::apis::urlencode(p_path_transaction_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTransactionOutputDocumentUrlResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTransactionOutputDocumentUrlResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTransactionOutputDocumentUrlError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch a list of faults for a given file execution, sorted by the date they were created from newest to oldest.
pub async fn list_execution_faults(configuration: &configuration::Configuration, execution_id: &str, page_size: Option<f64>, page_token: Option<&str>) -> Result<models::ListExecutionFaultsResponseContent, Error<ListExecutionFaultsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let p_query_page_size = page_size;
let p_query_page_token = page_token;
let uri_str = format!("{}/executions/{executionId}/faults", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_token {
req_builder = req_builder.query(&[("pageToken", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListExecutionFaultsResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListExecutionFaultsResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListExecutionFaultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch a list of transactions for a file execution, including the full transaction details.
pub async fn list_execution_transactions(configuration: &configuration::Configuration, execution_id: &str, page_size: Option<f64>, page_token: Option<&str>) -> Result<models::ListExecutionTransactionsResponseContent, Error<ListExecutionTransactionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_execution_id = execution_id;
let p_query_page_size = page_size;
let p_query_page_token = page_token;
let uri_str = format!("{}/executions/{executionId}/transactions", configuration.base_path, executionId=crate::core::apis::urlencode(p_path_execution_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_token {
req_builder = req_builder.query(&[("pageToken", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListExecutionTransactionsResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListExecutionTransactionsResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListExecutionTransactionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch a list of executions, sorted by the date they were created from newest to oldest.
pub async fn list_executions(configuration: &configuration::Configuration, page_size: Option<f64>, page_token: Option<&str>, direction: Option<models::Direction>, fault_code: Option<models::ExecutionFaultCode>, partnership_id: Option<&str>, status: Option<models::ExecutionStatus>, mode: Option<models::ExecutionMode>, from: Option<chrono::DateTime<chrono::FixedOffset>>, to: Option<chrono::DateTime<chrono::FixedOffset>>, display_name: Option<&str>) -> Result<models::ListExecutionsResponseContent, Error<ListExecutionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_page_size = page_size;
let p_query_page_token = page_token;
let p_query_direction = direction;
let p_query_fault_code = fault_code;
let p_query_partnership_id = partnership_id;
let p_query_status = status;
let p_query_mode = mode;
let p_query_from = from;
let p_query_to = to;
let p_query_display_name = display_name;
let uri_str = format!("{}/executions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_token {
req_builder = req_builder.query(&[("pageToken", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_fault_code {
req_builder = req_builder.query(&[("faultCode", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_partnership_id {
req_builder = req_builder.query(&[("partnershipId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_status {
req_builder = req_builder.query(&[("status", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_mode {
req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_from {
req_builder = req_builder.query(&[("from", ¶m_value.to_rfc3339_opts(chrono::SecondsFormat::Secs, true))]);
}
if let Some(ref param_value) = p_query_to {
req_builder = req_builder.query(&[("to", ¶m_value.to_rfc3339_opts(chrono::SecondsFormat::Secs, true))]);
}
if let Some(ref param_value) = p_query_display_name {
req_builder = req_builder.query(&[("displayName", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListExecutionsResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListExecutionsResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListExecutionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Poll for new file executions that Stedi has recently processed.
pub async fn list_polling_executions(configuration: &configuration::Configuration, page_size: Option<f64>, page_token: Option<&str>, start_date_time: Option<chrono::DateTime<chrono::FixedOffset>>) -> Result<models::ListPollingExecutionsResponseContent, Error<ListPollingExecutionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_page_size = page_size;
let p_query_page_token = page_token;
let p_query_start_date_time = start_date_time;
let uri_str = format!("{}/polling/executions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_token {
req_builder = req_builder.query(&[("pageToken", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_start_date_time {
req_builder = req_builder.query(&[("startDateTime", ¶m_value.to_rfc3339_opts(chrono::SecondsFormat::Secs, true))]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListPollingExecutionsResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListPollingExecutionsResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListPollingExecutionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Poll for new transactions that Stedi has processed.
pub async fn list_polling_transactions(configuration: &configuration::Configuration, page_size: Option<f64>, page_token: Option<&str>, start_date_time: Option<chrono::DateTime<chrono::FixedOffset>>) -> Result<models::ListPollingTransactionsResponseContent, Error<ListPollingTransactionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_page_size = page_size;
let p_query_page_token = page_token;
let p_query_start_date_time = start_date_time;
let uri_str = format!("{}/polling/transactions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_token {
req_builder = req_builder.query(&[("pageToken", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_start_date_time {
req_builder = req_builder.query(&[("startDateTime", ¶m_value.to_rfc3339_opts(chrono::SecondsFormat::Secs, true))]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListPollingTransactionsResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListPollingTransactionsResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListPollingTransactionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Fetch a list of transactions, sorted by the date they were created from newest to oldest.
pub async fn list_transactions(configuration: &configuration::Configuration, page_size: Option<f64>, page_token: Option<&str>, business_identifier: Option<&str>, transaction_set_id: Option<models::X12TransactionSetIdentifierCode>, sender: Option<&str>, receiver: Option<&str>, direction: Option<models::Direction>, mode: Option<models::Mode>, status: Option<models::TransactionStatus>, from: Option<chrono::DateTime<chrono::FixedOffset>>, to: Option<chrono::DateTime<chrono::FixedOffset>>, element_id: Option<&str>, partnership_id: Option<&str>) -> Result<models::ListTransactionsResponseContent, Error<ListTransactionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_page_size = page_size;
let p_query_page_token = page_token;
let p_query_business_identifier = business_identifier;
let p_query_transaction_set_id = transaction_set_id;
let p_query_sender = sender;
let p_query_receiver = receiver;
let p_query_direction = direction;
let p_query_mode = mode;
let p_query_status = status;
let p_query_from = from;
let p_query_to = to;
let p_query_element_id = element_id;
let p_query_partnership_id = partnership_id;
let uri_str = format!("{}/transactions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_token {
req_builder = req_builder.query(&[("pageToken", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_business_identifier {
req_builder = req_builder.query(&[("businessIdentifier", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_transaction_set_id {
req_builder = req_builder.query(&[("transactionSetId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sender {
req_builder = req_builder.query(&[("sender", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_receiver {
req_builder = req_builder.query(&[("receiver", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_mode {
req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_status {
req_builder = req_builder.query(&[("status", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_from {
req_builder = req_builder.query(&[("from", ¶m_value.to_rfc3339_opts(chrono::SecondsFormat::Secs, true))]);
}
if let Some(ref param_value) = p_query_to {
req_builder = req_builder.query(&[("to", ¶m_value.to_rfc3339_opts(chrono::SecondsFormat::Secs, true))]);
}
if let Some(ref param_value) = p_query_element_id {
req_builder = req_builder.query(&[("elementId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_partnership_id {
req_builder = req_builder.query(&[("partnershipId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListTransactionsResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListTransactionsResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListTransactionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// This endpoint retriggers the specified processing event.
pub async fn retry_event(configuration: &configuration::Configuration, event_id: &str) -> Result<models::RetryEventResponseContent, Error<RetryEventError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_event_id = event_id;
let uri_str = format!("{}/events/{eventId}/retry", configuration.base_path, eventId=crate::core::apis::urlencode(p_path_event_id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RetryEventResponseContent`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RetryEventResponseContent`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<RetryEventError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Queue file executions to be retried.
pub async fn retry_executions(configuration: &configuration::Configuration, retry_executions_request_content: models::RetryExecutionsRequestContent) -> Result<(), Error<RetryExecutionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_retry_executions_request_content = retry_executions_request_content;
let uri_str = format!("{}/executions/retry", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
req_builder = req_builder.json(&p_body_retry_executions_request_content);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<RetryExecutionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}