amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Invoices.
 *
 * Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.
 *
 * The version of the OpenAPI document: 2024-06-19
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Invoice : Provides detailed information about an invoice.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Invoice {
    /// The date and time the invoice is issued. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
    pub date: Option<String>,
    /// If the invoice is in an error state, this attribute displays the error code.
    #[serde(rename = "errorCode", skip_serializing_if = "Option::is_none")]
    pub error_code: Option<String>,
    /// The invoice identifier that is used by an external party. This is typically the government agency that authorized the invoice.
    #[serde(rename = "externalInvoiceId", skip_serializing_if = "Option::is_none")]
    pub external_invoice_id: Option<String>,
    /// The response message from the government authority when there is an error during invoice issuance.
    #[serde(rename = "govResponse", skip_serializing_if = "Option::is_none")]
    pub gov_response: Option<String>,
    /// The invoice identifier.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The classification of the invoice type. This varies across marketplaces. Use the `getInvoicesAttributes` operation to check `invoiceType` options.
    #[serde(rename = "invoiceType", skip_serializing_if = "Option::is_none")]
    pub invoice_type: Option<String>,
    /// Use this identifier in conjunction with `externalInvoiceId` to identify invoices from the same seller.
    #[serde(rename = "series", skip_serializing_if = "Option::is_none")]
    pub series: Option<String>,
    /// The invoice status classification. Use the `getInvoicesAttributes` operation to check invoice status options.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// List with identifiers for the transactions associated to the invoice.
    #[serde(rename = "transactionIds", skip_serializing_if = "Option::is_none")]
    pub transaction_ids: Option<Vec<models::invoices_2024_06_19::TransactionIdentifier>>,
    /// Classification of the transaction that originated this invoice. Use the `getInvoicesAttributes` operation to check `transactionType` options.
    #[serde(rename = "transactionType", skip_serializing_if = "Option::is_none")]
    pub transaction_type: Option<String>,
}

impl Invoice {
    /// Provides detailed information about an invoice.
    pub fn new() -> Invoice {
        Invoice {
            date: None,
            error_code: None,
            external_invoice_id: None,
            gov_response: None,
            id: None,
            invoice_type: None,
            series: None,
            status: None,
            transaction_ids: None,
            transaction_type: None,
        }
    }
}