amazon_spapi/models/services/
reservation.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/// Reservation : Reservation object reduces the capacity of a resource.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Reservation {
17    /// Unique identifier for a reservation. If present, it is treated as an update reservation request and will update the corresponding reservation. Otherwise, it is treated as a new create reservation request.
18    #[serde(rename = "reservationId", skip_serializing_if = "Option::is_none")]
19    pub reservation_id: Option<String>,
20    /// Type of reservation.
21    #[serde(rename = "type")]
22    pub r#type: Type,
23    #[serde(rename = "availability")]
24    pub availability: Box<models::services::AvailabilityRecord>,
25}
26
27impl Reservation {
28    /// Reservation object reduces the capacity of a resource.
29    pub fn new(r#type: Type, availability: models::services::AvailabilityRecord) -> Reservation {
30        Reservation {
31            reservation_id: None,
32            r#type,
33            availability: Box::new(availability),
34        }
35    }
36}
37/// Type of reservation.
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Type {
40    #[serde(rename = "APPOINTMENT")]
41    Appointment,
42    #[serde(rename = "TRAVEL")]
43    Travel,
44    #[serde(rename = "VACATION")]
45    Vacation,
46    #[serde(rename = "BREAK")]
47    Break,
48    #[serde(rename = "TRAINING")]
49    Training,
50}
51
52impl Default for Type {
53    fn default() -> Type {
54        Self::Appointment
55    }
56}
57