ocpp/v2_0_1/datatype/cost

OCPP 2.0.1 Cost data type (schema CostType).

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

Types

FieldTypeReqDescription
amountIntThe estimated or actual cost per kWh
amount_multiplierIntValues: -3..3, The amountMultiplier defines the exponent to base 10 (dec). The final value is determined by: amount * 10 ^ amountMultiplier
cost_kindCostKind
custom_dataCustomData

Schema: CostType · Cost · urn:x-oca:ocpp:uid:2:233258

pub type Cost {
  Cost(
    amount: Int,
    amount_multiplier: option.Option(Int),
    cost_kind: cost_kind.CostKind,
    custom_data: option.Option(custom_data.CustomData),
  )
}

Constructors

Values

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

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

pub fn new(
  amount amount: Int,
  cost_kind cost_kind: cost_kind.CostKind,
) -> Cost

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

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

Encode a Cost to its OCPP-J JSON object.

Search Document