amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Sellers
 *
 * 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.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Account : The response schema for the `getAccount` operation.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Account {
    /// List of marketplace participations.
    #[serde(rename = "marketplaceParticipationList")]
    pub marketplace_participation_list: Vec<models::sellers::MarketplaceParticipation>,
    /// The type of business registered for the seller account.
    #[serde(rename = "businessType")]
    pub business_type: BusinessType,
    /// The selling plan details.
    #[serde(rename = "sellingPlan")]
    pub selling_plan: SellingPlan,
    #[serde(rename = "business", skip_serializing_if = "Option::is_none")]
    pub business: Option<Box<models::sellers::Business>>,
    #[serde(rename = "primaryContact", skip_serializing_if = "Option::is_none")]
    pub primary_contact: Option<Box<models::sellers::PrimaryContact>>,
}

impl Account {
    /// The response schema for the `getAccount` operation.
    pub fn new(marketplace_participation_list: Vec<models::sellers::MarketplaceParticipation>, business_type: BusinessType, selling_plan: SellingPlan) -> Account {
        Account {
            marketplace_participation_list,
            business_type,
            selling_plan,
            business: None,
            primary_contact: None,
        }
    }
}
/// The type of business registered for the seller account.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BusinessType {
    #[serde(rename = "CHARITY")]
    Charity,
    #[serde(rename = "CRAFTSMAN")]
    Craftsman,
    #[serde(rename = "NATURAL_PERSON_COMPANY")]
    NaturalPersonCompany,
    #[serde(rename = "PUBLIC_LISTED")]
    PublicListed,
    #[serde(rename = "PRIVATE_LIMITED")]
    PrivateLimited,
    #[serde(rename = "SOLE_PROPRIETORSHIP")]
    SoleProprietorship,
    #[serde(rename = "STATE_OWNED")]
    StateOwned,
    #[serde(rename = "INDIVIDUAL")]
    Individual,
}

impl Default for BusinessType {
    fn default() -> BusinessType {
        Self::Charity
    }
}
/// The selling plan details.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SellingPlan {
    #[serde(rename = "PROFESSIONAL")]
    Professional,
    #[serde(rename = "INDIVIDUAL")]
    Individual,
}

impl Default for SellingPlan {
    fn default() -> SellingPlan {
        Self::Professional
    }
}