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

FieldTypeReqDescription
custom_dataCustomData
pricesList(TariffEnergyPrice)
tax_ratesList(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

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.

Search Document