amazon_spapi/models/invoices_2024_06_19/
error.rs

1/*
2 * The Selling Partner API for Invoices.
3 *
4 * Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.
5 *
6 * The version of the OpenAPI document: 2024-06-19
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Error : The error response that is 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    /// Additional details that can help the caller understand or fix the issue.
21    #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
22    pub details: Option<String>,
23    /// A message that describes the error condition.
24    #[serde(rename = "message")]
25    pub message: String,
26}
27
28impl Error {
29    /// The error response that is returned when the request is unsuccessful.
30    pub fn new(code: String, message: String) -> Error {
31        Error {
32            code,
33            details: None,
34            message,
35        }
36    }
37}
38