Skip to main content

hermes_ebay_sell_logistics/models/
error.rs

1/*
2 * Logistics API
3 *
4 * <span class=\"tablenote\"><b>Note:</b> This is a <a href=\"https://developer.ebay.com/api-docs/static/versioning.html#limited \" target=\"_blank\"> <img src=\"/cms/img/docs/partners-api.svg\" class=\"legend-icon partners-icon\" title=\"Limited Release\"  alt=\"Limited Release\" />(Limited Release)</a> API available only to select developers approved by business units.</span><br /><br />The <b>Logistics API</b> resources offer the following capabilities: <ul><li><b>shipping_quote</b> &ndash; Consolidates into a list a set of live shipping rates, or quotes, from which you can select a rate to ship a package.</li> <li><b>shipment</b> &ndash; Creates a \"shipment\" for the selected shipping rate.</li></ul> Call <b>createShippingQuote</b> to get a list of live shipping rates. The rates returned are all valid for a specific time window and all quoted prices are at eBay-negotiated rates. <br><br>Select one of the live rates and using its associated <b>rateId</b>, create a \"shipment\" for the package by calling <b>createFromShippingQuote</b>. Creating a shipment completes an agreement, and the cost of the base service and any added shipping options are summed into the returned <b>totalShippingCost</b> value. This action also generates a shipping label that you can use to ship the package.  The total cost of the shipment is incurred when the package is shipped using the supplied shipping label.  <p class=\"tablenote\"><b>Important!</b> Sellers must set up a payment method via their eBay account before they can use the methods in this API to create a shipment and the associated shipping label.</p>
5 *
6 * The version of the OpenAPI document: v1_beta.0.0
7 * Contact: your-email@example.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Error : A container that defines the elements of error and warning message.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Error {
17    /// The category type for this error or warning. It takes a string that can have one of three values:<ul><li><code>Application</code>: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency.</li><li><code>Business</code>: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as \"Seller does not ship item to Antarctica\" or \"Buyer ineligible to purchase an alcoholic item\". Business errors are not syntactical input errors.</li><li><code>Request</code>: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on.</li></ul>
18    #[serde(rename = "category", skip_serializing_if = "Option::is_none")]
19    pub category: Option<String>,
20    /// Name of the domain containing the service or application.
21    #[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
22    pub domain: Option<String>,
23    /// A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms.
24    #[serde(rename = "errorId", skip_serializing_if = "Option::is_none")]
25    pub error_id: Option<i32>,
26    /// Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use <i>JSONPath</i> notation.
27    #[serde(rename = "inputRefIds", skip_serializing_if = "Option::is_none")]
28    pub input_ref_ids: Option<Vec<String>>,
29    /// An expanded version of message that should be around 100-200 characters long, but is not required to be such.
30    #[serde(rename = "longMessage", skip_serializing_if = "Option::is_none")]
31    pub long_message: Option<String>,
32    /// An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale.
33    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
34    pub message: Option<String>,
35    /// Identifies specific response elements associated with the error, if any. Path format is the same as <code>inputRefId</code>.
36    #[serde(rename = "outputRefIds", skip_serializing_if = "Option::is_none")]
37    pub output_ref_ids: Option<Vec<String>>,
38    /// This optional complex field type contains a list of one or more context-specific <code>ErrorParameter</code> objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each <code>ErrorParameter</code> object consists of two fields, a <code>name</code> and a <code>value</code>.
39    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
40    pub parameters: Option<Vec<models::ErrorParameter>>,
41    /// Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain.
42    #[serde(rename = "subdomain", skip_serializing_if = "Option::is_none")]
43    pub subdomain: Option<String>,
44}
45
46impl Error {
47    /// A container that defines the elements of error and warning message.
48    pub fn new() -> Error {
49        Error {
50            category: None,
51            domain: None,
52            error_id: None,
53            input_ref_ids: None,
54            long_message: None,
55            message: None,
56            output_ref_ids: None,
57            parameters: None,
58            subdomain: None,
59        }
60    }
61}
62