amazon_spapi/models/shipping/
purchase_labels_result.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/// PurchaseLabelsResult : The payload schema for the purchaseLabels operation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PurchaseLabelsResult {
17    /// The unique shipment identifier.
18    #[serde(rename = "shipmentId")]
19    pub shipment_id: String,
20    /// Client reference id.
21    #[serde(rename = "clientReferenceId", skip_serializing_if = "Option::is_none")]
22    pub client_reference_id: Option<String>,
23    #[serde(rename = "acceptedRate")]
24    pub accepted_rate: Box<models::shipping::AcceptedRate>,
25    /// A list of label results
26    #[serde(rename = "labelResults")]
27    pub label_results: Vec<models::shipping::LabelResult>,
28}
29
30impl PurchaseLabelsResult {
31    /// The payload schema for the purchaseLabels operation.
32    pub fn new(shipment_id: String, accepted_rate: models::shipping::AcceptedRate, label_results: Vec<models::shipping::LabelResult>) -> PurchaseLabelsResult {
33        PurchaseLabelsResult {
34            shipment_id,
35            client_reference_id: None,
36            accepted_rate: Box::new(accepted_rate),
37            label_results,
38        }
39    }
40}
41