pub struct SessionBuilder<S: State = Empty> { /* private fields */ }v2_1_1 only.Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> SessionBuilder<S>
impl<S: State> SessionBuilder<S>
Sourcepub fn build(self) -> Sessionwhere
S: IsComplete,
pub fn build(self) -> Sessionwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn id(self, value: impl Into<OcpiString<36>>) -> SessionBuilder<SetId<S>>where
S::Id: IsUnset,
pub fn id(self, value: impl Into<OcpiString<36>>) -> SessionBuilder<SetId<S>>where
S::Id: IsUnset,
Required.
The unique id that identifies the session in the CPO platform.
Sourcepub fn start_date_time(
self,
value: impl Into<DateTime>,
) -> SessionBuilder<SetStartDateTime<S>>where
S::StartDateTime: IsUnset,
pub fn start_date_time(
self,
value: impl Into<DateTime>,
) -> SessionBuilder<SetStartDateTime<S>>where
S::StartDateTime: IsUnset,
Required.
When 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)].
Sourcepub fn end_date_time(
self,
value: impl Into<DateTime>,
) -> SessionBuilder<SetEndDateTime<S>>where
S::EndDateTime: IsUnset,
pub fn end_date_time(
self,
value: impl Into<DateTime>,
) -> SessionBuilder<SetEndDateTime<S>>where
S::EndDateTime: IsUnset,
Sourcepub fn maybe_end_date_time(
self,
value: Option<impl Into<DateTime>>,
) -> SessionBuilder<SetEndDateTime<S>>where
S::EndDateTime: IsUnset,
pub fn maybe_end_date_time(
self,
value: Option<impl Into<DateTime>>,
) -> SessionBuilder<SetEndDateTime<S>>where
S::EndDateTime: IsUnset,
Sourcepub fn kwh(self, value: impl Into<Number>) -> SessionBuilder<SetKwh<S>>where
S::Kwh: IsUnset,
pub fn kwh(self, value: impl Into<Number>) -> SessionBuilder<SetKwh<S>>where
S::Kwh: IsUnset,
Required.
How many kWh were charged.
Sourcepub fn auth_id(
self,
value: impl Into<OcpiString<36>>,
) -> SessionBuilder<SetAuthId<S>>where
S::AuthId: IsUnset,
pub fn auth_id(
self,
value: impl Into<OcpiString<36>>,
) -> SessionBuilder<SetAuthId<S>>where
S::AuthId: IsUnset,
Required.
Reference to the auth_id of the Token that started the session.
Sourcepub fn auth_method(
self,
value: impl Into<AuthMethod>,
) -> SessionBuilder<SetAuthMethod<S>>where
S::AuthMethod: IsUnset,
pub fn auth_method(
self,
value: impl Into<AuthMethod>,
) -> SessionBuilder<SetAuthMethod<S>>where
S::AuthMethod: IsUnset,
Required.
Method used for authentication.
Sourcepub fn location(
self,
value: impl Into<Location>,
) -> SessionBuilder<SetLocation<S>>where
S::Location: IsUnset,
pub fn location(
self,
value: impl Into<Location>,
) -> SessionBuilder<SetLocation<S>>where
S::Location: IsUnset,
Required.
Where this session took place, “including only the relevant EVSE and connector”.
Sourcepub fn meter_id(
self,
value: impl Into<OcpiString<255>>,
) -> SessionBuilder<SetMeterId<S>>where
S::MeterId: IsUnset,
pub fn meter_id(
self,
value: impl Into<OcpiString<255>>,
) -> SessionBuilder<SetMeterId<S>>where
S::MeterId: IsUnset,
Sourcepub fn maybe_meter_id(
self,
value: Option<impl Into<OcpiString<255>>>,
) -> SessionBuilder<SetMeterId<S>>where
S::MeterId: IsUnset,
pub fn maybe_meter_id(
self,
value: Option<impl Into<OcpiString<255>>>,
) -> SessionBuilder<SetMeterId<S>>where
S::MeterId: IsUnset,
Sourcepub fn currency(
self,
value: impl Into<Currency>,
) -> SessionBuilder<SetCurrency<S>>where
S::Currency: IsUnset,
pub fn currency(
self,
value: impl Into<Currency>,
) -> SessionBuilder<SetCurrency<S>>where
S::Currency: IsUnset,
Required.
ISO 4217 code of the currency used for this session.
Sourcepub fn charging_periods(
self,
value: impl Into<Vec<ChargingPeriod>>,
) -> SessionBuilder<SetChargingPeriods<S>>where
S::ChargingPeriods: IsUnset,
pub fn charging_periods(
self,
value: impl Into<Vec<ChargingPeriod>>,
) -> SessionBuilder<SetChargingPeriods<S>>where
S::ChargingPeriods: IsUnset,
Sourcepub fn maybe_charging_periods(
self,
value: Option<impl Into<Vec<ChargingPeriod>>>,
) -> SessionBuilder<SetChargingPeriods<S>>where
S::ChargingPeriods: IsUnset,
pub fn maybe_charging_periods(
self,
value: Option<impl Into<Vec<ChargingPeriod>>>,
) -> SessionBuilder<SetChargingPeriods<S>>where
S::ChargingPeriods: IsUnset,
Sourcepub fn total_cost(
self,
value: impl Into<Number>,
) -> SessionBuilder<SetTotalCost<S>>where
S::TotalCost: IsUnset,
pub fn total_cost(
self,
value: impl Into<Number>,
) -> SessionBuilder<SetTotalCost<S>>where
S::TotalCost: IsUnset,
Sourcepub fn maybe_total_cost(
self,
value: Option<impl Into<Number>>,
) -> SessionBuilder<SetTotalCost<S>>where
S::TotalCost: IsUnset,
pub fn maybe_total_cost(
self,
value: Option<impl Into<Number>>,
) -> SessionBuilder<SetTotalCost<S>>where
S::TotalCost: IsUnset,
Sourcepub fn status(
self,
value: impl Into<SessionStatus>,
) -> SessionBuilder<SetStatus<S>>where
S::Status: IsUnset,
pub fn status(
self,
value: impl Into<SessionStatus>,
) -> SessionBuilder<SetStatus<S>>where
S::Status: IsUnset,
Required.
The status of the session.
Sourcepub fn last_updated(
self,
value: impl Into<DateTime>,
) -> SessionBuilder<SetLastUpdated<S>>where
S::LastUpdated: IsUnset,
pub fn last_updated(
self,
value: impl Into<DateTime>,
) -> SessionBuilder<SetLastUpdated<S>>where
S::LastUpdated: IsUnset,
Required.
Timestamp when this Session was last updated (or created).