ocpp/v2_1/datatype/sales_tariff
OCPP 2.1 SalesTariff data type (schema SalesTariffType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
A SalesTariff provided by a Mobility Operator (EMSP) . NOTE: This dataType is based on dataTypes from ISO 15118-2.
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — | |
id | Int | ✓ | SalesTariff identifier used to identify one sales tariff. An SAID remains a unique identifier for one schedule throughout a charging session. (≥ 0) |
num_e_price_levels | Int | — | Defines the overall number of distinct price levels used across all provided SalesTariff elements. (≥ 0) |
sales_tariff_description | String | — | A human readable title/short description of the sales tariff e.g. for HMI display purposes. (max 32 chars) |
sales_tariff_entry | List(SalesTariffEntry) | ✓ |
Schema: SalesTariffType
pub type SalesTariff {
SalesTariff(
custom_data: option.Option(custom_data.CustomData),
id: Int,
num_e_price_levels: option.Option(Int),
sales_tariff_description: option.Option(String),
sales_tariff_entry: List(sales_tariff_entry.SalesTariffEntry),
)
}
Constructors
-
SalesTariff( custom_data: option.Option(custom_data.CustomData), id: Int, num_e_price_levels: option.Option(Int), sales_tariff_description: option.Option(String), sales_tariff_entry: List(sales_tariff_entry.SalesTariffEntry), )
Values
pub fn decoder() -> decode.Decoder(SalesTariff)
Decode a SalesTariff from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
id id: Int,
sales_tariff_entry sales_tariff_entry: List(
sales_tariff_entry.SalesTariffEntry,
),
) -> SalesTariff
Construct a SalesTariff from its required fields, with every optional field set to None.
pub fn to_json(value: SalesTariff) -> json.Json
Encode a SalesTariff to its OCPP-J JSON object.