amazon_spapi/models/services/
service_job.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/// ServiceJob : The job details of a service.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ServiceJob {
17    /// The date and time of the creation of the job in ISO 8601 format.
18    #[serde(rename = "createTime", skip_serializing_if = "Option::is_none")]
19    pub create_time: Option<String>,
20    /// Amazon identifier for the service job.
21    #[serde(rename = "serviceJobId", skip_serializing_if = "Option::is_none")]
22    pub service_job_id: Option<String>,
23    /// The status of the service job.
24    #[serde(rename = "serviceJobStatus", skip_serializing_if = "Option::is_none")]
25    pub service_job_status: Option<ServiceJobStatus>,
26    #[serde(rename = "scopeOfWork", skip_serializing_if = "Option::is_none")]
27    pub scope_of_work: Option<Box<models::services::ScopeOfWork>>,
28    #[serde(rename = "seller", skip_serializing_if = "Option::is_none")]
29    pub seller: Option<Box<models::services::Seller>>,
30    #[serde(rename = "serviceJobProvider", skip_serializing_if = "Option::is_none")]
31    pub service_job_provider: Option<Box<models::services::ServiceJobProvider>>,
32    /// A list of appointment windows preferred by the buyer. Included only if the buyer selected appointment windows when creating the order.
33    #[serde(rename = "preferredAppointmentTimes", skip_serializing_if = "Option::is_none")]
34    pub preferred_appointment_times: Option<Vec<models::services::AppointmentTime>>,
35    /// A list of appointments.
36    #[serde(rename = "appointments", skip_serializing_if = "Option::is_none")]
37    pub appointments: Option<Vec<models::services::Appointment>>,
38    /// The Amazon-defined identifier for an order placed by the buyer, in 3-7-7 format.
39    #[serde(rename = "serviceOrderId", skip_serializing_if = "Option::is_none")]
40    pub service_order_id: Option<String>,
41    /// The marketplace identifier.
42    #[serde(rename = "marketplaceId", skip_serializing_if = "Option::is_none")]
43    pub marketplace_id: Option<String>,
44    /// The Amazon-defined identifier for the region scope.
45    #[serde(rename = "storeId", skip_serializing_if = "Option::is_none")]
46    pub store_id: Option<String>,
47    #[serde(rename = "buyer", skip_serializing_if = "Option::is_none")]
48    pub buyer: Option<Box<models::services::Buyer>>,
49    /// A list of items associated with the service job.
50    #[serde(rename = "associatedItems", skip_serializing_if = "Option::is_none")]
51    pub associated_items: Option<Vec<models::services::AssociatedItem>>,
52    #[serde(rename = "serviceLocation", skip_serializing_if = "Option::is_none")]
53    pub service_location: Option<Box<models::services::ServiceLocation>>,
54}
55
56impl ServiceJob {
57    /// The job details of a service.
58    pub fn new() -> ServiceJob {
59        ServiceJob {
60            create_time: None,
61            service_job_id: None,
62            service_job_status: None,
63            scope_of_work: None,
64            seller: None,
65            service_job_provider: None,
66            preferred_appointment_times: None,
67            appointments: None,
68            service_order_id: None,
69            marketplace_id: None,
70            store_id: None,
71            buyer: None,
72            associated_items: None,
73            service_location: None,
74        }
75    }
76}
77/// The status of the service job.
78#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum ServiceJobStatus {
80    #[serde(rename = "NOT_SERVICED")]
81    NotServiced,
82    #[serde(rename = "CANCELLED")]
83    Cancelled,
84    #[serde(rename = "COMPLETED")]
85    Completed,
86    #[serde(rename = "PENDING_SCHEDULE")]
87    PendingSchedule,
88    #[serde(rename = "NOT_FULFILLABLE")]
89    NotFulfillable,
90    #[serde(rename = "HOLD")]
91    Hold,
92    #[serde(rename = "PAYMENT_DECLINED")]
93    PaymentDeclined,
94}
95
96impl Default for ServiceJobStatus {
97    fn default() -> ServiceJobStatus {
98        Self::NotServiced
99    }
100}
101