pub struct ContactLabelsResource<'a> { /* private fields */ }Expand description
client.contact_labels()
Implementations§
Source§impl<'a> ContactLabelsResource<'a>
impl<'a> ContactLabelsResource<'a>
Sourcepub fn create(&self, body: &ContactLabelCreate) -> Result<ContactLabel>
pub fn create(&self, body: &ContactLabelCreate) -> Result<ContactLabel>
Create new Contact Label
POST /contactlabels
Creates a reusable email contact label. Requires “edit masterdata” permission in churchdb. Setting isDefault to true replaces the existing default.
§Example
let body = models::ContactLabelCreate {
is_default: false,
name: "Private".into(),
sort_key: 10,
..Default::default()
};
let result = client.contact_labels().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, id: impl Display) -> Result<()>
pub fn delete(&self, id: impl Display) -> Result<()>
Delete Contact Label
DELETE /contactlabels/{id}
Deletes an email contact label. Requires “edit masterdata” permission in churchdb. Email-address references can block deletion.
Use Self::delete_with to pass query parameters.
§Example
client.contact_labels().delete(1)?;Sourcepub fn delete_with(
&self,
id: impl Display,
query: &DeleteContactlabelsIdQuery,
) -> Result<()>
pub fn delete_with( &self, id: impl Display, query: &DeleteContactlabelsIdQuery, ) -> Result<()>
Delete Contact Label
Like Self::delete, with query parameters.
DELETE /contactlabels/{id}
Deletes an email contact label. Requires “edit masterdata” permission in churchdb. Email-address references can block deletion.
Sourcepub fn get(&self, id: impl Display) -> Result<ContactLabel>
pub fn get(&self, id: impl Display) -> Result<ContactLabel>
Get Contact Label
GET /contactlabels/{id}
Returns a contact-label definition, including its translated display name and default flag.
§Example
let contact_label = client.contact_labels().get(1)?;
println!("{}", contact_label.name);Sourcepub fn list(&self) -> Result<Vec<ContactLabel>>
pub fn list(&self) -> Result<Vec<ContactLabel>>
Get All Contact Labels
GET /contactlabels
Returns all email contact labels, ordered by sortKey and then name, both ascending. Labels classify addresses such as private and work.
§Example
for contact_label in client.contact_labels().list()? {
println!("{}", contact_label.name);
}Sourcepub fn update(
&self,
id: impl Display,
body: &ContactLabelUpdate,
) -> Result<ContactLabel>
pub fn update( &self, id: impl Display, body: &ContactLabelUpdate, ) -> Result<ContactLabel>
Update Contact Label
PUT /contactlabels/{id}
Replaces an email contact label. Requires “edit masterdata” permission in churchdb. Existing email-address associations retain the label ID.
§Example
let body = models::ContactLabelUpdate {
is_default: false,
name: "Private".into(),
sort_key: 10,
..Default::default()
};
let result = client.contact_labels().update(1, &body)?;
println!("{}", result.name);