ocpp/v2_1/datatype/price_rule

OCPP 2.1 PriceRule data type (schema PriceRuleType).

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.

FieldTypeReqDescription
carbon_dioxide_emissionIntNumber of grams of CO2 per kWh. (≥ 0)
custom_dataCustomData
energy_feeRationalNumber
parking_feeRationalNumber
parking_fee_periodIntThe duration of the parking fee period (in seconds). When the time enters into a ParkingFeePeriod, the ParkingFee will apply to the session. .
power_range_startRationalNumber
renewable_generation_percentageIntPercentage of the power that is created by renewable resources. (0–100)

Schema: PriceRuleType

pub type PriceRule {
  PriceRule(
    carbon_dioxide_emission: option.Option(Int),
    custom_data: option.Option(custom_data.CustomData),
    energy_fee: rational_number.RationalNumber,
    parking_fee: option.Option(rational_number.RationalNumber),
    parking_fee_period: option.Option(Int),
    power_range_start: rational_number.RationalNumber,
    renewable_generation_percentage: option.Option(Int),
  )
}

Constructors

Values

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

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

pub fn new(
  energy_fee energy_fee: rational_number.RationalNumber,
  power_range_start power_range_start: rational_number.RationalNumber,
) -> PriceRule

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

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

Encode a PriceRule to its OCPP-J JSON object.

Search Document