amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Automotive.
 *
 * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
 *
 * The version of the OpenAPI document: 2024-11-01
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Vehicle : Combinations of attributes and unique identifier that represents a vehicle in vehicle list.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Vehicle {
    /// Vehicle Brand.
    #[serde(rename = "make")]
    pub make: String,
    /// Specific model of a vehicle.
    #[serde(rename = "model")]
    pub model: String,
    /// Name of the vehicle variant.
    #[serde(rename = "variantName", skip_serializing_if = "Option::is_none")]
    pub variant_name: Option<String>,
    /// Body style of vehicle (example: Hatchback, Cabriolet).
    #[serde(rename = "bodyStyle", skip_serializing_if = "Option::is_none")]
    pub body_style: Option<String>,
    /// Drive type of vehicle(example: Rear wheel drive).
    #[serde(rename = "driveType", skip_serializing_if = "Option::is_none")]
    pub drive_type: Option<String>,
    /// Energy Source for the vehicle(example: Petrol)
    #[serde(rename = "energy", skip_serializing_if = "Option::is_none")]
    pub energy: Option<String>,
    /// Engine output of vehicle.
    #[serde(rename = "engineOutput", skip_serializing_if = "Option::is_none")]
    pub engine_output: Option<Vec<models::vehicles_2024_11_01::EngineOutput>>,
    #[serde(rename = "manufacturingStartDate", skip_serializing_if = "Option::is_none")]
    pub manufacturing_start_date: Option<Box<models::vehicles_2024_11_01::MonthAndYear>>,
    #[serde(rename = "manufacturingStopDate", skip_serializing_if = "Option::is_none")]
    pub manufacturing_stop_date: Option<Box<models::vehicles_2024_11_01::MonthAndYear>>,
    /// The date on which the vehicle was last updated, in ISO-8601 date/time format.
    #[serde(rename = "lastProcessedDate", skip_serializing_if = "Option::is_none")]
    pub last_processed_date: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<models::vehicles_2024_11_01::VehicleStatusInCatalog>,
    /// Identifiers that can be used to identify the vehicle uniquely
    #[serde(rename = "identifiers")]
    pub identifiers: Vec<models::vehicles_2024_11_01::VehicleIdentifiers>,
}

impl Vehicle {
    /// Combinations of attributes and unique identifier that represents a vehicle in vehicle list.
    pub fn new(make: String, model: String, identifiers: Vec<models::vehicles_2024_11_01::VehicleIdentifiers>) -> Vehicle {
        Vehicle {
            make,
            model,
            variant_name: None,
            body_style: None,
            drive_type: None,
            energy: None,
            engine_output: None,
            manufacturing_start_date: None,
            manufacturing_stop_date: None,
            last_processed_date: None,
            status: None,
            identifiers,
        }
    }
}