amazon_spapi/models/shipping_v2/get_rates_result.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/// GetRatesResult : The payload for the getRates operation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GetRatesResult {
17 /// A unique token generated to identify a getRates operation.
18 #[serde(rename = "requestToken")]
19 pub request_token: String,
20 /// A list of eligible shipping service offerings.
21 #[serde(rename = "rates")]
22 pub rates: Vec<models::shipping_v2::Rate>,
23 /// A list of ineligible shipping service offerings.
24 #[serde(rename = "ineligibleRates", skip_serializing_if = "Option::is_none")]
25 pub ineligible_rates: Option<Vec<models::shipping_v2::IneligibleRate>>,
26}
27
28impl GetRatesResult {
29 /// The payload for the getRates operation.
30 pub fn new(request_token: String, rates: Vec<models::shipping_v2::Rate>) -> GetRatesResult {
31 GetRatesResult {
32 request_token,
33 rates,
34 ineligible_rates: None,
35 }
36 }
37}
38