rust_ocpp/v2_0_1/datatypes/additional_info_type.rs
1//! Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.
2use crate::v2_0_1::helpers::validator::validate_identifier_string;
3use validator::Validate;
4
5/// Contains a case insensitive identifier to use for the authorization and the
6/// type of authorization to support multiple forms of identifiers.
7///
8/// AdditionalInfoType is used by: [IdTokenType](`crate::v2_0_1::datatypes::id_token_type::IdTokenType`)
9#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
10#[serde(rename_all = "camelCase")]
11pub struct AdditionalInfoType {
12 /// This field specifies the additional IdToken
13 #[validate(
14 length(min = 1, max = 36),
15 custom(function = "validate_identifier_string")
16 )]
17 pub additional_id_token: String,
18 /// This defines the type of the additionalIdToken. This is a custom type, so the implementation needs to be agreed upon by all involved parties.
19 #[validate(length(min = 0, max = 50))]
20 #[serde(rename = "type")]
21 pub kind: String,
22}