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_2_1 only.Expand description
One charging session, as it stands right now, in OCPI 2.2.1.
Spec: 2.2.1 §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.
end_date_time: Option<DateTime>When the session was completed.
kwh: NumberHow many kWh were charged.
cdr_token: CdrTokenToken used to start this charging session.
auth_method: AuthMethodMethod used for authentication.
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. May be #NA.
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.
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.
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