ocpp/v2_1/datatype/price_rule_stack
OCPP 2.1 PriceRuleStack data type (schema PriceRuleStackType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Part of ISO 15118-20 price schedule.
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — | |
duration | Int | ✓ | Duration of the stack of price rules. he amount of seconds that define the duration of the given PriceRule(s). |
price_rule | List(PriceRule) | ✓ |
Schema: PriceRuleStackType
pub type PriceRuleStack {
PriceRuleStack(
custom_data: option.Option(custom_data.CustomData),
duration: Int,
price_rule: List(price_rule.PriceRule),
)
}
Constructors
-
PriceRuleStack( custom_data: option.Option(custom_data.CustomData), duration: Int, price_rule: List(price_rule.PriceRule), )
Values
pub fn decoder() -> decode.Decoder(PriceRuleStack)
Decode a PriceRuleStack from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
duration duration: Int,
price_rule price_rule: List(price_rule.PriceRule),
) -> PriceRuleStack
Construct a PriceRuleStack from its required fields, with every optional field set to None.
pub fn to_json(value: PriceRuleStack) -> json.Json
Encode a PriceRuleStack to its OCPP-J JSON object.