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 DeliveryReport {
    /// 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>,
    /// A unique identifier for the delivery attempt.
    #[serde(rename = "id")]
    pub 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 = "executionId")]
    pub execution_id: String,
    /// An identifier for the partnership within the Stedi platform.
    #[serde(rename = "partnershipId")]
    pub partnership_id: String,
    #[serde(rename = "connectionType")]
    pub connection_type: models::CoreConnectionType,
    /// An autogenerated identifier for the connection within the Stedi platform.
    #[serde(rename = "connectionId")]
    pub connection_id: String,
    /// The attempt number for the delivery.
    #[serde(rename = "attempt")]
    pub attempt: f64,
    /// The name of the file Stedi attempted to deliver.
    #[serde(rename = "filename")]
    pub filename: String,
    #[serde(rename = "status")]
    pub status: models::DeliveryReportStatus,
    /// A message providing more information about the delivery attempt. For example `Delivered to sftp://transfer.us.stedi.com/outbound/06bdccdc-4ab9-4add-b1dc-a76a0183f299.x12'.
    #[serde(rename = "message")]
    pub message: String,
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Box<models::DeliveryReportMetadata>>,
}

impl DeliveryReport {
    pub fn new(created_at: chrono::DateTime<chrono::FixedOffset>, id: String, execution_id: String, partnership_id: String, connection_type: models::CoreConnectionType, connection_id: String, attempt: f64, filename: String, status: models::DeliveryReportStatus, message: String) -> DeliveryReport {
        DeliveryReport {
            created_at,
            id,
            execution_id,
            partnership_id,
            connection_type,
            connection_id,
            attempt,
            filename,
            status,
            message,
            metadata: None,
        }
    }
}