Skip to main content

TariffBuilder

Struct TariffBuilder 

Source
pub struct TariffBuilder<S: State = Empty> { /* private fields */ }
Available on crate feature v2_2_1 only.
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> TariffBuilder<S>

Source

pub fn build(self) -> Tariff
where S: IsComplete,

Finish building and return the requested object

Source

pub fn country_code( self, value: impl Into<CountryCode>, ) -> TariffBuilder<SetCountryCode<S>>
where S::CountryCode: IsUnset,

Required.

ISO-3166 alpha-2 country code of the CPO that owns this Tariff.

Source

pub fn party_id(self, value: impl Into<PartyId>) -> TariffBuilder<SetPartyId<S>>
where S::PartyId: IsUnset,

Required.

ID of the CPO that ‘owns’ this Tariff.

Source

pub fn id(self, value: impl Into<CiString<36>>) -> TariffBuilder<SetId<S>>
where S::Id: IsUnset,

Required.

Uniquely identifies the tariff within the CPO’s platform.

Source

pub fn currency( self, value: impl Into<Currency>, ) -> TariffBuilder<SetCurrency<S>>
where S::Currency: IsUnset,

Required.

ISO-4217 code of the currency of this tariff.

Source

pub fn tariff_type( self, value: impl Into<TariffType>, ) -> TariffBuilder<SetTariffType<S>>
where S::TariffType: IsUnset,

Optional (Some / Option setters). The type of the tariff. When omitted, this tariff is valid for all sessions.

Source

pub fn maybe_tariff_type( self, value: Option<impl Into<TariffType>>, ) -> TariffBuilder<SetTariffType<S>>
where S::TariffType: IsUnset,

Optional (Some / Option setters). The type of the tariff. When omitted, this tariff is valid for all sessions.

Source

pub fn tariff_alt_text( self, value: impl Into<Vec<DisplayText>>, ) -> TariffBuilder<SetTariffAltText<S>>
where S::TariffAltText: IsUnset,

Optional (Some / Option setters). Default: <Vec<DisplayText> as Default>::default().

Multi-language alternative tariff info texts.

Source

pub fn maybe_tariff_alt_text( self, value: Option<impl Into<Vec<DisplayText>>>, ) -> TariffBuilder<SetTariffAltText<S>>
where S::TariffAltText: IsUnset,

Optional (Some / Option setters). Default: <Vec<DisplayText> as Default>::default().

Multi-language alternative tariff info texts.

Source

pub fn tariff_alt_url( self, value: impl Into<Url>, ) -> TariffBuilder<SetTariffAltUrl<S>>
where S::TariffAltUrl: IsUnset,

Optional (Some / Option setters). URL to a web page explaining the tariff in human-readable form.

Source

pub fn maybe_tariff_alt_url( self, value: Option<impl Into<Url>>, ) -> TariffBuilder<SetTariffAltUrl<S>>
where S::TariffAltUrl: IsUnset,

Optional (Some / Option setters). URL to a web page explaining the tariff in human-readable form.

Source

pub fn min_price(self, value: impl Into<Price>) -> TariffBuilder<SetMinPrice<S>>
where S::MinPrice: IsUnset,

Optional (Some / Option setters). A Charging Session with this tariff will cost at least this amount.

Source

pub fn maybe_min_price( self, value: Option<impl Into<Price>>, ) -> TariffBuilder<SetMinPrice<S>>
where S::MinPrice: IsUnset,

Optional (Some / Option setters). A Charging Session with this tariff will cost at least this amount.

Source

pub fn max_price(self, value: impl Into<Price>) -> TariffBuilder<SetMaxPrice<S>>
where S::MaxPrice: IsUnset,

Optional (Some / Option setters). A Charging Session with this tariff will not cost more than this amount.

Source

pub fn maybe_max_price( self, value: Option<impl Into<Price>>, ) -> TariffBuilder<SetMaxPrice<S>>
where S::MaxPrice: IsUnset,

Optional (Some / Option setters). A Charging Session with this tariff will not cost more than this amount.

Source

pub fn elements( self, value: impl Into<Vec<TariffElement>>, ) -> TariffBuilder<SetElements<S>>
where S::Elements: IsUnset,

Required.

The Tariff Elements. Cardinality +.

Source

pub fn start_date_time( self, value: impl Into<DateTime>, ) -> TariffBuilder<SetStartDateTime<S>>
where S::StartDateTime: IsUnset,

Optional (Some / Option setters). When this tariff becomes active, in UTC.

Source

pub fn maybe_start_date_time( self, value: Option<impl Into<DateTime>>, ) -> TariffBuilder<SetStartDateTime<S>>
where S::StartDateTime: IsUnset,

Optional (Some / Option setters). When this tariff becomes active, in UTC.

Source

pub fn end_date_time( self, value: impl Into<DateTime>, ) -> TariffBuilder<SetEndDateTime<S>>
where S::EndDateTime: IsUnset,

Optional (Some / Option setters). When this tariff stops being valid, in UTC.

Source

pub fn maybe_end_date_time( self, value: Option<impl Into<DateTime>>, ) -> TariffBuilder<SetEndDateTime<S>>
where S::EndDateTime: IsUnset,

Optional (Some / Option setters). When this tariff stops being valid, in UTC.

Source

pub fn energy_mix( self, value: impl Into<EnergyMix>, ) -> TariffBuilder<SetEnergyMix<S>>
where S::EnergyMix: IsUnset,

Optional (Some / Option setters). Details on the energy supplied with this tariff.

Source

pub fn maybe_energy_mix( self, value: Option<impl Into<EnergyMix>>, ) -> TariffBuilder<SetEnergyMix<S>>
where S::EnergyMix: IsUnset,

Optional (Some / Option setters). Details on the energy supplied with this tariff.

Source

pub fn last_updated( self, value: impl Into<DateTime>, ) -> TariffBuilder<SetLastUpdated<S>>
where S::LastUpdated: IsUnset,

Required.

Timestamp when this Tariff was last updated (or created).

Source

pub fn extensions( self, value: impl Into<Extensions>, ) -> TariffBuilder<SetExtensions<S>>
where S::Extensions: IsUnset,

Optional (Some / Option setters). Default: <Extensions as Default>::default().

Undocumented JSON fields, preserved verbatim.

Source

pub fn maybe_extensions( self, value: Option<impl Into<Extensions>>, ) -> TariffBuilder<SetExtensions<S>>
where S::Extensions: IsUnset,

Optional (Some / Option setters). Default: <Extensions as Default>::default().

Undocumented JSON fields, preserved verbatim.

Auto Trait Implementations§

§

impl<S> Freeze for TariffBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Tariff>)>: Freeze,

§

impl<S> RefUnwindSafe for TariffBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Tariff>)>: RefUnwindSafe,

§

impl<S> Send for TariffBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Tariff>)>: Send,

§

impl<S> Sync for TariffBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Tariff>)>: Sync,

§

impl<S> Unpin for TariffBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Tariff>)>: Unpin,

§

impl<S> UnsafeUnpin for TariffBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Tariff>)>: UnsafeUnpin,

§

impl<S> UnwindSafe for TariffBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Tariff>)>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more