ocpp/v2_1/datatype/message_content
OCPP 2.1 MessageContent data type (schema MessageContentType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Contains message details, for a message to be displayed on a Charging Station.
| Field | Type | Req | Description |
|---|---|---|---|
content | String | ✓ | (2.1) Required. Message contents. + Maximum length supported by Charging Station is given in OCPPCommCtrlr.FieldLength[“MessageContentType.content”]. Maximum length defaults to 1024. (max 1024 chars) |
custom_data | CustomData | — | |
format | MessageFormat | ✓ | |
language | String | — | Message language identifier. Contains a language code as defined in [RFC5646]. (max 8 chars) |
Schema: MessageContentType
pub type MessageContent {
MessageContent(
content: String,
custom_data: option.Option(custom_data.CustomData),
format: message_format.MessageFormat,
language: option.Option(String),
)
}
Constructors
-
MessageContent( content: String, custom_data: option.Option(custom_data.CustomData), format: message_format.MessageFormat, language: option.Option(String), )
Values
pub fn decoder() -> decode.Decoder(MessageContent)
Decode a MessageContent from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
content content: String,
format format: message_format.MessageFormat,
) -> MessageContent
Construct a MessageContent from its required fields, with every optional field set to None.
pub fn to_json(value: MessageContent) -> json.Json
Encode a MessageContent to its OCPP-J JSON object.