amazon_spapi/models/sellers/error.rs
1/*
2 * The Selling Partner API for Sellers
3 *
4 * The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as: - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Error : Error response returned when the request is unsuccessful.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Error {
17 /// An error code that identifies the type of error that occurred.
18 #[serde(rename = "code")]
19 pub code: String,
20 /// A message that describes the error condition in a human-readable form.
21 #[serde(rename = "message")]
22 pub message: String,
23 /// Additional details that can help you understand or fix the issue.
24 #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
25 pub details: Option<String>,
26}
27
28impl Error {
29 /// Error response returned when the request is unsuccessful.
30 pub fn new(code: String, message: String) -> Error {
31 Error {
32 code,
33 message,
34 details: None,
35 }
36 }
37}
38