pub struct SessionBuilder<S: State = Empty> { /* private fields */ }v2_3_0 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 country_code(
self,
value: impl Into<CountryCode>,
) -> SessionBuilder<SetCountryCode<S>>where
S::CountryCode: IsUnset,
pub fn country_code(
self,
value: impl Into<CountryCode>,
) -> SessionBuilder<SetCountryCode<S>>where
S::CountryCode: IsUnset,
Required.
ISO-3166 alpha-2 country code of the CPO that ‘owns’ this Session.
Sourcepub fn party_id(
self,
value: impl Into<PartyId>,
) -> SessionBuilder<SetPartyId<S>>where
S::PartyId: IsUnset,
pub fn party_id(
self,
value: impl Into<PartyId>,
) -> SessionBuilder<SetPartyId<S>>where
S::PartyId: IsUnset,
Required.
ID of the CPO that ‘owns’ this Session.
Sourcepub fn id(self, value: impl Into<CiString<36>>) -> SessionBuilder<SetId<S>>where
S::Id: IsUnset,
pub fn id(self, value: impl Into<CiString<36>>) -> SessionBuilder<SetId<S>>where
S::Id: IsUnset,
Required.
The unique id that identifies the charging 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 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.
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 cdr_token(
self,
value: impl Into<CdrToken>,
) -> SessionBuilder<SetCdrToken<S>>where
S::CdrToken: IsUnset,
pub fn cdr_token(
self,
value: impl Into<CdrToken>,
) -> SessionBuilder<SetCdrToken<S>>where
S::CdrToken: IsUnset,
Required.
Token used to start this charging 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. This might change during a session.
Sourcepub fn location_id(
self,
value: impl Into<CiString<36>>,
) -> SessionBuilder<SetLocationId<S>>where
S::LocationId: IsUnset,
pub fn location_id(
self,
value: impl Into<CiString<36>>,
) -> SessionBuilder<SetLocationId<S>>where
S::LocationId: IsUnset,
Required.
Location.id on which the charging session is or was happening.
Sourcepub fn evse_uid(
self,
value: impl Into<CiString<36>>,
) -> SessionBuilder<SetEvseUid<S>>where
S::EvseUid: IsUnset,
pub fn evse_uid(
self,
value: impl Into<CiString<36>>,
) -> SessionBuilder<SetEvseUid<S>>where
S::EvseUid: IsUnset,
Required.
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.
Sourcepub fn connector_id(
self,
value: impl Into<CiString<36>>,
) -> SessionBuilder<SetConnectorId<S>>where
S::ConnectorId: IsUnset,
pub fn connector_id(
self,
value: impl Into<CiString<36>>,
) -> SessionBuilder<SetConnectorId<S>>where
S::ConnectorId: IsUnset,
Required.
Connector.id where the charging session is or was happening. May be #NA.
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<Price>,
) -> SessionBuilder<SetTotalCost<S>>where
S::TotalCost: IsUnset,
pub fn total_cost(
self,
value: impl Into<Price>,
) -> SessionBuilder<SetTotalCost<S>>where
S::TotalCost: IsUnset,
Sourcepub fn maybe_total_cost(
self,
value: Option<impl Into<Price>>,
) -> SessionBuilder<SetTotalCost<S>>where
S::TotalCost: IsUnset,
pub fn maybe_total_cost(
self,
value: Option<impl Into<Price>>,
) -> 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).