amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Retail Procurement Payments
 *
 * The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// PaymentTerms : Terms of the payment for the invoice. The basis of the payment terms is the invoice date.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PaymentTerms {
    /// The payment term type for the invoice.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`.
    #[serde(rename = "discountPercent", skip_serializing_if = "Option::is_none")]
    pub discount_percent: Option<String>,
    /// The number of calendar days from the Base date (Invoice date) until the discount is no longer valid.
    #[serde(rename = "discountDueDays", skip_serializing_if = "Option::is_none")]
    pub discount_due_days: Option<f64>,
    /// The number of calendar days from the base date (invoice date) until the total amount on the invoice is due.
    #[serde(rename = "netDueDays", skip_serializing_if = "Option::is_none")]
    pub net_due_days: Option<f64>,
}

impl PaymentTerms {
    /// Terms of the payment for the invoice. The basis of the payment terms is the invoice date.
    pub fn new() -> PaymentTerms {
        PaymentTerms {
            r#type: None,
            discount_percent: None,
            discount_due_days: None,
            net_due_days: None,
        }
    }
}
/// The payment term type for the invoice.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "Basic")]
    Basic,
    #[serde(rename = "EndOfMonth")]
    EndOfMonth,
    #[serde(rename = "FixedDate")]
    FixedDate,
    #[serde(rename = "Proximo")]
    Proximo,
    #[serde(rename = "PaymentDueUponReceiptOfInvoice")]
    PaymentDueUponReceiptOfInvoice,
    #[serde(rename = "LetterofCredit")]
    LetterofCredit,
}

impl Default for Type {
    fn default() -> Type {
        Self::Basic
    }
}