#![allow(missing_docs, unreachable_pub, clippy::all, clippy::pedantic)]
use crate::client::Client;
use crate::error::Error;
use crate::generated::routes;
use crate::generated::types::*;
pub struct Designations<'a> {
client: &'a Client,
}
impl<'a> Designations<'a> {
pub(crate) fn new(client: &'a Client) -> Self {
Self { client }
}
pub fn client(&self) -> &'a Client {
self.client
}
pub async fn create(
&self,
box_id: i64,
body: &CreateBoxDesignationRequestContent,
) -> Result<(), Error> {
let mut operation = self
.client
.operation(&routes::CREATE_BOX_DESIGNATION, &[&box_id]);
operation.resource_id(box_id);
operation.json(body)?;
self.client.send_unit(operation).await
}
pub async fn delete(&self, box_id: i64, designation_id: i64) -> Result<(), Error> {
let mut operation = self
.client
.operation(&routes::DELETE_BOX_DESIGNATION, &[&box_id, &designation_id]);
operation.resource_id(designation_id);
self.client.send_unit(operation).await
}
}