ocpp/v2_0_1/datatype/cost
OCPP 2.0.1 Cost data type (schema CostType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
| Field | Type | Req | Description |
|---|---|---|---|
amount | Int | ✓ | The estimated or actual cost per kWh |
amount_multiplier | Int | — | Values: -3..3, The amountMultiplier defines the exponent to base 10 (dec). The final value is determined by: amount * 10 ^ amountMultiplier |
cost_kind | CostKind | ✓ | |
custom_data | CustomData | — |
Schema: CostType · Cost · urn:x-oca:ocpp:uid:2:233258
pub type Cost {
Cost(
amount: Int,
amount_multiplier: option.Option(Int),
cost_kind: cost_kind.CostKind,
custom_data: option.Option(custom_data.CustomData),
)
}
Constructors
-
Cost( amount: Int, amount_multiplier: option.Option(Int), cost_kind: cost_kind.CostKind, custom_data: option.Option(custom_data.CustomData), )
Values
pub fn decoder() -> decode.Decoder(Cost)
Decode a Cost from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
amount amount: Int,
cost_kind cost_kind: cost_kind.CostKind,
) -> Cost
Construct a Cost from its required fields, with every optional field set to None.