ocpp/v2_1/datatype/consumption_cost

OCPP 2.1 ConsumptionCost data type (schema ConsumptionCostType).

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

Types

FieldTypeReqDescription
costList(Cost)
custom_dataCustomData
start_valueFloatThe lowest level of consumption that defines the starting point of this consumption block. The block interval extends to the start of the next interval.

Schema: ConsumptionCostType

pub type ConsumptionCost {
  ConsumptionCost(
    cost: List(cost.Cost),
    custom_data: option.Option(custom_data.CustomData),
    start_value: Float,
  )
}

Constructors

Values

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

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

pub fn new(
  cost cost: List(cost.Cost),
  start_value start_value: Float,
) -> ConsumptionCost

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

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

Encode a ConsumptionCost to its OCPP-J JSON object.

Search Document