ocpp/v2_0_1/datatype/get_variable_result
OCPP 2.0.1 GetVariableResult data type (schema GetVariableResultType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Class to hold results of GetVariables request.
| Field | Type | Req | Description |
|---|---|---|---|
attribute_status | GetVariableStatus | ✓ | |
attribute_status_info | StatusInfo | — | |
attribute_type | Attribute | — | |
attribute_value | String | — | Value of requested attribute type of component-variable. This field can only be empty when the given status is NOT accepted. The Configuration Variable ReportingValueSize can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal. (max 2500 chars) |
component | Component | ✓ | |
custom_data | CustomData | — | |
variable | Variable | ✓ |
Schema: GetVariableResultType
pub type GetVariableResult {
GetVariableResult(
attribute_status: get_variable_status.GetVariableStatus,
attribute_status_info: option.Option(status_info.StatusInfo),
attribute_type: option.Option(attribute.Attribute),
attribute_value: option.Option(String),
component: component.Component,
custom_data: option.Option(custom_data.CustomData),
variable: variable.Variable,
)
}
Constructors
-
GetVariableResult( attribute_status: get_variable_status.GetVariableStatus, attribute_status_info: option.Option(status_info.StatusInfo), attribute_type: option.Option(attribute.Attribute), attribute_value: option.Option(String), component: component.Component, custom_data: option.Option(custom_data.CustomData), variable: variable.Variable, )
Values
pub fn decoder() -> decode.Decoder(GetVariableResult)
Decode a GetVariableResult from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
attribute_status attribute_status: get_variable_status.GetVariableStatus,
component component: component.Component,
variable variable: variable.Variable,
) -> GetVariableResult
Construct a GetVariableResult from its required fields, with every optional field set to None.
pub fn to_json(value: GetVariableResult) -> json.Json
Encode a GetVariableResult to its OCPP-J JSON object.