pub struct LocationsReceiver<'a>(/* private fields */);client only.Expand description
Pushes Locations to an eMSP or NSP.
These are client-owned objects: the URL carries the owner’s country_code and party_id,
and POST is not used.
POST is not supported for these kinds of modules. PUT is used to send new objects.
Spec: 2.3.0 §mod_locations_emsp_interface
Implementations§
Source§impl<'a> LocationsReceiver<'a>
impl<'a> LocationsReceiver<'a>
Sourcepub const fn new(client: ModuleClient<'a>) -> Self
pub const fn new(client: ModuleClient<'a>) -> Self
Wraps a module client.
Sourcepub async fn put_location(
&self,
owner: &PartyRef,
location: &Location,
) -> Result<(), OcpiError>
pub async fn put_location( &self, owner: &PartyRef, location: &Location, ) -> Result<(), OcpiError>
PUT {locations}/{country_code}/{party_id}/{location_id}.
§Errors
Propagates validation, transport and OCPI-level errors.
Sourcepub async fn put_evse(
&self,
owner: &PartyRef,
location_id: &str,
evse: &Evse,
) -> Result<(), OcpiError>
pub async fn put_evse( &self, owner: &PartyRef, location_id: &str, evse: &Evse, ) -> Result<(), OcpiError>
PUT {locations}/{country_code}/{party_id}/{location_id}/{evse_uid}.
§Errors
Propagates validation, transport and OCPI-level errors.
Sourcepub async fn patch<T>(
&self,
owner: &PartyRef,
location_id: &str,
evse_uid: Option<&str>,
connector_id: Option<&str>,
patch: &Patch<T>,
) -> Result<(), OcpiError>
pub async fn patch<T>( &self, owner: &PartyRef, location_id: &str, evse_uid: Option<&str>, connector_id: Option<&str>, patch: &Patch<T>, ) -> Result<(), OcpiError>
PATCH {locations}/{country_code}/{party_id}/{location_id}[/{evse_uid}[/{connector_id}]].
This is how an EVSE is retired: “REMOVED via PATCH status, never DELETE”.
§Errors
Propagates transport and OCPI-level errors, and refuses a patch without last_updated.
Trait Implementations§
Source§impl<'a> Clone for LocationsReceiver<'a>
impl<'a> Clone for LocationsReceiver<'a>
Source§fn clone(&self) -> LocationsReceiver<'a>
fn clone(&self) -> LocationsReceiver<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more