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
/*
 * Selling Partner API for Listings Restrictions
 *
 * The Selling Partner API for Listings Restrictions provides programmatic access to restrictions on Amazon catalog listings.  For more information, see the [Listings Restrictions API Use Case Guide](doc:listings-restrictions-api-v2021-08-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2021-08-01
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Reason : A reason for the restriction, including path forward links that may allow Selling Partners to remove the restriction, if available.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Reason {
    /// A message describing the reason for the restriction.
    #[serde(default, rename = "message")]
    pub message: String,
    /// A code indicating why the listing is restricted.
    #[serde(default, rename = "reasonCode", skip_serializing_if = "Option::is_none")]
    pub reason_code: Option<ReasonCode>,
    /// A list of path forward links that may allow Selling Partners to remove the restriction.
    #[serde(default, rename = "links", skip_serializing_if = "Option::is_none")]
    pub links: Option<Vec<crate::models::Link>>,
}

impl Reason {
    /// A reason for the restriction, including path forward links that may allow Selling Partners to remove the restriction, if available.
    pub fn new(message: String) -> Reason {
        Reason {
            message,
            reason_code: None,
            links: None,
        }
    }
}

/// A code indicating why the listing is restricted.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ReasonCode {
    #[serde(rename = "APPROVAL_REQUIRED")]
    APPROVALREQUIRED,
    #[serde(rename = "ASIN_NOT_FOUND")]
    ASINNOTFOUND,
    #[serde(rename = "NOT_ELIGIBLE")]
    NOTELIGIBLE,
}

impl Default for ReasonCode {
    fn default() -> ReasonCode {
        Self::APPROVALREQUIRED
    }
}