amazon_spapi/models/shipping_v2/
charge_component.rs

1/*
2 * Amazon Shipping API
3 *
4 * The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
5 *
6 * The version of the OpenAPI document: v2
7 * Contact: swa-api-core@amazon.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ChargeComponent : The type and amount of a charge applied on a package.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ChargeComponent {
17    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
18    pub amount: Option<Box<models::shipping_v2::Currency>>,
19    /// The type of charge.
20    #[serde(rename = "chargeType", skip_serializing_if = "Option::is_none")]
21    pub charge_type: Option<ChargeType>,
22}
23
24impl ChargeComponent {
25    /// The type and amount of a charge applied on a package.
26    pub fn new() -> ChargeComponent {
27        ChargeComponent {
28            amount: None,
29            charge_type: None,
30        }
31    }
32}
33/// The type of charge.
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum ChargeType {
36    #[serde(rename = "TAX")]
37    Tax,
38    #[serde(rename = "DISCOUNT")]
39    Discount,
40}
41
42impl Default for ChargeType {
43    fn default() -> ChargeType {
44        Self::Tax
45    }
46}
47