pub struct Session {Show 14 fields
pub id: OcpiString<36>,
pub start_date_time: DateTime,
pub end_date_time: Option<DateTime>,
pub kwh: Number,
pub auth_id: OcpiString<36>,
pub auth_method: AuthMethod,
pub location: Location,
pub meter_id: Option<OcpiString<255>>,
pub currency: Currency,
pub charging_periods: Vec<ChargingPeriod>,
pub total_cost: Option<Number>,
pub status: SessionStatus,
pub last_updated: DateTime,
pub extensions: Extensions,
}v2_1_1 only.Expand description
One charging session, in OCPI 2.1.1.
Spec: 2.1.1 §mod_sessions_session_object
Fields§
§id: OcpiString<36>The unique id that identifies the session in the CPO platform.
start_date_time: DateTimeWhen the session became active.
Note the spelling. OCPI 2.1.1 writes start_datetime; every later version writes
start_date_time. Getting this wrong is a silent data loss, which is why the Rust field
is named after the later spelling and carries an explicit #[serde(rename)].
end_date_time: Option<DateTime>When the session was completed.
kwh: NumberHow many kWh were charged.
auth_id: OcpiString<36>Reference to the auth_id of the Token that started the session.
auth_method: AuthMethodMethod used for authentication.
location: LocationWhere this session took place, “including only the relevant EVSE and connector”.
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<Number>The total cost of the session, excluding VAT.
A total_cost of 0.00 means free of charge. When omitted … this does not have to mean it is 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 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