Skip to main content

amazon_spapi/models/product_fees_v0/
fees_estimate_request.rs

1/*
2 * Selling Partner API for Product Fees
3 *
4 * The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing.
5 *
6 * The version of the OpenAPI document: v0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// FeesEstimateRequest : A product, marketplace, and proposed price used to request estimated fees.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FeesEstimateRequest {
17    /// A marketplace identifier.
18    #[serde(rename = "MarketplaceId")]
19    pub marketplace_id: String,
20    /// When true, the offer is fulfilled by Amazon.
21    #[serde(rename = "IsAmazonFulfilled", skip_serializing_if = "Option::is_none")]
22    pub is_amazon_fulfilled: Option<bool>,
23    #[serde(rename = "PriceToEstimateFees")]
24    pub price_to_estimate_fees: Box<models::product_fees_v0::PriceToEstimateFees>,
25    /// A unique identifier provided by the caller to track this request.
26    #[serde(rename = "Identifier")]
27    pub identifier: String,
28    #[serde(rename = "OptionalFulfillmentProgram", skip_serializing_if = "Option::is_none")]
29    pub optional_fulfillment_program: Option<models::product_fees_v0::OptionalFulfillmentProgram>,
30}
31
32impl FeesEstimateRequest {
33    /// A product, marketplace, and proposed price used to request estimated fees.
34    pub fn new(marketplace_id: String, price_to_estimate_fees: models::product_fees_v0::PriceToEstimateFees, identifier: String) -> FeesEstimateRequest {
35        FeesEstimateRequest {
36            marketplace_id,
37            is_amazon_fulfilled: None,
38            price_to_estimate_fees: Box::new(price_to_estimate_fees),
39            identifier,
40            optional_fulfillment_program: None,
41        }
42    }
43}
44