ocpp/v2_1/datatype/price

OCPP 2.1 Price data type (schema PriceType).

to_json/decoder map to/from its OCPP-J JSON object; new (when present) builds a value from the required fields only.

Types

Price with and without tax. At least one of exclTax, inclTax must be present.

FieldTypeReqDescription
custom_dataCustomData
excl_taxFloatPrice/cost excluding tax. Can be absent if inclTax is present.
incl_taxFloatPrice/cost including tax. Can be absent if exclTax is present.
tax_ratesList(TaxRate)

Schema: PriceType

pub type Price {
  Price(
    custom_data: option.Option(custom_data.CustomData),
    excl_tax: option.Option(Float),
    incl_tax: option.Option(Float),
    tax_rates: option.Option(List(tax_rate.TaxRate)),
  )
}

Constructors

Values

pub fn decoder() -> decode.Decoder(Price)

Decode a Price from its OCPP-J JSON object, enforcing schema constraints.

pub fn new() -> Price

Construct a Price from its required fields, with every optional field set to None.

pub fn to_json(value: Price) -> json.Json

Encode a Price to its OCPP-J JSON object.

Search Document