amazon_spapi/models/shipping/
service_rate.rs

1/*
2 * Selling Partner API for Shipping
3 *
4 * Provides programmatic access to Amazon Shipping APIs.   **Note:** If you are new to the Amazon Shipping API, refer to the latest version of <a href=\"https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference\">Amazon Shipping API (v2)</a> on the <a href=\"https://developer-docs.amazon.com/amazon-shipping/\">Amazon Shipping Developer Documentation</a> site.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ServiceRate : The specific rate for a shipping service, or null if no service available.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ServiceRate {
17    #[serde(rename = "totalCharge")]
18    pub total_charge: Box<models::shipping::Currency>,
19    #[serde(rename = "billableWeight")]
20    pub billable_weight: Box<models::shipping::Weight>,
21    #[serde(rename = "serviceType")]
22    pub service_type: models::shipping::ServiceType,
23    #[serde(rename = "promise")]
24    pub promise: Box<models::shipping::ShippingPromiseSet>,
25}
26
27impl ServiceRate {
28    /// The specific rate for a shipping service, or null if no service available.
29    pub fn new(total_charge: models::shipping::Currency, billable_weight: models::shipping::Weight, service_type: models::shipping::ServiceType, promise: models::shipping::ShippingPromiseSet) -> ServiceRate {
30        ServiceRate {
31            total_charge: Box::new(total_charge),
32            billable_weight: Box::new(billable_weight),
33            service_type,
34            promise: Box::new(promise),
35        }
36    }
37}
38