rust_ocpp/v2_0_1/messages/
get_report.rs

1//! GetReport
2use crate::v2_0_1::datatypes::component_variable_type::ComponentVariableType;
3use crate::v2_0_1::datatypes::status_info_type::StatusInfoType;
4use crate::v2_0_1::enumerations::component_criterion_enum_type::ComponentCriterionEnumType;
5use crate::v2_0_1::enumerations::generic_device_model_status_enum_type::GenericDeviceModelStatusEnumType;
6use validator::Validate;
7
8/// GetReportRequest, sent by the CSMS to the Charging Station.
9#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Validate, Default)]
10#[serde(rename_all = "camelCase")]
11pub struct GetReportRequest {
12    /// The Id of the request.
13    pub request_id: i32,
14    /// This field contains criteria for components forwhich a report is requested.
15    #[serde(skip_serializing_if = "Option::is_none")]
16    #[validate(length(min = 0, max = 4))]
17    pub component_criteria: Option<Vec<ComponentCriterionEnumType>>,
18    /// This field specifies the components andvariables for which a report is requested.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub component_variable: Option<Vec<ComponentVariableType>>,
21}
22
23/// GetReportRequest, sent by the Charging Station to the CSMS.
24#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
25#[serde(rename_all = "camelCase")]
26pub struct GetReportResponse {
27    /// This field indicates whether the ChargingStation was able to accept the request.
28    pub status: GenericDeviceModelStatusEnumType,
29    /// Detailed status information.
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub status_info: Option<StatusInfoType>,
32}