rust_ocpp/v1_6/messages/
authorize.rs

1use crate::v1_6::types::IdTagInfo;
2use validator::Validate;
3
4// # From OCPP Specification
5// 6.1. Authorize.req
6#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
7#[serde(rename_all = "camelCase")]
8pub struct AuthorizeRequest {
9    /// Required. This contains the identifier that needs to be authorized.
10    #[validate(length(min = 1, max = 20))]
11    pub id_tag: String, // IdToken, should maybe be a type?
12}
13
14#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
15#[serde(rename_all = "camelCase")]
16pub struct AuthorizeResponse {
17    /// This contains the field definition of the Authorize.conf PDU sent by the Central System to the Charge Point in response to a Authorize.req PDU. See also Authorize
18    pub id_tag_info: IdTagInfo,
19}