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 GenerateEdiRequestContent {
    #[serde(rename = "characterSet", skip_serializing_if = "Option::is_none")]
    pub character_set: Option<models::CoreCharacterSet>,
    #[serde(rename = "repairOptions", skip_serializing_if = "Option::is_none")]
    pub repair_options: Option<Box<models::RepairOptions>>,
    /// Contains one or more EDI functional groups, each containing the data for one or more EDI transactions. You can override the Application IDs (GS-02 and GS-03) for each group individually. The outbound transaction setting for each group must be configured to use the same connection. If you need to send transactions to different connections, you must call the endpoint multiple times.
    #[serde(rename = "transactionGroups")]
    pub transaction_groups: Vec<models::TransactionGroup>,
    /// Set a custom name for the generated EDI file. Stedi overwrites files with the same name, so we recommend making the filename unique by including a timestamp or other identifier. If you do not specify a filename, Stedi autogenerates a unique name using an ID.
    #[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
    pub filename: Option<String>,
    #[serde(rename = "overrides", skip_serializing_if = "Option::is_none")]
    pub overrides: Option<Box<models::InterchangeOverrides>>,
    #[serde(rename = "interchangeUsageIndicatorOverride", skip_serializing_if = "Option::is_none")]
    pub interchange_usage_indicator_override: Option<models::X12UsageIndicator>,
    #[serde(rename = "interchangeAuthorization", skip_serializing_if = "Option::is_none")]
    pub interchange_authorization: Option<Box<models::X12InterchangeAuthorization>>,
}

impl GenerateEdiRequestContent {
    pub fn new(transaction_groups: Vec<models::TransactionGroup>) -> GenerateEdiRequestContent {
        GenerateEdiRequestContent {
            character_set: None,
            repair_options: None,
            transaction_groups,
            filename: None,
            overrides: None,
            interchange_usage_indicator_override: None,
            interchange_authorization: None,
        }
    }
}