rust_ocpp/v1_6/messages/remote_start_transaction.rs
1use validator::Validate;
2
3use crate::v1_6::types::{ChargingProfile, RemoteStartStopStatus};
4
5/// This contains the field definitions of the RemoteStartTransactionRequest PDU sent to Charge Point by Central System. See also Remote Start Transaction
6#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
7#[serde(rename_all = "camelCase")]
8pub struct RemoteStartTransactionRequest {
9 /// Optional. Number of the connector on which to start the transaction. connectorId SHALL be > 0
10 #[serde(skip_serializing_if = "Option::is_none")]
11 pub connector_id: Option<u32>,
12 /// Required. The identifier that Charge Point must use to start a transaction.
13 #[validate(length(min = 1, max = 20))]
14 pub id_tag: String, // IdToken, should this be a type?
15 /// Optional. Charging Profile to be used by the Charge Point for the requested transaction. ChargingProfilePurpose MUST be set to TxProfile
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub charging_profile: Option<ChargingProfile>,
18}
19
20/// This contains the field definitions of the RemoteStartTransaction.conf PDU sent from Charge Point to Central System. See also Remote Start Transaction
21#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
22#[serde(rename_all = "camelCase")]
23pub struct RemoteStartTransactionResponse {
24 // Required. Status indicating whether Charge Point accepts the request to start a transaction.
25 pub status: RemoteStartStopStatus,
26}