amazon_spapi/models/listings_restrictions_2021_08_01/reason.rs
1/*
2 * Selling Partner API for Listings Restrictions
3 *
4 * 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).
5 *
6 * The version of the OpenAPI document: 2021-08-01
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Reason : A reason for the restriction, including path forward links that may allow Selling Partners to remove the restriction, if available.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Reason {
17 /// A message describing the reason for the restriction.
18 #[serde(rename = "message")]
19 pub message: String,
20 /// A code indicating why the listing is restricted.
21 #[serde(rename = "reasonCode", skip_serializing_if = "Option::is_none")]
22 pub reason_code: Option<ReasonCode>,
23 /// A list of path forward links that may allow Selling Partners to remove the restriction.
24 #[serde(rename = "links", skip_serializing_if = "Option::is_none")]
25 pub links: Option<Vec<models::listings_restrictions_2021_08_01::Link>>,
26}
27
28impl Reason {
29 /// A reason for the restriction, including path forward links that may allow Selling Partners to remove the restriction, if available.
30 pub fn new(message: String) -> Reason {
31 Reason {
32 message,
33 reason_code: None,
34 links: None,
35 }
36 }
37}
38/// A code indicating why the listing is restricted.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum ReasonCode {
41 #[serde(rename = "APPROVAL_REQUIRED")]
42 ApprovalRequired,
43 #[serde(rename = "ASIN_NOT_FOUND")]
44 AsinNotFound,
45 #[serde(rename = "NOT_ELIGIBLE")]
46 NotEligible,
47}
48
49impl Default for ReasonCode {
50 fn default() -> ReasonCode {
51 Self::ApprovalRequired
52 }
53}
54