autogen-stedi 0.3.2

Auto-generated, strongly-typed Rust client for the Stedi APIs
Documentation
/*
 * 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 crate::core::models;
use serde::{Deserialize, Serialize};

/// TransactionSummary : The processed transactions that match the request criteria. The `items` array is empty if there are no matching transactions.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionSummary {
    /// A unique identifier for the processed transaction within Stedi. This ID is included in the transaction processed event. You can also retrieve it manually from the transaction's details page within the Stedi portal.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// A unique identifier for the processed file within Stedi. This ID is included in the transaction processed event. You can also retrieve it manually from the file's details page in the Stedi portal.
    #[serde(rename = "fileExecutionId")]
    pub file_execution_id: String,
    #[serde(rename = "status")]
    pub status: models::TransactionStatus,
    #[serde(rename = "direction")]
    pub direction: models::Direction,
    #[serde(rename = "mode")]
    pub mode: models::Mode,
    /// The date and time when Stedi processed the transaction, in ISO 8601 format. For example, `2023-08-28T00:00:00Z`.
    #[serde(rename = "processedAt")]
    pub processed_at: chrono::DateTime<chrono::FixedOffset>,
    /// A list of artifacts related to the transaction.
    #[serde(rename = "artifacts")]
    pub artifacts: Vec<models::Artifact>,
    #[serde(rename = "partnership")]
    pub partnership: Box<models::Partnership>,
    #[serde(rename = "x12", skip_serializing_if = "Option::is_none")]
    pub x12: Option<Box<models::X12TransactionSummary>>,
    #[serde(rename = "fragments", skip_serializing_if = "Option::is_none")]
    pub fragments: Option<Box<models::TransactionFragmentsSummary>>,
    /// Details about errors that prevented Stedi from processing the transaction.
    #[serde(rename = "translationErrors", skip_serializing_if = "Option::is_none")]
    pub translation_errors: Option<Vec<models::TranslationError>>,
    /// Any business identifiers extracted from the transaction.
    #[serde(rename = "businessIdentifiers", skip_serializing_if = "Option::is_none")]
    pub business_identifiers: Option<Vec<models::BusinessIdentifier>>,
}

impl TransactionSummary {
    /// The processed transactions that match the request criteria. The `items` array is empty if there are no matching transactions.
    pub fn new(transaction_id: String, file_execution_id: String, status: models::TransactionStatus, direction: models::Direction, mode: models::Mode, processed_at: chrono::DateTime<chrono::FixedOffset>, artifacts: Vec<models::Artifact>, partnership: models::Partnership) -> TransactionSummary {
        TransactionSummary {
            transaction_id,
            file_execution_id,
            status,
            direction,
            mode,
            processed_at,
            artifacts,
            partnership: Box::new(partnership),
            x12: None,
            fragments: None,
            translation_errors: None,
            business_identifiers: None,
        }
    }
}