//! Query parameters (`…Query`) and form fields (`…Form`) of the generated methods.
//! Unset fields are left out of the request; fill them with `..Default::default()`.
//!
//! Generated by codegen/generate.py from the OpenAPI spec of ChurchTools 3.138.1 (build 32938). Do not edit. The spec is licensed under CC BY 4.0 (<https://creativecommons.org/licenses/by/4.0/>); see NOTICE.
#![allow(clippy::all, deprecated)]
use crate::client::Query;
use crate::query::ToQuery;
/// Query parameters for `GET /addresses/search`.
#[derive(Debug, Clone, Default)]
pub struct GetAddressesSearchQuery {
/// Search term to look up addresses by (e.g. street, city, person name).
pub query: Option<String>,
}
impl GetAddressesSearchQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.query.push_query("query", &mut q);
q
}
}
/// Query parameters for `DELETE /agendatemplates/{agendaId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteAgendatemplatesAgendaIdQuery {
/// Deprecated. Accepted but ignored. Both `false` and `true` execute deletion; this parameter does not provide a dry run.
#[deprecated = "deprecated in the ChurchTools API"]
pub dry_run: Option<bool>,
}
impl DeleteAgendatemplatesAgendaIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `POST /agendatemplates/{agendaId}/export`.
#[derive(Debug, Clone, Default)]
pub struct PostAgendatemplatesAgendaIdExportQuery {
/// Target presenter format. The generated archive is returned through a download URL in the JSON response.
/// Allowed values: `PRO_PRESENTER_6`, `PRO_PRESENTER_7`, `SONG_BEAMER`.
pub format: Option<String>,
}
impl PostAgendatemplatesAgendaIdExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.format.push_query("format", &mut q);
q
}
}
/// Query parameters for `POST /agendatemplates/{agendaId}/items`.
#[derive(Debug, Clone, Default)]
pub struct PostAgendatemplatesAgendaIdItemsQuery {
/// Place the item before this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub before_id: Option<i64>,
/// Place the item after this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub after_id: Option<i64>,
/// Deprecated. Accepted and validated as an integer, but not applied by the item service. Use `before_id` or `after_id` to position an item.
#[deprecated = "Use `before_id` or `after_id` to position an item."]
pub sort_key: Option<i64>,
}
impl PostAgendatemplatesAgendaIdItemsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.before_id.push_query("before_id", &mut q);
self.after_id.push_query("after_id", &mut q);
self.sort_key.push_query("sortKey", &mut q);
q
}
}
/// Query parameters for `PUT /agendatemplates/{agendaId}/items/{itemId}`.
#[derive(Debug, Clone, Default)]
pub struct PutAgendatemplatesAgendaIdItemsItemIdQuery {
/// Place the item before this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub before_id: Option<i64>,
/// Place the item after this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub after_id: Option<i64>,
/// Deprecated. Accepted and validated as an integer, but not applied by the item service. Use `before_id` or `after_id` to position an item.
#[deprecated = "Use `before_id` or `after_id` to position an item."]
pub sort_key: Option<i64>,
}
impl PutAgendatemplatesAgendaIdItemsItemIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.before_id.push_query("before_id", &mut q);
self.after_id.push_query("after_id", &mut q);
self.sort_key.push_query("sortKey", &mut q);
q
}
}
/// Query parameters for `GET /bookings/{bookingId}`.
#[derive(Debug, Clone, Default)]
pub struct GetBookingsIdQuery {
/// Optional enrichments. conflicts adds overlapping bookings; involvedPersonsDomainObjects adds person references to the booking base.
/// Allowed values: `conflicts`, `involvedPersonsDomainObjects`.
pub include: Option<Vec<String>>,
}
impl GetBookingsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /bookings`.
#[derive(Debug, Clone, Default)]
pub struct GetBookingsQuery {
/// Optional enrichments. conflicts adds overlapping bookings; involvedPersonsDomainObjects adds person references to the booking base.
/// Allowed values: `conflicts`, `involvedPersonsDomainObjects`.
pub include: Option<Vec<String>>,
/// IDs of resources to include.
pub resource_ids: Option<Vec<i64>>,
/// Substring search in booking titles; at least two characters after trimming.
pub query: Option<String>,
/// Return bookings created by this person or made on their behalf.
pub person_id: Option<i64>,
/// Booking statuses to include.
/// Allowed values: `1`, `2`, `3`.
pub status_ids: Option<Vec<i64>>,
/// First included local date.
pub from: Option<chrono::NaiveDate>,
/// Last included local date, on or after `from`.
pub to: Option<chrono::NaiveDate>,
}
impl GetBookingsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
self.resource_ids.push_query("resource_ids[]", &mut q);
self.query.push_query("query", &mut q);
self.person_id.push_query("person_id", &mut q);
self.status_ids.push_query("status_ids[]", &mut q);
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
q
}
}
/// Query parameters for `GET /calendars/{calendarId}/meetingrequestpersons`.
#[derive(Debug, Clone, Default)]
pub struct GetCalendarsCalendarIdMeetingrequestpersonsQuery {
/// Include persons already invited to this appointment
pub appointment_id: Option<i64>,
}
impl GetCalendarsCalendarIdMeetingrequestpersonsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.appointment_id.push_query("appointmentId", &mut q);
q
}
}
/// Query parameters for `GET /calendars/{calendarId}/appointments/{appointmentId}`.
#[derive(Debug, Clone, Default)]
pub struct GetCalendarsCalendarIdAppointmentsAppointmentIdQuery {
/// Additional series data: event, group, bookings and titleSuffix enrich calculatedDates; tags enriches additionalInfos.
/// Allowed values: `bookings`, `event`, `group`, `meetingRequests`, `tags`, `titleSuffix`.
pub include: Option<Vec<String>>,
}
impl GetCalendarsCalendarIdAppointmentsAppointmentIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /calendars/appointments/{appointmentId}/{startDate}`.
#[derive(Debug, Clone, Default)]
pub struct GetCalendarsAppointmentsAppointmentIdStartDateQuery {
/// Additional data for this occurrence. Meeting requests belong to the whole appointment/series.
/// Allowed values: `bookings`, `event`, `group`, `meetingRequests`, `tags`, `titleSuffix`.
pub include: Option<Vec<String>>,
}
impl GetCalendarsAppointmentsAppointmentIdStartDateQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /calendars/{calendarId}/appointments/{appointmentId}/{startDate}`.
#[derive(Debug, Clone, Default)]
pub struct GetCalendarsCalendarIdAppointmentsAppointmentIdStartDateQuery {
/// Additional data for this occurrence. Meeting requests belong to the whole appointment/series.
/// Allowed values: `bookings`, `event`, `group`, `meetingRequests`, `tags`, `titleSuffix`.
pub include: Option<Vec<String>>,
}
impl GetCalendarsCalendarIdAppointmentsAppointmentIdStartDateQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /calendars/appointments`.
#[derive(Debug, Clone, Default)]
pub struct GetCalendarsAppointmentsQuery {
/// IDs of the calendars to read. Access is checked for every selected calendar.
pub calendar_ids: Option<Vec<i64>>,
/// Start of the requested date range in the installation’s timezone. Defaults to the first day of the current month.
pub from: Option<chrono::NaiveDate>,
/// Last requested calendar date. Defaults to the last day of the current month and must be on or after from.
pub to: Option<chrono::NaiveDate>,
/// Search appointment titles for the supplied text.
pub query: Option<String>,
/// Additional data requested for each calculated occurrence.
/// Allowed values: `bookings`, `event`, `group`, `meetingRequests`, `tags`, `titleSuffix`.
pub include: Option<Vec<String>>,
}
impl GetCalendarsAppointmentsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.calendar_ids.push_query("calendar_ids[]", &mut q);
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.query.push_query("query", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /calendars/{calendarId}/appointments`.
#[derive(Debug, Clone, Default)]
pub struct GetCalendarsCalendarIdAppointmentsQuery {
/// Start of the requested date range in the installation’s timezone. Defaults to the first day of the current month.
pub from: Option<chrono::NaiveDate>,
/// Last requested calendar date. Defaults to the last day of the current month and must be on or after from.
pub to: Option<chrono::NaiveDate>,
/// Search appointment titles for the supplied text.
pub query: Option<String>,
/// Additional data requested for each calculated occurrence.
/// Allowed values: `bookings`, `event`, `group`, `meetingRequests`, `tags`, `titleSuffix`.
pub include: Option<Vec<String>>,
}
impl GetCalendarsCalendarIdAppointmentsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.query.push_query("query", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /calendars/{calendarId}/meetingrequest/candidates`.
#[derive(Debug, Clone, Default)]
pub struct GetCalendarsCalendarIdMeetingrequestCandidatesQuery {
/// Include persons already invited to this appointment
pub appointment_id: Option<i64>,
}
impl GetCalendarsCalendarIdMeetingrequestCandidatesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.appointment_id.push_query("appointmentId", &mut q);
q
}
}
/// Query parameters for `DELETE /chat/{guid}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteChatGuidQuery {
/// Synchronization token for central chat service callbacks.
pub nonce: Option<String>,
}
impl DeleteChatGuidQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.nonce.push_query("nonce", &mut q);
q
}
}
/// Query parameters for `GET /chat`.
#[derive(Debug, Clone, Default)]
pub struct GetChatQuery {
/// Synchronization token for central chat service callbacks.
pub nonce: Option<String>,
}
impl GetChatQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.nonce.push_query("nonce", &mut q);
q
}
}
/// Query parameters for `POST /checkin/persons`.
#[derive(Debug, Clone, Default)]
pub struct PostCheckinPersonsQuery {
/// Omits the otherwise mandatory privacy policy agreement fields. Only effective when `privacy_policy_fields_mandatory_api` is disabled in the ChurchTools configuration. Clients must verify that configuration before using this parameter and must not use it as a fallback for missing agreement information.
pub without_privacy_policy_agreement: Option<bool>,
}
impl PostCheckinPersonsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.without_privacy_policy_agreement.push_query("without_privacy_policy_agreement", &mut q);
q
}
}
/// Query parameters for `GET /churchquery/metadata`.
#[derive(Debug, Clone, Default)]
pub struct GetChurchqueryMetadataQuery {
/// Root entity prefix for which metadata should be generated.
pub entity_to_search_for: Option<String>,
/// Excludes db-field intern codes from metadata field lists (e.g. `multiselect`).
pub exclude_field_types: Option<Vec<String>>,
}
impl GetChurchqueryMetadataQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.entity_to_search_for.push_query("entity_to_search_for", &mut q);
self.exclude_field_types.push_query("exclude_field_types[]", &mut q);
q
}
}
/// Query parameters for `POST /churchquery/debug/export`.
#[derive(Debug, Clone, Default)]
pub struct PostChurchqueryDebugExportQuery {
/// type of export
pub r#type: Option<String>,
}
impl PostChurchqueryDebugExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /config`.
#[derive(Debug, Clone, Default)]
pub struct GetConfigQuery {
/// If `true` the response will contain the extended config.
pub extended: Option<bool>,
}
impl GetConfigQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.extended.push_query("extended", &mut q);
q
}
}
/// Query parameters for `DELETE /contactlabels/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteContactlabelsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteContactlabelsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /dbfields`.
#[derive(Debug, Clone, Default)]
pub struct GetDbfieldsQuery {
/// Limit results to database-field categories.
/// Allowed values: `f_address`, `f_category`, `f_church`, `f_datasecurity`, `f_dep`, `f_group`, `f_growpath`.
pub categories: Option<Vec<String>>,
/// Expand selection choices for each field.
/// Allowed values: `options`.
pub include: Option<Vec<String>>,
}
impl GetDbfieldsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.categories.push_query("categories[]", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `DELETE /dbfields/{fieldId}/options/{optionId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteDbfieldsFieldIdOptionsOptionIdQuery {
/// If true, the deletion is only simulated and the option is not deleted. The response describes whether the option can be deleted.
pub dry_run: Option<bool>,
}
impl DeleteDbfieldsFieldIdOptionsOptionIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `GET /domainobjects`.
#[derive(Debug, Clone, Default)]
pub struct GetDomainobjectsQuery {
/// Registered object types, paired by index with `domain_identifiers[]`.
/// Allowed values: `appointment`, `appointment_occurrence`, `event`, `group`, `group_membership`, `person`, `song`, `wiki_page`.
pub domain_types: Option<Vec<String>>,
/// For `person`, `group`, `song`, `event`, `group_membership`, and `appointment`, use a numeric database ID encoded as a string. `group_membership` uses the membership row ID, and `wiki_page` uses the page GUID. For `appointment_occurrence`, use `-`, for example `23-2026-09-14`.
pub domain_identifiers: Option<Vec<String>>,
}
impl GetDomainobjectsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.domain_types.push_query("domain_types[]", &mut q);
self.domain_identifiers.push_query("domain_identifiers[]", &mut q);
q
}
}
/// Query parameters for `POST /events/ical`.
#[derive(Debug, Clone, Default)]
pub struct PostEventsIcalQuery {
/// ID of person
pub person_id: Option<i64>,
}
impl PostEventsIcalQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.person_id.push_query("personId", &mut q);
q
}
}
/// Query parameters for `DELETE /events/{eventId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteEventsIdQuery {
/// Check deletion and return a `409` report. Does not suppress the `sendMail` step.
pub dry_run: Option<bool>,
/// Request event-deletion notifications before the deletion check, including during `dryRun`.
pub send_mail: Option<bool>,
}
impl DeleteEventsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
self.send_mail.push_query("sendMail", &mut q);
q
}
}
/// Query parameters for `GET /events/ical`.
#[derive(Debug, Clone, Default)]
pub struct GetEventsIcalQuery {
/// ID of person
pub person_id: Option<i64>,
}
impl GetEventsIcalQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.person_id.push_query("personId", &mut q);
q
}
}
/// Query parameters for `GET /events`.
#[derive(Debug, Clone, Default)]
pub struct GetEventsQuery {
/// Midnight anchor or beginning of the range.
pub from: Option<chrono::NaiveDate>,
/// Range upper bound at midnight, inclusive.
pub to: Option<chrono::NaiveDate>,
/// Enable directional pagination; omit for an unpaginated date range.
/// Allowed values: `backward`, `forward`.
pub direction: Option<String>,
/// Results per page in directional mode; ignored in range mode.
pub limit: Option<i64>,
/// Include cancelled events in addition to active events.
pub canceled: Option<bool>,
/// Comma-separated Fractal includes. event_services includes visible assignments; eventServices is its legacy spelling. The response key follows the selected spelling. Other Fractal syntax is accepted, so this is not a closed enum.
pub include: Option<String>,
}
impl GetEventsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.direction.push_query("direction", &mut q);
self.limit.push_query("limit", &mut q);
self.canceled.push_query("canceled", &mut q);
self.include.push_query("include", &mut q);
q
}
}
/// Query parameters for `POST /events/{eventId}/agenda/export`.
#[derive(Debug, Clone, Default)]
pub struct PostEventsIdAgendaExportQuery {
/// Target presenter format. The generated archive is returned through a download URL in the JSON response.
/// Allowed values: `PRO_PRESENTER_6`, `PRO_PRESENTER_7`, `SONG_BEAMER`.
pub format: Option<String>,
}
impl PostEventsIdAgendaExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.format.push_query("format", &mut q);
q
}
}
/// Query parameters for `POST /events/{eventId}/agenda/integrate`.
#[derive(Debug, Clone, Default)]
pub struct PostEventsIdAgendaIntegrateQuery {
/// Source event ID. Its agenda is shared with the target event in the path; the two event IDs must differ.
pub event_id: Option<i64>,
}
impl PostEventsIdAgendaIntegrateQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.event_id.push_query("event_id", &mut q);
q
}
}
/// Query parameters for `PUT /events/{eventId}/agenda`.
#[derive(Debug, Clone, Default)]
pub struct PutEventsIdAgendaQuery {
/// Agenda template to copy. Replaces the target items with copies and supplies fallback metadata values. Mutually exclusive with `event_id` and the items body field.
pub template_id: Option<i64>,
/// Event whose agenda should be copied. Must differ from the target event ID. Replaces target items with copies and supplies fallback metadata values. Mutually exclusive with `template_id` and the items body field.
pub event_id: Option<i64>,
}
impl PutEventsIdAgendaQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.template_id.push_query("template_id", &mut q);
self.event_id.push_query("event_id", &mut q);
q
}
}
/// Query parameters for `POST /events/{eventId}/agenda/items`.
#[derive(Debug, Clone, Default)]
pub struct PostEventsIdAgendaItemsQuery {
/// Place the item before this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub before_id: Option<i64>,
/// Place the item after this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub after_id: Option<i64>,
/// Deprecated. Accepted and validated as an integer, but not applied by the item service. Use `before_id` or `after_id` to position an item.
#[deprecated = "Use `before_id` or `after_id` to position an item."]
pub sort_key: Option<i64>,
}
impl PostEventsIdAgendaItemsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.before_id.push_query("before_id", &mut q);
self.after_id.push_query("after_id", &mut q);
self.sort_key.push_query("sortKey", &mut q);
q
}
}
/// Query parameters for `PUT /events/{eventId}/agenda/items/{itemId}`.
#[derive(Debug, Clone, Default)]
pub struct PutEventsIdAgendaItemsIdQuery {
/// Place the item before this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub before_id: Option<i64>,
/// Place the item after this existing item in the same agenda. Use at most one of `before_id` and `after_id`. These are item IDs, not zero-based positions.
pub after_id: Option<i64>,
/// Deprecated. Accepted and validated as an integer, but not applied by the item service. Use `before_id` or `after_id` to position an item.
#[deprecated = "Use `before_id` or `after_id` to position an item."]
pub sort_key: Option<i64>,
}
impl PutEventsIdAgendaItemsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.before_id.push_query("before_id", &mut q);
self.after_id.push_query("after_id", &mut q);
self.sort_key.push_query("sortKey", &mut q);
q
}
}
/// Query parameters for `POST /events/facts/export`.
#[derive(Debug, Clone, Default)]
pub struct PostEventsFactsExportQuery {
/// Download format.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
}
impl PostEventsFactsExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.format.push_query("format", &mut q);
q
}
}
/// Query parameters for `GET /events/facts`.
#[derive(Debug, Clone, Default)]
pub struct GetEventsFactsQuery {
/// Return entities starting from this date.
pub from: Option<chrono::NaiveDate>,
/// Return entities up to (but not including) this date.
pub to: Option<chrono::NaiveDate>,
/// Restrict to these service-planning event IDs. An empty list does not restrict events.
pub event_id: Option<Vec<i64>>,
/// Restrict to these fact definitions, intersected with the definitions the user may view or edit. An empty list uses all visible definitions.
pub fact_id: Option<Vec<i64>>,
/// Number of results per page.
pub limit: Option<i64>,
}
impl GetEventsFactsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.event_id.push_query("event_id[]", &mut q);
self.fact_id.push_query("fact_id[]", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /externallogins/oidc/callback`.
#[derive(Debug, Clone, Default)]
pub struct GetExternalloginsOidcCallbackQuery {
/// Opaque state created by the matching OIDC start request.
pub state: Option<String>,
/// Authorization code returned by the OIDC provider.
pub code: Option<String>,
/// OIDC authorization error returned instead of a code.
pub error: Option<String>,
}
impl GetExternalloginsOidcCallbackQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.state.push_query("state", &mut q);
self.code.push_query("code", &mut q);
self.error.push_query("error", &mut q);
q
}
}
/// Query parameters for `GET /externallogins/{externalLoginId}/oidc/callback`.
#[derive(Debug, Clone, Default)]
pub struct GetExternalloginsIdOidcCallbackQuery {
/// Opaque state created by the matching OIDC start request.
pub state: Option<String>,
/// Authorization code returned by the OIDC provider.
pub code: Option<String>,
/// OIDC authorization error returned instead of a code.
pub error: Option<String>,
}
impl GetExternalloginsIdOidcCallbackQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.state.push_query("state", &mut q);
self.code.push_query("code", &mut q);
self.error.push_query("error", &mut q);
q
}
}
/// Query parameters for `GET /externallogins/{externalLoginId}/oidc/start`.
#[derive(Debug, Clone, Default)]
pub struct GetExternalloginsIdOidcStartQuery {
/// Absolute same-origin URL within the ChurchTools base path to open after login. Invalid, external or relative targets are ignored and fall back to the installation root.
pub redirect: Option<String>,
}
impl GetExternalloginsIdOidcStartQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.redirect.push_query("redirect", &mut q);
q
}
}
/// Query parameters for `POST /externallogins/{externalLoginId}/saml/sls`.
#[derive(Debug, Clone, Default)]
pub struct PostExternalloginsExternalLoginIdSamlSlsQuery {
/// Base64-encoded, DEFLATE-compressed SAML LogoutRequest. Supply either `SAMLRequest` or `SAMLResponse`.
pub saml_request: Option<String>,
/// Base64-encoded, DEFLATE-compressed SAML LogoutResponse. Takes precedence when both message fields are supplied.
pub saml_response: Option<String>,
/// Opaque state echoed when responding to a logout request.
pub relay_state: Option<String>,
/// URI of the redirect-binding signature algorithm.
pub sig_alg: Option<String>,
/// Base64-encoded redirect-binding signature.
pub signature: Option<String>,
}
impl PostExternalloginsExternalLoginIdSamlSlsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.saml_request.push_query("SAMLRequest", &mut q);
self.saml_response.push_query("SAMLResponse", &mut q);
self.relay_state.push_query("RelayState", &mut q);
self.sig_alg.push_query("SigAlg", &mut q);
self.signature.push_query("Signature", &mut q);
q
}
}
/// Query parameters for `DELETE /externallogins/{externalLoginId}/saml/sls`.
#[derive(Debug, Clone, Default)]
pub struct DeleteExternalloginsExternalLoginIdSamlSlsQuery {
/// Base64-encoded, DEFLATE-compressed SAML LogoutRequest. Supply either `SAMLRequest` or `SAMLResponse`.
pub saml_request: Option<String>,
/// Base64-encoded, DEFLATE-compressed SAML LogoutResponse. Takes precedence when both message fields are supplied.
pub saml_response: Option<String>,
/// Opaque state echoed when responding to a logout request.
pub relay_state: Option<String>,
/// URI of the redirect-binding signature algorithm.
pub sig_alg: Option<String>,
/// Base64-encoded redirect-binding signature.
pub signature: Option<String>,
}
impl DeleteExternalloginsExternalLoginIdSamlSlsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.saml_request.push_query("SAMLRequest", &mut q);
self.saml_response.push_query("SAMLResponse", &mut q);
self.relay_state.push_query("RelayState", &mut q);
self.sig_alg.push_query("SigAlg", &mut q);
self.signature.push_query("Signature", &mut q);
q
}
}
/// Query parameters for `GET /externallogins/{externalLoginId}/saml/login`.
#[derive(Debug, Clone, Default)]
pub struct GetExternalloginsExternalLoginIdSamlLoginQuery {
/// Absolute same-origin destination after successful login.
pub redirect: Option<String>,
}
impl GetExternalloginsExternalLoginIdSamlLoginQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.redirect.push_query("redirect", &mut q);
q
}
}
/// Query parameters for `GET /externallogins/{externalLoginId}/saml/sls`.
#[derive(Debug, Clone, Default)]
pub struct GetExternalloginsExternalLoginIdSamlSlsQuery {
/// Base64-encoded, DEFLATE-compressed SAML LogoutRequest. Supply either `SAMLRequest` or `SAMLResponse`.
pub saml_request: Option<String>,
/// Base64-encoded, DEFLATE-compressed SAML LogoutResponse. Takes precedence when both message fields are supplied.
pub saml_response: Option<String>,
/// Opaque state echoed when responding to a logout request.
pub relay_state: Option<String>,
/// URI of the redirect-binding signature algorithm.
pub sig_alg: Option<String>,
/// Base64-encoded redirect-binding signature.
pub signature: Option<String>,
}
impl GetExternalloginsExternalLoginIdSamlSlsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.saml_request.push_query("SAMLRequest", &mut q);
self.saml_response.push_query("SAMLResponse", &mut q);
self.relay_state.push_query("RelayState", &mut q);
self.sig_alg.push_query("SigAlg", &mut q);
self.signature.push_query("Signature", &mut q);
q
}
}
/// Query parameters for `PATCH /externallogins/{externalLoginId}/saml/sls`.
#[derive(Debug, Clone, Default)]
pub struct PatchExternalloginsExternalLoginIdSamlSlsQuery {
/// Base64-encoded, DEFLATE-compressed SAML LogoutRequest. Supply either `SAMLRequest` or `SAMLResponse`.
pub saml_request: Option<String>,
/// Base64-encoded, DEFLATE-compressed SAML LogoutResponse. Takes precedence when both message fields are supplied.
pub saml_response: Option<String>,
/// Opaque state echoed when responding to a logout request.
pub relay_state: Option<String>,
/// URI of the redirect-binding signature algorithm.
pub sig_alg: Option<String>,
/// Base64-encoded redirect-binding signature.
pub signature: Option<String>,
}
impl PatchExternalloginsExternalLoginIdSamlSlsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.saml_request.push_query("SAMLRequest", &mut q);
self.saml_response.push_query("SAMLResponse", &mut q);
self.relay_state.push_query("RelayState", &mut q);
self.sig_alg.push_query("SigAlg", &mut q);
self.signature.push_query("Signature", &mut q);
q
}
}
/// Query parameters for `PUT /externallogins/{externalLoginId}/saml/sls`.
#[derive(Debug, Clone, Default)]
pub struct PutExternalloginsExternalLoginIdSamlSlsQuery {
/// Base64-encoded, DEFLATE-compressed SAML LogoutRequest. Supply either `SAMLRequest` or `SAMLResponse`.
pub saml_request: Option<String>,
/// Base64-encoded, DEFLATE-compressed SAML LogoutResponse. Takes precedence when both message fields are supplied.
pub saml_response: Option<String>,
/// Opaque state echoed when responding to a logout request.
pub relay_state: Option<String>,
/// URI of the redirect-binding signature algorithm.
pub sig_alg: Option<String>,
/// Base64-encoded redirect-binding signature.
pub signature: Option<String>,
}
impl PutExternalloginsExternalLoginIdSamlSlsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.saml_request.push_query("SAMLRequest", &mut q);
self.saml_response.push_query("SAMLResponse", &mut q);
self.relay_state.push_query("RelayState", &mut q);
self.sig_alg.push_query("SigAlg", &mut q);
self.signature.push_query("Signature", &mut q);
q
}
}
/// Query parameters for `GET /externalposts`.
#[derive(Debug, Clone, Default)]
pub struct GetExternalpostsQuery {
/// If set, only posts created before this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub before: Option<chrono::DateTime<chrono::Utc>>,
/// If set, posts created at the "before" date are included in the result, if the guids of the posts are lexically smaller than the last_post_indentifier. Will be ignored if "before" is not set.
pub last_post_indentifier: Option<String>,
/// If set, only posts created after this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub after: Option<chrono::DateTime<chrono::Utc>>,
/// If set posts of these groups are returned.
pub external_group_guid: Option<Vec<String>>,
/// If set posts of these instances are returned.
pub external_instance_guid: Option<Vec<String>>,
/// If set, the response will include the specified data.
/// Allowed values: `linkings`.
pub include: Option<Vec<String>>,
/// Number of results per page.
pub limit: Option<i64>,
}
impl GetExternalpostsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.before.push_query("before", &mut q);
self.last_post_indentifier.push_query("last_post_indentifier", &mut q);
self.after.push_query("after", &mut q);
self.external_group_guid.push_query("external_group_guid[]", &mut q);
self.external_instance_guid.push_query("external_instance_guid[]", &mut q);
self.include.push_query("include[]", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `DELETE /facts/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFactsIdQuery {
/// Inspect deletion references without deleting. Returns `409` with the deletion report, including deletable=`true` when deletion would be allowed.
pub dry_run: Option<bool>,
}
impl DeleteFactsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Form fields for `POST /files/{domainType}/{domainIdentifier}` besides the files.
#[derive(Debug, Clone, Default)]
pub struct PostFilesDomainTypeDomainIdentifierForm {
/// JSON-encoded image crop and focus options.
pub image_options: Option<String>,
/// Security level used by the selected attachment category.
pub securitylevel_id: Option<i64>,
/// Stored sort key.
pub sort_key: Option<i64>,
}
impl PostFilesDomainTypeDomainIdentifierForm {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.image_options.push_query("image_options", &mut q);
self.securitylevel_id.push_query("securitylevel_id", &mut q);
self.sort_key.push_query("sortKey", &mut q);
q
}
}
/// Query parameters for `GET /finance/masterdata`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceMasterdataQuery {
/// Visible accounting period whose finance definitions are requested.
pub accounting_period_id: Option<i64>,
}
impl GetFinanceMasterdataQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/accountclasses/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceAccountclassesIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceAccountclassesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/accountgroups/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceAccountgroupsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceAccountgroupsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/accounttypes/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceAccounttypesIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceAccounttypesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/accountingperiods/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceAccountingperiodsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceAccountingperiodsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /finance/accountingperiods/{id}/bills`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceAccountingperiodsIdBillsQuery {
/// Maximum documents per page.
pub limit: Option<i64>,
/// Enable sorting by submission date, with bill ID as a tie-breaker.
/// Allowed values: `submittedDate`.
pub order_by: Option<String>,
/// Direction used when order_by is supplied.
/// Allowed values: `ASC`, `DESC`.
pub order_direction: Option<String>,
}
impl GetFinanceAccountingperiodsIdBillsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
q
}
}
/// Query parameters for `GET /finance/accountingperiods/{id}/accounts/{accountId}/movements`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceAccountingperiodsIdAccountsIdMovementsQuery {
/// Positive number of results per page. No upper bound is enforced.
pub limit: Option<i64>,
/// Restrict to a stored movement state.
/// Allowed values: `booked`, `ignored`, `open`.
pub state: Option<String>,
/// Substring search across purpose, account identifier and person name.
pub query: Option<String>,
/// Additional suggestion details; use the PHP array syntax include\[\]=bills.
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl GetFinanceAccountingperiodsIdAccountsIdMovementsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.state.push_query("state", &mut q);
self.query.push_query("query", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /finance/accountingperiods/{id}/accounts/{accountId}/statements/{statementId}/movements`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceAccountingperiodsIdAccountsIdStatementsIdMovementsQuery {
/// Positive number of results per page. No upper bound is enforced.
pub limit: Option<i64>,
/// Restrict to a stored movement state.
/// Allowed values: `booked`, `ignored`, `open`.
pub state: Option<String>,
/// Substring search across purpose, account identifier and person name.
pub query: Option<String>,
/// Additional suggestion details; use the PHP array syntax include\[\]=bills.
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl GetFinanceAccountingperiodsIdAccountsIdStatementsIdMovementsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.state.push_query("state", &mut q);
self.query.push_query("query", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/accounts/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceAccountsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceAccountsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /finance/accounts/csv`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceAccountsCsvQuery {
/// Accounting period to export.
pub accounting_period_id: Option<i64>,
}
impl GetFinanceAccountsCsvQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `GET /finance/accounts/export`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceAccountsExportQuery {
/// Accounting period to export.
pub accounting_period_id: Option<i64>,
/// Download format. Only CSV and XLSX generators are registered.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
/// Deprecated. Compatibility alias for format.
/// Allowed values: `csv`, `xlsx`.
#[deprecated = "deprecated in the ChurchTools API"]
pub r#type: Option<String>,
}
impl GetFinanceAccountsExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.format.push_query("format", &mut q);
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /finance/accounts`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceAccountsQuery {
/// One accounting period or an array of period IDs. Use accounting_period_id\[\]=1&accounting_period_id\[\]=2 for multiple periods. Omit to search all visible periods.
pub accounting_period_id: Option<serde_json::Value>,
/// Calculate current balances and budgets from the previous period. False skips these calculations; returned zero or null values do not indicate calculated balances.
pub calculate_balance: Option<bool>,
}
impl GetFinanceAccountsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.calculate_balance.push_query("calculate_balance", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/bills/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceBillsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceBillsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/cashdiscounts/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceCashdiscountsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceCashdiscountsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /finance/cashdiscounts`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceCashdiscountsQuery {
/// Only return entries linked to accounts in this accounting period. Omit to return all periods.
pub accounting_period_id: Option<i64>,
}
impl GetFinanceCashdiscountsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/clients/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceClientsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceClientsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/costcenters/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceCostcentersIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceCostcentersIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /finance/costcenters/export`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceCostcentersExportQuery {
/// Accounting period to export.
pub accounting_period_id: Option<i64>,
/// Download format. Only CSV and XLSX generators are registered.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
/// Deprecated. Compatibility alias for format.
/// Allowed values: `csv`, `xlsx`.
#[deprecated = "deprecated in the ChurchTools API"]
pub r#type: Option<String>,
}
impl GetFinanceCostcentersExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.format.push_query("format", &mut q);
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /finance/costcenters`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceCostcentersQuery {
/// Restrict results to this accounting period. The period must also be visible to the caller.
pub accounting_period_id: Option<i64>,
}
impl GetFinanceCostcentersQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/donators/{donatorCoupleId}/receipts`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceDonatorsDonatorCoupleIdQuery {
/// Accounting period for these donation receipts.
pub accounting_period_id: Option<i64>,
}
impl DeleteFinanceDonatorsDonatorCoupleIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/donators/receipts`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceDonatorsReceiptsQuery {
/// Accounting period for these donation receipts.
pub accounting_period_id: Option<i64>,
}
impl DeleteFinanceDonatorsReceiptsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `GET /finance/donators/receipts`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceDonatorsReceiptsQuery {
/// Accounting period for these donation receipts.
pub accounting_period_id: Option<i64>,
/// Combine letters and attachments separately (twofiles), or interleave them by recipient into one PDF (onefile).
/// Allowed values: `onefile`, `twofiles`.
pub mode: Option<String>,
/// Insert blank pages for duplex printing: all, only cover letters, only attachments, or none. In onefile mode donation_attachment alone has no effect.
/// Allowed values: `all`, `donation_attachment`, `donation_cover_letter`, `none`.
pub cleardoublepage: Option<String>,
}
impl GetFinanceDonatorsReceiptsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.mode.push_query("mode", &mut q);
self.cleardoublepage.push_query("cleardoublepage", &mut q);
q
}
}
/// Query parameters for `GET /finance/donators/{donatorCoupleId}/receipts`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceDonatorsDonatorCoupleIdQuery {
/// Accounting period for these donation receipts.
pub accounting_period_id: Option<i64>,
/// Watermark for returned files. Does not select the stored receipt type.
/// Allowed values: `DRAFT`, `DUPLICATE`, `ORIGINAL`.
pub r#type: Option<String>,
}
impl GetFinanceDonatorsDonatorCoupleIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /finance/donators`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceDonatorsQuery {
/// Accounting period to aggregate.
pub accounting_period_id: Option<i64>,
/// Return only households missing at least one required name/address field.
pub only_incomplete: Option<bool>,
/// Sort by primary last name, donation count, latest donation date or net sum.
/// Allowed values: `count`, `last`, `name`, `sum`.
pub order_by: Option<String>,
/// Sort direction; upper- and lower-case values are accepted.
/// Allowed values: `ASC`, `DESC`, `asc`, `desc`.
pub order_direction: Option<String>,
/// Substring search on the primary first or last name. No minimum length is enforced; SQL LIKE wildcards are not escaped.
pub query: Option<String>,
/// Maximum households per page. No upper bound is enforced.
pub limit: Option<i64>,
}
impl GetFinanceDonatorsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.only_incomplete.push_query("only_incomplete", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.query.push_query("query", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /finance/eubp/submissions`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceEubpSubmissionsQuery {
/// Filter by client ID
pub client_id: Option<i64>,
}
impl GetFinanceEubpSubmissionsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.client_id.push_query("client_id", &mut q);
q
}
}
/// Query parameters for `GET /finance/eubp/submissions/{id}/accounts`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceEubpSubmissionsIdAccountsQuery {
/// Optional finance client ID to return accounts only for this client.
pub client_id: Option<i64>,
}
impl GetFinanceEubpSubmissionsIdAccountsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.client_id.push_query("client_id", &mut q);
q
}
}
/// Query parameters for `POST /finance/splittransactions`.
#[derive(Debug, Clone, Default)]
pub struct PostFinanceSplittransactionsQuery {
/// Skip the normal donation-account/donor constraint. Must be a query parameter. Joint-donor consistency checks still apply in the child service.
pub ignore_donation_constraint: Option<bool>,
}
impl PostFinanceSplittransactionsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.ignore_donation_constraint.push_query("ignoreDonationConstraint", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/splittransactions/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceSplittransactionsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
/// Include additional information
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl DeleteFinanceSplittransactionsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /finance/splittransactions/{id}`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceSplittransactionsIdQuery {
/// Include additional information
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl GetFinanceSplittransactionsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `PUT /finance/splittransactions/{id}`.
#[derive(Debug, Clone, Default)]
pub struct PutFinanceSplittransactionsIdQuery {
/// Skip the normal donation-account/donor constraint. Must be a query parameter. Joint-donor consistency checks still apply in the child service.
pub ignore_donation_constraint: Option<bool>,
/// Include additional information
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl PutFinanceSplittransactionsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.ignore_donation_constraint.push_query("ignoreDonationConstraint", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/taxrates/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceTaxratesIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceTaxratesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /finance/taxrates`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTaxratesQuery {
/// Only return entries linked to accounts in this accounting period. Omit to return all periods.
pub accounting_period_id: Option<i64>,
}
impl GetFinanceTaxratesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/taxtypes/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceTaxtypesIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceTaxtypesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `POST /finance/templates/{id}`.
#[derive(Debug, Clone, Default)]
pub struct PostFinanceTemplatesIdQuery {
/// Existing accounting period visible to the caller.
pub accounting_period_id: Option<i64>,
}
impl PostFinanceTemplatesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `GET /finance/templates/export`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTemplatesExportQuery {
/// Existing accounting period visible to the caller.
pub accounting_period_id: Option<i64>,
}
impl GetFinanceTemplatesExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/transactionpurposes/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceTransactionpurposesIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteFinanceTransactionpurposesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `POST /finance/transactions/bulkcreate`.
#[derive(Debug, Clone, Default)]
pub struct PostFinanceTransactionsBulkcreateQuery {
/// Skip the donor/account constraint. For creation this must be a query parameter; a body-only value does not disable the constraint. Spouse consistency remains enforced.
pub ignore_donation_constraint: Option<bool>,
}
impl PostFinanceTransactionsBulkcreateQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.ignore_donation_constraint.push_query("ignoreDonationConstraint", &mut q);
q
}
}
/// Query parameters for `POST /finance/transactions`.
#[derive(Debug, Clone, Default)]
pub struct PostFinanceTransactionsQuery {
/// Skip the donor/account constraint. For creation this must be a query parameter; a body-only value does not disable the constraint. Spouse consistency remains enforced.
pub ignore_donation_constraint: Option<bool>,
}
impl PostFinanceTransactionsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.ignore_donation_constraint.push_query("ignoreDonationConstraint", &mut q);
q
}
}
/// Query parameters for `DELETE /finance/transactions/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteFinanceTransactionsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
/// Include additional information
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl DeleteFinanceTransactionsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/{id}`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsIdQuery {
/// Include additional information
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl GetFinanceTransactionsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/csv`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsCsvQuery {
/// ID of accounting period to get master data for
pub accounting_period_id: Option<i64>,
/// Filter by person ID. Get all transactions the person has created. But only show those the user can see.
pub created_pid: Option<i64>,
/// Filter by cost centers.
pub cost_center_ids: Option<Vec<i64>>,
/// Person IDs matching either donor or spouse, including donors of the original booking when matching cancellations.
pub donator_ids: Option<Vec<i64>>,
/// Filter by ids to include.
pub include_ids: Option<Vec<i64>>,
/// Filter by ids to exclude.
pub exclude_ids: Option<Vec<i64>>,
/// Filter by account/contra account. All transactions match, where either account or contra account is in the list.
pub account_ids: Option<Vec<i64>>,
/// Currently, either true or false selects bookings with a positive donor ID. Omit this parameter to include both donations and other bookings.
pub is_donation: Option<bool>,
/// True selects a cash-asset debit account and a non-cash-asset credit account (income); false selects the reverse (expense). Transfers between two cash-asset accounts or two non-cash-asset accounts match neither value.
pub is_income: Option<bool>,
/// Inclusive lower bound for documentDate.
pub start_date: Option<chrono::NaiveDate>,
/// Inclusive upper bound for documentDate.
pub end_date: Option<chrono::NaiveDate>,
/// Filter transactions, whether transaction is immutable.
pub is_immutable: Option<bool>,
/// Sort by document date, amount, modification time, document number, note, account number, contra-account number, cost-center number, donor name or receipt count. Date and modification time plus ID break ties where applicable. Document numbers use their stored text, numeric and split suffix parts.
/// Allowed values: `account`, `amount`, `bills`, `contra_account`, `cost_center`, `date`, `donator`, `modified`, `note`, `number`.
pub order_by: Option<String>,
/// Primary sort direction. Prefer uppercase values for consistent secondary sorting.
/// Allowed values: `ASC`, `DESC`, `asc`, `desc`.
pub order_direction: Option<String>,
/// Search note, document number or amount. For amount matching, leading zeros and decimal separators are removed.
pub query: Option<String>,
/// Filter by whether reimbursement of expenses was waived as a donation.
pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
/// Column layout: default is the human-readable CT export; sage100 uses separate debit/credit account and cost-center numbers plus tax fields. An empty string selects default.
/// Allowed values: ``, `default`, `sage100`.
pub target: Option<String>,
}
impl GetFinanceTransactionsCsvQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.created_pid.push_query("created_pid", &mut q);
self.cost_center_ids.push_query("cost_center_ids[]", &mut q);
self.donator_ids.push_query("donator_ids[]", &mut q);
self.include_ids.push_query("include_ids[]", &mut q);
self.exclude_ids.push_query("exclude_ids[]", &mut q);
self.account_ids.push_query("account_ids[]", &mut q);
self.is_donation.push_query("is_donation", &mut q);
self.is_income.push_query("is_income", &mut q);
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.is_immutable.push_query("is_immutable", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.query.push_query("query", &mut q);
self.is_waiver_of_reimbursement_of_expenses.push_query("is_waiver_of_reimbursement_of_expenses", &mut q);
self.target.push_query("target", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/datevexport`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsDatevexportQuery {
/// ID of accounting period to get master data for
pub accounting_period_id: Option<i64>,
/// Filter by person ID. Get all transactions the person has created. But only show those the user can see.
pub created_pid: Option<i64>,
/// Filter by cost centers.
pub cost_center_ids: Option<Vec<i64>>,
/// Person IDs matching either donor or spouse, including donors of the original booking when matching cancellations.
pub donator_ids: Option<Vec<i64>>,
/// Filter by ids to include.
pub include_ids: Option<Vec<i64>>,
/// Filter by ids to exclude.
pub exclude_ids: Option<Vec<i64>>,
/// Filter by account/contra account. All transactions match, where either account or contra account is in the list.
pub account_ids: Option<Vec<i64>>,
/// Currently, either true or false selects bookings with a positive donor ID. Omit this parameter to include both donations and other bookings.
pub is_donation: Option<bool>,
/// True selects a cash-asset debit account and a non-cash-asset credit account (income); false selects the reverse (expense). Transfers between two cash-asset accounts or two non-cash-asset accounts match neither value.
pub is_income: Option<bool>,
/// Inclusive lower bound for documentDate.
pub start_date: Option<chrono::NaiveDate>,
/// Inclusive upper bound for documentDate.
pub end_date: Option<chrono::NaiveDate>,
/// Filter transactions, whether transaction is immutable.
pub is_immutable: Option<bool>,
/// Sort by document date, amount, modification time, document number, note, account number, contra-account number, cost-center number, donor name or receipt count. Date and modification time plus ID break ties where applicable. Document numbers use their stored text, numeric and split suffix parts.
/// Allowed values: `account`, `amount`, `bills`, `contra_account`, `cost_center`, `date`, `donator`, `modified`, `note`, `number`.
pub order_by: Option<String>,
/// Primary sort direction. Prefer uppercase values for consistent secondary sorting.
/// Allowed values: `ASC`, `DESC`, `asc`, `desc`.
pub order_direction: Option<String>,
/// Search note, document number or amount. For amount matching, leading zeros and decimal separators are removed.
pub query: Option<String>,
/// Filter by whether reimbursement of expenses was waived as a donation.
pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
}
impl GetFinanceTransactionsDatevexportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.created_pid.push_query("created_pid", &mut q);
self.cost_center_ids.push_query("cost_center_ids[]", &mut q);
self.donator_ids.push_query("donator_ids[]", &mut q);
self.include_ids.push_query("include_ids[]", &mut q);
self.exclude_ids.push_query("exclude_ids[]", &mut q);
self.account_ids.push_query("account_ids[]", &mut q);
self.is_donation.push_query("is_donation", &mut q);
self.is_income.push_query("is_income", &mut q);
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.is_immutable.push_query("is_immutable", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.query.push_query("query", &mut q);
self.is_waiver_of_reimbursement_of_expenses.push_query("is_waiver_of_reimbursement_of_expenses", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/documentnumberavailable`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsDocumentnumberavailableQuery {
/// ID of accounting period to get master data for
pub accounting_period_id: Option<i64>,
/// Document number to check for availability.
pub document_number: Option<String>,
}
impl GetFinanceTransactionsDocumentnumberavailableQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.document_number.push_query("document_number", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/export`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsExportQuery {
/// ID of accounting period to get master data for
pub accounting_period_id: Option<i64>,
/// Filter by person ID. Get all transactions the person has created. But only show those the user can see.
pub created_pid: Option<i64>,
/// Filter by cost centers.
pub cost_center_ids: Option<Vec<i64>>,
/// Person IDs matching either donor or spouse, including donors of the original booking when matching cancellations.
pub donator_ids: Option<Vec<i64>>,
/// Filter by ids to include.
pub include_ids: Option<Vec<i64>>,
/// Filter by ids to exclude.
pub exclude_ids: Option<Vec<i64>>,
/// Filter by account/contra account. All transactions match, where either account or contra account is in the list.
pub account_ids: Option<Vec<i64>>,
/// Currently, either true or false selects bookings with a positive donor ID. Omit this parameter to include both donations and other bookings.
pub is_donation: Option<bool>,
/// True selects a cash-asset debit account and a non-cash-asset credit account (income); false selects the reverse (expense). Transfers between two cash-asset accounts or two non-cash-asset accounts match neither value.
pub is_income: Option<bool>,
/// Inclusive lower bound for documentDate.
pub start_date: Option<chrono::NaiveDate>,
/// Inclusive upper bound for documentDate.
pub end_date: Option<chrono::NaiveDate>,
/// Filter transactions, whether transaction is immutable.
pub is_immutable: Option<bool>,
/// Sort by document date, amount, modification time, document number, note, account number, contra-account number, cost-center number, donor name or receipt count. Date and modification time plus ID break ties where applicable. Document numbers use their stored text, numeric and split suffix parts.
/// Allowed values: `account`, `amount`, `bills`, `contra_account`, `cost_center`, `date`, `donator`, `modified`, `note`, `number`.
pub order_by: Option<String>,
/// Primary sort direction. Prefer uppercase values for consistent secondary sorting.
/// Allowed values: `ASC`, `DESC`, `asc`, `desc`.
pub order_direction: Option<String>,
/// Search note, document number or amount. For amount matching, leading zeros and decimal separators are removed.
pub query: Option<String>,
/// Filter by whether reimbursement of expenses was waived as a donation.
pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
/// Column layout: default is the human-readable CT export; sage100 uses separate debit/credit account and cost-center numbers plus tax fields. An empty string selects default.
/// Allowed values: ``, `default`, `sage100`.
pub target: Option<String>,
/// File format.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
/// Deprecated. Legacy alias for format. Use format for new integrations.
/// Allowed values: `csv`, `xlsx`.
#[deprecated = "Use format for new integrations."]
pub r#type: Option<String>,
}
impl GetFinanceTransactionsExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.created_pid.push_query("created_pid", &mut q);
self.cost_center_ids.push_query("cost_center_ids[]", &mut q);
self.donator_ids.push_query("donator_ids[]", &mut q);
self.include_ids.push_query("include_ids[]", &mut q);
self.exclude_ids.push_query("exclude_ids[]", &mut q);
self.account_ids.push_query("account_ids[]", &mut q);
self.is_donation.push_query("is_donation", &mut q);
self.is_income.push_query("is_income", &mut q);
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.is_immutable.push_query("is_immutable", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.query.push_query("query", &mut q);
self.is_waiver_of_reimbursement_of_expenses.push_query("is_waiver_of_reimbursement_of_expenses", &mut q);
self.target.push_query("target", &mut q);
self.format.push_query("format", &mut q);
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/ids`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsIdsQuery {
/// Optional ID of an accounting period. When provided, only the transaction IDs of that period are returned as a flat array.
pub accounting_period_id: Option<i64>,
}
impl GetFinanceTransactionsIdsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/nextdocumentnumber`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsNextdocumentnumberQuery {
/// ID of accounting period to get master data for
pub accounting_period_id: Option<i64>,
}
impl GetFinanceTransactionsNextdocumentnumberQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions/summary`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsSummaryQuery {
/// ID of accounting period to get master data for
pub accounting_period_id: Option<i64>,
/// Filter by person ID. Get all transactions the person has created. But only show those the user can see.
pub created_pid: Option<i64>,
/// Filter by cost centers.
pub cost_center_ids: Option<Vec<i64>>,
/// Person IDs matching either donor or spouse, including donors of the original booking when matching cancellations.
pub donator_ids: Option<Vec<i64>>,
/// Filter by account/contra account. All transactions match, where either account or contra account is in the list.
pub account_ids: Option<Vec<i64>>,
/// Currently, either true or false selects bookings with a positive donor ID. Omit this parameter to include both donations and other bookings.
pub is_donation: Option<bool>,
/// True selects a cash-asset debit account and a non-cash-asset credit account (income); false selects the reverse (expense). Transfers between two cash-asset accounts or two non-cash-asset accounts match neither value.
pub is_income: Option<bool>,
/// Inclusive lower bound for documentDate.
pub start_date: Option<chrono::NaiveDate>,
/// Inclusive upper bound for documentDate.
pub end_date: Option<chrono::NaiveDate>,
/// Filter transactions, whether transaction is immutable.
pub is_immutable: Option<bool>,
/// Sort by document date, amount, modification time, document number, note, account number, contra-account number, cost-center number, donor name or receipt count. Date and modification time plus ID break ties where applicable. Document numbers use their stored text, numeric and split suffix parts.
/// Allowed values: `account`, `amount`, `bills`, `contra_account`, `cost_center`, `date`, `donator`, `modified`, `note`, `number`.
pub order_by: Option<String>,
/// Primary sort direction. Prefer uppercase values for consistent secondary sorting.
/// Allowed values: `ASC`, `DESC`, `asc`, `desc`.
pub order_direction: Option<String>,
/// Search note, document number or amount. For amount matching, leading zeros and decimal separators are removed.
pub query: Option<String>,
/// Filter by whether reimbursement of expenses was waived as a donation.
pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
/// Explicit calculation mode, also saved as the current user’s preference. credit-debit uses selected account_ids; costcenter-sum uses cost-center selection; donation-sum uses donor selection.
/// Allowed values: `costcenter-sum`, `credit-debit`, `donation-sum`.
pub calculation_type: Option<String>,
}
impl GetFinanceTransactionsSummaryQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.created_pid.push_query("created_pid", &mut q);
self.cost_center_ids.push_query("cost_center_ids[]", &mut q);
self.donator_ids.push_query("donator_ids[]", &mut q);
self.account_ids.push_query("account_ids[]", &mut q);
self.is_donation.push_query("is_donation", &mut q);
self.is_income.push_query("is_income", &mut q);
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.is_immutable.push_query("is_immutable", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.query.push_query("query", &mut q);
self.is_waiver_of_reimbursement_of_expenses.push_query("is_waiver_of_reimbursement_of_expenses", &mut q);
self.calculation_type.push_query("calculation_type", &mut q);
q
}
}
/// Query parameters for `GET /finance/transactions`.
#[derive(Debug, Clone, Default)]
pub struct GetFinanceTransactionsQuery {
/// ID of accounting period to get master data for
pub accounting_period_id: Option<i64>,
/// Filter by person ID. Get all transactions the person has created. But only show those the user can see.
pub created_pid: Option<i64>,
/// Filter by cost centers.
pub cost_center_ids: Option<Vec<i64>>,
/// Person IDs matching either donor or spouse, including the original donation referenced by a cancellation booking. Subject to the donor-filter permission described above.
pub donator_ids: Option<Vec<i64>>,
/// Filter by ids to include.
pub include_ids: Option<Vec<i64>>,
/// Filter by ids to exclude.
pub exclude_ids: Option<Vec<i64>>,
/// Filter by account/contra account. All transactions match, where either account or contra account is in the list.
pub account_ids: Option<Vec<i64>>,
/// Currently, either true or false selects bookings with a positive donor ID. Omit this parameter to include both donations and other bookings.
pub is_donation: Option<bool>,
/// True selects a cash-asset debit account and a non-cash-asset credit account (income); false selects the reverse (expense). Transfers between two cash-asset accounts or two non-cash-asset accounts match neither value.
pub is_income: Option<bool>,
/// Inclusive lower bound for documentDate.
pub start_date: Option<chrono::NaiveDate>,
/// Inclusive upper bound for documentDate.
pub end_date: Option<chrono::NaiveDate>,
/// Filter transactions, whether transaction is immutable.
pub is_immutable: Option<bool>,
/// Exclude both cancellation bookings and the original bookings they cancel.
pub exclude_stornos: Option<bool>,
/// Exclude donor-linked bookings debiting a donation account and crediting a non-donation account (donation repayments).
pub exclude_paybacks: Option<bool>,
/// Sort by document date, amount, modification time, document number, note, account number, contra-account number, cost-center number, donor name or receipt count. Date and modification time plus ID break ties where applicable. Document numbers use their stored text, numeric and split suffix parts.
/// Allowed values: `account`, `amount`, `bills`, `contra_account`, `cost_center`, `date`, `donator`, `modified`, `note`, `number`.
pub order_by: Option<String>,
/// Primary sort direction. Prefer uppercase values for consistent secondary sorting.
/// Allowed values: `ASC`, `DESC`, `asc`, `desc`.
pub order_direction: Option<String>,
/// Maximum number of bookings per page. No explicit maximum is validated.
pub limit: Option<i64>,
/// Include additional information
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
/// Search note, document number or amount. For amount matching, leading zeros and decimal separators are removed.
pub query: Option<String>,
/// Filter by whether reimbursement of expenses was waived as a donation.
pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
}
impl GetFinanceTransactionsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.accounting_period_id.push_query("accounting_period_id", &mut q);
self.created_pid.push_query("created_pid", &mut q);
self.cost_center_ids.push_query("cost_center_ids[]", &mut q);
self.donator_ids.push_query("donator_ids[]", &mut q);
self.include_ids.push_query("include_ids[]", &mut q);
self.exclude_ids.push_query("exclude_ids[]", &mut q);
self.account_ids.push_query("account_ids[]", &mut q);
self.is_donation.push_query("is_donation", &mut q);
self.is_income.push_query("is_income", &mut q);
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.is_immutable.push_query("is_immutable", &mut q);
self.exclude_stornos.push_query("exclude_stornos", &mut q);
self.exclude_paybacks.push_query("exclude_paybacks", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.limit.push_query("limit", &mut q);
self.include.push_query("include[]", &mut q);
self.query.push_query("query", &mut q);
self.is_waiver_of_reimbursement_of_expenses.push_query("is_waiver_of_reimbursement_of_expenses", &mut q);
q
}
}
/// Query parameters for `PUT /finance/transactions/{id}`.
#[derive(Debug, Clone, Default)]
pub struct PutFinanceTransactionsIdQuery {
/// Include additional information
/// Allowed values: `bills`.
pub include: Option<Vec<String>>,
}
impl PutFinanceTransactionsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /followups`.
#[derive(Debug, Clone, Default)]
pub struct GetFollowupsQuery {
/// Repeat to select any of the listed states. An empty array includes all states.
/// Allowed values: `done`, `due-after-today`, `due-before-today`, `due-today`, `due-unspecified`.
pub filter: Option<Vec<String>>,
/// Maximum results in this page.
pub limit: Option<i64>,
}
impl GetFollowupsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.filter.push_query("filter[]", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `POST /followups/{followUpId}/notes`.
#[derive(Debug, Clone, Default)]
pub struct PostFollowupsFollowUpIdNotesQuery {
/// Additionally link the same note to the subject person.
pub also_apply_to_person: Option<bool>,
}
impl PostFollowupsFollowUpIdNotesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.also_apply_to_person.push_query("also_apply_to_person", &mut q);
q
}
}
/// Query parameters for `DELETE /group/agegroups/{ageGroupId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteGroupAgegroupsAgeGroupIdQuery {
/// Required; true returns a 409 deletion report without deleting, false performs deletion.
pub dry_run: Option<bool>,
}
impl DeleteGroupAgegroupsAgeGroupIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `DELETE /group/groupcategories/{groupCategoryId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteGroupGroupcategoriesGroupCategoryIdQuery {
/// Required; true returns a 409 deletion report without deleting, false performs deletion.
pub dry_run: Option<bool>,
}
impl DeleteGroupGroupcategoriesGroupCategoryIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `DELETE /group/grouptypes/{groupTypeId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteGroupGrouptypesGroupTypeIdQuery {
/// Inspect deletion dependencies without deleting; returns a 409 deletion report.
pub dry_run: Option<bool>,
}
impl DeleteGroupGrouptypesGroupTypeIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `DELETE /group/meetingtemplates/{meetingTemplateId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteGroupMeetingtemplatesMeetingTemplateIdQuery {
/// Required; true returns a 409 deletion report without deleting, false performs deletion.
pub dry_run: Option<bool>,
}
impl DeleteGroupMeetingtemplatesMeetingTemplateIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `DELETE /group/roles/{roleId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteGroupRolesRoleIdQuery {
/// Inspect deletion dependencies without deleting; returns a 409 deletion report.
pub dry_run: Option<bool>,
}
impl DeleteGroupRolesRoleIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `GET /group/roles`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupRolesQuery {
/// ID of the group type whose role definitions to return.
pub group_type_id: Option<i64>,
/// Choose full role definitions (standard) or compact display references (domainObject).
/// Allowed values: `domainObject`, `standard`.
pub response_format: Option<String>,
}
impl GetGroupRolesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.group_type_id.push_query("group_type_id", &mut q);
self.response_format.push_query("responseFormat", &mut q);
q
}
}
/// Query parameters for `DELETE /group/targetgroups/{targetGroupId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteGroupTargetgroupsTargetGroupIdQuery {
/// Required; true returns a 409 deletion report without deleting, false performs deletion.
pub dry_run: Option<bool>,
}
impl DeleteGroupTargetgroupsTargetGroupIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `GET /grouphomepages/{hash}`.
#[derive(Debug, Clone, Default)]
pub struct GetGrouphomepagesHashQuery {
/// Optional hierarchy-depth override. 0 gives no descendants, positive values limit levels, negative values currently act as unbounded. Omitted uses the stored depth.
pub depth: Option<i64>,
}
impl GetGrouphomepagesHashQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.depth.push_query("depth", &mut q);
q
}
}
/// Query parameters for `DELETE /groups/{groupId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteGroupsGroupIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteGroupsGroupIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `POST /groups/{groupId}/duplicate`.
#[derive(Debug, Clone, Default)]
pub struct PostGroupsIdDuplicateQuery {
/// Name of the copy, trimmed before validation. Required in either the query or JSON body. The validator accepts up to 255 characters, but the stored group name column is limited to 100.
pub new_name: Option<String>,
/// Copy memberships, including statuses, roles, comments and member field values. Archived persons are excluded; group capacity is ignored and leaders are not informed.
pub copy_members: Option<bool>,
/// Copy group-role permissions and permission inheritance settings. Locked permissions are omitted unless the current user is an authorized person.
pub copy_permissions: Option<bool>,
/// Copy membership routines and prepare their potential runs for the new group.
pub copy_routines: Option<bool>,
}
impl PostGroupsIdDuplicateQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.new_name.push_query("newName", &mut q);
self.copy_members.push_query("copyMembers", &mut q);
self.copy_permissions.push_query("copyPermissions", &mut q);
self.copy_routines.push_query("copyRoutines", &mut q);
q
}
}
/// Query parameters for `POST /groups/export`.
#[derive(Debug, Clone, Default)]
pub struct PostGroupsExportQuery {
/// Export file format. Defaults to `csv` when omitted. The response content type depends on the selected format.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
/// Deprecated. Use `format`
/// Allowed values: `csv`, `xlsx`.
#[deprecated = "Use `format`"]
pub r#type: Option<String>,
}
impl PostGroupsExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.format.push_query("format", &mut q);
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdQuery {
/// Include additional information (currently, 'roles' are included by default but this behaviour is now deprecated)
/// Allowed values: `averageMemberAge`, `hasPermissions`, `memberStatistics`, `places`, `publicPostsStatistic`, `roles`, `signupConditions`, `tags`.
pub include: Option<Vec<String>>,
}
impl GetGroupsGroupIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /groups/grouped`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupedQuery {
/// Group attribute used to build the response buckets
/// Allowed values: `ageGroup`, `campus`, `groupCategory`, `groupStatus`, `groupType`, `isOpenForMembers`, `targetGroup`, `visibility`.
pub group_by: Option<String>,
/// Number of results per page.
pub limit: Option<i64>,
}
impl GetGroupsGroupedQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.group_by.push_query("group_by", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /groups`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Array of group ids
pub ids: Option<Vec<i64>>,
/// Return direct child groups of this group
pub parent_id: Option<i64>,
/// Return direct parent groups of this group
pub child_id: Option<i64>,
/// Array of campus ids to filter the groups
pub campus_ids: Option<Vec<i64>>,
/// Array of age group ids to filter the groups
pub agegroup_ids: Option<Vec<i64>>,
/// Array of group status ids to filter the groups
pub group_status_ids: Option<Vec<i64>>,
/// Array of group category ids to filter the groups
pub group_category_ids: Option<Vec<i64>>,
/// Array of target group ids to filter the groups
pub target_group_ids: Option<Vec<i64>>,
/// Array of weekdays to filter the groups. Sunday = 0, Monday = 1 ...
pub weekdays: Option<Vec<i64>>,
/// Array of group type ids to filter the groups
pub group_type_ids: Option<Vec<i64>>,
/// Array of group tag ids to filter the groups
pub tag_ids: Option<Vec<i64>>,
/// Filters groups by its open status
pub is_open_for_members: Option<bool>,
/// Determines if groups should be omitted where I am in
pub without_my_groups: Option<bool>,
/// Determines if only groups where I am in should be returned
pub only_my_groups: Option<bool>,
/// Only show groups with meeting place
pub has_meeting_place: Option<bool>,
/// Only show groups where posting is allowed
pub allow_posts: Option<bool>,
/// Only show groups which has posts
pub has_posts: Option<bool>,
/// Filter groups based on whether they have an active chat
pub has_active_chat: Option<bool>,
pub query: Option<String>,
/// Group visibility
/// Allowed values: `hidden`, `intern`, `public`, `restricted`.
pub visibility: Option<String>,
/// The fields to order by
pub order_fields: Option<Vec<String>>,
/// The order direction ASC or DESC for the order_fields
/// Allowed values: `ASC`, `DESC`.
pub order_directions: Option<Vec<String>>,
/// Include additional information (currently, 'roles' are included by default but this behaviour is now deprecated)
/// Allowed values: `averageMemberAge`, `hasPermissions`, `memberStatistics`, `places`, `publicPostsStatistic`, `roles`, `signupConditions`, `tags`.
pub include: Option<Vec<String>>,
}
impl GetGroupsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.ids.push_query("ids[]", &mut q);
self.parent_id.push_query("parent_id", &mut q);
self.child_id.push_query("child_id", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.agegroup_ids.push_query("agegroup_ids[]", &mut q);
self.group_status_ids.push_query("group_status_ids[]", &mut q);
self.group_category_ids.push_query("group_category_ids[]", &mut q);
self.target_group_ids.push_query("target_group_ids[]", &mut q);
self.weekdays.push_query("weekdays[]", &mut q);
self.group_type_ids.push_query("group_type_ids[]", &mut q);
self.tag_ids.push_query("tag_ids[]", &mut q);
self.is_open_for_members.push_query("is_open_for_members", &mut q);
self.without_my_groups.push_query("without_my_groups", &mut q);
self.only_my_groups.push_query("only_my_groups", &mut q);
self.has_meeting_place.push_query("has_meeting_place", &mut q);
self.allow_posts.push_query("allow_posts", &mut q);
self.has_posts.push_query("has_posts", &mut q);
self.has_active_chat.push_query("has_active_chat", &mut q);
self.query.push_query("query", &mut q);
self.visibility.push_query("visibility", &mut q);
self.order_fields.push_query("order_fields[]", &mut q);
self.order_directions.push_query("order_directions[]", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/absences`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsAbsencesQuery {
/// Start of the overlap window. Defaults to midnight two weeks ago.
pub from: Option<serde_json::Value>,
/// End of the overlap window. Defaults to midnight two weeks from today.
pub to: Option<serde_json::Value>,
/// Order by absence start.
/// Allowed values: `ASC`, `DESC`.
pub order_direction: Option<String>,
/// Deprecated. Legacy alias for from.
#[deprecated = "deprecated in the ChurchTools API"]
pub from_date: Option<serde_json::Value>,
/// Deprecated. Legacy alias for to.
#[deprecated = "deprecated in the ChurchTools API"]
pub to_date: Option<serde_json::Value>,
}
impl GetGroupsAbsencesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.from_date.push_query("from_date", &mut q);
self.to_date.push_query("to_date", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/children`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdChildrenQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Array of group ids
pub ids: Option<Vec<i64>>,
/// Array of campus ids to filter the groups
pub campus_ids: Option<Vec<i64>>,
/// Array of age group ids to filter the groups
pub agegroup_ids: Option<Vec<i64>>,
/// Array of group status ids to filter the groups
pub group_status_ids: Option<Vec<i64>>,
/// Array of group category ids to filter the groups
pub group_category_ids: Option<Vec<i64>>,
/// Array of target group ids to filter the groups
pub target_group_ids: Option<Vec<i64>>,
/// Array of weekdays to filter the groups. Sunday = 0, Monday = 1 ...
pub weekdays: Option<Vec<i64>>,
/// Array of group type ids to filter the groups
pub group_type_ids: Option<Vec<i64>>,
/// Array of group tag ids to filter the groups
pub tag_ids: Option<Vec<i64>>,
/// Filters groups by its open status
pub is_open_for_members: Option<bool>,
/// Determines if groups should be omitted where I am in
pub without_my_groups: Option<bool>,
/// Determines if only groups where I am in should be returned
pub only_my_groups: Option<bool>,
/// Only show groups with meeting place
pub has_meeting_place: Option<bool>,
/// Only show groups where posting is allowed
pub allow_posts: Option<bool>,
/// Only show groups which has posts
pub has_posts: Option<bool>,
/// Filter groups based on whether they have an active chat
pub has_active_chat: Option<bool>,
pub query: Option<String>,
/// Group visibility
/// Allowed values: `hidden`, `intern`, `public`, `restricted`.
pub visibility: Option<String>,
}
impl GetGroupsGroupIdChildrenQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.ids.push_query("ids[]", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.agegroup_ids.push_query("agegroup_ids[]", &mut q);
self.group_status_ids.push_query("group_status_ids[]", &mut q);
self.group_category_ids.push_query("group_category_ids[]", &mut q);
self.target_group_ids.push_query("target_group_ids[]", &mut q);
self.weekdays.push_query("weekdays[]", &mut q);
self.group_type_ids.push_query("group_type_ids[]", &mut q);
self.tag_ids.push_query("tag_ids[]", &mut q);
self.is_open_for_members.push_query("is_open_for_members", &mut q);
self.without_my_groups.push_query("without_my_groups", &mut q);
self.only_my_groups.push_query("only_my_groups", &mut q);
self.has_meeting_place.push_query("has_meeting_place", &mut q);
self.allow_posts.push_query("allow_posts", &mut q);
self.has_posts.push_query("has_posts", &mut q);
self.has_active_chat.push_query("has_active_chat", &mut q);
self.query.push_query("query", &mut q);
self.visibility.push_query("visibility", &mut q);
q
}
}
/// Query parameters for `GET /groups/hierarchies`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsHierarchiesQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Array of group ids
pub ids: Option<Vec<i64>>,
/// Array of campus ids to filter the groups
pub campus_ids: Option<Vec<i64>>,
/// Array of age group ids to filter the groups
pub agegroup_ids: Option<Vec<i64>>,
/// Array of group status ids to filter the groups
pub group_status_ids: Option<Vec<i64>>,
/// Array of group category ids to filter the groups
pub group_category_ids: Option<Vec<i64>>,
/// Array of target group ids to filter the groups
pub target_group_ids: Option<Vec<i64>>,
/// Array of weekdays to filter the groups. Sunday = 0, Monday = 1 ...
pub weekdays: Option<Vec<i64>>,
/// Array of group type ids to filter the groups
pub group_type_ids: Option<Vec<i64>>,
/// Array of group tag ids to filter the groups
pub tag_ids: Option<Vec<i64>>,
/// Filters groups by its open status
pub is_open_for_members: Option<bool>,
/// Determines if groups should be omitted where I am in
pub without_my_groups: Option<bool>,
/// Determines if only groups where I am in should be returned
pub only_my_groups: Option<bool>,
/// Only show groups with meeting place
pub has_meeting_place: Option<bool>,
/// Only show groups where posting is allowed
pub allow_posts: Option<bool>,
/// Only show groups which has posts
pub has_posts: Option<bool>,
/// Filter groups based on whether they have an active chat
pub has_active_chat: Option<bool>,
pub query: Option<String>,
/// Group visibility
/// Allowed values: `hidden`, `intern`, `public`, `restricted`.
pub visibility: Option<String>,
}
impl GetGroupsHierarchiesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.ids.push_query("ids[]", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.agegroup_ids.push_query("agegroup_ids[]", &mut q);
self.group_status_ids.push_query("group_status_ids[]", &mut q);
self.group_category_ids.push_query("group_category_ids[]", &mut q);
self.target_group_ids.push_query("target_group_ids[]", &mut q);
self.weekdays.push_query("weekdays[]", &mut q);
self.group_type_ids.push_query("group_type_ids[]", &mut q);
self.tag_ids.push_query("tag_ids[]", &mut q);
self.is_open_for_members.push_query("is_open_for_members", &mut q);
self.without_my_groups.push_query("without_my_groups", &mut q);
self.only_my_groups.push_query("only_my_groups", &mut q);
self.has_meeting_place.push_query("has_meeting_place", &mut q);
self.allow_posts.push_query("allow_posts", &mut q);
self.has_posts.push_query("has_posts", &mut q);
self.has_active_chat.push_query("has_active_chat", &mut q);
self.query.push_query("query", &mut q);
self.visibility.push_query("visibility", &mut q);
q
}
}
/// Query parameters for `GET /groups/ids`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsIdsQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Array of group ids
pub ids: Option<Vec<i64>>,
/// Return direct child groups of this group
pub parent_id: Option<i64>,
/// Return direct parent groups of this group
pub child_id: Option<i64>,
/// Array of campus ids to filter the groups
pub campus_ids: Option<Vec<i64>>,
/// Array of age group ids to filter the groups
pub agegroup_ids: Option<Vec<i64>>,
/// Array of group status ids to filter the groups
pub group_status_ids: Option<Vec<i64>>,
/// Array of group category ids to filter the groups
pub group_category_ids: Option<Vec<i64>>,
/// Array of target group ids to filter the groups
pub target_group_ids: Option<Vec<i64>>,
/// Array of weekdays to filter the groups. Sunday = 0, Monday = 1 ...
pub weekdays: Option<Vec<i64>>,
/// Array of group type ids to filter the groups
pub group_type_ids: Option<Vec<i64>>,
/// Array of group tag ids to filter the groups
pub tag_ids: Option<Vec<i64>>,
/// Filters groups by its open status
pub is_open_for_members: Option<bool>,
/// Determines if groups should be omitted where I am in
pub without_my_groups: Option<bool>,
/// Determines if only groups where I am in should be returned
pub only_my_groups: Option<bool>,
/// Only show groups with meeting place
pub has_meeting_place: Option<bool>,
/// Only show groups where posting is allowed
pub allow_posts: Option<bool>,
/// Only show groups which has posts
pub has_posts: Option<bool>,
/// Filter groups based on whether they have an active chat
pub has_active_chat: Option<bool>,
pub query: Option<String>,
/// Group visibility
/// Allowed values: `hidden`, `intern`, `public`, `restricted`.
pub visibility: Option<String>,
}
impl GetGroupsIdsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.ids.push_query("ids[]", &mut q);
self.parent_id.push_query("parent_id", &mut q);
self.child_id.push_query("child_id", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.agegroup_ids.push_query("agegroup_ids[]", &mut q);
self.group_status_ids.push_query("group_status_ids[]", &mut q);
self.group_category_ids.push_query("group_category_ids[]", &mut q);
self.target_group_ids.push_query("target_group_ids[]", &mut q);
self.weekdays.push_query("weekdays[]", &mut q);
self.group_type_ids.push_query("group_type_ids[]", &mut q);
self.tag_ids.push_query("tag_ids[]", &mut q);
self.is_open_for_members.push_query("is_open_for_members", &mut q);
self.without_my_groups.push_query("without_my_groups", &mut q);
self.only_my_groups.push_query("only_my_groups", &mut q);
self.has_meeting_place.push_query("has_meeting_place", &mut q);
self.allow_posts.push_query("allow_posts", &mut q);
self.has_posts.push_query("has_posts", &mut q);
self.has_active_chat.push_query("has_active_chat", &mut q);
self.query.push_query("query", &mut q);
self.visibility.push_query("visibility", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/memberids`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdMemberidsQuery {
/// Filter by role definition IDs (Role.id from GET /roles), matching groupTypeRoleId on memberships. Multiple IDs match any of the selected roles.
pub role_ids: Option<Vec<i64>>,
/// Filter by person IDs. These are the IDs in person.domainIdentifier, not membership record IDs.
pub person_id: Option<Vec<i64>>,
/// Filter by membership status, independently of the member’s role. Multiple values match any selected status. Omit this filter to include all visible statuses.
/// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
pub group_member_statuses: Option<Vec<String>>,
/// If true, return only group members, that are allowed to chat in this group
pub allowed_chat_users_only: Option<bool>,
/// If true, return only group members that are allowed to write in the chat.
pub allowed_chat_writers_only: Option<bool>,
/// Search the first and last names of the persons belonging to the group.
pub query: Option<String>,
/// Return memberships whose comment contains the supplied text.
pub comment: Option<String>,
/// Filter by a membership start date strictly after this value. Memberships without a start date do not match. Use YYYY-MM-DD; UTC timestamps are also accepted for compatibility.
pub member_start_date_after: Option<serde_json::Value>,
/// Filter by a membership start date strictly before this value. Memberships without a start date do not match. Use YYYY-MM-DD; UTC timestamps are also accepted for compatibility.
pub member_start_date_before: Option<serde_json::Value>,
}
impl GetGroupsGroupIdMemberidsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.role_ids.push_query("role_ids[]", &mut q);
self.person_id.push_query("person_id[]", &mut q);
self.group_member_statuses.push_query("group_member_statuses[]", &mut q);
self.allowed_chat_users_only.push_query("allowed_chat_users_only", &mut q);
self.allowed_chat_writers_only.push_query("allowed_chat_writers_only", &mut q);
self.query.push_query("query", &mut q);
self.comment.push_query("comment", &mut q);
self.member_start_date_after.push_query("member_start_date_after", &mut q);
self.member_start_date_before.push_query("member_start_date_before", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/memberpreview`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdMemberpreviewQuery {
/// Maximum number of active, visible members returned for each role.
pub members_per_role: Option<i64>,
}
impl GetGroupsGroupIdMemberpreviewQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.members_per_role.push_query("members_per_role", &mut q);
q
}
}
/// Query parameters for `GET /groups/members`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsMembersQuery {
/// Array of group ids
pub ids: Option<Vec<i64>>,
/// If true, return also deleted group members
pub with_deleted: Option<bool>,
}
impl GetGroupsMembersQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.ids.push_query("ids[]", &mut q);
self.with_deleted.push_query("with_deleted", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/posts`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdPostsQuery {
/// If set, only posts published before this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub before: Option<chrono::DateTime<chrono::Utc>>,
/// If set, posts published at the `before` date are included in the result, if the guids of the posts are lexically smaller than the `last_post_identifier`. Will be ignored if `before` is not set.
pub last_post_identifier: Option<String>,
/// If set, only posts published at or after this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub after: Option<chrono::DateTime<chrono::Utc>>,
/// Maximum number of posts in this batch.
pub limit: Option<i64>,
/// Optional comments and reactions. Linkings are already included by default.
/// Allowed values: `comments`, `linkings`, `reactions`.
pub include: Option<Vec<String>>,
}
impl GetGroupsGroupIdPostsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.before.push_query("before", &mut q);
self.last_post_identifier.push_query("last_post_identifier", &mut q);
self.after.push_query("after", &mut q);
self.limit.push_query("limit", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `POST /groups/{groupId}/notification`.
#[derive(Debug, Clone, Default)]
pub struct PostGroupsGroupIdNotificationQuery {
/// Preview the recipient count without sending. Only available before the group has been marked as notified.
pub dry_run: Option<bool>,
}
impl PostGroupsGroupIdNotificationQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `PATCH /groups/{groupId}`.
#[derive(Debug, Clone, Default)]
pub struct PatchGroupsIdQuery {
/// Decides in case of changing the visibility of posts in the group whether the current users posts should be skipped. Default: false
pub skip_my_posts_reducing_visibility: Option<bool>,
/// When changing the group status to finished with this flag it can be decided if all routines should be deactivated
pub deactivate_routines_on_status_finished: Option<bool>,
}
impl PatchGroupsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.skip_my_posts_reducing_visibility.push_query("skip_my_posts_reducing_visibility", &mut q);
self.deactivate_routines_on_status_finished.push_query("deactivate_routines_on_status_finished", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/followups`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdFollowupsQuery {
/// Repeat to select any of the listed states; omitted/empty includes all states.
/// Allowed values: `done`, `due-after-today`, `due-before-today`, `due-today`, `due-unspecified`.
pub filter: Option<Vec<String>>,
/// Maximum results in this page.
pub limit: Option<i64>,
}
impl GetGroupsGroupIdFollowupsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.filter.push_query("filter[]", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/meetings/export`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdMeetingsExportQuery {
/// Download format supported by the export generators.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
/// Choose a person-by-meeting attendance matrix or one summary row per meeting.
/// Allowed values: `meetings_members`, `meetings_overview`.
pub r#type: Option<String>,
/// Match the exact cancellation flag; omit to include canceled and non-canceled meetings.
pub is_canceled: Option<bool>,
/// Match the exact completion flag; omit to include both states.
pub is_completed: Option<bool>,
/// Inclusive lower start-time boundary. Date or UTC date-time; defaults to yesterday at midnight. start_date is a legacy alias.
pub from: Option<String>,
/// Exclusive upper start-time boundary. Date or UTC date-time; defaults to midnight 30 days after today. end_date is a legacy alias.
pub to: Option<String>,
/// Accepted for compatibility; the current date-range export remains ordered oldest first.
/// Allowed values: `backward`, `forward`.
pub direction: Option<String>,
}
impl GetGroupsGroupIdMeetingsExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.format.push_query("format", &mut q);
self.r#type.push_query("type", &mut q);
self.is_canceled.push_query("is_canceled", &mut q);
self.is_completed.push_query("is_completed", &mut q);
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.direction.push_query("direction", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/meetings`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsIdMeetingsQuery {
/// Filter by the exact cancellation flag: true selects canceled meetings, false selects non-canceled meetings. Omit to include both.
pub is_canceled: Option<bool>,
/// Filter by the exact completion flag. Omit to include both completed and incomplete meetings.
pub is_completed: Option<bool>,
/// Lower inclusive range boundary, or exclusive anchor when direction is supplied. Defaults to yesterday at midnight. start_date is a legacy alias.
pub from: Option<String>,
/// Exclusive upper range boundary. Defaults to midnight 30 days after today; ignored in directional mode. end_date is a legacy alias.
pub to: Option<String>,
/// Enable directional paging strictly before or after from; omit for an unpaginated date range.
/// Allowed values: `backward`, `forward`.
pub direction: Option<String>,
/// Number of meetings per page in directional mode only.
pub limit: Option<i64>,
/// Include additional information
/// Allowed values: `attendances`.
pub include: Option<Vec<String>>,
}
impl GetGroupsIdMeetingsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.is_canceled.push_query("is_canceled", &mut q);
self.is_completed.push_query("is_completed", &mut q);
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.direction.push_query("direction", &mut q);
self.limit.push_query("limit", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `POST /groups/{groupId}/members/export`.
#[derive(Debug, Clone, Default)]
pub struct PostGroupsIdMembersExportQuery {
/// Output format; CSV by default.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
/// Deprecated. Use `format`
/// Allowed values: `csv`, `xlsx`.
#[deprecated = "Use `format`"]
pub r#type: Option<String>,
}
impl PostGroupsIdMembersExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.format.push_query("format", &mut q);
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/members/export`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdMembersExportQuery {
/// Output format; CSV by default.
/// Allowed values: `csv`, `xlsx`.
pub format: Option<String>,
/// Deprecated. Use `format`
/// Allowed values: `csv`, `xlsx`.
#[deprecated = "Use `format`"]
pub r#type: Option<String>,
}
impl GetGroupsGroupIdMembersExportQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.format.push_query("format", &mut q);
self.r#type.push_query("type", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/members`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsIdMembersQuery {
/// Maximum number of memberships per page.
pub limit: Option<i64>,
/// Filter by role definition IDs (Role.id from GET /roles), matching groupTypeRoleId on memberships. Multiple IDs match any of the selected roles.
pub role_ids: Option<Vec<i64>>,
/// Filter by person IDs. These are the IDs in person.domainIdentifier, not membership record IDs.
pub person_id: Option<Vec<i64>>,
/// Filter by membership status, independently of the member’s role. Multiple values match any selected status. Omit this filter to include all visible statuses.
/// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
pub group_member_statuses: Option<Vec<String>>,
/// If true, return only group members, that are allowed to chat in this group
pub allowed_chat_users_only: Option<bool>,
/// If true, return only group members that are allowed to write in the chat.
pub allowed_chat_writers_only: Option<bool>,
/// Search the first and last names of the persons belonging to the group.
pub query: Option<String>,
/// Return memberships whose comment contains the supplied text.
pub comment: Option<String>,
/// Filter by a membership start date strictly after this value. Memberships without a start date do not match. Use YYYY-MM-DD; UTC timestamps are also accepted for compatibility.
pub member_start_date_after: Option<serde_json::Value>,
/// Filter by a membership start date strictly before this value. Memberships without a start date do not match. Use YYYY-MM-DD; UTC timestamps are also accepted for compatibility.
pub member_start_date_before: Option<serde_json::Value>,
/// Fields used to sort the member list. Use person_ for person fields and member_ for membership properties or custom member fields. For example: person_lastName or member_groupTypeRoleId. Without this parameter, results are ordered by role type, role sort key, last name, first name and person ID.
pub order_fields: Option<Vec<String>>,
/// Sort directions corresponding by position to orderFields. Supply one direction per sort field. Built-in fields default to ASC when their direction is omitted.
/// Allowed values: `ASC`, `DESC`.
pub order_directions: Option<Vec<String>>,
/// Additional person-field keys to include in each member’s personFields object, for example firstName. Person-field permissions apply; membership-specific fields are returned separately in fields.
pub person_fields: Option<Vec<String>>,
/// Additional member-list data. newsletter and tags add properties to each member; aggregations adds meta.aggregations.fields with numeric group member field aggregates over all filtered members, across all pages.
/// Allowed values: `aggregations`, `newsletter`, `tags`.
pub include: Option<Vec<String>>,
}
impl GetGroupsIdMembersQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.role_ids.push_query("role_ids[]", &mut q);
self.person_id.push_query("person_id[]", &mut q);
self.group_member_statuses.push_query("group_member_statuses[]", &mut q);
self.allowed_chat_users_only.push_query("allowed_chat_users_only", &mut q);
self.allowed_chat_writers_only.push_query("allowed_chat_writers_only", &mut q);
self.query.push_query("query", &mut q);
self.comment.push_query("comment", &mut q);
self.member_start_date_after.push_query("member_start_date_after", &mut q);
self.member_start_date_before.push_query("member_start_date_before", &mut q);
self.order_fields.push_query("orderFields[]", &mut q);
self.order_directions.push_query("orderDirections[]", &mut q);
self.person_fields.push_query("personFields[]", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/members/history`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdMembersHistoryQuery {
/// Affected person ID.
pub member_id: Option<i64>,
/// Person ID recorded as the actor.
pub actor_id: Option<i64>,
/// Origin of the membership change.
/// Allowed values: `automatic`, `bulk-job`, `check-in`, `cron`, `default`, `duplicate-group`, `follow-up`, `group-creation`, `person-deletion`, `routine`, `self-registration`, `sign-up`, `waitinglist`.
pub origin: Option<String>,
/// Only changes to this role ID. Takes precedence over status/field-change filters.
pub new_role_id: Option<i64>,
/// Only changes to this status, unless new_role_id is supplied. Unknown strings match no entries.
pub new_status: Option<String>,
/// Whether the stored field snapshot changed; ignored when new_role_id or new_status is supplied.
pub new_fields: Option<bool>,
/// Deprecated. Legacy alias used only if new_fields is absent.
#[deprecated = "deprecated in the ChurchTools API"]
pub has_field_changed: Option<bool>,
/// Exclusive upper entry-ID boundary; 0 yields an empty list.
pub offset_id: Option<i64>,
/// Maximum entries in this batch.
pub limit: Option<i64>,
}
impl GetGroupsGroupIdMembersHistoryQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.member_id.push_query("member_id", &mut q);
self.actor_id.push_query("actor_id", &mut q);
self.origin.push_query("origin", &mut q);
self.new_role_id.push_query("new_role_id", &mut q);
self.new_status.push_query("new_status", &mut q);
self.new_fields.push_query("new_fields", &mut q);
self.has_field_changed.push_query("has_field_changed", &mut q);
self.offset_id.push_query("offset_id", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/members/statistics`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdMembersStatisticsQuery {
/// Group-type role IDs configured for this group; limits the population to these roles.
pub group_type_role_ids: Option<Vec<i64>>,
/// Keys of person database fields from address, information or church categories. Custom keys depend on the installation.
pub person_fields: Option<Vec<String>>,
/// IDs of custom membership field definitions belonging to this group.
pub group_member_fields: Option<Vec<i64>>,
}
impl GetGroupsGroupIdMembersStatisticsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.group_type_role_ids.push_query("group_type_role_ids[]", &mut q);
self.person_fields.push_query("personFields[]", &mut q);
self.group_member_fields.push_query("groupMemberFields[]", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/members/{personId}/followups`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdMembersPersonIdFollowupsQuery {
/// Repeat to select any of the listed states; omitted/empty includes all states.
/// Allowed values: `done`, `due-after-today`, `due-before-today`, `due-today`, `due-unspecified`.
pub filter: Option<Vec<String>>,
/// Maximum results in this page.
pub limit: Option<i64>,
}
impl GetGroupsGroupIdMembersPersonIdFollowupsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.filter.push_query("filter[]", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `POST /groups/{groupId}/newsletter-integrations/{provider}/{listId}/resend-optins`.
#[derive(Debug, Clone, Default)]
pub struct PostGroupsGroupIdNewsletterIntegrationsProviderListIdResendOptinsQuery {
/// Resend only the pending opt-in for this person.
pub person_id: Option<i64>,
}
impl PostGroupsGroupIdNewsletterIntegrationsProviderListIdResendOptinsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.person_id.push_query("person_id", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/parents`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsGroupIdParentsQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Array of group ids
pub ids: Option<Vec<i64>>,
/// Array of campus ids to filter the groups
pub campus_ids: Option<Vec<i64>>,
/// Array of age group ids to filter the groups
pub agegroup_ids: Option<Vec<i64>>,
/// Array of group status ids to filter the groups
pub group_status_ids: Option<Vec<i64>>,
/// Array of group category ids to filter the groups
pub group_category_ids: Option<Vec<i64>>,
/// Array of target group ids to filter the groups
pub target_group_ids: Option<Vec<i64>>,
/// Array of weekdays to filter the groups. Sunday = 0, Monday = 1 ...
pub weekdays: Option<Vec<i64>>,
/// Array of group type ids to filter the groups
pub group_type_ids: Option<Vec<i64>>,
/// Array of group tag ids to filter the groups
pub tag_ids: Option<Vec<i64>>,
/// Filters groups by its open status
pub is_open_for_members: Option<bool>,
/// Determines if groups should be omitted where I am in
pub without_my_groups: Option<bool>,
/// Determines if only groups where I am in should be returned
pub only_my_groups: Option<bool>,
/// Only show groups with meeting place
pub has_meeting_place: Option<bool>,
/// Only show groups where posting is allowed
pub allow_posts: Option<bool>,
/// Only show groups which has posts
pub has_posts: Option<bool>,
/// Filter groups based on whether they have an active chat
pub has_active_chat: Option<bool>,
pub query: Option<String>,
/// Group visibility
/// Allowed values: `hidden`, `intern`, `public`, `restricted`.
pub visibility: Option<String>,
}
impl GetGroupsGroupIdParentsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.ids.push_query("ids[]", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.agegroup_ids.push_query("agegroup_ids[]", &mut q);
self.group_status_ids.push_query("group_status_ids[]", &mut q);
self.group_category_ids.push_query("group_category_ids[]", &mut q);
self.target_group_ids.push_query("target_group_ids[]", &mut q);
self.weekdays.push_query("weekdays[]", &mut q);
self.group_type_ids.push_query("group_type_ids[]", &mut q);
self.tag_ids.push_query("tag_ids[]", &mut q);
self.is_open_for_members.push_query("is_open_for_members", &mut q);
self.without_my_groups.push_query("without_my_groups", &mut q);
self.only_my_groups.push_query("only_my_groups", &mut q);
self.has_meeting_place.push_query("has_meeting_place", &mut q);
self.allow_posts.push_query("allow_posts", &mut q);
self.has_posts.push_query("has_posts", &mut q);
self.has_active_chat.push_query("has_active_chat", &mut q);
self.query.push_query("query", &mut q);
self.visibility.push_query("visibility", &mut q);
q
}
}
/// Query parameters for `GET /groups/{groupId}/wiki/categories/pages`.
#[derive(Debug, Clone, Default)]
pub struct GetGroupsIdWikiCategoriesPagesQuery {
/// Maximum amount of pages returned per wiki category.
pub limit: Option<i64>,
}
impl GetGroupsIdWikiCategoriesPagesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /history`.
#[derive(Debug, Clone, Default)]
pub struct GetHistoryQuery {
/// Types of domain objects to retrieve
pub domain_types: Option<Vec<String>>,
/// Identifiers of domain objects to retrieve
pub domain_identifiers: Option<Vec<String>>,
/// Filters the action of the entry
pub action: Option<String>,
/// Full-Text Search for the Entry Name.
pub query: Option<String>,
/// Return entities starting from this date.
pub from: Option<chrono::NaiveDate>,
/// Return entities up to (but not including) this date.
pub to: Option<chrono::NaiveDate>,
/// Return entries created by this person.
pub actor_id: Option<i64>,
/// Return entries with this origin.
pub origin: Option<String>,
/// Number of results per page.
pub limit: Option<i64>,
}
impl GetHistoryQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.domain_types.push_query("domain_types[]", &mut q);
self.domain_identifiers.push_query("domain_identifiers[]", &mut q);
self.action.push_query("action", &mut q);
self.query.push_query("query", &mut q);
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.actor_id.push_query("actor_id", &mut q);
self.origin.push_query("origin", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `DELETE /htmltemplates/{templateId}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteHtmltemplatesTemplateIdQuery {
/// True: only return a 409 dependency report. False: perform deletion if no blocker exists. No default is provided by the validator.
pub dry_run: Option<bool>,
}
impl DeleteHtmltemplatesTemplateIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `GET /htmltemplates`.
#[derive(Debug, Clone, Default)]
pub struct GetHtmltemplatesQuery {
/// Template purpose. Supply this canonical parameter, or the legacy type alias.
/// Allowed values: `bulkletter`, `donation-receipt-attachment`, `donation-receipt-letter`, `email`, `groupmember-document`.
pub domain_type: Option<String>,
/// Deprecated. Legacy alias for domain_type; domain_type wins if both are provided.
/// Allowed values: `bulkletter`, `donation-receipt-attachment`, `donation-receipt-letter`, `email`, `groupmember-document`.
#[deprecated = "deprecated in the ChurchTools API"]
pub r#type: Option<String>,
/// Filter by the current owner, regardless of private/global visibility.
pub only_own: Option<bool>,
}
impl GetHtmltemplatesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.domain_type.push_query("domain_type", &mut q);
self.r#type.push_query("type", &mut q);
self.only_own.push_query("onlyOwn", &mut q);
q
}
}
/// Query parameters for `GET /images/{fileId}/{hash}`.
#[derive(Debug, Clone, Default)]
pub struct GetImagesFileIdHashQuery {
/// Output width in pixels, or `auto` to let Glide derive it.
pub w: Option<String>,
/// Output height in pixels, or `auto` to let Glide derive it.
pub h: Option<String>,
/// Output quality.
pub q: Option<i64>,
/// Glide crop specification. `original` bypasses the stored crop.
pub crop: Option<String>,
/// Glide fit mode. Raster images use their stored focus point by default.
pub fit: Option<String>,
/// Output format. A recognized hash suffix takes precedence.
/// Allowed values: `avif`, `gif`, `heic`, `jpg`, `pjpg`, `png`, `tiff`, `webp`.
pub fm: Option<String>,
/// Comma-separated preset names: `group-homepage`, `group-detail`, `group-list`, `group-tile`, `group-minitile`, `person-detail` and `avatar`. Explicit parameters take precedence over preset values.
pub p: Option<String>,
}
impl GetImagesFileIdHashQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.w.push_query("w", &mut q);
self.h.push_query("h", &mut q);
self.q.push_query("q", &mut q);
self.crop.push_query("crop", &mut q);
self.fit.push_query("fit", &mut q);
self.fm.push_query("fm", &mut q);
self.p.push_query("p", &mut q);
q
}
}
/// Query parameters for `GET /joblog`.
#[derive(Debug, Clone, Default)]
pub struct GetJoblogQuery {
/// Exact job identifier supplied by the job workflow, including any suffix.
pub guid: Option<String>,
}
impl GetJoblogQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.guid.push_query("guid", &mut q);
q
}
}
/// Query parameters for `GET /jobs`.
#[derive(Debug, Clone, Default)]
pub struct GetJobsQuery {
/// Filter by stored states. Omit this filter to include all states.
/// Allowed values: `DONE`, `ERROR`, `IN_PROGRESS`.
pub status: Option<Vec<String>>,
/// Exact identifier match, not a substring search.
pub identifier: Option<String>,
/// Exact name match, not a substring search.
pub name: Option<String>,
/// Associated business-object IDs, matched across all job domain types. Empty list does not restrict results.
pub domain_ids: Option<Vec<f64>>,
/// Inclusive lower date bound.
pub created_start_date: Option<chrono::NaiveDate>,
/// Inclusive upper date bound.
pub created_end_date: Option<chrono::NaiveDate>,
/// Inclusive lower date bound.
pub modified_start_date: Option<chrono::NaiveDate>,
/// Inclusive upper date bound.
pub modified_end_date: Option<chrono::NaiveDate>,
}
impl GetJobsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.status.push_query("status[]", &mut q);
self.identifier.push_query("identifier", &mut q);
self.name.push_query("name", &mut q);
self.domain_ids.push_query("domain_ids[]", &mut q);
self.created_start_date.push_query("created_start_date", &mut q);
self.created_end_date.push_query("created_end_date", &mut q);
self.modified_start_date.push_query("modified_start_date", &mut q);
self.modified_end_date.push_query("modified_end_date", &mut q);
q
}
}
/// Query parameters for `GET /languages`.
#[derive(Debug, Clone, Default)]
pub struct GetLanguagesQuery {
/// Set to true if only active languages should be returned
pub only_active: Option<bool>,
}
impl GetLanguagesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.only_active.push_query("only_active", &mut q);
q
}
}
/// Query parameters for `GET /logs`.
#[derive(Debug, Clone, Default)]
pub struct GetLogsQuery {
/// Filter by text
pub message: Option<String>,
/// Filter by log level ID
pub levels: Option<Vec<String>>,
/// Filter log messages before that date. (Use DateTime-Format)
pub before: Option<String>,
/// Filter log messages after that date. (Use DateTime-Format)
pub after: Option<String>,
/// Filter by person
pub person_id: Option<i64>,
/// Number of results per page.
pub limit: Option<i64>,
}
impl GetLogsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.message.push_query("message", &mut q);
self.levels.push_query("levels[]", &mut q);
self.before.push_query("before", &mut q);
self.after.push_query("after", &mut q);
self.person_id.push_query("person_id", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /logs/statistics/login`.
#[derive(Debug, Clone, Default)]
pub struct GetLogsStatisticsLoginQuery {
/// Order the pagination result. Allowed values: `frequent` and `last`
pub order_by: Option<String>,
/// Number of results per page.
pub limit: Option<i64>,
}
impl GetLogsStatisticsLoginQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.order_by.push_query("order_by", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /permissions/definitions`.
#[derive(Debug, Clone, Default)]
pub struct GetPermissionsDefinitionsQuery {
/// Permission scope to return
/// Allowed values: `all`, `global`, `internal`.
pub scope: Option<String>,
}
impl GetPermissionsDefinitionsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.scope.push_query("scope", &mut q);
q
}
}
/// Query parameters for `GET /permissions/assignment-targets`.
#[derive(Debug, Clone, Default)]
pub struct GetPermissionsAssignmentTargetsQuery {
/// Search status, role, group-type, group, or person names
pub query: Option<String>,
/// Restrict categories; omitted or empty selects all categories
/// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
pub domain_types: Option<Vec<String>>,
/// Restrict to concrete roles of this group, intersected with domainTypes. A nonexistent group or incompatible categories yield an empty list.
pub group_id: Option<i64>,
/// Maximum number of targets per page across all categories
pub limit: Option<i64>,
}
impl GetPermissionsAssignmentTargetsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.query.push_query("query", &mut q);
self.domain_types.push_query("domainTypes[]", &mut q);
self.group_id.push_query("groupId", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /permissions/{domainType}`.
#[derive(Debug, Clone, Default)]
pub struct GetPermissionsPermissionDomainTypeQuery {
/// Optional owner ID for direct domains; required in practice for group and group_type combined views. Prefer the explicit /{domainId} route for these views.
pub domain_id: Option<i64>,
}
impl GetPermissionsPermissionDomainTypeQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.domain_id.push_query("domainId", &mut q);
q
}
}
/// Query parameters for `GET /permissions/global/auths/{authId}/assignment-summary`.
#[derive(Debug, Clone, Default)]
pub struct GetPermissionsGlobalAuthsAuthIdAssignmentSummaryQuery {
/// Required for a permission with selectable values, and forbidden for a boolean permission. Supply a configured selection ID, or -1 for genuinely unrestricted access to all current and future values. This differs from the internal permission endpoint, where -1 expands into separate configured selections.
pub data_id: Option<i64>,
}
impl GetPermissionsGlobalAuthsAuthIdAssignmentSummaryQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.data_id.push_query("data_id", &mut q);
q
}
}
/// Query parameters for `GET /permissions/global/auths/{authId}/persons`.
#[derive(Debug, Clone, Default)]
pub struct GetPermissionsGlobalAuthsAuthIdPersonsQuery {
/// Required for a permission with selectable values, and forbidden for a boolean permission. Supply a configured selection ID, or -1 for genuinely unrestricted access to all current and future values. This differs from the internal permission endpoint, where -1 expands into separate configured selections.
pub data_id: Option<i64>,
/// One-based page. Providing page, limit or include=origins enables pagination; otherwise all matching IDs are returned. Defaults to 1 when pagination is enabled.
pub page: Option<i64>,
/// Page size, 1–100. Providing it enables pagination; page defaults to 1. When pagination is enabled by page or include, this defaults to 50.
pub limit: Option<i64>,
/// Add origins for each person on the page. This also enables pagination with defaults page=1 and limit=50.
/// Allowed values: `origins`.
pub include: Option<String>,
}
impl GetPermissionsGlobalAuthsAuthIdPersonsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.data_id.push_query("data_id", &mut q);
self.page.push_query("page", &mut q);
self.limit.push_query("limit", &mut q);
self.include.push_query("include", &mut q);
q
}
}
/// Query parameters for `GET /permissions/internal/groups/{groupId}/auths/{authId}/persons`.
#[derive(Debug, Clone, Default)]
pub struct GetPermissionsInternalGroupsGroupIdAuthsAuthIdPersonsQuery {
/// For group-internal permissions with selection values, this parameter is required: a configured ID selects one value and -1 expands into all current configured IDs, in ascending order. It does not select only unrestricted grants as in the global endpoint. Omit it for boolean permissions.
pub data_id: Option<i64>,
}
impl GetPermissionsInternalGroupsGroupIdAuthsAuthIdPersonsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.data_id.push_query("data_id", &mut q);
q
}
}
/// Query parameters for `GET /permissions/origins/internal/persons/{personId}`.
#[derive(Debug, Clone, Default)]
pub struct GetPermissionsOriginsInternalPersonsPersonIdQuery {
/// Target group IDs to inspect. Omission includes all targets; an empty array returns no groups. Duplicate IDs are collapsed and unknown IDs are omitted.
pub group_ids: Option<Vec<i64>>,
}
impl GetPermissionsOriginsInternalPersonsPersonIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.group_ids.push_query("group_ids[]", &mut q);
q
}
}
/// Query parameters for `DELETE /person/commentviewers/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePersonCommentviewersIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeletePersonCommentviewersIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `DELETE /person/growpaths/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePersonGrowpathsIdQuery {
/// Simulate deletion. Returns 409 with a deletion report even when deletion would be allowed. The spelling is dryRun, not the dry_run used by several other master-data endpoints.
pub dry_run: Option<bool>,
}
impl DeletePersonGrowpathsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `DELETE /person/relationshiptypes/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePersonRelationshiptypesIdQuery {
/// Preview blockers and relationships that would be deleted. Always returns the deletion report with `409` and does not delete data.
pub dry_run: Option<bool>,
}
impl DeletePersonRelationshiptypesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `DELETE /person/sexes/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePersonSexesIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeletePersonSexesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `POST /persons`.
#[derive(Debug, Clone, Default)]
pub struct PostPersonsQuery {
/// Force the action, which would otherwise fail.
pub force: Option<bool>,
/// Omits the otherwise mandatory privacy policy agreement fields. Only effective when `privacy_policy_fields_mandatory_api` is disabled in the ChurchTools configuration. Clients must verify that configuration before using this parameter and must not use it as a fallback for missing agreement information.
pub without_privacy_policy_agreement: Option<bool>,
}
impl PostPersonsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.force.push_query("force", &mut q);
self.without_privacy_policy_agreement.push_query("without_privacy_policy_agreement", &mut q);
q
}
}
/// Query parameters for `POST /persons/filter`.
#[derive(Debug, Clone, Default)]
pub struct PostPersonsFilterQuery {
/// Page number to show page in pagination. If empty, start at first page.
pub page: Option<i64>,
/// Number of matching persons returned per page.
pub limit: Option<i64>,
}
impl PostPersonsFilterQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.page.push_query("page", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /persons`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsQuery {
/// Array of person ids
pub ids: Option<Vec<i64>>,
/// Filter by status id
pub status_ids: Option<Vec<i64>>,
/// Filter by campus id
pub campus_ids: Option<Vec<i64>>,
/// Filter by birthdays before that date (Format: YYYY-MM-DD)
pub birthday_before: Option<chrono::NaiveDate>,
/// Filter by birthdays after that date (Format: YYYY-MM-DD)
pub birthday_after: Option<chrono::NaiveDate>,
/// Show only archived or not archived people
pub is_archived: Option<bool>,
/// Show only persons with locked/not locked account
pub is_account_locked: Option<bool>,
/// Show only persons with or without a system user account
pub is_system_user: Option<bool>,
/// Filter by first name (case-insensitive substring match)
pub first_name: Option<String>,
/// Filter by nickname (case-insensitive substring match)
pub nick_name: Option<String>,
/// Filter by last name (case-insensitive substring match)
pub last_name: Option<String>,
/// Filter by a substring in first name, last name, or nickname (case-insensitive)
pub query: Option<String>,
/// Filter by an email address substring (case-insensitive)
pub email: Option<String>,
/// Filter by an exact email address
pub email_exact: Option<String>,
/// Number of results per page.
pub limit: Option<i64>,
/// Include additional information
/// Allowed values: `tags`.
pub include: Option<Vec<String>>,
}
impl GetPersonsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.ids.push_query("ids[]", &mut q);
self.status_ids.push_query("status_ids[]", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.birthday_before.push_query("birthday_before", &mut q);
self.birthday_after.push_query("birthday_after", &mut q);
self.is_archived.push_query("is_archived", &mut q);
self.is_account_locked.push_query("is_account_locked", &mut q);
self.is_system_user.push_query("is_system_user", &mut q);
self.first_name.push_query("firstName", &mut q);
self.nick_name.push_query("nickName", &mut q);
self.last_name.push_query("lastName", &mut q);
self.query.push_query("query", &mut q);
self.email.push_query("email", &mut q);
self.email_exact.push_query("email-exact", &mut q);
self.limit.push_query("limit", &mut q);
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /persons/birthdays`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsBirthdaysQuery {
/// Birthdays from that date on, defaults to yesterday
pub start_date: Option<chrono::NaiveDate>,
/// Birthdays up to that date, defaults to 30 days from now
pub end_date: Option<chrono::NaiveDate>,
/// The direction of the result set
/// Allowed values: `backward`, `forward`.
pub direction: Option<String>,
/// Number of results per page.
pub limit: Option<i64>,
/// Filter by campus ids
pub campus_ids: Option<Vec<i64>>,
/// Filter by group ids
pub group_ids: Option<Vec<i64>>,
/// Filter by people in my groups
pub my_groups: Option<bool>,
/// Filter by status ids
pub status_ids: Option<Vec<i64>>,
}
impl GetPersonsBirthdaysQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.direction.push_query("direction", &mut q);
self.limit.push_query("limit", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.group_ids.push_query("group_ids[]", &mut q);
self.my_groups.push_query("my_groups", &mut q);
self.status_ids.push_query("status_ids[]", &mut q);
q
}
}
/// Query parameters for `GET /persons/duplicates`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsDuplicatesQuery {
pub reset_cache: Option<bool>,
}
impl GetPersonsDuplicatesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.reset_cache.push_query("reset_cache", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/groups`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsIdGroupsQuery {
/// If set groups that reached their enddate +x days configured in the admin settings, are also shown.
pub show_overdue_groups: Option<bool>,
/// If set groups that have the status 'archived' are shown
pub show_inactive_groups: Option<bool>,
/// If set groups were the user has the group member status 'to_deleted' are shown.
pub show_to_delete_memberships: Option<bool>,
/// If set groups were the user has the group member status 'requested' or 'waiting' are shown.
pub show_requested_or_waiting_memberships: Option<bool>,
}
impl GetPersonsIdGroupsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.show_overdue_groups.push_query("show_overdue_groups", &mut q);
self.show_inactive_groups.push_query("show_inactive_groups", &mut q);
self.show_to_delete_memberships.push_query("show_to_delete_memberships", &mut q);
self.show_requested_or_waiting_memberships.push_query("show_requested_or_waiting_memberships", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/posts`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsPersonIdPostsQuery {
/// Can only be used if the endpoint is called with the personId of the currently logged in user. If a different personId is used in combination with filter\[\] the result will be empty.
/// Allowed values: `banned`, `expiration_future`, `expiration_past`, `publication_future`, `published`.
pub filter: Option<Vec<String>>,
/// Number of results per page.
pub limit: Option<i64>,
/// If set, only posts created before this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub before: Option<chrono::DateTime<chrono::Utc>>,
/// If set, posts created at the "before" date are included in the result, if the guids of the posts are lexically smaller than the last_post_indentifier. Will be ignored if "before" is not set.
pub last_post_indentifier: Option<String>,
/// If set, only posts created after this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub after: Option<chrono::DateTime<chrono::Utc>>,
}
impl GetPersonsPersonIdPostsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.filter.push_query("filter[]", &mut q);
self.limit.push_query("limit", &mut q);
self.before.push_query("before", &mut q);
self.last_post_indentifier.push_query("last_post_indentifier", &mut q);
self.after.push_query("after", &mut q);
q
}
}
/// Query parameters for `DELETE /persons/{personId}/absences/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePersonsPersonIdAbsencesIdQuery {
/// Perform the lookup without removing the absence.
pub dry_run: Option<bool>,
}
impl DeletePersonsPersonIdAbsencesIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/absences`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsPersonIdAbsencesQuery {
/// Start of the overlap window. Defaults to midnight two weeks ago.
pub from: Option<serde_json::Value>,
/// End of the overlap window. Defaults to midnight two weeks from today.
pub to: Option<serde_json::Value>,
/// Order by absence start.
/// Allowed values: `ASC`, `DESC`.
pub order_direction: Option<String>,
}
impl GetPersonsPersonIdAbsencesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.from.push_query("from", &mut q);
self.to.push_query("to", &mut q);
self.order_direction.push_query("order_direction", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/events`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsIdEventsQuery {
/// Lower bound, strictly after midnight on this date. Defaults to today.
pub from: Option<chrono::NaiveDate>,
}
impl GetPersonsIdEventsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.from.push_query("from", &mut q);
q
}
}
/// Query parameters for `DELETE /persons/{personId}/events/{eventId}/services/{serviceId}/exchangerequests/{requestId}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePersonsIdEventsIdServicesIdExchangerequestsIdQuery {
/// Permanently remove the request instead of changing its status to `CANCELLED`.
pub hard_delete: Option<bool>,
}
impl DeletePersonsIdEventsIdServicesIdExchangerequestsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.hard_delete.push_query("hardDelete", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/events/{eventId}/services/{serviceId}/exchangerequests`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsIdEventsIdServicesIdExchangerequestsQuery {
/// `false` selects exchanges initiated from this assignment; `true` selects exchanges targeting it.
pub incoming: Option<bool>,
}
impl GetPersonsIdEventsIdServicesIdExchangerequestsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.incoming.push_query("incoming", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/exchangerequests`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsIdExchangerequestsQuery {
/// `false` selects exchanges received by the person; `true` selects exchanges initiated by the person.
pub person_is_requester: Option<bool>,
}
impl GetPersonsIdExchangerequestsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.person_is_requester.push_query("personIsRequester", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/followups`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsPersonIdFollowupsQuery {
/// Repeat to select any of the listed states; omitted/empty includes all states.
/// Allowed values: `done`, `due-after-today`, `due-before-today`, `due-today`, `due-unspecified`.
pub filter: Option<Vec<String>>,
/// Maximum results in this page.
pub limit: Option<i64>,
}
impl GetPersonsPersonIdFollowupsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.filter.push_query("filter[]", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `DELETE /persons/{personId}/servicerequests/{requestId}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePersonsIdServicerequestsIdQuery {
/// Optional decline comment.
pub comment: Option<String>,
}
impl DeletePersonsIdServicerequestsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.comment.push_query("comment", &mut q);
q
}
}
/// Query parameters for `GET /persons/{personId}/servicerequests`.
#[derive(Debug, Clone, Default)]
pub struct GetPersonsIdServicerequestsQuery {
/// Include only events starting at or after midnight today. Both outstanding and confirmed valid assignments are included.
pub only_future: Option<bool>,
/// Deprecated. Legacy alias for only_future.
#[deprecated = "deprecated in the ChurchTools API"]
pub get_all_in_future: Option<bool>,
}
impl GetPersonsIdServicerequestsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.only_future.push_query("only_future", &mut q);
self.get_all_in_future.push_query("getAllInFuture", &mut q);
q
}
}
/// Query parameters for `GET /pollfornews`.
#[derive(Debug, Clone, Default)]
pub struct GetPollfornewsQuery {
/// Filters for which domain types the changes should be checked.
pub domain_types: Option<Vec<String>>,
/// The date when you last called the API.
pub since: Option<chrono::DateTime<chrono::Utc>>,
}
impl GetPollfornewsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.domain_types.push_query("domain_types[]", &mut q);
self.since.push_query("since", &mut q);
q
}
}
/// Query parameters for `GET /post/linkings`.
#[derive(Debug, Clone, Default)]
pub struct GetPostLinkingsQuery {
/// Filters for which posts the linkings should be loaded.
pub post_ids: Option<Vec<i64>>,
}
impl GetPostLinkingsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.post_ids.push_query("post_ids[]", &mut q);
q
}
}
/// Query parameters for `GET /post/search`.
#[derive(Debug, Clone, Default)]
pub struct GetPostSearchQuery {
/// The query string to search for in post title and content
pub query: Option<String>,
/// The order the posts are returned in.
/// Allowed values: `publishedDate`, `relevance`.
pub order_by: Option<String>,
/// The order direction. Only works for order_by publishedDate.
/// Allowed values: `ASC`, `DESC`.
pub order_direction: Option<String>,
/// If set, only posts created before this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub before: Option<chrono::DateTime<chrono::Utc>>,
/// If set, only posts created after this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub after: Option<chrono::DateTime<chrono::Utc>>,
/// If set, only posts of these campuses are returned. If not set, posts of all campuses are returned.
pub campus_ids: Option<Vec<i64>>,
/// If set, only posts by these persons are returned. If not set, posts by all persons are returned.
pub actor_ids: Option<Vec<i64>>,
/// If set, only posts are returned that belong to groups with this visibility.
/// Allowed values: `hidden`, `intern`, `public`, `restricted`.
pub group_visibility: Option<String>,
/// If set, only posts with that visibility are returned.
/// Allowed values: `group_intern`, `group_visible`.
pub post_visibility: Option<String>,
/// If set, only posts of these groups are returned. If not set, posts of all groups are returned.
pub group_ids: Option<Vec<i64>>,
/// If set, the response will include the specified data.
/// Allowed values: `comments`, `linkings`, `reactions`.
pub include: Option<Vec<String>>,
/// If set to true, only posts of groups the user is member of are returned. If not set, posts of all groups are returned.
pub only_my_groups: Option<bool>,
}
impl GetPostSearchQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.query.push_query("query", &mut q);
self.order_by.push_query("order_by", &mut q);
self.order_direction.push_query("order_direction", &mut q);
self.before.push_query("before", &mut q);
self.after.push_query("after", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.actor_ids.push_query("actor_ids[]", &mut q);
self.group_visibility.push_query("group_visibility", &mut q);
self.post_visibility.push_query("post_visibility", &mut q);
self.group_ids.push_query("group_ids[]", &mut q);
self.include.push_query("include[]", &mut q);
self.only_my_groups.push_query("only_my_groups", &mut q);
q
}
}
/// Query parameters for `GET /post/reports`.
#[derive(Debug, Clone, Default)]
pub struct GetPostReportsQuery {
/// Allowed values: `post`, `post_comment`.
pub domain_type: Option<String>,
pub domain_id: Option<i64>,
/// Allowed values: `accepted`, `declined`, `pending`, `pending-again`.
pub status: Option<String>,
}
impl GetPostReportsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.domain_type.push_query("domain_type", &mut q);
self.domain_id.push_query("domain_id", &mut q);
self.status.push_query("status", &mut q);
q
}
}
/// Query parameters for `DELETE /posts/{postId}`.
#[derive(Debug, Clone, Default)]
pub struct DeletePostsPostIdQuery {
/// If set to true, the post will not be deleted but the response will contain the result of the deletion.
pub dry_run: Option<bool>,
}
impl DeletePostsPostIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dryRun", &mut q);
q
}
}
/// Query parameters for `GET /posts/{postId}`.
#[derive(Debug, Clone, Default)]
pub struct GetPostsPostIdQuery {
/// If set, the response will include the specified data.
/// Allowed values: `comments`, `reactions`.
pub include: Option<Vec<String>>,
}
impl GetPostsPostIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /posts`.
#[derive(Debug, Clone, Default)]
pub struct GetPostsQuery {
/// If set, only posts published before this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub before: Option<chrono::DateTime<chrono::Utc>>,
/// If set, posts published at the `before` date are included in the result, if the guids of the posts are lexically smaller than the `last_post_identifier`. Will be ignored if `before` is not set.
pub last_post_identifier: Option<String>,
/// If set, only posts published at or after this date are returned. The date must be in RFC3339 format (Zulu-Date).
pub after: Option<chrono::DateTime<chrono::Utc>>,
/// Deprecated. If set, only posts of this campus are returned. If not set, posts of all campuses are returned.
#[deprecated = "deprecated in the ChurchTools API"]
pub campus_id: Option<i64>,
/// If set, only posts of these campuses are returned. If not set, posts of all campuses are returned.
pub campus_ids: Option<Vec<i64>>,
/// If set, only posts by these persons are returned. If not set, posts by all persons are returned.
pub actor_ids: Option<Vec<i64>>,
/// If set, only posts are returned that belong to groups with this visibility.
/// Allowed values: `hidden`, `intern`, `public`, `restricted`.
pub group_visibility: Option<String>,
/// If set, only posts with that visibility are returned.
/// Allowed values: `group_intern`, `group_visible`.
pub post_visibility: Option<String>,
/// If set, only posts of these groups are returned. If not set, posts of all groups are returned.
pub group_ids: Option<Vec<i64>>,
/// If set, the response will include the specified data.
/// Allowed values: `comments`, `linkings`, `reactions`.
pub include: Option<Vec<String>>,
/// Number of results per page.
pub limit: Option<i64>,
/// If set to true, only posts of groups the user is member of are returned. If not set, posts of all groups are returned.
pub only_my_groups: Option<bool>,
}
impl GetPostsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.before.push_query("before", &mut q);
self.last_post_identifier.push_query("last_post_identifier", &mut q);
self.after.push_query("after", &mut q);
self.campus_id.push_query("campus_id", &mut q);
self.campus_ids.push_query("campus_ids[]", &mut q);
self.actor_ids.push_query("actor_ids[]", &mut q);
self.group_visibility.push_query("group_visibility", &mut q);
self.post_visibility.push_query("post_visibility", &mut q);
self.group_ids.push_query("group_ids[]", &mut q);
self.include.push_query("include[]", &mut q);
self.limit.push_query("limit", &mut q);
self.only_my_groups.push_query("only_my_groups", &mut q);
q
}
}
/// Query parameters for `GET /profiles/slugcheck/{slug}`.
#[derive(Debug, Clone, Default)]
pub struct GetProfilesSlugcheckSlugQuery {
/// GUID of the profile currently being edited. If this profile already uses the slug, the slug is considered available.
pub guid: Option<String>,
}
impl GetProfilesSlugcheckSlugQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.guid.push_query("guid", &mut q);
q
}
}
/// Query parameters for `GET /publicgroups/{groupId}`.
#[derive(Debug, Clone, Default)]
pub struct GetPublicgroupsIdQuery {
/// Optional group-homepage hash.
pub hash: Option<String>,
}
impl GetPublicgroupsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.hash.push_query("hash", &mut q);
q
}
}
/// Query parameters for `GET /publicgroups/{groupId}/form`.
#[derive(Debug, Clone, Default)]
pub struct GetPublicgroupsGroupIdFormQuery {
/// Sign Up Token
pub token: Option<String>,
/// Optional requester selection; updates the token’s requester and clicked selection.
pub person_id: Option<i64>,
}
impl GetPublicgroupsGroupIdFormQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.token.push_query("token", &mut q);
self.person_id.push_query("personId", &mut q);
q
}
}
/// Query parameters for `GET /publicgroups/{groupId}/possiblerequesters`.
#[derive(Debug, Clone, Default)]
pub struct GetPublicgroupsGroupIdPossiblerequestersQuery {
/// The signup token for the registration
pub token: Option<String>,
}
impl GetPublicgroupsGroupIdPossiblerequestersQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.token.push_query("token", &mut q);
q
}
}
/// Query parameters for `GET /publicgroups/{groupId}/signoutdata`.
#[derive(Debug, Clone, Default)]
pub struct GetPublicgroupsIdSignoutdataQuery {
/// Optional signup token; omit to use the current user.
pub token: Option<String>,
}
impl GetPublicgroupsIdSignoutdataQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.token.push_query("token", &mut q);
q
}
}
/// Query parameters for `GET /repeatcalculation`.
#[derive(Debug, Clone, Default)]
pub struct GetRepeatcalculationQuery {
/// Indexed entries encoded with PHP bracket notation, for example additionals\[0\]\[date\]=2026-10-01 and additionals\[0\]\[isRepeated\]=false.
pub additionals: Option<serde_json::Value>,
/// Recurrence input: endDate.
pub end_date: Option<serde_json::Value>,
/// Indexed entries encoded with PHP bracket notation, for example exceptions\[0\]\[date\]=2026-10-01.
pub exceptions: Option<serde_json::Value>,
/// Recurrence input: repeatFrequency.
pub repeat_frequency: Option<i64>,
/// Recurrence input: repeatId.
/// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
pub repeat_id: Option<i64>,
/// Recurrence input: repeatOption.
pub repeat_option: Option<i64>,
/// Recurrence input: repeatUntil.
pub repeat_until: Option<chrono::NaiveDate>,
/// Recurrence input: startDate.
pub start_date: Option<serde_json::Value>,
}
impl GetRepeatcalculationQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.additionals.push_query("additionals", &mut q);
self.end_date.push_query("endDate", &mut q);
self.exceptions.push_query("exceptions", &mut q);
self.repeat_frequency.push_query("repeatFrequency", &mut q);
self.repeat_id.push_query("repeatId", &mut q);
self.repeat_option.push_query("repeatOption", &mut q);
self.repeat_until.push_query("repeatUntil", &mut q);
self.start_date.push_query("startDate", &mut q);
q
}
}
/// Query parameters for `GET /resource/masterdata`.
#[derive(Debug, Clone, Default)]
pub struct GetResourceMasterdataQuery {
/// Optional enrichment with person references for resource administrators.
/// Allowed values: `involvedPersonsDomainObjects`.
pub include: Option<Vec<String>>,
}
impl GetResourceMasterdataQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /resources/{resourceId}`.
#[derive(Debug, Clone, Default)]
pub struct GetResourcesResourceIdQuery {
/// Optional enrichment with person references for resource administrators.
/// Allowed values: `involvedPersonsDomainObjects`.
pub include: Option<Vec<String>>,
}
impl GetResourcesResourceIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /resources`.
#[derive(Debug, Clone, Default)]
pub struct GetResourcesQuery {
/// Optional enrichment with person references for resource administrators.
/// Allowed values: `involvedPersonsDomainObjects`.
pub include: Option<Vec<String>>,
}
impl GetResourcesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /routines`.
#[derive(Debug, Clone, Default)]
pub struct GetRoutinesQuery {
/// Optional domain filter; group_membership is the currently registered handler.
/// Allowed values: `group_membership`.
pub domain_type: Option<String>,
}
impl GetRoutinesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.domain_type.push_query("domain_type", &mut q);
q
}
}
/// Query parameters for `PATCH /routines/{routineId}`.
#[derive(Debug, Clone, Default)]
pub struct PatchRoutinesRoutineIdQuery {
/// Validate controller-level input/permissions without persisting; returns 204.
pub dry_run: Option<bool>,
}
impl PatchRoutinesRoutineIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /routines/{routineId}/runs`.
#[derive(Debug, Clone, Default)]
pub struct GetRoutinesRoutineIdRunsQuery {
/// Include additional information
/// Allowed values: `domainObject`.
pub include: Option<Vec<String>>,
/// Append unpersisted candidate runs with null IDs.
pub with_potential_domain_objects: Option<bool>,
}
impl GetRoutinesRoutineIdRunsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
self.with_potential_domain_objects.push_query("with_potential_domain_objects", &mut q);
q
}
}
/// Query parameters for `GET /saml/login`.
#[derive(Debug, Clone, Default)]
pub struct GetSamlLoginQuery {
/// Absolute same-origin destination after successful login.
pub redirect: Option<String>,
}
impl GetSamlLoginQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.redirect.push_query("redirect", &mut q);
q
}
}
/// Query parameters for `GET /search`.
#[derive(Debug, Clone, Default)]
pub struct GetSearchQuery {
pub query: Option<String>,
/// Allowed values: `action`, `group`, `person`, `song`, `wiki_page`.
pub domain_types: Option<Vec<String>>,
}
impl GetSearchQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.query.push_query("query", &mut q);
self.domain_types.push_query("domain_types[]", &mut q);
q
}
}
/// Query parameters for `DELETE /securitylevels/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteSecuritylevelsIdQuery {
/// If set to true, the deletion is simulated but nothing will be deleted.
pub dry_run: Option<bool>,
}
impl DeleteSecuritylevelsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `PATCH /securitylevels/{id}`.
#[derive(Debug, Clone, Default)]
pub struct PatchSecuritylevelsIdQuery {
/// Need to be true, if securitylevel shall be reordered
pub forcereorder: Option<bool>,
}
impl PatchSecuritylevelsIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.forcereorder.push_query("forcereorder", &mut q);
q
}
}
/// Query parameters for `GET /songs/{songId}`.
#[derive(Debug, Clone, Default)]
pub struct GetSongsSongIdQuery {
/// Optional enrichments. Use include=tags for tags, or include\[\]=tags&include\[\]=arrangements for multiple values. Comma-separated values are not supported. Arrangements are already returned without this option by the current API, but this will change in a future release. Omitted requests no enrichment.
/// Allowed values: `arrangements`, `tags`.
pub include: Option<Vec<String>>,
}
impl GetSongsSongIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /songs`.
#[derive(Debug, Clone, Default)]
pub struct GetSongsQuery {
/// Restrict to these song category IDs, intersected with permitted categories.
pub song_category_ids: Option<Vec<i64>>,
/// Restrict to these song IDs. An empty array matches no songs.
pub ids: Option<Vec<i64>>,
/// Filter the rehearsal flag: `true` selects songs marked for practice, false selects those not marked.
pub practice: Option<bool>,
/// Filter by arrangement key. Song plus all its arrangements are returned if one arrangement meets the filter criterion.
/// Allowed values: `A`, `A#`, `A#m`, `Ab`, `Abm`, `Am`, `B`, `B#`, `B#m`, `Bb`, `Bbm`, `Bm`, `C`, `C#`, `C#m`, `Cb`, `Cbm`, `Cm`, `D`, `D#`, `D#m`, `Db`, `Dbm`, `Dm`, `E`, `E#`, `E#m`, `Eb`, `Ebm`, `Em`, ….
pub key_of_arrangement: Option<String>,
/// Substring filter on the song title, combined with query and the other filters.
pub name: Option<String>,
/// Substring search in either title or author, combined with name and the other filters.
pub query: Option<String>,
/// Optional enrichments. Use include=tags for tags, or include\[\]=tags&include\[\]=arrangements for multiple values. Comma-separated values are not supported. Arrangements are already returned without this option by the current API, but this will change in a future release. Omitted requests no enrichment.
/// Allowed values: `arrangements`, `tags`.
pub include: Option<Vec<String>>,
/// Number of songs per page, from 1 to 200.
pub limit: Option<i64>,
}
impl GetSongsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.song_category_ids.push_query("song_category_ids[]", &mut q);
self.ids.push_query("ids[]", &mut q);
self.practice.push_query("practice", &mut q);
self.key_of_arrangement.push_query("key_of_arrangement", &mut q);
self.name.push_query("name", &mut q);
self.query.push_query("query", &mut q);
self.include.push_query("include[]", &mut q);
self.limit.push_query("limit", &mut q);
q
}
}
/// Query parameters for `GET /sync/executions`.
#[derive(Debug, Clone, Default)]
pub struct GetSyncExecutionsQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Filter by external connection IDs.
pub es_ids: Option<Vec<i64>>,
/// Filter by job configuration IDs.
pub job_ids: Option<Vec<i64>>,
/// First included log day.
pub start_date: Option<chrono::NaiveDate>,
/// Last included log day.
pub end_date: Option<chrono::NaiveDate>,
/// Background execution statuses.
/// Allowed values: `CANCELED`, `DONE`, `ERROR`, `IN_PROGRESS`, `QUEUED`.
pub statuses: Option<Vec<String>>,
/// Filter by dry-run mode.
pub is_dry_run: Option<bool>,
}
impl GetSyncExecutionsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.es_ids.push_query("es_ids[]", &mut q);
self.job_ids.push_query("job_ids[]", &mut q);
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.statuses.push_query("statuses[]", &mut q);
self.is_dry_run.push_query("is_dry_run", &mut q);
q
}
}
/// Query parameters for `GET /sync/jobconfigs`.
#[derive(Debug, Clone, Default)]
pub struct GetSyncJobconfigsQuery {
/// Restrict to these external connection IDs.
pub external_system_ids: Option<Vec<i64>>,
}
impl GetSyncJobconfigsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.external_system_ids.push_query("external_system_ids[]", &mut q);
q
}
}
/// Query parameters for `GET /sync/logs`.
#[derive(Debug, Clone, Default)]
pub struct GetSyncLogsQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Filter by external connection IDs.
pub es_ids: Option<Vec<i64>>,
/// Filter by job configuration IDs.
pub job_ids: Option<Vec<i64>>,
/// Filter by background execution IDs.
pub execution_ids: Option<Vec<String>>,
/// First included log day.
pub start_date: Option<chrono::NaiveDate>,
/// Last included log day.
pub end_date: Option<chrono::NaiveDate>,
/// Operation types.
/// Allowed values: `create`, `delete`, `execution`, `link`, `update`.
pub types: Option<Vec<String>>,
/// Log severities.
/// Allowed values: `alert`, `critical`, `debug`, `emergency`, `error`, `info`, `notice`, `warning`.
pub levels: Option<Vec<String>>,
/// Substring search in rendered log messages.
pub query: Option<String>,
/// Select dry-run or actual-execution logs.
pub is_dry_run: Option<bool>,
}
impl GetSyncLogsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.es_ids.push_query("es_ids[]", &mut q);
self.job_ids.push_query("job_ids[]", &mut q);
self.execution_ids.push_query("execution_ids[]", &mut q);
self.start_date.push_query("start_date", &mut q);
self.end_date.push_query("end_date", &mut q);
self.types.push_query("types[]", &mut q);
self.levels.push_query("levels[]", &mut q);
self.query.push_query("query", &mut q);
self.is_dry_run.push_query("is_dry_run", &mut q);
q
}
}
/// Query parameters for `DELETE /sync/adapters/{id}`.
#[derive(Debug, Clone, Default)]
pub struct DeleteSyncAdaptersIdQuery {
/// Return a deletion report without deleting.
pub dry_run: Option<bool>,
}
impl DeleteSyncAdaptersIdQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.dry_run.push_query("dry_run", &mut q);
q
}
}
/// Query parameters for `GET /sync/conflicts`.
#[derive(Debug, Clone, Default)]
pub struct GetSyncConflictsQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Conflict categories.
/// Allowed values: `create`, `delete_or_create`, `duplicate_in_CT`, `duplicate_in_source`, `link_and_update`, `update`.
pub types: Option<Vec<String>>,
/// Domains of linked entity mappings.
/// Allowed values: `account`, `account_class`, `account_group`, `account_type`, `accounting_period`, `agenda`, `agenda_item`, `appointment`, `appointment_image`, `appointment_occurrence`, `appointment_template_image`, `attachments`, `avatar`, `booking`, `bulkletter_template`, `client`, `cost_center`, `custom_module`, `donation_attachment_template`, `donation_cover_letter_template`, `eubp_attachment`, `eubp_submission`, `event`, `eventchat`, `familyavatar`, `file`, `finance_template`, `follow_up`, `further_link`, `group`, ….
pub domain_types: Option<Vec<String>>,
/// External connection IDs of linked entity mappings.
pub source_ids: Option<Vec<i64>>,
}
impl GetSyncConflictsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.types.push_query("types[]", &mut q);
self.domain_types.push_query("domain_types[]", &mut q);
self.source_ids.push_query("source_ids[]", &mut q);
q
}
}
/// Query parameters for `GET /sync/entitymappings`.
#[derive(Debug, Clone, Default)]
pub struct GetSyncEntitymappingsQuery {
/// Number of results per page.
pub limit: Option<i64>,
/// Restrict to these ChurchTools domains.
/// Allowed values: `account`, `account_class`, `account_group`, `account_type`, `accounting_period`, `agenda`, `agenda_item`, `appointment`, `appointment_image`, `appointment_occurrence`, `appointment_template_image`, `attachments`, `avatar`, `booking`, `bulkletter_template`, `client`, `cost_center`, `custom_module`, `donation_attachment_template`, `donation_cover_letter_template`, `eubp_attachment`, `eubp_submission`, `event`, `eventchat`, `familyavatar`, `file`, `finance_template`, `follow_up`, `further_link`, `group`, ….
pub domain_type: Option<Vec<String>>,
/// Filter ChurchTools record IDs, represented as strings.
pub domain_id: Option<Vec<String>>,
/// Filter external record IDs.
pub source_entity_id: Option<Vec<String>>,
/// External connection ID as a string.
pub source_id: Option<String>,
/// Adapter-specific context key.
pub scope: Option<String>,
}
impl GetSyncEntitymappingsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.domain_type.push_query("domain_type[]", &mut q);
self.domain_id.push_query("domain_id[]", &mut q);
self.source_entity_id.push_query("source_entity_id[]", &mut q);
self.source_id.push_query("source_id", &mut q);
self.scope.push_query("scope", &mut q);
q
}
}
/// Query parameters for `GET /translations`.
#[derive(Debug, Clone, Default)]
pub struct GetTranslationsQuery {
/// Filter if church has updated this translation by themselves.
pub updated_by_church: Option<bool>,
/// Filter if translation has to be checked.
pub needs_check: Option<bool>,
}
impl GetTranslationsQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.updated_by_church.push_query("updated_by_church", &mut q);
self.needs_check.push_query("needs_check", &mut q);
q
}
}
/// Query parameters for `GET /translations/keysbytext`.
#[derive(Debug, Clone, Default)]
pub struct GetTranslationsKeysbytextQuery {
/// Translated text string
pub query: Option<String>,
}
impl GetTranslationsKeysbytextQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.query.push_query("query", &mut q);
q
}
}
/// Query parameters for `GET /website/data`.
#[derive(Debug, Clone, Default)]
pub struct GetWebsiteDataQuery {
/// Include additional information
/// Allowed values: `domainData`.
pub include: Option<Vec<String>>,
}
impl GetWebsiteDataQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.include.push_query("include[]", &mut q);
q
}
}
/// Query parameters for `GET /whoami`.
#[derive(Debug, Clone, Default)]
pub struct GetWhoamiQuery {
/// If set to `true` the route will return 401 Unauthorized if the user is not logged in.
pub only_allow_authenticated: Option<bool>,
}
impl GetWhoamiQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.only_allow_authenticated.push_query("only_allow_authenticated", &mut q);
q
}
}
/// Query parameters for `GET /wiki/pages`.
#[derive(Debug, Clone, Default)]
pub struct GetWikiPagesQuery {
/// Maximum page size.
pub limit: Option<i64>,
/// Trimmed search term. SQL LIKE wildcard characters % and _ are interpreted by the backend.
pub query: Option<String>,
/// Wiki category IDs that should be included. If none are given, all categories the user can view are included. Categories the user is not allowed to view are silently filtered out.
pub wiki_category_ids: Option<Vec<i64>>,
/// Fields used to sort the result. Multiple fields are applied in the given order. If omitted while `query` is present, results are sorted by search relevance.
/// Allowed values: `createdDate`, `modifiedDate`, `modifiedPerson`, `title`, `wikiCategoryId`, `wikiCategoryName`.
pub order_fields: Option<Vec<String>>,
/// Sort directions matching `order_fields[]` by position. Missing directions default to `ASC`.
/// Allowed values: `ASC`, `DESC`.
pub order_directions: Option<Vec<String>>,
/// text returns Markdown or sanitized HTML; preview returns a raw stored-text prefix without HTML sanitization.
/// Allowed values: `preview`, `text`.
pub include: Option<Vec<String>>,
/// Maximum number of characters returned in `textPreview` when `include[]=preview` is requested. Ignored without `include[]=preview`.
pub preview_length: Option<i64>,
}
impl GetWikiPagesQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.limit.push_query("limit", &mut q);
self.query.push_query("query", &mut q);
self.wiki_category_ids.push_query("wiki_category_ids[]", &mut q);
self.order_fields.push_query("order_fields[]", &mut q);
self.order_directions.push_query("order_directions[]", &mut q);
self.include.push_query("include[]", &mut q);
self.preview_length.push_query("preview_length", &mut q);
q
}
}
/// Query parameters for `GET /wiki/search`.
#[derive(Debug, Clone, Default)]
pub struct GetWikiSearchQuery {
/// Search term. Must contain at least one character.
pub query: Option<String>,
/// Wiki categories that should be searched. If none are given, all categories the user can view are searched. Categories the user is not allowed to view are silently filtered out.
pub wiki_category_ids: Option<Vec<i64>>,
}
impl GetWikiSearchQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.query.push_query("query", &mut q);
self.wiki_category_ids.push_query("wiki_category_ids[]", &mut q);
q
}
}
/// Query parameters for `GET /wiki/categories/{wikiCategoryId}/pages/{identifier}`.
#[derive(Debug, Clone, Default)]
pub struct GetWikiCategoriesIdPagesIdentifierQuery {
/// Revision number; omission or 0 selects the latest revision. A nonexistent nonzero revision returns 404.
pub version: Option<i64>,
}
impl GetWikiCategoriesIdPagesIdentifierQuery {
pub(crate) fn to_query(&self) -> Query {
let mut q = Query::new();
self.version.push_query("version", &mut q);
q
}
}