pub struct CredentialsBuilder<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> CredentialsBuilder<S>
impl<S: State> CredentialsBuilder<S>
Sourcepub fn build(self) -> Credentialswhere
S: IsComplete,
pub fn build(self) -> Credentialswhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn token(
self,
value: impl Into<OcpiString<64>>,
) -> CredentialsBuilder<SetToken<S>>where
S::Token: IsUnset,
pub fn token(
self,
value: impl Into<OcpiString<64>>,
) -> CredentialsBuilder<SetToken<S>>where
S::Token: IsUnset,
Required.
The credentials token for the other party to authenticate in your system.
It should only contain printable non-whitespace ASCII characters, that is, characters with Unicode code points from the range of U+0021 up to and including U+007E.
This is the token in cleartext — the value that goes, Base64-encoded, into the peer’s
Authorization header. CredentialsToken is the
type to hold it in once it leaves this object: it redacts itself in Debug, compares in
constant time and is zeroised on drop.
Sourcepub fn url(self, value: impl Into<Url>) -> CredentialsBuilder<SetUrl<S>>where
S::Url: IsUnset,
pub fn url(self, value: impl Into<Url>) -> CredentialsBuilder<SetUrl<S>>where
S::Url: IsUnset,
Required.
The URL to your API versions endpoint.
Sourcepub fn hub_party_id(
self,
value: impl Into<CiString<5>>,
) -> CredentialsBuilder<SetHubPartyId<S>>where
S::HubPartyId: IsUnset,
pub fn hub_party_id(
self,
value: impl Into<CiString<5>>,
) -> CredentialsBuilder<SetHubPartyId<S>>where
S::HubPartyId: IsUnset,
Optional (Some / Option setters).
The Hub party of this platform, as a five-character <country><party> string.
A Platform that supports Hub functionality with the Message routing headers SHALL give the country code and party ID of the Hub in the
hub_party_idfield.
New in OCPI 2.3.0. Use PartyRef::from_hub_party_id to split it.
Sourcepub fn maybe_hub_party_id(
self,
value: Option<impl Into<CiString<5>>>,
) -> CredentialsBuilder<SetHubPartyId<S>>where
S::HubPartyId: IsUnset,
pub fn maybe_hub_party_id(
self,
value: Option<impl Into<CiString<5>>>,
) -> CredentialsBuilder<SetHubPartyId<S>>where
S::HubPartyId: IsUnset,
Optional (Some / Option setters).
The Hub party of this platform, as a five-character <country><party> string.
A Platform that supports Hub functionality with the Message routing headers SHALL give the country code and party ID of the Hub in the
hub_party_idfield.
New in OCPI 2.3.0. Use PartyRef::from_hub_party_id to split it.
Sourcepub fn roles(
self,
value: impl Into<Vec<CredentialsRole>>,
) -> CredentialsBuilder<SetRoles<S>>where
S::Roles: IsUnset,
pub fn roles(
self,
value: impl Into<Vec<CredentialsRole>>,
) -> CredentialsBuilder<SetRoles<S>>where
S::Roles: IsUnset,
Required.
The roles this platform provides. Cardinality +.
NOTE: In OCPI 2.3.0, unlike in OCPI 2.2 or 2.2.1, Roaming Hubs’ platforms are expected to include the parties that are reachable through the Roaming Hub in the list in
roles.