amazon_spapi/models/shipping_v2/
get_rates_request.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/// GetRatesRequest : The request schema for the getRates operation. When the channelType is Amazon, the shipTo address is not required and will be ignored.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GetRatesRequest {
17    #[serde(rename = "shipTo", skip_serializing_if = "Option::is_none")]
18    pub ship_to: Option<Box<models::shipping_v2::Address>>,
19    #[serde(rename = "shipFrom")]
20    pub ship_from: Box<models::shipping_v2::Address>,
21    #[serde(rename = "returnTo", skip_serializing_if = "Option::is_none")]
22    pub return_to: Option<Box<models::shipping_v2::Address>>,
23    /// The ship date and time (the requested pickup). This defaults to the current date and time.
24    #[serde(rename = "shipDate", skip_serializing_if = "Option::is_none")]
25    pub ship_date: Option<String>,
26    #[serde(rename = "shipperInstruction", skip_serializing_if = "Option::is_none")]
27    pub shipper_instruction: Option<Box<models::shipping_v2::ShipperInstruction>>,
28    /// A list of packages to be shipped through a shipping service offering.
29    #[serde(rename = "packages")]
30    pub packages: Vec<models::shipping_v2::Package>,
31    #[serde(rename = "valueAddedServices", skip_serializing_if = "Option::is_none")]
32    pub value_added_services: Option<Box<models::shipping_v2::ValueAddedServiceDetails>>,
33    /// A list of tax detail information.
34    #[serde(rename = "taxDetails", skip_serializing_if = "Option::is_none")]
35    pub tax_details: Option<Vec<models::shipping_v2::TaxDetail>>,
36    #[serde(rename = "channelDetails")]
37    pub channel_details: Box<models::shipping_v2::ChannelDetails>,
38    /// Object to pass additional information about the MCI Integrator shipperType: List of ClientReferenceDetail
39    #[serde(rename = "clientReferenceDetails", skip_serializing_if = "Option::is_none")]
40    pub client_reference_details: Option<Vec<models::shipping_v2::ClientReferenceDetail>>,
41    #[serde(rename = "shipmentType", skip_serializing_if = "Option::is_none")]
42    pub shipment_type: Option<models::shipping_v2::ShipmentType>,
43    #[serde(rename = "destinationAccessPointDetails", skip_serializing_if = "Option::is_none")]
44    pub destination_access_point_details: Option<Box<models::shipping_v2::AccessPointDetails>>,
45    /// A list of CarrierAccounts
46    #[serde(rename = "carrierAccounts", skip_serializing_if = "Option::is_none")]
47    pub carrier_accounts: Option<Vec<models::shipping_v2::CarrierAccount>>,
48}
49
50impl GetRatesRequest {
51    /// The request schema for the getRates operation. When the channelType is Amazon, the shipTo address is not required and will be ignored.
52    pub fn new(ship_from: models::shipping_v2::Address, packages: Vec<models::shipping_v2::Package>, channel_details: models::shipping_v2::ChannelDetails) -> GetRatesRequest {
53        GetRatesRequest {
54            ship_to: None,
55            ship_from: Box::new(ship_from),
56            return_to: None,
57            ship_date: None,
58            shipper_instruction: None,
59            packages,
60            value_added_services: None,
61            tax_details: None,
62            channel_details: Box::new(channel_details),
63            client_reference_details: None,
64            shipment_type: None,
65            destination_access_point_details: None,
66            carrier_accounts: None,
67        }
68    }
69}
70