rust_ocpp/v2_0_1/messages/
customer_information.rs

1//! CustomerInformation
2use validator::Validate;
3
4use crate::v2_0_1::datatypes::certificate_hash_data_type::CertificateHashDataType;
5use crate::v2_0_1::datatypes::id_token_type::IdTokenType;
6use crate::v2_0_1::datatypes::status_info_type::StatusInfoType;
7use crate::v2_0_1::enumerations::customer_information_status_enum_type::CustomerInformationStatusEnumType;
8
9/// CustomerInformationRequest, sent by the CSMS to the Charging Station
10#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct CustomerInformationRequest {
13    /// The Id of the request
14    pub request_id: i32,
15    /// Flag indicating whether the Charging Station should return NotifyCustomerInformationRequest
16    ///  messages containing information about the customer referred to.
17    pub report: bool,
18    /// Flag indicating whether the Charging Station should clear all information about the customer referred to.
19    pub clear: bool,
20    /// A (e.g. vendor specific) identifier of the customer this request refers to.
21    /// This field contains a custom identifier other than IdToken and Certificate.
22    ///  One of the possible identifiers (customerIdentifier, customerIdToken or
23    /// customerCertificate) should be in the request message.
24    #[validate(length(min = 0, max = 64))]
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub customer_identifier: Option<String>,
27    /// The IdToken of the customer this request refers to. One of the possible identifiers
28    /// (customerIdentifier, customerIdToken or customerCertificate) should be in the request message.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub id_token: Option<IdTokenType>,
31    /// The Certificate of the customer this request refers to. One of the possible identifiers
32    /// (customerIdentifier, customerIdToken or customerCertificate) should be in the request message.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub customer_certificate: Option<CertificateHashDataType>,
35}
36
37/// CustomerInformationResponse
38#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
39#[serde(rename_all = "camelCase")]
40pub struct CustomerInformationResponse {
41    /// Indicates whether the request was accepted.
42    pub status: CustomerInformationStatusEnumType,
43    /// Detailed status information.
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub status_info: Option<StatusInfoType>,
46}