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.
| 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. |
tax_rates | List(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
-
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)), )
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.