hey_sdk/services/designations.rs
1//! Screening a contact into a box, so everything they send lands there.
2//!
3//! HEY models a designation under the box that holds it, so these are `/boxes/{id}` paths;
4//! every SDK files them under the name the feature goes by, which is this handle.
5
6use crate::error::Error;
7use crate::generated::types::CreateBoxDesignationRequestContent;
8
9pub use crate::generated::services::designations::*;
10
11impl Designations<'_> {
12 /// Designates a contact to a box. The generated [`Designations::create`] takes the same
13 /// request as a body.
14 ///
15 /// HEY designates the contact's primary, so a contact's aliases fold into the one
16 /// designation — whose id cannot be worked out from `contact_id`. Read the box back if
17 /// you need it.
18 pub async fn create_box_designation(&self, box_id: i64, contact_id: i64) -> Result<(), Error> {
19 let body = CreateBoxDesignationRequestContent { contact_id };
20 self.create(box_id, &body).await
21 }
22}