1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Code {
#[serde(rename = "InvalidInput")]
InvalidInput,
#[serde(rename = "InvalidTimeSlotId")]
InvalidTimeSlotId,
#[serde(rename = "ScheduledPackageAlreadyExists")]
ScheduledPackageAlreadyExists,
#[serde(rename = "ScheduleWindowExpired")]
ScheduleWindowExpired,
#[serde(rename = "RetryableAfterGettingNewSlots")]
RetryableAfterGettingNewSlots,
#[serde(rename = "TimeSlotNotAvailable")]
TimeSlotNotAvailable,
#[serde(rename = "ResourceNotFound")]
ResourceNotFound,
#[serde(rename = "InvalidOrderState")]
InvalidOrderState,
#[serde(rename = "RegionNotSupported")]
RegionNotSupported,
#[serde(rename = "OrderNotEligibleForRescheduling")]
OrderNotEligibleForRescheduling,
#[serde(rename = "InternalServerError")]
InternalServerError,
}
impl ToString for Code {
fn to_string(&self) -> String {
match self {
Self::InvalidInput => String::from("InvalidInput"),
Self::InvalidTimeSlotId => String::from("InvalidTimeSlotId"),
Self::ScheduledPackageAlreadyExists => String::from("ScheduledPackageAlreadyExists"),
Self::ScheduleWindowExpired => String::from("ScheduleWindowExpired"),
Self::RetryableAfterGettingNewSlots => String::from("RetryableAfterGettingNewSlots"),
Self::TimeSlotNotAvailable => String::from("TimeSlotNotAvailable"),
Self::ResourceNotFound => String::from("ResourceNotFound"),
Self::InvalidOrderState => String::from("InvalidOrderState"),
Self::RegionNotSupported => String::from("RegionNotSupported"),
Self::OrderNotEligibleForRescheduling => String::from("OrderNotEligibleForRescheduling"),
Self::InternalServerError => String::from("InternalServerError"),
}
}
}
impl Default for Code {
fn default() -> Code {
Self::InvalidInput
}
}