hey_sdk/generated/services/
designations.rs1#![allow(missing_docs, unreachable_pub, clippy::all, clippy::pedantic)]
4
5use crate::client::Client;
6use crate::error::Error;
7use crate::generated::routes;
8use crate::generated::types::*;
9
10pub struct Designations<'a> {
11 client: &'a Client,
12}
13
14impl<'a> Designations<'a> {
15 pub(crate) fn new(client: &'a Client) -> Self {
16 Self { client }
17 }
18
19 pub fn client(&self) -> &'a Client {
21 self.client
22 }
23
24 pub async fn create(
26 &self,
27 box_id: i64,
28 body: &CreateBoxDesignationRequestContent,
29 ) -> Result<(), Error> {
30 let mut operation = self
31 .client
32 .operation(&routes::CREATE_BOX_DESIGNATION, &[&box_id]);
33 operation.resource_id(box_id);
34 operation.json(body)?;
35 self.client.send_unit(operation).await
36 }
37
38 pub async fn delete(&self, box_id: i64, designation_id: i64) -> Result<(), Error> {
40 let mut operation = self
41 .client
42 .operation(&routes::DELETE_BOX_DESIGNATION, &[&box_id, &designation_id]);
43 operation.resource_id(designation_id);
44 self.client.send_unit(operation).await
45 }
46}