ocpp/v2_1/datatype/id_token

OCPP 2.1 IdToken data type (schema IdTokenType).

to_json/decoder map to/from its OCPP-J JSON object; new (when present) builds a value from the required fields only.

Types

Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.

FieldTypeReqDescription
additional_infoList(AdditionalInfo)
custom_dataCustomData
id_tokenString(2.1) IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID. (max 255 chars)
type_String(2.1) Enumeration of possible idToken types. Values defined in Appendix as IdTokenEnumStringType. (max 20 chars)

Schema: IdTokenType

pub type IdToken {
  IdToken(
    additional_info: option.Option(
      List(additional_info.AdditionalInfo),
    ),
    custom_data: option.Option(custom_data.CustomData),
    id_token: String,
    type_: String,
  )
}

Constructors

Values

pub fn decoder() -> decode.Decoder(IdToken)

Decode a IdToken from its OCPP-J JSON object, enforcing schema constraints.

pub fn new(
  id_token id_token: String,
  type_ type_: String,
) -> IdToken

Construct a IdToken from its required fields, with every optional field set to None.

pub fn to_json(value: IdToken) -> json.Json

Encode a IdToken to its OCPP-J JSON object.

Search Document