pub struct Session {Show 19 fields
pub country_code: CountryCode,
pub party_id: PartyId,
pub id: CiString<36>,
pub start_date_time: DateTime,
pub end_date_time: Option<DateTime>,
pub kwh: Number,
pub cdr_token: CdrToken,
pub auth_method: AuthMethod,
pub authorization_reference: Option<CiString<36>>,
pub location_id: CiString<36>,
pub evse_uid: CiString<36>,
pub connector_id: CiString<36>,
pub meter_id: Option<OcpiString<255>>,
pub currency: Currency,
pub charging_periods: Vec<ChargingPeriod>,
pub total_cost: Option<Price>,
pub status: SessionStatus,
pub last_updated: DateTime,
pub extensions: Extensions,
}v2_3_0 only.Expand description
One charging session, as it stands right now.
That doesn’t mean it is required that energy has been transferred between EV and the Charge Point. … as the EV was connected to the Charge Point, some form of start tariff, park tariff or reservation cost might be relevant.
Spec: 2.3.0 §mod_sessions_session_object
Fields§
§country_code: CountryCodeISO-3166 alpha-2 country code of the CPO that ‘owns’ this Session.
party_id: PartyIdID of the CPO that ‘owns’ this Session.
id: CiString<36>The unique id that identifies the charging session in the CPO platform.
start_date_time: DateTimeWhen the session became ACTIVE in the Charge Point.
When the session is still
PENDING, this field SHALL be set to the time the Session was created at the Charge Point. When a Session goes fromPENDINGtoACTIVE, this field SHALL be updated to the moment the Session went toACTIVE.
end_date_time: Option<DateTime>When the session was completed. Charging may have finished earlier.
kwh: NumberHow many kWh were charged.
cdr_token: CdrTokenToken used to start this charging session.
auth_method: AuthMethodMethod used for authentication. This might change during a session.
Reference to the authorization given by the eMSP.
location_id: CiString<36>Location.id on which the charging session is or was happening.
evse_uid: CiString<36>EVSE.uid on which the charging session is or was happening.
Allowed to be set to
#NAwhen this session is created for a reservation, but no EVSE yet assigned to the driver.
connector_id: CiString<36>Connector.id where the charging session is or was happening. May be #NA.
meter_id: Option<OcpiString<255>>Optional identification of the kWh meter.
currency: CurrencyISO 4217 code of the currency used for this session.
charging_periods: Vec<ChargingPeriod>Charging Periods that can be used to calculate and verify the total cost.
total_cost: Option<Price>The total cost of the session.
A total_cost of 0.00 means free of charge. When omitted … it does not imply the session is/was free of charge.
status: SessionStatusThe status of the session.
last_updated: DateTimeTimestamp when this Session was last updated (or created).
extensions: ExtensionsUndocumented JSON fields, preserved verbatim.
Implementations§
Source§impl Session
impl Session
Sourcepub fn builder() -> SessionBuilder
pub fn builder() -> SessionBuilder
Create an instance of Session using the builder syntax
Source§impl Session
impl Session
Sourcepub fn owner_party(&self) -> PartyRef
pub fn owner_party(&self) -> PartyRef
The CPO that owns this Session.
Sourcepub fn has_assigned_evse(&self) -> bool
pub fn has_assigned_evse(&self) -> bool
Whether an EVSE and connector have been assigned yet.
Both fields may carry the #NA sentinel while a reservation has not been taken up.
Sourcepub fn is_final(&self) -> bool
pub fn is_final(&self) -> bool
Whether the session has reached a state that will not change again.
Sourcepub fn dimension_total(&self, dimension: CdrDimensionType) -> Number
pub fn dimension_total(&self, dimension: CdrDimensionType) -> Number
The total volume of one dimension across every charging period.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
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 JsonSchema for Session
impl JsonSchema for Session
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more