ocpp/v2_1/datatype/tariff_energy
OCPP 2.1 TariffEnergy data type (schema TariffEnergyType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Price elements and tax for energy
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — | |
prices | List(TariffEnergyPrice) | ✓ | |
tax_rates | List(TaxRate) | — |
Schema: TariffEnergyType
pub type TariffEnergy {
TariffEnergy(
custom_data: option.Option(custom_data.CustomData),
prices: List(tariff_energy_price.TariffEnergyPrice),
tax_rates: option.Option(List(tax_rate.TaxRate)),
)
}
Constructors
-
TariffEnergy( custom_data: option.Option(custom_data.CustomData), prices: List(tariff_energy_price.TariffEnergyPrice), tax_rates: option.Option(List(tax_rate.TaxRate)), )
Values
pub fn decoder() -> decode.Decoder(TariffEnergy)
Decode a TariffEnergy from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
prices prices: List(tariff_energy_price.TariffEnergyPrice),
) -> TariffEnergy
Construct a TariffEnergy from its required fields, with every optional field set to None.
pub fn to_json(value: TariffEnergy) -> json.Json
Encode a TariffEnergy to its OCPP-J JSON object.