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

/// ExecutionFault : A failure to process a given file within stedi.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExecutionFault {
    /// 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>,
    #[serde(rename = "id")]
    pub id: String,
    /// A unique identifier for the processed file within Stedi.
    #[serde(rename = "executionId")]
    pub execution_id: String,
    #[serde(rename = "faultCode")]
    pub fault_code: models::ExecutionFaultCode,
    #[serde(rename = "faultMessage")]
    pub fault_message: String,
    /// The unique identifier for the Stedi guide used to process the transactions in the file.  Stedi guides are machine-readable specifications that describe how to structure and validate EDI files for each transaction type.
    #[serde(rename = "guideId", skip_serializing_if = "Option::is_none")]
    pub guide_id: Option<String>,
    #[serde(rename = "receiverProfile", skip_serializing_if = "Option::is_none")]
    pub receiver_profile: Option<Box<models::ExecutionPartnershipProfile>>,
    #[serde(rename = "senderProfile", skip_serializing_if = "Option::is_none")]
    pub sender_profile: Option<Box<models::ExecutionPartnershipProfile>>,
    #[serde(rename = "translateFaultContext", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub translate_fault_context: Option<Option<serde_json::Value>>,
    #[serde(rename = "transactionSetIdentifier", skip_serializing_if = "Option::is_none")]
    pub transaction_set_identifier: Option<String>,
    #[serde(rename = "release", skip_serializing_if = "Option::is_none")]
    pub release: Option<String>,
    #[serde(rename = "artifacts", skip_serializing_if = "Option::is_none")]
    pub artifacts: Option<Vec<models::Artifact>>,
}

impl ExecutionFault {
    /// A failure to process a given file within stedi.
    pub fn new(created_at: chrono::DateTime<chrono::FixedOffset>, id: String, execution_id: String, fault_code: models::ExecutionFaultCode, fault_message: String) -> ExecutionFault {
        ExecutionFault {
            created_at,
            id,
            execution_id,
            fault_code,
            fault_message,
            guide_id: None,
            receiver_profile: None,
            sender_profile: None,
            translate_fault_context: None,
            transaction_set_identifier: None,
            release: None,
            artifacts: None,
        }
    }
}