amazon_spapi/models/listings_items_2021_08_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 [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-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/// 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    /// The names of the attributes associated with the issue, if applicable.
27    #[serde(rename = "attributeNames", skip_serializing_if = "Option::is_none")]
28    pub attribute_names: Option<Vec<String>>,
29    /// List of issue categories.   Possible values:   * 'INVALID_ATTRIBUTE' - Indicating an invalid attribute in the listing.   * 'MISSING_ATTRIBUTE' - Highlighting a missing attribute in the listing.   * 'INVALID_IMAGE' - Signifying an invalid image in the listing.   * 'MISSING_IMAGE' - Noting the absence of an image in the listing.   * 'INVALID_PRICE' - Pertaining to issues with the listing's price-related attributes.   * 'MISSING_PRICE' - Pointing out the absence of a price attribute in the listing.   * 'DUPLICATE' - Identifying listings with potential duplicate problems, such as this ASIN potentially being a duplicate of another ASIN.   * 'QUALIFICATION_REQUIRED' - Indicating that the listing requires qualification-related approval.
30    #[serde(rename = "categories")]
31    pub categories: Vec<String>,
32    #[serde(rename = "enforcements", skip_serializing_if = "Option::is_none")]
33    pub enforcements: Option<Box<models::listings_items_2021_08_01::IssueEnforcements>>,
34}
35
36impl Issue {
37    /// An issue with a listings item.
38    pub fn new(code: String, message: String, severity: Severity, categories: Vec<String>) -> Issue {
39        Issue {
40            code,
41            message,
42            severity,
43            attribute_names: None,
44            categories,
45            enforcements: None,
46        }
47    }
48}
49/// The severity of the issue.
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Severity {
52    #[serde(rename = "ERROR")]
53    Error,
54    #[serde(rename = "WARNING")]
55    Warning,
56    #[serde(rename = "INFO")]
57    Info,
58}
59
60impl Default for Severity {
61    fn default() -> Severity {
62        Self::Error
63    }
64}
65