ocpp/v2_1/datatype/total_price
OCPP 2.1 TotalPrice data type (schema TotalPriceType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Total cost with and without tax. Contains the total of energy, charging time, idle time, fixed and reservation costs including and/or excluding tax.
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — | |
excl_tax | Float | — | Price/cost excluding tax. Can be absent if inclTax is present. |
incl_tax | Float | — | Price/cost including tax. Can be absent if exclTax is present. |
Schema: TotalPriceType
pub type TotalPrice {
TotalPrice(
custom_data: option.Option(custom_data.CustomData),
excl_tax: option.Option(Float),
incl_tax: option.Option(Float),
)
}
Constructors
-
TotalPrice( custom_data: option.Option(custom_data.CustomData), excl_tax: option.Option(Float), incl_tax: option.Option(Float), )
Values
pub fn decoder() -> decode.Decoder(TotalPrice)
Decode a TotalPrice from its OCPP-J JSON object, enforcing schema constraints.
pub fn new() -> TotalPrice
Construct a TotalPrice from its required fields, with every optional field set to None.
pub fn to_json(value: TotalPrice) -> json.Json
Encode a TotalPrice to its OCPP-J JSON object.