rust_ocpp/v1_6/messages/get_composite_schedule.rs
1use chrono::{DateTime, Utc};
2
3use crate::v1_6::types::{ChargingRateUnitType, ChargingSchedule, GetCompositeScheduleStatus};
4
5/// This contains the field definition of the GetCompositeSchedule.req PDU sent by the Central System to theCharge Point. See also Get Composite Schedule
6#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
7#[serde(rename_all = "camelCase")]
8pub struct GetCompositeScheduleRequest {
9 /// Required. The ID of the Connector for which the schedule is requested. When ConnectorId=0, the Charge Point will calculate the expected consumption for the grid connection.
10 pub connector_id: i32,
11 /// Required. Time in seconds. length of requested schedule
12 pub duration: i32,
13 /// Optional. Can be used to force a power or current profile
14 #[serde(skip_serializing_if = "Option::is_none")]
15 pub charging_rate_unit: Option<ChargingRateUnitType>,
16}
17
18/// This contains the field definition of the GetCompositeSchedule.conf PDU sent by the Charge Point to the Central System in response to a GetCompositeSchedule.req PDU. See also Get Composite Schedule
19#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
20#[serde(rename_all = "camelCase")]
21pub struct GetCompositeScheduleResponse {
22 /// Required. Status of the request. The Charge Point will indicate if it was able to process the request
23 pub status: GetCompositeScheduleStatus,
24 /// Optional. The charging schedule contained in this notification applies to a Connector.
25 #[serde(skip_serializing_if = "Option::is_none")]
26 pub connector_id: Option<i32>,
27 /// Optional. Time. Periods contained in the charging profile are relative to this point in time. If status is "Rejected", this field may be absent.
28 #[serde(skip_serializing_if = "Option::is_none")]
29 pub schedule_start: Option<DateTime<Utc>>,
30 /// Optional. Planned Composite Charging Schedule, the energy consumption over time. Always relative to ScheduleStart. If status is "Rejected", this field may be absent.
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub charging_schedule: Option<ChargingSchedule>,
33}