amazon_spapi/models/orders_v0/
business_hours.rs

1/*
2 * Selling Partner API for Orders
3 *
4 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
5 *
6 * The version of the OpenAPI document: v0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BusinessHours : Business days and hours when the destination is open for deliveries.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BusinessHours {
17    /// Day of the week.
18    #[serde(rename = "DayOfWeek", skip_serializing_if = "Option::is_none")]
19    pub day_of_week: Option<DayOfWeek>,
20    /// Time window during the day when the business is open.
21    #[serde(rename = "OpenIntervals", skip_serializing_if = "Option::is_none")]
22    pub open_intervals: Option<Vec<models::orders_v0::OpenInterval>>,
23}
24
25impl BusinessHours {
26    /// Business days and hours when the destination is open for deliveries.
27    pub fn new() -> BusinessHours {
28        BusinessHours {
29            day_of_week: None,
30            open_intervals: None,
31        }
32    }
33}
34/// Day of the week.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum DayOfWeek {
37    #[serde(rename = "SUN")]
38    Sun,
39    #[serde(rename = "MON")]
40    Mon,
41    #[serde(rename = "TUE")]
42    Tue,
43    #[serde(rename = "WED")]
44    Wed,
45    #[serde(rename = "THU")]
46    Thu,
47    #[serde(rename = "FRI")]
48    Fri,
49    #[serde(rename = "SAT")]
50    Sat,
51}
52
53impl Default for DayOfWeek {
54    fn default() -> DayOfWeek {
55        Self::Sun
56    }
57}
58