pub struct LabelsResource<'a> { /* private fields */ }Expand description
client.labels()
Implementations§
Source§impl<'a> LabelsResource<'a>
impl<'a> LabelsResource<'a>
Sourcepub fn create(&self, body: &LabelCreate) -> Result<PostLabelsData>
pub fn create(&self, body: &LabelCreate) -> Result<PostLabelsData>
Create an address-label PDF
POST /labels
Generates and stores a PDF of address labels, returning an absolute download URL. Labels use the configured German address formatter and one of three A4 layouts. Only visible selected persons are included; individual printable fields are checked against security levels. Incomplete addresses are still included. With combineSpouses=true, selected visible spouses may share a label even when their addresses differ; the first spouse with a complete address is preferred. Birthday sorting forces separate labels. PDF files are scheduled to expire after one day. The generation handler checks person visibility but has no explicit create print labels permission check; the labels file-download handler checks that permission. Input is currently read without the shared request validator, so malformed input can cause server errors.
§Example
let body = models::LabelCreate {
person_ids: serde_json::json!([42]),
r#type: "AveryLabels3475".into(),
..Default::default()
};
let result = client.labels().create(&body)?;
println!("{}", result.pdf);Sourcepub fn totals(&self, body: &LabelTotalsRequest) -> Result<LabelTotals>
pub fn totals(&self, body: &LabelTotalsRequest) -> Result<LabelTotals>
Count address labels
POST /labels/totals
Calculates four label counts for visible selected persons without generating a PDF. ignoreAddress includes incomplete addresses; onlyCompleteAddress requires street, postal code and city, but not country or address addition. Each contains the count with separate persons and after spouse grouping. Both spouses must be in the visible selection, but their addresses need not match. These counts do not take sortpolicy or layout into account; birthday PDF sorting always uses separate labels. Stored field completeness is checked before any printable-field security filtering.
§Example
let body = models::LabelTotalsRequest {
person_ids: serde_json::json!([42]),
..Default::default()
};
let label = client.labels().totals(&body)?;
println!("{:?}", label);