Skip to main content

amazon_spapi/models/sellers/
account.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/// Account : The response schema for the `getAccount` operation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Account {
17    /// List of marketplace participations.
18    #[serde(rename = "marketplaceParticipationList")]
19    pub marketplace_participation_list: Vec<models::sellers::MarketplaceParticipation>,
20    /// The type of business registered for the seller account.
21    #[serde(rename = "businessType")]
22    pub business_type: BusinessType,
23    /// The selling plan details.
24    #[serde(rename = "sellingPlan")]
25    pub selling_plan: SellingPlan,
26    #[serde(rename = "business", skip_serializing_if = "Option::is_none")]
27    pub business: Option<Box<models::sellers::Business>>,
28    #[serde(rename = "primaryContact", skip_serializing_if = "Option::is_none")]
29    pub primary_contact: Option<Box<models::sellers::PrimaryContact>>,
30}
31
32impl Account {
33    /// The response schema for the `getAccount` operation.
34    pub fn new(marketplace_participation_list: Vec<models::sellers::MarketplaceParticipation>, business_type: BusinessType, selling_plan: SellingPlan) -> Account {
35        Account {
36            marketplace_participation_list,
37            business_type,
38            selling_plan,
39            business: None,
40            primary_contact: None,
41        }
42    }
43}
44/// The type of business registered for the seller account.
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum BusinessType {
47    #[serde(rename = "CHARITY")]
48    Charity,
49    #[serde(rename = "CRAFTSMAN")]
50    Craftsman,
51    #[serde(rename = "NATURAL_PERSON_COMPANY")]
52    NaturalPersonCompany,
53    #[serde(rename = "PUBLIC_LISTED")]
54    PublicListed,
55    #[serde(rename = "PRIVATE_LIMITED")]
56    PrivateLimited,
57    #[serde(rename = "SOLE_PROPRIETORSHIP")]
58    SoleProprietorship,
59    #[serde(rename = "STATE_OWNED")]
60    StateOwned,
61    #[serde(rename = "INDIVIDUAL")]
62    Individual,
63}
64
65impl Default for BusinessType {
66    fn default() -> BusinessType {
67        Self::Charity
68    }
69}
70/// The selling plan details.
71#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum SellingPlan {
73    #[serde(rename = "PROFESSIONAL")]
74    Professional,
75    #[serde(rename = "INDIVIDUAL")]
76    Individual,
77}
78
79impl Default for SellingPlan {
80    fn default() -> SellingPlan {
81        Self::Professional
82    }
83}
84