rust_ocpp/v1_6/messages/
get_diagnostics.rs

1use chrono::{DateTime, Utc};
2use validator::Validate;
3
4/// This contains the field definition of the GetDiagnostics.req PDU sent by the Central System to the Charge Point. See also Get Diagnostics
5#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
6#[serde(rename_all = "camelCase")]
7pub struct GetDiagnosticsRequest {
8    /// Required. This contains the location (directory) where the diagnostics file shall be uploaded to.
9    pub location: String,
10    /// Optional. This specifies how many times Charge Point must try to upload the diagnostics before giving up. If this field is not present, it is left to Charge Point to decide how many times it wants to retry.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub retries: Option<i32>,
13    /// Optional. The interval in seconds after which a retry may be attempted. If this field is not present, it is left to Charge Point to decide how long to wait between attempts.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub retry_interval: Option<i32>,
16    /// Optional. This contains the date and time of the oldest logging information to include in the diagnostics.
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub start_time: Option<DateTime<Utc>>,
19    /// Optional. This contains the date and time of the latest logging information to include in the diagnostics.
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub stop_time: Option<DateTime<Utc>>,
22}
23
24/// This contains the field definition of the GetDiagnostics.conf PDU sent by the Charge Point to the Central System in response to a GetDiagnosticsRequest PDU. See also Get Diagnostics
25#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
26#[serde(rename_all = "camelCase")]
27pub struct GetDiagnosticsResponse {
28    /// Optional. This contains the name of the file with diagnostic information that will be uploaded. This field is not present when no diagnostic information is vailable.
29    #[validate(length(min = 1, max = 255))]
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub file_name: Option<String>,
32}