ocpp/v2_1/datatype/charging_period

OCPP 2.1 ChargingPeriod data type (schema ChargingPeriodType).

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

Types

A ChargingPeriodType consists of a start time, and a list of possible values that influence this period, for example: amount of energy charged this period, maximum current during this period etc.

FieldTypeReqDescription
custom_dataCustomData
dimensionsList(CostDimensionType)
start_periodDateTimeStart timestamp of charging period. A period ends when the next period starts. The last period ends when the session ends.
tariff_idStringUnique identifier of the Tariff that was used to calculate cost. If not provided, then cost was calculated by some other means. (max 60 chars)

Schema: ChargingPeriodType

pub type ChargingPeriod {
  ChargingPeriod(
    custom_data: option.Option(custom_data.CustomData),
    dimensions: option.Option(
      List(cost_dimension_type.CostDimensionType),
    ),
    start_period: timestamp.Timestamp,
    tariff_id: option.Option(String),
  )
}

Constructors

Values

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

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

pub fn new(
  start_period start_period: timestamp.Timestamp,
) -> ChargingPeriod

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

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

Encode a ChargingPeriod to its OCPP-J JSON object.

Search Document