pub struct GeoBans<'a> { /* private fields */ }Expand description
Geo ban routes, from Client::geo_bans.
A ban stops Relay from answering with one record value to clients in an area. Access
follows the value’s zone. To work by area names instead of uuids, see
ops::add_geo_bans and
ops::select_geo_bans.
Implementations§
Source§impl<'a> GeoBans<'a>
impl<'a> GeoBans<'a>
Sourcepub async fn create(&self, record_id: Uuid, area: GeoArea) -> Result<GeoBan>
pub async fn create(&self, record_id: Uuid, area: GeoArea) -> Result<GeoBan>
Bans area for the record value record_id. Core does not refuse a duplicate;
ops::add_geo_bans skips areas already banned.
POST /api/v1/geo-bans
§Errors
ErrorCode::NotFound if there is no such value.
Sourcepub async fn update(&self, uuid: Uuid, area: GeoArea) -> Result<GeoBan>
pub async fn update(&self, uuid: Uuid, area: GeoArea) -> Result<GeoBan>
Moves a ban to another area.
PATCH /api/v1/geo-bans/:uuid
§Errors
ErrorCode::NotFound if there is no such ban.
Sourcepub async fn delete(&self, uuid: Uuid, record_id: Option<Uuid>) -> Result<()>
pub async fn delete(&self, uuid: Uuid, record_id: Option<Uuid>) -> Result<()>
Removes a ban. record_id, when given, must be the ban’s value (Core checks it), a
guard against removing a ban of the wrong value.
DELETE /api/v1/geo-bans/:uuid[?record_id=...]
§Errors
ErrorCode::NotFound if there is no such ban, or it
belongs to another value than record_id.