amazon_spapi/models/services/
service_upload_document.rs

1/*
2 * Selling Partner API for Services
3 *
4 * With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.
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/// ServiceUploadDocument : Input for to be uploaded document.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ServiceUploadDocument {
17    /// The content type of the to-be-uploaded file
18    #[serde(rename = "contentType")]
19    pub content_type: ContentType,
20    /// The content length of the to-be-uploaded file
21    #[serde(rename = "contentLength")]
22    pub content_length: f64,
23    /// An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit.
24    #[serde(rename = "contentMD5", skip_serializing_if = "Option::is_none")]
25    pub content_md5: Option<String>,
26}
27
28impl ServiceUploadDocument {
29    /// Input for to be uploaded document.
30    pub fn new(content_type: ContentType, content_length: f64) -> ServiceUploadDocument {
31        ServiceUploadDocument {
32            content_type,
33            content_length,
34            content_md5: None,
35        }
36    }
37}
38/// The content type of the to-be-uploaded file
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum ContentType {
41    #[serde(rename = "TIFF")]
42    Tiff,
43    #[serde(rename = "JPG")]
44    Jpg,
45    #[serde(rename = "PNG")]
46    Png,
47    #[serde(rename = "JPEG")]
48    Jpeg,
49    #[serde(rename = "GIF")]
50    Gif,
51    #[serde(rename = "PDF")]
52    Pdf,
53}
54
55impl Default for ContentType {
56    fn default() -> ContentType {
57        Self::Tiff
58    }
59}
60