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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetExecutionResponseContent {
    /// The date and time when the resource was created, in ISO 8601 format. For example, `2023-08-28T00:00:00Z`.
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    /// The date and time when the resource was last updated, in ISO 8601 format. For example, `2023-08-28T00:00:00Z`.
    #[serde(rename = "updatedAt")]
    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
    /// 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 = "executionId")]
    pub execution_id: String,
    #[serde(rename = "status")]
    pub status: models::ExecutionStatus,
    #[serde(rename = "direction")]
    pub direction: models::Direction,
    /// The number of individual transactions included in the file.
    #[serde(rename = "transactionCount", skip_serializing_if = "Option::is_none")]
    pub transaction_count: Option<f64>,
    /// The number of errors that occurred during processing. If the file was successfully processed completely, this value is `0`.
    #[serde(rename = "faultCount", skip_serializing_if = "Option::is_none")]
    pub fault_count: Option<f64>,
    #[serde(rename = "faultCode", skip_serializing_if = "Option::is_none")]
    pub fault_code: Option<models::ExecutionFaultCode>,
    /// A message providing more information about the fault. Note that if there are multiple faults, Stedi sets the first fault as the code and corresponding message.
    #[serde(rename = "faultMessage", skip_serializing_if = "Option::is_none")]
    pub fault_message: Option<String>,
    #[serde(rename = "fileType", skip_serializing_if = "Option::is_none")]
    pub file_type: Option<models::FileType>,
    /// If `true`, you can retry the file in the Stedi portal.
    #[serde(rename = "retryable", skip_serializing_if = "Option::is_none")]
    pub retryable: Option<bool>,
    /// The ID of this execution's parent execution, if it is part of a retry chain. When you retry a file, Stedi creates a child execution with a new ID and links it to the original (parent) execution.
    #[serde(rename = "parentExecutionId", skip_serializing_if = "Option::is_none")]
    pub parent_execution_id: Option<String>,
    /// The ID of this execution's child execution, if it is part of a retry chain. When you retry a file, Stedi creates a child execution with a new ID and links it to the original (parent) execution.
    #[serde(rename = "childExecutionId", skip_serializing_if = "Option::is_none")]
    pub child_execution_id: Option<String>,
    /// The unique identifier for the partnership within the Stedi platform.  A partnership describes all aspects of the EDI relationship between two profiles in your Stedi account, such as which transaction sets they will exchange and other important information for processing EDI files.
    #[serde(rename = "partnershipId", skip_serializing_if = "Option::is_none")]
    pub partnership_id: Option<String>,
    #[serde(rename = "connectionType", skip_serializing_if = "Option::is_none")]
    pub connection_type: Option<models::CoreConnectionType>,
    /// An autogenerated identifier for the connection within the Stedi platform.
    #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")]
    pub connection_id: Option<String>,
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<Box<models::ExecutionSource>>,
    #[serde(rename = "mode")]
    pub mode: models::ExecutionMode,
    /// A list of artifacts related to the transaction. Input artifacts represent the original transaction data Stedi received before processing. Output artifacts represent the processed data.  For example, for an inbound 835 ERA from a payer, the input artifact would be the original X12 EDI, and the output artifact would be the JSON representation of the ERA.
    #[serde(rename = "artifacts", skip_serializing_if = "Option::is_none")]
    pub artifacts: Option<Vec<models::Artifact>>,
    /// Details about delivery attempts for outbound files./n/nStedi attempts to deliver a file to all configured connections every 6 minutes for up to 3 total attempts. If it cannot deliver the file after the third attempt, it marks the file execution as `FAILED` and emits the file failed event.
    #[serde(rename = "deliveryReports", skip_serializing_if = "Option::is_none")]
    pub delivery_reports: Option<Vec<models::DeliveryReport>>,
}

impl GetExecutionResponseContent {
    pub fn new(created_at: chrono::DateTime<chrono::FixedOffset>, updated_at: chrono::DateTime<chrono::FixedOffset>, execution_id: String, status: models::ExecutionStatus, direction: models::Direction, mode: models::ExecutionMode) -> GetExecutionResponseContent {
        GetExecutionResponseContent {
            created_at,
            updated_at,
            execution_id,
            status,
            direction,
            transaction_count: None,
            fault_count: None,
            fault_code: None,
            fault_message: None,
            file_type: None,
            retryable: None,
            parent_execution_id: None,
            child_execution_id: None,
            partnership_id: None,
            connection_type: None,
            connection_id: None,
            source: None,
            mode,
            artifacts: None,
            delivery_reports: None,
        }
    }
}