rust_ocpp/v2_0_1/messages/
get_15118ev_certificate.rs

1//! Get15118EVCertificate
2use validator::Validate;
3
4use crate::v2_0_1::datatypes::status_info_type::StatusInfoType;
5use crate::v2_0_1::enumerations::certificate_action_enum_type::CertificateActionEnumType;
6use crate::v2_0_1::enumerations::iso15118ev_certificate_status_enum_type::Iso15118EVCertificateStatusEnumType;
7
8/// Get15118EVCertificateRequest, sent by the Charging Station to the CSMS.
9///
10/// If an ISO 15118 vehicle selects the service Certificate installation.
11///
12/// NOTE:
13/// This message is based on CertificateInstallationReq Res from ISO 15118 2.
14#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
15#[serde(rename_all = "camelCase")]
16pub struct Get15118EVCertificateRequest {
17    /// Schema version currently used for the 15118 session between EV and Charging Station. Needed for parsing of the EXI stream by the CSMS.
18    #[validate(length(min = 0, max = 50))]
19    #[serde(rename = "iso15118SchemaVersion")]
20    pub iso_15118_schema_version: String,
21    /// Defines whether certificate needs to be installed or updated.
22    pub action: CertificateActionEnumType,
23    /// Raw CertificateInstallationReq request from EV, Base64 encoded.
24    #[validate(length(min = 0, max = 5600))]
25    pub exi_request: String,
26}
27
28/// Get15118EVCertificateResponse, Response message from CSMS to Charging Station.
29///
30/// Containing the status and optionally new certificate.
31///
32/// NOTE: This message is based on CertificateInstallationReq Res from ISO 15118-2.
33#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
34#[serde(rename_all = "camelCase")]
35pub struct Get15118EVCertificateResponse {
36    /// Indicates whether the message was processed properly.
37    pub status: Iso15118EVCertificateStatusEnumType,
38    /// Raw CertificateInstallationRes response for the EV, Base64 encoded.
39    pub exi_response: String,
40    /// Detailed status information
41    #[serde(skip_serializing_if = "Option::is_none")]
42    pub status_info: Option<StatusInfoType>,
43}