rust_ocpp/v2_0_1/messages/
install_certificate.rs

1//! InstallCertificate
2
3use crate::v2_0_1::datatypes::status_info_type::StatusInfoType;
4use crate::v2_0_1::enumerations::install_certificate_status_enum_type::InstallCertificateStatusEnumType;
5use crate::v2_0_1::enumerations::install_certificate_use_enum_type::InstallCertificateUseEnumType;
6
7use validator::Validate;
8
9/// Used by the CSMS to request installation of a certificate on a Charging Station.
10#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct InstallCertificateRequest {
13    /// Indicates the certificate type that is sent.
14    pub certificate_type: InstallCertificateUseEnumType,
15    /// A PEM encoded X.509 certificate.
16    #[validate(length(min = 0, max = 5500))]
17    pub certificate: String,
18}
19
20/// The response to a InstallCertificateRequest, sent by the Charging Station to the CSMS
21#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
22#[serde(rename_all = "camelCase")]
23pub struct InstallCertificateResponse {
24    /// Charging Station indicates if installation wassuccessful.
25    pub status: InstallCertificateStatusEnumType,
26    /// Detailed status information.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub status_info: Option<StatusInfoType>,
29}