rust_ocpp/v2_0_1/messages/
get_log.rs

1//! GetLog
2use crate::v2_0_1::datatypes::log_parameters_type::LogParametersType;
3use crate::v2_0_1::datatypes::status_info_type::StatusInfoType;
4use crate::v2_0_1::enumerations::log_enum_type::LogEnumType;
5use crate::v2_0_1::enumerations::log_status_enum_type::LogStatusEnumType;
6
7use validator::Validate;
8
9/// GetLogRequest, sent by the CSMS to the Charging Station.
10#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct GetLogRequest {
13    /// This contains the type of log file that theCharging Station should send
14    pub log_type: LogEnumType,
15    /// The Id of this request
16    pub request_id: i32,
17    /// This specifies how many times the ChargingStation must try to upload the log before giving up. If thisfield is not present, it is left to Charging Station to decidehow many times it wants to retry
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub retries: Option<i32>,
20    /// The interval in seconds after which a retry maybe attempted. If this field is not present, it is left toCharging Station to decide how long to wait between attempts
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub retry_interval: Option<i32>,
23    /// This field specifies the requested log and thelocation to which the log should be sent.
24    pub log: LogParametersType,
25}
26
27/// GetLogResponse, sent by the Charging Station to the CSMS in response to a GetLogRequest.
28#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
29#[serde(rename_all = "camelCase")]
30pub struct GetLogResponse {
31    /// This field indicates whether the ChargingStation was able to accept the request.
32    pub status: LogStatusEnumType,
33    /// This contains the name of the log file that willbe uploaded. This field is not present when no logginginformation is available.
34    #[validate(length(min = 0, max = 255))]
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub filename: Option<String>,
37    /// Detailed status information.
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub status_info: Option<StatusInfoType>,
40}