pub struct TransactionEventRequest {Show 16 fields
pub event_type: TransactionEventEnum,
pub timestamp: DateTime,
pub trigger_reason: TriggerReason,
pub seq_no: i32,
pub transaction_info: Transaction,
pub cost_details: Option<CostDetails>,
pub meter_value: Option<Vec<MeterValue>>,
pub offline: Option<bool>,
pub number_of_phases_used: Option<i32>,
pub cable_max_current: Option<i32>,
pub reservation_id: Option<i32>,
pub preconditioning_status: Option<PreconditioningStatus>,
pub evse_sleep: Option<bool>,
pub evse: Option<EVSE>,
pub id_token: Option<IdToken>,
pub custom_data: Option<CustomData>,
}Expand description
Spec: OCPP 2.1 · E — Transactions · Charging Station → CSMS · CALL.
Fields§
§event_type: TransactionEventEnumThe eventType member.
timestamp: DateTimeThe date and time at which this transaction event occurred.
trigger_reason: TriggerReasonThe triggerReason member.
seq_no: i32Incremental sequence number, helps with determining if all messages of a transaction have been received.
transaction_info: TransactionThe transactionInfo member.
cost_details: Option<CostDetails>The costDetails member.
meter_value: Option<Vec<MeterValue>>The meterValue member.
offline: Option<bool>Indication that this transaction event happened when the Charging Station was offline. Default = false, meaning: the event occurred when the Charging Station was online.
Schema default: false.
number_of_phases_used: Option<i32>If the Charging Station is able to report the number of phases used, then it SHALL provide it. When omitted the CSMS may be able to determine the number of phases used as follows: + 1: The numberPhases in the currently used ChargingSchedule. + 2: The number of phases provided via device management.
cable_max_current: Option<i32>The maximum current of the connected cable in Ampere (A).
reservation_id: Option<i32>This contains the Id of the reservation that terminates as a result of this transaction.
preconditioning_status: Option<PreconditioningStatus>The preconditioningStatus member.
evse_sleep: Option<bool>(2.1) True when EVSE electronics are in sleep mode for this transaction. Default value (when absent) is false.
evse: Option<EVSE>The evse member.
id_token: Option<IdToken>The idToken member.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl TransactionEventRequest
impl TransactionEventRequest
Sourcepub fn new(
event_type: TransactionEventEnum,
timestamp: impl Into<DateTime>,
trigger_reason: TriggerReason,
seq_no: i32,
transaction_info: Transaction,
) -> Self
pub fn new( event_type: TransactionEventEnum, timestamp: impl Into<DateTime>, trigger_reason: TriggerReason, seq_no: i32, transaction_info: Transaction, ) -> Self
Creates a TransactionEventRequest from its required fields.
Sourcepub fn with_cost_details(self, value: CostDetails) -> Self
pub fn with_cost_details(self, value: CostDetails) -> Self
Sets the optional costDetails field.
Sourcepub fn with_meter_value(self, value: Vec<MeterValue>) -> Self
pub fn with_meter_value(self, value: Vec<MeterValue>) -> Self
Sets the optional meterValue field.
Sourcepub fn with_offline(self, value: bool) -> Self
pub fn with_offline(self, value: bool) -> Self
Sets the optional offline field.
Sourcepub fn with_number_of_phases_used(self, value: i32) -> Self
pub fn with_number_of_phases_used(self, value: i32) -> Self
Sets the optional numberOfPhasesUsed field.
Sourcepub fn with_cable_max_current(self, value: i32) -> Self
pub fn with_cable_max_current(self, value: i32) -> Self
Sets the optional cableMaxCurrent field.
Sourcepub fn with_reservation_id(self, value: i32) -> Self
pub fn with_reservation_id(self, value: i32) -> Self
Sets the optional reservationId field.
Sourcepub fn with_preconditioning_status(self, value: PreconditioningStatus) -> Self
pub fn with_preconditioning_status(self, value: PreconditioningStatus) -> Self
Sets the optional preconditioningStatus field.
Sourcepub fn with_evse_sleep(self, value: bool) -> Self
pub fn with_evse_sleep(self, value: bool) -> Self
Sets the optional evseSleep field.
Sourcepub fn with_id_token(self, value: IdToken) -> Self
pub fn with_id_token(self, value: IdToken) -> Self
Sets the optional idToken field.
Sourcepub fn with_custom_data(self, value: CustomData) -> Self
pub fn with_custom_data(self, value: CustomData) -> Self
Sets the optional customData field.
Trait Implementations§
Source§impl Clone for TransactionEventRequest
impl Clone for TransactionEventRequest
impl Confirmed for TransactionEventRequest
Source§impl Debug for TransactionEventRequest
impl Debug for TransactionEventRequest
Source§impl<'de> Deserialize<'de> for TransactionEventRequest
impl<'de> Deserialize<'de> for TransactionEventRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TransactionEventRequest
impl PartialEq for TransactionEventRequest
Source§impl Request for TransactionEventRequest
impl Request for TransactionEventRequest
Source§const KIND: MessageKind = MessageKind::Call
const KIND: MessageKind = MessageKind::Call
CALL or SEND.Source§type Response = TransactionEventResponse
type Response = TransactionEventResponse
NoResponse for a SEND.impl Sealed for TransactionEventRequest
Source§impl Serialize for TransactionEventRequest
impl Serialize for TransactionEventRequest
impl StructuralPartialEq for TransactionEventRequest
Source§impl Validate for TransactionEventRequest
impl Validate for TransactionEventRequest
Source§fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
out, relative to path.