Skip to main content

amazon_spapi/models/listings_items_2020_09_01/
issue.rs

1/*
2 * Selling Partner API for Listings Items
3 *
4 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listing Items API Use Case Guide](doc:listings-items-api-v2020-09-01-use-case-guide).
5 *
6 * The version of the OpenAPI document: 2020-09-01
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Issue : An issue with a listings item.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Issue {
17    /// An issue code that identifies the type of issue.
18    #[serde(rename = "code")]
19    pub code: String,
20    /// A message that describes the issue.
21    #[serde(rename = "message")]
22    pub message: String,
23    /// The severity of the issue.
24    #[serde(rename = "severity")]
25    pub severity: Severity,
26    /// Name of the attribute associated with the issue, if applicable.
27    #[serde(rename = "attributeName", skip_serializing_if = "Option::is_none")]
28    pub attribute_name: Option<String>,
29}
30
31impl Issue {
32    /// An issue with a listings item.
33    pub fn new(code: String, message: String, severity: Severity) -> Issue {
34        Issue {
35            code,
36            message,
37            severity,
38            attribute_name: None,
39        }
40    }
41}
42/// The severity of the issue.
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum Severity {
45    #[serde(rename = "ERROR")]
46    Error,
47    #[serde(rename = "WARNING")]
48    Warning,
49    #[serde(rename = "INFO")]
50    Info,
51}
52
53impl Default for Severity {
54    fn default() -> Severity {
55        Self::Error
56    }
57}
58