rust_ocpp/v1_6/messages/
get_configuration.rs

1use validator::Validate;
2
3use crate::v1_6::types::KeyValue;
4
5/// This contains the field definition of the GetConfiguration.req PDU sent by the Central System to the Charge Point. See also Get Configuration
6#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
7#[serde(rename_all = "camelCase")]
8pub struct GetConfigurationRequest {
9    /// Optional. List of keys for which the configuration value is requested.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    #[validate(length(min = 1, max = 50))]
12    pub key: Option<Vec<String>>,
13}
14
15/// This contains the field definition of the GetConfiguration.conf PDU sent by Charge Point the to the Central System in response to a GetConfiguration.req. See also Get Configuration
16#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
17#[serde(rename_all = "camelCase")]
18pub struct GetConfigurationResponse {
19    /// Optional. List of requested or known keys
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub configuration_key: Option<Vec<KeyValue>>,
22    /// Optional. Requested keys that are unknown
23    #[validate(length(min = 1, max = 50))]
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub unknown_key: Option<Vec<String>>,
26}