amazon_spapi/models/shipping_v2/requested_document_specification.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/// RequestedDocumentSpecification : The document specifications requested. For calls to the purchaseShipment operation, the shipment purchase fails if the specified document specifications are not among those returned in the response to the getRates operation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RequestedDocumentSpecification {
17 #[serde(rename = "format")]
18 pub format: models::shipping_v2::DocumentFormat,
19 #[serde(rename = "size")]
20 pub size: Box<models::shipping_v2::DocumentSize>,
21 /// The dots per inch (DPI) value used in printing. This value represents a measure of the resolution of the document.
22 #[serde(rename = "dpi", skip_serializing_if = "Option::is_none")]
23 pub dpi: Option<i32>,
24 /// Indicates the position of the label on the paper. Should be the same value as returned in getRates response.
25 #[serde(rename = "pageLayout", skip_serializing_if = "Option::is_none")]
26 pub page_layout: Option<String>,
27 /// When true, files should be stitched together. Otherwise, files should be returned separately. Defaults to false.
28 #[serde(rename = "needFileJoining")]
29 pub need_file_joining: bool,
30 /// A list of the document types requested.
31 #[serde(rename = "requestedDocumentTypes")]
32 pub requested_document_types: Vec<models::shipping_v2::DocumentType>,
33 #[serde(rename = "requestedLabelCustomization", skip_serializing_if = "Option::is_none")]
34 pub requested_label_customization: Option<Box<models::shipping_v2::RequestedLabelCustomization>>,
35}
36
37impl RequestedDocumentSpecification {
38 /// The document specifications requested. For calls to the purchaseShipment operation, the shipment purchase fails if the specified document specifications are not among those returned in the response to the getRates operation.
39 pub fn new(format: models::shipping_v2::DocumentFormat, size: models::shipping_v2::DocumentSize, need_file_joining: bool, requested_document_types: Vec<models::shipping_v2::DocumentType>) -> RequestedDocumentSpecification {
40 RequestedDocumentSpecification {
41 format,
42 size: Box::new(size),
43 dpi: None,
44 page_layout: None,
45 need_file_joining,
46 requested_document_types,
47 requested_label_customization: None,
48 }
49 }
50}
51