amazon_spapi/models/services/
associated_item.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/// AssociatedItem : Information about an item associated with the service job.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AssociatedItem {
17    /// The Amazon Standard Identification Number (ASIN) of the item.
18    #[serde(rename = "asin", skip_serializing_if = "Option::is_none")]
19    pub asin: Option<String>,
20    /// The title of the item.
21    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
22    pub title: Option<String>,
23    /// The total number of items included in the order.
24    #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")]
25    pub quantity: Option<i32>,
26    /// The Amazon-defined identifier for an order placed by the buyer, in 3-7-7 format.
27    #[serde(rename = "orderId", skip_serializing_if = "Option::is_none")]
28    pub order_id: Option<String>,
29    /// The status of the item.
30    #[serde(rename = "itemStatus", skip_serializing_if = "Option::is_none")]
31    pub item_status: Option<ItemStatus>,
32    /// The brand name of the item.
33    #[serde(rename = "brandName", skip_serializing_if = "Option::is_none")]
34    pub brand_name: Option<String>,
35    #[serde(rename = "itemDelivery", skip_serializing_if = "Option::is_none")]
36    pub item_delivery: Option<Box<models::services::ItemDelivery>>,
37}
38
39impl AssociatedItem {
40    /// Information about an item associated with the service job.
41    pub fn new() -> AssociatedItem {
42        AssociatedItem {
43            asin: None,
44            title: None,
45            quantity: None,
46            order_id: None,
47            item_status: None,
48            brand_name: None,
49            item_delivery: None,
50        }
51    }
52}
53/// The status of the item.
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum ItemStatus {
56    #[serde(rename = "ACTIVE")]
57    Active,
58    #[serde(rename = "CANCELLED")]
59    Cancelled,
60    #[serde(rename = "SHIPPED")]
61    Shipped,
62    #[serde(rename = "DELIVERED")]
63    Delivered,
64}
65
66impl Default for ItemStatus {
67    fn default() -> ItemStatus {
68        Self::Active
69    }
70}
71