amazon_spapi/models/shipping_v2/purchase_shipment_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/// PurchaseShipmentRequest : The request schema for the purchaseShipment operation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PurchaseShipmentRequest {
17 /// A unique token generated to identify a getRates operation.
18 #[serde(rename = "requestToken")]
19 pub request_token: String,
20 /// An identifier for the rate (shipment offering) provided by a shipping service provider.
21 #[serde(rename = "rateId")]
22 pub rate_id: String,
23 #[serde(rename = "requestedDocumentSpecification")]
24 pub requested_document_specification: Box<models::shipping_v2::RequestedDocumentSpecification>,
25 /// The value-added services to be added to a shipping service purchase.
26 #[serde(rename = "requestedValueAddedServices", skip_serializing_if = "Option::is_none")]
27 pub requested_value_added_services: Option<Vec<models::shipping_v2::RequestedValueAddedService>>,
28 /// The additional inputs required to purchase a shipping offering, in JSON format. The JSON provided here must adhere to the JSON schema that is returned in the response to the getAdditionalInputs operation. Additional inputs are only required when indicated by the requiresAdditionalInputs property in the response to the getRates operation.
29 #[serde(rename = "additionalInputs", skip_serializing_if = "Option::is_none")]
30 pub additional_inputs: Option<std::collections::HashMap<String, serde_json::Value>>,
31}
32
33impl PurchaseShipmentRequest {
34 /// The request schema for the purchaseShipment operation.
35 pub fn new(request_token: String, rate_id: String, requested_document_specification: models::shipping_v2::RequestedDocumentSpecification) -> PurchaseShipmentRequest {
36 PurchaseShipmentRequest {
37 request_token,
38 rate_id,
39 requested_document_specification: Box::new(requested_document_specification),
40 requested_value_added_services: None,
41 additional_inputs: None,
42 }
43 }
44}
45