Skip to main content

amazon_spapi/models/shipping/
get_rates_request.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/// GetRatesRequest : The payload schema for the getRates operation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GetRatesRequest {
17    #[serde(rename = "shipTo")]
18    pub ship_to: Box<models::shipping::Address>,
19    #[serde(rename = "shipFrom")]
20    pub ship_from: Box<models::shipping::Address>,
21    /// A list of service types that can be used to send the shipment.
22    #[serde(rename = "serviceTypes")]
23    pub service_types: Vec<models::shipping::ServiceType>,
24    /// The start date and time. This defaults to the current date and time.
25    #[serde(rename = "shipDate", skip_serializing_if = "Option::is_none")]
26    pub ship_date: Option<String>,
27    /// A list of container specifications.
28    #[serde(rename = "containerSpecifications")]
29    pub container_specifications: Vec<models::shipping::ContainerSpecification>,
30}
31
32impl GetRatesRequest {
33    /// The payload schema for the getRates operation.
34    pub fn new(ship_to: models::shipping::Address, ship_from: models::shipping::Address, service_types: Vec<models::shipping::ServiceType>, container_specifications: Vec<models::shipping::ContainerSpecification>) -> GetRatesRequest {
35        GetRatesRequest {
36            ship_to: Box::new(ship_to),
37            ship_from: Box::new(ship_from),
38            service_types,
39            ship_date: None,
40            container_specifications,
41        }
42    }
43}
44