amazon_spapi/models/easy_ship_2022_03_23/
code.rs

1/*
2 * Selling Partner API for Easy Ship
3 *
4 * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
5 *
6 * The version of the OpenAPI document: 2022-03-23
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Code : An error code that identifies the type of error that occurred. The error codes listed below are specific to the Easy Ship section.
15/// An error code that identifies the type of error that occurred. The error codes listed below are specific to the Easy Ship section.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum Code {
18    #[serde(rename = "InvalidInput")]
19    InvalidInput,
20    #[serde(rename = "InvalidTimeSlotId")]
21    InvalidTimeSlotId,
22    #[serde(rename = "ScheduledPackageAlreadyExists")]
23    ScheduledPackageAlreadyExists,
24    #[serde(rename = "ScheduleWindowExpired")]
25    ScheduleWindowExpired,
26    #[serde(rename = "RetryableAfterGettingNewSlots")]
27    RetryableAfterGettingNewSlots,
28    #[serde(rename = "TimeSlotNotAvailable")]
29    TimeSlotNotAvailable,
30    #[serde(rename = "ResourceNotFound")]
31    ResourceNotFound,
32    #[serde(rename = "InvalidOrderState")]
33    InvalidOrderState,
34    #[serde(rename = "RegionNotSupported")]
35    RegionNotSupported,
36    #[serde(rename = "OrderNotEligibleForRescheduling")]
37    OrderNotEligibleForRescheduling,
38    #[serde(rename = "InternalServerError")]
39    InternalServerError,
40
41}
42
43impl std::fmt::Display for Code {
44    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
45        match self {
46            Self::InvalidInput => write!(f, "InvalidInput"),
47            Self::InvalidTimeSlotId => write!(f, "InvalidTimeSlotId"),
48            Self::ScheduledPackageAlreadyExists => write!(f, "ScheduledPackageAlreadyExists"),
49            Self::ScheduleWindowExpired => write!(f, "ScheduleWindowExpired"),
50            Self::RetryableAfterGettingNewSlots => write!(f, "RetryableAfterGettingNewSlots"),
51            Self::TimeSlotNotAvailable => write!(f, "TimeSlotNotAvailable"),
52            Self::ResourceNotFound => write!(f, "ResourceNotFound"),
53            Self::InvalidOrderState => write!(f, "InvalidOrderState"),
54            Self::RegionNotSupported => write!(f, "RegionNotSupported"),
55            Self::OrderNotEligibleForRescheduling => write!(f, "OrderNotEligibleForRescheduling"),
56            Self::InternalServerError => write!(f, "InternalServerError"),
57        }
58    }
59}
60
61impl Default for Code {
62    fn default() -> Code {
63        Self::InvalidInput
64    }
65}
66