pub struct Credentials {
pub token: OcpiString<64>,
pub url: Url,
pub roles: Vec<CredentialsRole>,
pub extensions: Extensions,
}v2_2_1 only.Expand description
The credentials one platform gives another, in OCPI 2.2.1.
Spec: 2.2.1 §credentials_credentials_object
Fields§
§token: OcpiString<64>The credentials token for the other party to authenticate in your system.
url: UrlThe URL to your API versions endpoint.
roles: Vec<CredentialsRole>The roles this party provides. Cardinality +.
extensions: ExtensionsUndocumented JSON fields, preserved verbatim.
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn builder() -> CredentialsBuilder
pub fn builder() -> CredentialsBuilder
Create an instance of Credentials using the builder syntax
Source§impl Credentials
impl Credentials
Sourcepub fn parties(&self) -> impl Iterator<Item = PartyRef> + '_
pub fn parties(&self) -> impl Iterator<Item = PartyRef> + '_
Every party this platform speaks for.
Sourcepub fn is_hub(&self) -> bool
pub fn is_hub(&self) -> bool
Whether this platform declares itself a hub.
In 2.2.1 that is the HUB role. OCPI 2.3.0 removed the role and uses
Credentials.hub_party_id instead; see
v2_3_0::credentials::Credentials::is_routing_platform.
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Credentials
impl Debug for Credentials
Source§impl<'de> Deserialize<'de> for Credentials
impl<'de> Deserialize<'de> for Credentials
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 Downgrade<Credentials> for Credentials
Available on crate feature convert only.
impl Downgrade<Credentials> for Credentials
convert only.Source§fn downgrade(self) -> Converted<Credentials>
fn downgrade(self) -> Converted<Credentials>
A 2.3.0 hub_party_id becomes a 2.2.1 HUB role.
The 2.2.1 role needs business_details, which 2.3.0 does not carry for the hub party
itself; the first role’s details are reused and the substitution is reported.
Source§impl JsonSchema for Credentials
impl JsonSchema for Credentials
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 moreSource§impl PartialEq for Credentials
impl PartialEq for Credentials
Source§impl Serialize for Credentials
impl Serialize for Credentials
impl StructuralPartialEq for Credentials
Source§impl Upgrade<Credentials> for Credentials
Available on crate feature convert only.
impl Upgrade<Credentials> for Credentials
convert only.Source§fn upgrade(self) -> Converted<Credentials>
fn upgrade(self) -> Converted<Credentials>
A 2.2.1 HUB role becomes 2.3.0’s hub_party_id, and the role entry is dropped: that is
exactly where OCPI 2.3.0 moved the information.
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.