amazon_spapi/models/sales/order_metrics_interval.rs
1/*
2 * Selling Partner API for Sales
3 *
4 * The Selling Partner API for Sales provides APIs related to sales performance.
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/// OrderMetricsInterval : Contains order metrics.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OrderMetricsInterval {
17 /// The interval of time based on requested granularity (ex. Hour, Day, etc.) If this is the first or the last interval from the list, it might contain incomplete data if the requested interval doesn't align with the requested granularity (ex. request interval 2018-09-01T02:00:00Z--2018-09-04T19:00:00Z and granularity day will result in Sept 1st UTC day and Sept 4th UTC days having partial data).
18 #[serde(rename = "interval")]
19 pub interval: String,
20 /// The number of units in orders based on the specified filters.
21 #[serde(rename = "unitCount")]
22 pub unit_count: i32,
23 /// The number of order items based on the specified filters.
24 #[serde(rename = "orderItemCount")]
25 pub order_item_count: i32,
26 /// The number of orders based on the specified filters.
27 #[serde(rename = "orderCount")]
28 pub order_count: i32,
29 #[serde(rename = "averageUnitPrice")]
30 pub average_unit_price: Box<models::sales::Money>,
31 #[serde(rename = "totalSales")]
32 pub total_sales: Box<models::sales::Money>,
33}
34
35impl OrderMetricsInterval {
36 /// Contains order metrics.
37 pub fn new(interval: String, unit_count: i32, order_item_count: i32, order_count: i32, average_unit_price: models::sales::Money, total_sales: models::sales::Money) -> OrderMetricsInterval {
38 OrderMetricsInterval {
39 interval,
40 unit_count,
41 order_item_count,
42 order_count,
43 average_unit_price: Box::new(average_unit_price),
44 total_sales: Box::new(total_sales),
45 }
46 }
47}
48