amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Merchant Fulfillment
 *
 * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services.
 *
 * The version of the OpenAPI document: v0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// SellerInputDefinition : Specifies characteristics that apply to a seller input.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SellerInputDefinition {
    /// When true, the additional input field is required.
    #[serde(rename = "IsRequired")]
    pub is_required: bool,
    /// The data type of the additional input field.
    #[serde(rename = "DataType")]
    pub data_type: String,
    /// List of constraints.
    #[serde(rename = "Constraints")]
    pub constraints: Vec<models::merchant_fulfillment_v0::Constraint>,
    /// The display text for the additional input field.
    #[serde(rename = "InputDisplayText")]
    pub input_display_text: String,
    #[serde(rename = "InputTarget", skip_serializing_if = "Option::is_none")]
    pub input_target: Option<models::merchant_fulfillment_v0::InputTargetType>,
    #[serde(rename = "StoredValue")]
    pub stored_value: Box<models::merchant_fulfillment_v0::AdditionalSellerInput>,
    /// The set of fixed values in an additional seller input.
    #[serde(rename = "RestrictedSetValues", skip_serializing_if = "Option::is_none")]
    pub restricted_set_values: Option<Vec<String>>,
}

impl SellerInputDefinition {
    /// Specifies characteristics that apply to a seller input.
    pub fn new(is_required: bool, data_type: String, constraints: Vec<models::merchant_fulfillment_v0::Constraint>, input_display_text: String, stored_value: models::merchant_fulfillment_v0::AdditionalSellerInput) -> SellerInputDefinition {
        SellerInputDefinition {
            is_required,
            data_type,
            constraints,
            input_display_text,
            input_target: None,
            stored_value: Box::new(stored_value),
            restricted_set_values: None,
        }
    }
}