pub struct PersonsAbsencesResource<'a> { /* private fields */ }Expand description
client.persons().absences()
Implementations§
Source§impl<'a> PersonsAbsencesResource<'a>
impl<'a> PersonsAbsencesResource<'a>
Sourcepub fn create(
&self,
person_id: impl Display,
body: &AbsenceCreate,
) -> Result<Absence>
pub fn create( &self, person_id: impl Display, body: &AbsenceCreate, ) -> Result<Absence>
Create new absence for person
POST /persons/{personId}/absences
Creates an absence for the person. Access requires the person themselves or “manage absent” or “churchservice +view absence” permission together with access to the person.
§Example
let body = models::AbsenceCreate {
absence_reason_id: 1,
..Default::default()
};
let result = client.persons().absences().create(42, &body)?;
println!("{}", result.id);Sourcepub fn delete(&self, person_id: impl Display, id: impl Display) -> Result<()>
pub fn delete(&self, person_id: impl Display, id: impl Display) -> Result<()>
Delete absence
DELETE /persons/{personId}/absences/{id}
Deletes the absence belonging to the person. Access requires the person themselves or “manage absent” or “churchservice +view absence” permission together with access to the person.
Use Self::delete_with to pass query parameters.
§Example
client.persons().absences().delete(42, 1)?;Sourcepub fn delete_with(
&self,
person_id: impl Display,
id: impl Display,
query: &DeletePersonsPersonIdAbsencesIdQuery,
) -> Result<()>
pub fn delete_with( &self, person_id: impl Display, id: impl Display, query: &DeletePersonsPersonIdAbsencesIdQuery, ) -> Result<()>
Delete absence
Like Self::delete, with query parameters.
DELETE /persons/{personId}/absences/{id}
Deletes the absence belonging to the person. Access requires the person themselves or “manage absent” or “churchservice +view absence” permission together with access to the person.
Sourcepub fn get(&self, person_id: impl Display, id: impl Display) -> Result<Absence>
pub fn get(&self, person_id: impl Display, id: impl Display) -> Result<Absence>
Fetch one absence
GET /persons/{personId}/absences/{id}
Returns the absence belonging to the person. Access requires the person themselves or “manage absent” or “churchservice +view absence” permission together with access to the person.
§Example
let absence = client.persons().absences().get(42, 1)?;
println!("{}", absence.id);Sourcepub fn list(&self, person_id: impl Display) -> Result<Vec<Absence>>
pub fn list(&self, person_id: impl Display) -> Result<Vec<Absence>>
Fetch all absences for a person
GET /persons/{personId}/absences
Returns this person’s absences that overlap the requested date range, sorted by start. Access requires the person themselves or “manage absent” or “churchservice +view absence” permission together with access to the person.
Use Self::list_with to pass query parameters.
§Example
for absence in client.persons().absences().list(42)? {
println!("{}", absence.id);
}Sourcepub fn list_with(
&self,
person_id: impl Display,
query: &GetPersonsPersonIdAbsencesQuery,
) -> Result<Vec<Absence>>
pub fn list_with( &self, person_id: impl Display, query: &GetPersonsPersonIdAbsencesQuery, ) -> Result<Vec<Absence>>
Fetch all absences for a person
Like Self::list, with query parameters.
GET /persons/{personId}/absences
Returns this person’s absences that overlap the requested date range, sorted by start. Access requires the person themselves or “manage absent” or “churchservice +view absence” permission together with access to the person.
Sourcepub fn update(
&self,
person_id: impl Display,
id: impl Display,
body: &AbsenceUpdate,
) -> Result<Absence>
pub fn update( &self, person_id: impl Display, id: impl Display, body: &AbsenceUpdate, ) -> Result<Absence>
Update absence
PUT /persons/{personId}/absences/{id}
Replaces an absence belonging to the person. Access requires the person themselves or “manage absent” or “churchservice +view absence” permission together with access to the person.
§Example
let body = models::AbsenceUpdate {
absence_reason_id: 1,
..Default::default()
};
let result = client.persons().absences().update(42, 1, &body)?;
println!("{}", result.id);