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

/// TotalWeight : The aggregate weight of this item being invoiced. This information will be available for items sold by weight.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TotalWeight {
    /// The unit of measure for items sold by weight.
    #[serde(rename = "unitOfMeasure")]
    pub unit_of_measure: UnitOfMeasure,
    /// 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 = "amount")]
    pub amount: String,
}

impl TotalWeight {
    /// The aggregate weight of this item being invoiced. This information will be available for items sold by weight.
    pub fn new(unit_of_measure: UnitOfMeasure, amount: String) -> TotalWeight {
        TotalWeight {
            unit_of_measure,
            amount,
        }
    }
}
/// The unit of measure for items sold by weight.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum UnitOfMeasure {
    #[serde(rename = "POUNDS")]
    Pounds,
    #[serde(rename = "OUNCES")]
    Ounces,
    #[serde(rename = "GRAMS")]
    Grams,
    #[serde(rename = "KILOGRAMS")]
    Kilograms,
}

impl Default for UnitOfMeasure {
    fn default() -> UnitOfMeasure {
        Self::Pounds
    }
}