ocpp/v2_1/message/cost_updated
OCPP 2.1 CostUpdated action.
Request/Response payload types with their OCPP-J codecs
(request_to_json/request_decoder, response_to_json/
response_decoder). Transport-agnostic; the action-string mapping
lives in ocpp/v2_1/dispatch.
Types
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — | |
total_cost | Float | ✓ | Current total cost, based on the information known by the CSMS, of the transaction including taxes. In the currency configured with the configuration Variable: [Currency] |
transaction_id | String | ✓ | Transaction Id of the transaction the current cost are asked for. (max 36 chars) |
Schema: CostUpdatedRequest
pub type Request {
Request(
custom_data: option.Option(custom_data.CustomData),
total_cost: Float,
transaction_id: String,
)
}
Constructors
-
Request( custom_data: option.Option(custom_data.CustomData), total_cost: Float, transaction_id: String, )
| Field | Type | Req | Description |
|---|---|---|---|
custom_data | CustomData | — |
Schema: CostUpdatedResponse
pub type Response {
Response(custom_data: option.Option(custom_data.CustomData))
}
Constructors
-
Response(custom_data: option.Option(custom_data.CustomData))
Values
pub fn new_request(
total_cost total_cost: Float,
transaction_id transaction_id: String,
) -> Request
Construct a Request from its required fields, with every optional field set to None.
pub fn new_response() -> Response
Construct a Response from its required fields, with every optional field set to None.
pub fn request_decoder() -> decode.Decoder(Request)
Decode a Request from its OCPP-J JSON object, enforcing schema constraints.
pub fn response_decoder() -> decode.Decoder(Response)
Decode a Response from its OCPP-J JSON object, enforcing schema constraints.