Skip to main content

churchtools_api/generated/
models.rs

1//! Generated ChurchTools models.
2//!
3//! 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.
4
5#![allow(clippy::all, deprecated)]
6
7use serde::{Deserialize, Serialize};
8
9/// An absence from service planning for one person, such as vacation or sickness. Both boundaries are stored in the application time zone. If both are midnight, startTime and endTime are `null`; otherwise both contain full UTC timestamps. startDate and endDate always contain the local calendar dates.
10#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11pub struct Absence {
12    /// Installation-specific category of absence, such as vacation or sickness. Use its id as absenceReasonId. Labels are configurable and must not be treated as an enum.
13    #[serde(rename = "absenceReason")]
14    pub absence_reason: AbsenceReason,
15    /// Stored comment; absent comments are returned as an empty string.
16    #[serde(deserialize_with = "crate::lenient::string")]
17    pub comment: String,
18    /// When this absence ends.
19    #[serde(rename = "endDate")]
20    pub end_date: chrono::NaiveDate,
21    /// When this absence ends. Is null if absence is all-day.
22    #[serde(rename = "endTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
23    pub end_time: Option<chrono::DateTime<chrono::Utc>>,
24    /// ID of Record
25    #[serde(deserialize_with = "crate::lenient::number")]
26    pub id: i64,
27    pub meta: MetaDataEntityId,
28    /// Person as Domain Object
29    pub person: DomainObjectPerson,
30    /// When this absence begins.
31    #[serde(rename = "startDate")]
32    pub start_date: chrono::NaiveDate,
33    /// When this absence begins. Is null if absence is all-day.
34    #[serde(rename = "startTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
35    pub start_time: Option<chrono::DateTime<chrono::Utc>>,
36    /// Fields not described by the spec, e.g. instance-specific DB fields.
37    #[serde(flatten)]
38    pub extra: serde_json::Map<String, serde_json::Value>,
39}
40
41/// Creates an absence for the person identified by the path. A Time field takes precedence over the corresponding Date field, but every supplied boundary participates in chronological validation.
42#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
43pub struct AbsenceCreate {
44    /// ID of an existing, installation-specific absence reason. Reasons are master data and are not a fixed enum.
45    #[serde(rename = "absenceReasonId", deserialize_with = "crate::lenient::number")]
46    pub absence_reason_id: i64,
47    /// Comment about the absence.
48    ///
49    /// `None` leaves the field out, `Some(None)` sends `null`.
50    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
51    pub comment: Option<Option<String>>,
52    /// Calendar date (`YYYY-MM-DD`), interpreted at midnight in the application time zone, or a UTC timestamp ending in `Z`. Timestamp values for `startDate` and `endDate` use whole-minute precision.
53    #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
54    pub end_date: Option<crate::DateOrDateTime>,
55    /// Takes precedence over `endDate`.
56    #[serde(rename = "endTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
57    pub end_time: Option<chrono::DateTime<chrono::Utc>>,
58    /// Calendar date (`YYYY-MM-DD`), interpreted at midnight in the application time zone, or a UTC timestamp ending in `Z`. Timestamp values for `startDate` and `endDate` use whole-minute precision.
59    #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
60    pub start_date: Option<crate::DateOrDateTime>,
61    /// Takes precedence over `startDate`.
62    #[serde(rename = "startTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
63    pub start_time: Option<chrono::DateTime<chrono::Utc>>,
64    /// Fields not described by the spec, e.g. instance-specific DB fields.
65    #[serde(flatten)]
66    pub extra: serde_json::Map<String, serde_json::Value>,
67}
68
69/// Installation-specific category of absence, such as vacation or sickness. Use its id as absenceReasonId. Labels are configurable and must not be treated as an enum.
70#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
71pub struct AbsenceReason {
72    /// ID of the absence reason.
73    #[serde(deserialize_with = "crate::lenient::number")]
74    pub id: i64,
75    /// Stored label or translation key.
76    #[serde(deserialize_with = "crate::lenient::string")]
77    pub name: String,
78    /// Label translated for the current language.
79    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
80    pub name_translated: String,
81    /// Display order.
82    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
83    pub sort_key: i64,
84    /// Fields not described by the spec, e.g. instance-specific DB fields.
85    #[serde(flatten)]
86    pub extra: serde_json::Map<String, serde_json::Value>,
87}
88
89/// Replaces an existing absence belonging to the person identified by the path.
90#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
91pub struct AbsenceUpdate {
92    /// ID of an existing, installation-specific absence reason. Reasons are master data and are not a fixed enum.
93    #[serde(rename = "absenceReasonId", deserialize_with = "crate::lenient::number")]
94    pub absence_reason_id: i64,
95    /// Comment about the absence.
96    ///
97    /// `None` leaves the field out, `Some(None)` sends `null`.
98    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
99    pub comment: Option<Option<String>>,
100    /// Calendar date (`YYYY-MM-DD`), interpreted at midnight in the application time zone, or a UTC timestamp ending in `Z`. Timestamp values for `startDate` and `endDate` use whole-minute precision.
101    #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
102    pub end_date: Option<crate::DateOrDateTime>,
103    /// Takes precedence over `endDate`.
104    #[serde(rename = "endTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
105    pub end_time: Option<chrono::DateTime<chrono::Utc>>,
106    /// Calendar date (`YYYY-MM-DD`), interpreted at midnight in the application time zone, or a UTC timestamp ending in `Z`. Timestamp values for `startDate` and `endDate` use whole-minute precision.
107    #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
108    pub start_date: Option<crate::DateOrDateTime>,
109    /// Takes precedence over `startDate`.
110    #[serde(rename = "startTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
111    pub start_time: Option<chrono::DateTime<chrono::Utc>>,
112    /// Fields not described by the spec, e.g. instance-specific DB fields.
113    #[serde(flatten)]
114    pub extra: serde_json::Map<String, serde_json::Value>,
115}
116
117/// A ledger account belongs to one accounting period and one account group. The group links it to an account class and account type. Transactions post amounts between an account and a contra account. Amounts and budgets use integer minor currency units, for example cents.
118#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
119pub struct Account {
120    #[serde(rename = "accountGroupId", deserialize_with = "crate::lenient::number")]
121    pub account_group_id: i64,
122    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
123    pub accounting_period_id: i64,
124    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
125    pub annotation: Option<String>,
126    /// Calculated account balance in minor currency units. When calculation is disabled, the current in-memory value is returned, initially 0.
127    #[serde(deserialize_with = "crate::lenient::number")]
128    pub balance: i64,
129    /// Budget of account in cent.
130    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
131    pub budget: Option<i64>,
132    /// Budget (or 0 without a budget) minus debit plus credit, in minor currency units. A value is returned even without a budget.
133    #[serde(rename = "budgetBalance", deserialize_with = "crate::lenient::number")]
134    pub budget_balance: i64,
135    /// Budget balance of the matching account in the preceding period, in minor currency units. Defaults to 0 when unavailable or not calculated.
136    #[serde(rename = "budgetBalanceLastPeriod", deserialize_with = "crate::lenient::number")]
137    pub budget_balance_last_period: i64,
138    /// Budget of the account with the same number in the preceding period of this client, in minor currency units. Null when unavailable or not calculated.
139    #[serde(rename = "budgetLastPeriod", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
140    pub budget_last_period: Option<i64>,
141    #[serde(deserialize_with = "crate::lenient::number")]
142    pub id: i64,
143    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
144    pub identifier: Option<String>,
145    #[serde(rename = "isDonationAccount")]
146    pub is_donation_account: bool,
147    /// Flag indicating if this account must be included in euBP submissions.
148    #[serde(rename = "isMandatoryEubp")]
149    pub is_mandatory_eubp: bool,
150    /// Flag indicating if isMandatoryEubp was set by a ChurchTools account template and cannot be edited manually.
151    #[serde(rename = "isMandatoryEubpLocked")]
152    pub is_mandatory_eubp_locked: bool,
153    #[serde(rename = "isOpeningBalanceAccount")]
154    pub is_opening_balance_account: bool,
155    pub meta: MetaDataEntityId,
156    #[serde(deserialize_with = "crate::lenient::string")]
157    pub name: String,
158    #[serde(deserialize_with = "crate::lenient::string")]
159    pub number: String,
160    /// Posting permission for the current caller, separate from permission to view or edit account definitions.
161    pub permissions: AccountPermissions,
162    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
163    pub tax_rate_id: Option<i64>,
164    /// Fields not described by the spec, e.g. instance-specific DB fields.
165    #[serde(flatten)]
166    pub extra: serde_json::Map<String, serde_json::Value>,
167}
168
169/// Account classes group account groups within one account type. The hierarchy is account type → account class → account group → account.
170#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
171pub struct AccountClass {
172    /// ID of the related account type.
173    #[serde(rename = "accountTypeId", deserialize_with = "crate::lenient::number")]
174    pub account_type_id: i64,
175    /// Adds the profit-and-loss total to this class in reports. At most one account class in the installation may enable this flag; it is not restricted by account type. Omitted values default to false, including on update.
176    #[serde(rename = "includeProfitLoss", default, skip_serializing_if = "Option::is_none")]
177    pub include_profit_loss: Option<bool>,
178    /// Unique account-class name. The controller does not trim the name or enforce a length limit.
179    #[serde(deserialize_with = "crate::lenient::string")]
180    pub name: String,
181    /// Sort order of the account class.
182    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
183    pub sort_key: Option<i64>,
184    #[serde(deserialize_with = "crate::lenient::number")]
185    pub id: i64,
186    pub meta: MetaDataEntityId,
187    /// Fields not described by the spec, e.g. instance-specific DB fields.
188    #[serde(flatten)]
189    pub extra: serde_json::Map<String, serde_json::Value>,
190}
191
192/// Account classes group account groups within one account type. The hierarchy is account type → account class → account group → account.
193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
194pub struct AccountClassCreate {
195    /// ID of the related account type.
196    #[serde(rename = "accountTypeId", deserialize_with = "crate::lenient::number")]
197    pub account_type_id: i64,
198    /// Adds the profit-and-loss total to this class in reports. At most one account class in the installation may enable this flag; it is not restricted by account type. Omitted values default to false, including on update.
199    #[serde(rename = "includeProfitLoss", default, skip_serializing_if = "Option::is_none")]
200    pub include_profit_loss: Option<bool>,
201    /// Unique account-class name. The controller does not trim the name or enforce a length limit.
202    #[serde(deserialize_with = "crate::lenient::string")]
203    pub name: String,
204    /// Sort order of the account class.
205    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
206    pub sort_key: Option<i64>,
207    /// Fields not described by the spec, e.g. instance-specific DB fields.
208    #[serde(flatten)]
209    pub extra: serde_json::Map<String, serde_json::Value>,
210}
211
212/// Replacement values for an existing account class. Optional fields use the creation defaults when omitted.
213#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
214pub struct AccountClassUpdate {
215    /// ID of the related account type.
216    #[serde(rename = "accountTypeId", deserialize_with = "crate::lenient::number")]
217    pub account_type_id: i64,
218    /// Adds the profit-and-loss total to this class in reports. At most one account class in the installation may enable this flag; it is not restricted by account type. Omitted values default to false, including on update.
219    #[serde(rename = "includeProfitLoss", default, skip_serializing_if = "Option::is_none")]
220    pub include_profit_loss: Option<bool>,
221    /// Unique account-class name. The controller does not trim the name or enforce a length limit.
222    #[serde(deserialize_with = "crate::lenient::string")]
223    pub name: String,
224    /// Sort order of the account class.
225    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
226    pub sort_key: Option<i64>,
227    /// Fields not described by the spec, e.g. instance-specific DB fields.
228    #[serde(flatten)]
229    pub extra: serde_json::Map<String, serde_json::Value>,
230}
231
232/// A ledger account belongs to one accounting period and one account group. The group links it to an account class and account type. Transactions post amounts between an account and a contra account. Amounts and budgets use integer minor currency units, for example cents.
233#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
234pub struct AccountCreate {
235    /// Existing parent account group from /finance/accountgroups.
236    #[serde(rename = "accountGroupId", deserialize_with = "crate::lenient::number")]
237    pub account_group_id: i64,
238    /// Optional trimmed note. Omitted, null or blank clears it.
239    ///
240    /// `None` leaves the field out, `Some(None)` sends `null`.
241    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
242    pub annotation: Option<Option<String>>,
243    /// Budget in minor currency units. Omitted or null clears it.
244    ///
245    /// `None` leaves the field out, `Some(None)` sends `null`.
246    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
247    pub budget: Option<Option<i64>>,
248    /// Optional account identifier, for example an IBAN. All spaces are removed before storage; no IBAN-format validation is performed. Omitted or null clears it.
249    ///
250    /// `None` leaves the field out, `Some(None)` sends `null`.
251    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
252    pub identifier: Option<Option<String>>,
253    /// Whether transactions on this account can be recorded as donations. Omission resets the flag to false.
254    #[serde(rename = "isDonationAccount", default, skip_serializing_if = "Option::is_none")]
255    pub is_donation_account: Option<bool>,
256    /// Whether the account is included in electronically supported employer audits (euBP). On update, an existing lock forces this flag to true.
257    #[serde(rename = "isMandatoryEubp", default, skip_serializing_if = "Option::is_none")]
258    pub is_mandatory_eubp: Option<bool>,
259    /// Whether this account is used for opening-balance postings. Omission resets the flag to false.
260    #[serde(rename = "isOpeningBalanceAccount", default, skip_serializing_if = "Option::is_none")]
261    pub is_opening_balance_account: Option<bool>,
262    /// Trimmed, nonblank account name. Creation checks uniqueness within the accounting period.
263    #[serde(deserialize_with = "crate::lenient::string")]
264    pub name: String,
265    /// Trimmed account number. The value 9999 is reserved for the profit-and-loss total in reports. On creation, number must be unique within the accounting period.
266    #[serde(deserialize_with = "crate::lenient::string")]
267    pub number: String,
268    /// Optional default tax rate from /finance/taxrates. Omitted or null clears it.
269    ///
270    /// `None` leaves the field out, `Some(None)` sends `null`.
271    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
272    pub tax_rate_id: Option<Option<i64>>,
273    /// Existing, open accounting period. Required for creation and cannot be changed by PUT.
274    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
275    pub accounting_period_id: i64,
276    /// Initial euBP lock. When already locked, later updates force isMandatoryEubp to true. PUT validates but does not change this lock.
277    #[serde(rename = "isMandatoryEubpLocked", default, skip_serializing_if = "Option::is_none")]
278    pub is_mandatory_eubp_locked: Option<bool>,
279    /// Fields not described by the spec, e.g. instance-specific DB fields.
280    #[serde(flatten)]
281    pub extra: serde_json::Map<String, serde_json::Value>,
282}
283
284/// Account groups collect individual ledger accounts within one account class. isCashAssetAccount identifies groups of cash or bank accounts.
285#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
286pub struct AccountGroup {
287    /// Existing parent account class, obtainable from /finance/accountclasses.
288    #[serde(rename = "accountClassId", deserialize_with = "crate::lenient::number")]
289    pub account_class_id: i64,
290    /// Whether accounts in this group represent cash or bank assets.
291    #[serde(rename = "isCashAssetAccount")]
292    pub is_cash_asset_account: bool,
293    /// Unique account-group name, trimmed before storage. Supply a nonblank name.
294    #[serde(deserialize_with = "crate::lenient::string")]
295    pub name: String,
296    /// Ascending display order. Omission resets it to 0, including on update.
297    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
298    pub sort_key: Option<i64>,
299    #[serde(deserialize_with = "crate::lenient::number")]
300    pub id: i64,
301    pub meta: MetaDataEntityId,
302    /// Fields not described by the spec, e.g. instance-specific DB fields.
303    #[serde(flatten)]
304    pub extra: serde_json::Map<String, serde_json::Value>,
305}
306
307/// Account groups collect individual ledger accounts within one account class. isCashAssetAccount identifies groups of cash or bank accounts.
308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
309pub struct AccountGroupCreate {
310    /// Existing parent account class, obtainable from /finance/accountclasses.
311    #[serde(rename = "accountClassId", deserialize_with = "crate::lenient::number")]
312    pub account_class_id: i64,
313    /// Whether accounts in this group represent cash or bank assets.
314    #[serde(rename = "isCashAssetAccount")]
315    pub is_cash_asset_account: bool,
316    /// Unique account-group name, trimmed before storage. Supply a nonblank name.
317    #[serde(deserialize_with = "crate::lenient::string")]
318    pub name: String,
319    /// Ascending display order. Omission resets it to 0, including on update.
320    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
321    pub sort_key: Option<i64>,
322    /// Fields not described by the spec, e.g. instance-specific DB fields.
323    #[serde(flatten)]
324    pub extra: serde_json::Map<String, serde_json::Value>,
325}
326
327/// Replacement values for an existing account group. Optional fields use the creation defaults when omitted.
328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
329pub struct AccountGroupUpdate {
330    /// Existing parent account class, obtainable from /finance/accountclasses.
331    #[serde(rename = "accountClassId", deserialize_with = "crate::lenient::number")]
332    pub account_class_id: i64,
333    /// Whether accounts in this group represent cash or bank assets.
334    #[serde(rename = "isCashAssetAccount")]
335    pub is_cash_asset_account: bool,
336    /// Unique account-group name, trimmed before storage. Supply a nonblank name.
337    #[serde(deserialize_with = "crate::lenient::string")]
338    pub name: String,
339    /// Ascending display order. Omission resets it to 0, including on update.
340    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
341    pub sort_key: Option<i64>,
342    /// Fields not described by the spec, e.g. instance-specific DB fields.
343    #[serde(flatten)]
344    pub extra: serde_json::Map<String, serde_json::Value>,
345}
346
347/// Selection for an XLSX account-import workbook. All fields are optional.
348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
349pub struct AccountImportTemplateCreate {
350    /// Filter existing accounts by client. Ignored when templateId is supplied.
351    ///
352    /// `None` leaves the field out, `Some(None)` sends `null`.
353    #[serde(rename = "clientId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
354    pub client_id: Option<Option<i64>>,
355    /// Finance-template file ID. Takes precedence over year and clientId; account rows are read from the template.
356    ///
357    /// `None` leaves the field out, `Some(None)` sends `null`.
358    #[serde(rename = "templateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
359    pub template_id: Option<Option<i64>>,
360    /// Prepend client and booking-year columns. With templateId, these cells are left blank.
361    #[serde(rename = "withClients", default, skip_serializing_if = "Option::is_none")]
362    pub with_clients: Option<bool>,
363    /// Calendar year of the accounting-period start date. Without year or templateId, the workbook contains headings and instructions but no accounts.
364    ///
365    /// `None` leaves the field out, `Some(None)` sends `null`.
366    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
367    pub year: Option<Option<i64>>,
368    /// Fields not described by the spec, e.g. instance-specific DB fields.
369    #[serde(flatten)]
370    pub extra: serde_json::Map<String, serde_json::Value>,
371}
372
373/// Posting permission for the current caller, separate from permission to view or edit account definitions.
374#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
375pub struct AccountPermissions {
376    /// Flag, if user can use this account to post a transaction.
377    #[serde(rename = "allowPosting")]
378    pub allow_posting: bool,
379    /// Fields not described by the spec, e.g. instance-specific DB fields.
380    #[serde(flatten)]
381    pub extra: serde_json::Map<String, serde_json::Value>,
382}
383
384/// Imported bank statement with balances and movement counts. Actual finance transactions are created separately when movements are booked.
385#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
386pub struct AccountStatement {
387    /// Number of source movements skipped as duplicates during import.
388    #[serde(deserialize_with = "crate::lenient::number")]
389    pub duplicates: i64,
390    /// Balance in minor currency units (cents for EUR), which can be negative.
391    #[serde(rename = "endAmount", deserialize_with = "crate::lenient::number")]
392    pub end_amount: i64,
393    /// A simple date in ISO format, e.g. '2022-10-19'
394    #[serde(rename = "endDate")]
395    pub end_date: chrono::NaiveDate,
396    #[serde(deserialize_with = "crate::lenient::number")]
397    pub id: i64,
398    /// Account identifier detected in the source, such as an IBAN; null if the format provides none.
399    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
400    pub identifier: Option<String>,
401    #[serde(deserialize_with = "crate::lenient::string")]
402    pub name: String,
403    /// Balance in minor currency units (cents for EUR), which can be negative.
404    #[serde(rename = "startAmount", deserialize_with = "crate::lenient::number")]
405    pub start_amount: i64,
406    /// A simple date in ISO format, e.g. '2022-10-19'
407    #[serde(rename = "startDate")]
408    pub start_date: chrono::NaiveDate,
409    pub statistics: StatementStatistics,
410    /// Fields not described by the spec, e.g. instance-specific DB fields.
411    #[serde(flatten)]
412    pub extra: serde_json::Map<String, serde_json::Value>,
413}
414
415/// Parsed statement preview. Amounts are in minor currency units.
416#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
417pub struct AccountStatementPreview {
418    /// Movements matching existing movements across all accounts in the parsed date range.
419    #[serde(deserialize_with = "crate::lenient::number")]
420    pub duplicates: i64,
421    /// End balance in cents.
422    #[serde(rename = "endAmount", deserialize_with = "crate::lenient::number")]
423    pub end_amount: i64,
424    /// A simple date in ISO format, e.g. '2022-10-19'
425    #[serde(rename = "endDate")]
426    pub end_date: chrono::NaiveDate,
427    #[serde(rename = "fileName", deserialize_with = "crate::lenient::string")]
428    pub file_name: String,
429    /// Detected parser format.
430    /// Allowed values: `camt`, `mt940`, `paypal`.
431    #[serde(rename = "fileType", deserialize_with = "crate::lenient::string")]
432    pub file_type: String,
433    /// Account identifier detected in the source, such as an IBAN; null if the format provides none.
434    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
435    pub identifier: Option<String>,
436    /// Movement count after cross-account duplicate comparison.
437    #[serde(deserialize_with = "crate::lenient::number")]
438    pub movements: i64,
439    /// Start balance in cents.
440    #[serde(rename = "startAmount", deserialize_with = "crate::lenient::number")]
441    pub start_amount: i64,
442    /// A simple date in ISO format, e.g. '2022-10-19'
443    #[serde(rename = "startDate")]
444    pub start_date: chrono::NaiveDate,
445    /// Number of movements with an amount of zero that would be skipped on import.
446    #[serde(rename = "withoutAmount", deserialize_with = "crate::lenient::number")]
447    pub without_amount: i64,
448    /// Fields not described by the spec, e.g. instance-specific DB fields.
449    #[serde(flatten)]
450    pub extra: serde_json::Map<String, serde_json::Value>,
451}
452
453/// Optional account-report options. A missing body selects the entire accounting period as a PDF.
454#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
455pub struct AccountStatementReportCreate {
456    /// Last document date to include. Omission or null defaults to the corresponding accounting-period boundary. The final endDate must be on or after startDate.
457    ///
458    /// `None` leaves the field out, `Some(None)` sends `null`.
459    #[serde(rename = "endDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
460    pub end_date: Option<Option<chrono::NaiveDate>>,
461    /// PDF creates a file and returns its URL with HTTP 201. CSV/XLSX return the file directly with HTTP 200. Accept: text/html overrides this selection.
462    /// Allowed values: `csv`, `pdf`, `xlsx`.
463    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
464    pub format: Option<String>,
465    /// First document date to include. Omission or null defaults to the corresponding accounting-period boundary. The final endDate must be on or after startDate.
466    ///
467    /// `None` leaves the field out, `Some(None)` sends `null`.
468    #[serde(rename = "startDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
469    pub start_date: Option<Option<chrono::NaiveDate>>,
470    /// Fields not described by the spec, e.g. instance-specific DB fields.
471    #[serde(flatten)]
472    pub extra: serde_json::Map<String, serde_json::Value>,
473}
474
475/// Movement counts for one account. States without movements are omitted.
476#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
477pub struct AccountStatementStatistics {
478    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
479    pub account_id: i64,
480    /// Number of movements that have been booked.
481    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
482    pub booked: Option<i64>,
483    /// Number of movements that have been ignored.
484    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
485    pub ignored: Option<i64>,
486    /// Number of movements that are still open.
487    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
488    pub open: Option<i64>,
489    /// Fields not described by the spec, e.g. instance-specific DB fields.
490    #[serde(flatten)]
491    pub extra: serde_json::Map<String, serde_json::Value>,
492}
493
494/// New display name for an imported statement.
495#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
496pub struct AccountStatementUpdate {
497    /// Stored as supplied; whitespace and an empty string are accepted.
498    #[serde(deserialize_with = "crate::lenient::string")]
499    pub name: String,
500    /// Fields not described by the spec, e.g. instance-specific DB fields.
501    #[serde(flatten)]
502    pub extra: serde_json::Map<String, serde_json::Value>,
503}
504
505/// Account types are the top level of the finance chart of accounts. They distinguish assets, liabilities and profit-and-loss accounts. Each account class belongs to one account type.
506#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
507pub struct AccountType {
508    /// Balance-sheet side: assets or liabilities. Omit this field for a profit-and-loss account type. On update, omission also clears the balance-sheet classification.
509    /// Allowed values: `assets`, `liabilities`.
510    #[serde(rename = "balanceType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
511    pub balance_type: Option<String>,
512    /// Unique account-type name. The controller does not trim the name or enforce a length limit.
513    #[serde(deserialize_with = "crate::lenient::string")]
514    pub name: String,
515    /// Ascending display order. Omission resets it to 0, including on update.
516    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
517    pub sort_key: Option<i64>,
518    #[serde(deserialize_with = "crate::lenient::number")]
519    pub id: i64,
520    /// Legacy flag: true when balanceType is non-null. Use balanceType instead.
521    #[serde(rename = "isBalanceAccount", default, skip_serializing_if = "Option::is_none")]
522    #[deprecated = "Use balanceType instead."]
523    pub is_balance_account: Option<bool>,
524    pub meta: MetaDataEntityId,
525    /// Fields not described by the spec, e.g. instance-specific DB fields.
526    #[serde(flatten)]
527    pub extra: serde_json::Map<String, serde_json::Value>,
528}
529
530/// Account types are the top level of the finance chart of accounts. They distinguish assets, liabilities and profit-and-loss accounts. Each account class belongs to one account type.
531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
532pub struct AccountTypeCreate {
533    /// Balance-sheet side: assets or liabilities. Omit this field for a profit-and-loss account type. On update, omission also clears the balance-sheet classification.
534    /// Allowed values: `assets`, `liabilities`.
535    ///
536    /// `None` leaves the field out, `Some(None)` sends `null`.
537    #[serde(rename = "balanceType", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
538    pub balance_type: Option<Option<String>>,
539    /// Unique account-type name. The controller does not trim the name or enforce a length limit.
540    #[serde(deserialize_with = "crate::lenient::string")]
541    pub name: String,
542    /// Ascending display order. Omission resets it to 0, including on update.
543    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
544    pub sort_key: Option<i64>,
545    /// Fields not described by the spec, e.g. instance-specific DB fields.
546    #[serde(flatten)]
547    pub extra: serde_json::Map<String, serde_json::Value>,
548}
549
550/// Replacement values for an existing account type. Optional fields use the creation defaults when omitted.
551#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
552pub struct AccountTypeUpdate {
553    /// Balance-sheet side: assets or liabilities. Omit this field for a profit-and-loss account type. On update, omission also clears the balance-sheet classification.
554    /// Allowed values: `assets`, `liabilities`.
555    ///
556    /// `None` leaves the field out, `Some(None)` sends `null`.
557    #[serde(rename = "balanceType", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
558    pub balance_type: Option<Option<String>>,
559    /// Unique account-type name. The controller does not trim the name or enforce a length limit.
560    #[serde(deserialize_with = "crate::lenient::string")]
561    pub name: String,
562    /// Ascending display order. Omission resets it to 0, including on update.
563    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
564    pub sort_key: Option<i64>,
565    /// Fields not described by the spec, e.g. instance-specific DB fields.
566    #[serde(flatten)]
567    pub extra: serde_json::Map<String, serde_json::Value>,
568}
569
570/// Replacement values for an account in an open accounting period. The period cannot be changed here. Omitted optional fields reset to false or null. A donation account with existing donation transactions cannot have isDonationAccount disabled through this single-update endpoint.
571#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
572pub struct AccountUpdate {
573    /// Existing parent account group from /finance/accountgroups.
574    #[serde(rename = "accountGroupId", deserialize_with = "crate::lenient::number")]
575    pub account_group_id: i64,
576    /// Optional trimmed note. Omitted, null or blank clears it.
577    ///
578    /// `None` leaves the field out, `Some(None)` sends `null`.
579    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
580    pub annotation: Option<Option<String>>,
581    /// Budget in minor currency units. Omitted or null clears it.
582    ///
583    /// `None` leaves the field out, `Some(None)` sends `null`.
584    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
585    pub budget: Option<Option<i64>>,
586    /// Optional account identifier, for example an IBAN. All spaces are removed before storage; no IBAN-format validation is performed. Omitted or null clears it.
587    ///
588    /// `None` leaves the field out, `Some(None)` sends `null`.
589    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
590    pub identifier: Option<Option<String>>,
591    /// Whether transactions on this account can be recorded as donations. Omission resets the flag to false.
592    #[serde(rename = "isDonationAccount", default, skip_serializing_if = "Option::is_none")]
593    pub is_donation_account: Option<bool>,
594    /// Whether the account is included in electronically supported employer audits (euBP). On update, an existing lock forces this flag to true.
595    #[serde(rename = "isMandatoryEubp", default, skip_serializing_if = "Option::is_none")]
596    pub is_mandatory_eubp: Option<bool>,
597    /// Whether this account is used for opening-balance postings. Omission resets the flag to false.
598    #[serde(rename = "isOpeningBalanceAccount", default, skip_serializing_if = "Option::is_none")]
599    pub is_opening_balance_account: Option<bool>,
600    /// Trimmed, nonblank account name. Creation checks uniqueness within the accounting period.
601    #[serde(deserialize_with = "crate::lenient::string")]
602    pub name: String,
603    /// Trimmed account number. The value 9999 is reserved for the profit-and-loss total in reports. On creation, number must be unique within the accounting period.
604    #[serde(deserialize_with = "crate::lenient::string")]
605    pub number: String,
606    /// Optional default tax rate from /finance/taxrates. Omitted or null clears it.
607    ///
608    /// `None` leaves the field out, `Some(None)` sends `null`.
609    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
610    pub tax_rate_id: Option<Option<i64>>,
611    /// Fields not described by the spec, e.g. instance-specific DB fields.
612    #[serde(flatten)]
613    pub extra: serde_json::Map<String, serde_json::Value>,
614}
615
616/// An accounting period is the date range for one finance client’s books, usually a financial year. Accounts and cost centers belong to a period. Closing a period prevents ordinary account and transaction changes; it is separate from making individual transactions immutable.
617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
618pub struct AccountingPeriod {
619    /// Finance client owning this period.
620    #[serde(rename = "clientId", deserialize_with = "crate::lenient::number")]
621    pub client_id: i64,
622    /// Last date of the period.
623    #[serde(rename = "endDate")]
624    pub end_date: chrono::NaiveDate,
625    /// Whether document numbers are incremented automatically. Required in both creation and update.
626    #[serde(rename = "incrementDocumentNumber")]
627    pub increment_document_number: bool,
628    /// Whether the period is closed for ordinary accounting changes. This flag alone does not make transactions immutable.
629    #[serde(rename = "isClosed")]
630    pub is_closed: bool,
631    /// First date of the period. Used to match the previous period by subtracting exactly one year.
632    #[serde(rename = "startDate")]
633    pub start_date: chrono::NaiveDate,
634    /// Timestamp when donation receipts were marked as created, or null when not yet marked.
635    #[serde(rename = "donationReceiptsCreated", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
636    pub donation_receipts_created: Option<chrono::DateTime<chrono::Utc>>,
637    #[serde(deserialize_with = "crate::lenient::number")]
638    pub id: i64,
639    pub meta: MetaDataEntityId,
640    pub permissions: AccountingPeriodPermissions,
641    /// Fields not described by the spec, e.g. instance-specific DB fields.
642    #[serde(flatten)]
643    pub extra: serde_json::Map<String, serde_json::Value>,
644}
645
646/// Optional opening-balance transfer. Both an openingBalanceAccount and a nonempty from list are needed to start a transfer. The previous period must have the same client and a start date exactly one year earlier.
647#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
648pub struct AccountingPeriodBalanceTransfer {
649    /// Source balance-sheet account IDs from the previous period. Matching target accounts must have the same numbers. Profit-and-loss accounts are not allowed. The transfer posts only the difference between closing balances and already existing opening balances; zero differences are skipped.
650    #[serde(default, skip_serializing_if = "Option::is_none")]
651    pub from: Option<Vec<i64>>,
652    /// ID of an existing account whose number identifies an opening-balance account in the target period. The source ID itself need not belong to the target period; its number is used for matching.
653    ///
654    /// `None` leaves the field out, `Some(None)` sends `null`.
655    #[serde(rename = "openingBalanceAccount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
656    pub opening_balance_account: Option<Option<i64>>,
657    /// Fields not described by the spec, e.g. instance-specific DB fields.
658    #[serde(flatten)]
659    pub extra: serde_json::Map<String, serde_json::Value>,
660}
661
662/// An accounting period is the date range for one finance client’s books, usually a financial year. Accounts and cost centers belong to a period. Closing a period prevents ordinary account and transaction changes; it is separate from making individual transactions immutable.
663#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
664pub struct AccountingPeriodCreate {
665    /// Finance client owning this period.
666    #[serde(rename = "clientId", deserialize_with = "crate::lenient::number")]
667    pub client_id: i64,
668    /// Last date of the period.
669    #[serde(rename = "endDate")]
670    pub end_date: chrono::NaiveDate,
671    /// Whether document numbers are incremented automatically. Required in both creation and update.
672    #[serde(rename = "incrementDocumentNumber")]
673    pub increment_document_number: bool,
674    /// Whether the period is closed for ordinary accounting changes. This flag alone does not make transactions immutable.
675    #[serde(rename = "isClosed")]
676    pub is_closed: bool,
677    /// First date of the period. Used to match the previous period by subtracting exactly one year.
678    #[serde(rename = "startDate")]
679    pub start_date: chrono::NaiveDate,
680    /// Optional opening-balance transfer. Both an openingBalanceAccount and a nonempty from list are needed to start a transfer. The previous period must have the same client and a start date exactly one year earlier.
681    #[serde(default, skip_serializing_if = "Option::is_none")]
682    pub balances: Option<AccountingPeriodBalanceTransfer>,
683    /// Copy the previous period’s accounts, cost centers and related finance master data. The previous period is matched by client and a start date exactly one year earlier. Without a match, an empty period is created. Ordinary transactions are not copied. The current copy implementation retains the previous incrementDocumentNumber setting.
684    #[serde(rename = "copyMasterData", default, skip_serializing_if = "Option::is_none")]
685    pub copy_master_data: Option<bool>,
686    /// Fields not described by the spec, e.g. instance-specific DB fields.
687    #[serde(flatten)]
688    pub extra: serde_json::Map<String, serde_json::Value>,
689}
690
691#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
692pub struct AccountingPeriodPermissions {
693    /// Whether the caller has resolved edit permission for finance expert-mode operations in this period. This does not replace finance master-data permission for changing period settings.
694    #[serde(rename = "canUseExpertMode")]
695    pub can_use_expert_mode: bool,
696    /// Whether the caller has global finance edit accounting period permission for this period.
697    #[serde(rename = "edit accounting period")]
698    pub edit_accounting_period: bool,
699    /// Whether the caller has global finance view accounting period permission for this period. Visibility may also come from other permissions.
700    #[serde(rename = "view accounting period")]
701    pub view_accounting_period: bool,
702    /// Fields not described by the spec, e.g. instance-specific DB fields.
703    #[serde(flatten)]
704    pub extra: serde_json::Map<String, serde_json::Value>,
705}
706
707/// Replacement period settings. All AccountingPeriodBase fields are required. Optional balance transfer and transaction immutability are applied after saving the period.
708#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
709pub struct AccountingPeriodUpdate {
710    /// Finance client owning this period.
711    #[serde(rename = "clientId", deserialize_with = "crate::lenient::number")]
712    pub client_id: i64,
713    /// Last date of the period.
714    #[serde(rename = "endDate")]
715    pub end_date: chrono::NaiveDate,
716    /// Whether document numbers are incremented automatically. Required in both creation and update.
717    #[serde(rename = "incrementDocumentNumber")]
718    pub increment_document_number: bool,
719    /// Whether the period is closed for ordinary accounting changes. This flag alone does not make transactions immutable.
720    #[serde(rename = "isClosed")]
721    pub is_closed: bool,
722    /// First date of the period. Used to match the previous period by subtracting exactly one year.
723    #[serde(rename = "startDate")]
724    pub start_date: chrono::NaiveDate,
725    /// Optional opening-balance transfer. Both an openingBalanceAccount and a nonempty from list are needed to start a transfer. The previous period must have the same client and a start date exactly one year earlier.
726    #[serde(default, skip_serializing_if = "Option::is_none")]
727    pub balances: Option<AccountingPeriodBalanceTransfer>,
728    /// When isClosed=true, make currently mutable transactions in the period immutable. Ignored when isClosed=false. Reopening the period does not undo transaction immutability.
729    #[serde(rename = "setImmutability", default, skip_serializing_if = "Option::is_none")]
730    pub set_immutability: Option<bool>,
731    /// Fields not described by the spec, e.g. instance-specific DB fields.
732    #[serde(flatten)]
733    pub extra: serde_json::Map<String, serde_json::Value>,
734}
735
736#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
737pub struct Action {
738    #[serde(rename = "actionMetaData")]
739    pub action_meta_data: ActionMetaData,
740    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
741    pub domain_type: String,
742    #[serde(default, skip_serializing_if = "Option::is_none")]
743    pub group: Option<ActionGroup>,
744    /// Allowed values: `add-member-to-group`, `archive-member`, `change-member-status-active-requested`, `change-member-status-active-to_delete`, `change-member-status-requested-active`, `change-member-status-requested-to_delete`, `change-member-status-requested-waiting`, `change-member-status-to_delete-active`, `change-member-status-to_delete-requested`, `change-member-status-waiting-active`, `change-member-status-waiting-requested`, `change-member-status-waiting-to_delete`, `create-follow-up`, `edit-group-membership`, `edit-member`, `edit-tags-for-member`, `invite-member`, `remove-member`, `send-member-email`, `special:repeat`, `special:wait`.
745    #[serde(deserialize_with = "crate::lenient::string")]
746    pub key: String,
747    /// Fields not described by the spec, e.g. instance-specific DB fields.
748    #[serde(flatten)]
749    pub extra: serde_json::Map<String, serde_json::Value>,
750}
751
752#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
753pub struct ActionGroup {
754    #[serde(deserialize_with = "crate::lenient::string")]
755    pub key: String,
756    #[serde(deserialize_with = "crate::lenient::string")]
757    pub name: String,
758    /// Fields not described by the spec, e.g. instance-specific DB fields.
759    #[serde(flatten)]
760    pub extra: serde_json::Map<String, serde_json::Value>,
761}
762
763#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
764pub struct ActionMetaData {
765    /// A color in ChurchTools
766    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
767    #[serde(deserialize_with = "crate::lenient::string")]
768    pub color: String,
769    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
770    pub description: Option<String>,
771    #[serde(deserialize_with = "crate::lenient::string")]
772    pub icon: String,
773    #[serde(deserialize_with = "crate::lenient::string")]
774    pub name: String,
775    /// Fields not described by the spec, e.g. instance-specific DB fields.
776    #[serde(flatten)]
777    pub extra: serde_json::Map<String, serde_json::Value>,
778}
779
780#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
781pub struct Address {
782    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
783    pub addition: Option<String>,
784    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
785    pub city: Option<String>,
786    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`, `default`, `parent`.
787    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
788    pub color: serde_json::Value,
789    /// A country's ISO-code
790    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
791    pub country: Option<String>,
792    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
793    pub district: Option<String>,
794    /// The identifier of the domain object. This field is set automatically from the path parameter and should not be included in the request body.
795    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
796    pub domain_identifier: String,
797    /// The domain type of the address. This field is set automatically from the path parameter and should not be included in the request body.
798    /// Allowed values: `appointment`, `campus`, `church`, `group`.
799    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
800    pub domain_type: String,
801    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
802    pub icon: Option<String>,
803    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
804    pub latitude: Option<String>,
805    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
806    pub longitude: Option<String>,
807    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
808    pub name: Option<String>,
809    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
810    pub street: Option<String>,
811    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
812    pub zip: Option<String>,
813    #[serde(deserialize_with = "crate::lenient::number")]
814    pub id: i64,
815    /// Legacy field mappings emitted by the address serializer.
816    #[serde(rename = "@deprecated")]
817    pub deprecated: AddressDeprecated,
818    /// Use `latitude` instead
819    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
820    #[deprecated = "Use `latitude` instead"]
821    pub geo_lat: Option<String>,
822    /// Use `longitude` instead
823    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
824    #[deprecated = "Use `longitude` instead"]
825    pub geo_lng: Option<String>,
826    /// Use `latitude` instead
827    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
828    #[deprecated = "Use `latitude` instead"]
829    pub latitude_loose: Option<String>,
830    /// Use `longitude` instead
831    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
832    #[deprecated = "Use `longitude` instead"]
833    pub longitude_loose: Option<String>,
834    /// Allowed values: `default`, `parent`, `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
835    #[serde(rename = "markerColor", default, skip_serializing_if = "serde_json::Value::is_null")]
836    #[deprecated = "deprecated in the ChurchTools API"]
837    pub marker_color: serde_json::Value,
838    /// Use `icon` instead
839    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
840    #[deprecated = "Use `icon` instead"]
841    pub marker_icon: Option<String>,
842    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
843    #[deprecated = "deprecated in the ChurchTools API"]
844    pub marker_url: Option<String>,
845    /// Use `name` instead
846    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
847    #[deprecated = "Use `name` instead"]
848    pub meeting_at: Option<String>,
849    /// Use `zip` instead
850    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
851    #[deprecated = "Use `zip` instead"]
852    pub postalcode: Option<String>,
853    /// Fields not described by the spec, e.g. instance-specific DB fields.
854    #[serde(flatten)]
855    pub extra: serde_json::Map<String, serde_json::Value>,
856}
857
858/// Legacy field mappings emitted by the address serializer.
859#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
860pub struct AddressDeprecated {
861    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::string")]
862    pub geo_lat: String,
863    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::string")]
864    pub geo_lng: String,
865    #[serde(rename = "markerColor", deserialize_with = "crate::lenient::string")]
866    pub marker_color: String,
867    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::string")]
868    pub marker_icon: String,
869    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::string")]
870    pub marker_url: String,
871    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::string")]
872    pub meeting_at: String,
873    #[serde(deserialize_with = "crate::lenient::string")]
874    pub postalcode: String,
875    /// Fields not described by the spec, e.g. instance-specific DB fields.
876    #[serde(flatten)]
877    pub extra: serde_json::Map<String, serde_json::Value>,
878}
879
880#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
881pub struct AddressInterface {
882    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
883    pub addition: Option<String>,
884    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
885    pub city: Option<String>,
886    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
887    pub country: Option<String>,
888    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
889    pub district: Option<String>,
890    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
891    pub latitude: Option<String>,
892    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
893    pub longitude: Option<String>,
894    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
895    pub name: Option<String>,
896    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
897    pub street: Option<String>,
898    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
899    pub zip: Option<String>,
900    /// Fields not described by the spec, e.g. instance-specific DB fields.
901    #[serde(flatten)]
902    pub extra: serde_json::Map<String, serde_json::Value>,
903}
904
905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
906pub struct AddressSearchResult {
907    pub address: AddressInterface,
908    #[serde(rename = "domainObject", default, skip_serializing_if = "serde_json::Value::is_null")]
909    pub domain_object: serde_json::Value,
910    /// Fields not described by the spec, e.g. instance-specific DB fields.
911    #[serde(flatten)]
912    pub extra: serde_json::Map<String, serde_json::Value>,
913}
914
915/// An age range used to describe the intended ages for a group, for example ages 3 to 5. A group can reference several ranges through information.ageGroupIds. These are configured ranges, not the calculated ages of its current members.
916#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
917pub struct AgeGroup {
918    /// Upper age boundary in years, inclusive.
919    #[serde(deserialize_with = "crate::lenient::number")]
920    pub end: i64,
921    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
922    #[serde(deserialize_with = "crate::lenient::string")]
923    pub name: String,
924    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
925    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
926    pub sort_key: i64,
927    /// Lower age boundary in years, inclusive.
928    #[serde(deserialize_with = "crate::lenient::number")]
929    pub start: i64,
930    /// ID of this master-data record in this ChurchTools installation. Use it when assigning this classification to a group.
931    #[serde(deserialize_with = "crate::lenient::number")]
932    pub id: i64,
933    /// Localized display name, translated from the stored name when a translation exists.
934    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
935    pub name_translated: String,
936    /// Fields not described by the spec, e.g. instance-specific DB fields.
937    #[serde(flatten)]
938    pub extra: serde_json::Map<String, serde_json::Value>,
939}
940
941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
942pub struct AgeGroupCreate {
943    /// Upper age boundary in years, inclusive.
944    #[serde(deserialize_with = "crate::lenient::number")]
945    pub end: i64,
946    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
947    #[serde(deserialize_with = "crate::lenient::string")]
948    pub name: String,
949    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
950    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
951    pub sort_key: i64,
952    /// Lower age boundary in years, inclusive.
953    #[serde(deserialize_with = "crate::lenient::number")]
954    pub start: i64,
955    /// Fields not described by the spec, e.g. instance-specific DB fields.
956    #[serde(flatten)]
957    pub extra: serde_json::Map<String, serde_json::Value>,
958}
959
960/// Ordered running plan for an event, such as a worship service, or a reusable agenda template. Several events can share the same agenda and item IDs. Their dates and hidden items can differ, so item `startTimes` are calculated separately for each event. Changes to shared content and the lock state affect every linked event.
961#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
962pub struct Agenda {
963    /// Compatibility mapping included in the response.
964    #[serde(rename = "@deprecated")]
965    pub deprecated: AgendaDeprecated,
966    /// Calendar assigned to the agenda. Linking another event does not replace this value with the target event's calendar ID.
967    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
968    pub calendar_id: i64,
969    /// Zero-based index in the complete ordered items array where the event begins. Earlier items are marked isBeforeEvent and their visible, non-header durations are subtracted from the event start. Hidden items and headers still occupy positions in the array.
970    #[serde(rename = "eventStartPosition", deserialize_with = "crate::lenient::number")]
971    pub event_start_position: i64,
972    /// ID of the shared agenda, not the event. Integrated events return the same agenda ID.
973    #[serde(deserialize_with = "crate::lenient::number")]
974    pub id: i64,
975    /// Use `isLocked` instead.
976    #[serde(rename = "isFinal", default, skip_serializing_if = "Option::is_none")]
977    #[deprecated = "Use `isLocked` instead."]
978    pub is_final: Option<bool>,
979    /// Shared lock state. Content editing is blocked while `true`; linking or detaching events is still possible.
980    #[serde(rename = "isLocked")]
981    pub is_locked: bool,
982    /// All agenda items ordered by sort key, including headers and items hidden for the requested event. Use `startTimes`\[`eventId`\] to identify hidden items.
983    pub items: Vec<serde_json::Value>,
984    pub meta: MetaDataEntityId,
985    /// For an event agenda, a display name derived from the requested event's date and appointment title. For templates, the stored template name. The display name can differ between events sharing one agenda.
986    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
987    pub name: Option<String>,
988    /// Optional free-text series name, for example a sermon series. This is independent of calendar recurrence.
989    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
990    pub series: Option<String>,
991    /// Number of non-header items in the complete shared agenda, including items hidden for the requested event. This is a count, not a duration.
992    #[serde(deserialize_with = "crate::lenient::number")]
993    pub total: i64,
994    /// Fields not described by the spec, e.g. instance-specific DB fields.
995    #[serde(flatten)]
996    pub extra: serde_json::Map<String, serde_json::Value>,
997}
998
999/// Create an agenda without copying a template or another event. Supply `calendarId` explicitly; it is not inferred from the event. Items are optional, so an empty agenda can be created.
1000#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1001pub struct AgendaCreate {
1002    /// Calendar assigned to this agenda. It is not automatically taken from the event.
1003    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1004    pub calendar_id: Option<i64>,
1005    /// Zero-based index in the complete items array where the event begins, including headers and hidden items.
1006    #[serde(rename = "eventStartPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1007    pub event_start_position: Option<i64>,
1008    /// Complete replacement list in the intended order. Existing IDs retain and update those items; entries without IDs create new ones. An empty array deletes all items. Cannot be combined with either copy-source query parameter.
1009    #[serde(default, skip_serializing_if = "Option::is_none")]
1010    pub items: Option<Vec<AgendaItemListUpdate>>,
1011    /// Free-text series name.
1012    ///
1013    /// `None` leaves the field out, `Some(None)` sends `null`.
1014    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1015    pub series: Option<Option<String>>,
1016    /// Fields not described by the spec, e.g. instance-specific DB fields.
1017    #[serde(flatten)]
1018    pub extra: serde_json::Map<String, serde_json::Value>,
1019}
1020
1021/// Compatibility mapping included in the response.
1022#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1023pub struct AgendaDeprecated {
1024    /// Allowed values: `isLocked`.
1025    #[serde(rename = "isFinal", deserialize_with = "crate::lenient::string")]
1026    pub is_final: String,
1027    /// Fields not described by the spec, e.g. instance-specific DB fields.
1028    #[serde(flatten)]
1029    pub extra: serde_json::Map<String, serde_json::Value>,
1030}
1031
1032/// Generated presenter archive and information about ambiguous song-file choices. The response is JSON, not the archive itself.
1033#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1034pub struct AgendaExport {
1035    /// Labels in the form "song title - arrangement name" for agenda items whose selected arrangement has multiple files matching the target format. The exporter still selects the first file.
1036    #[serde(rename = "songsWithMultipleFiles")]
1037    pub songs_with_multiple_files: Vec<String>,
1038    /// Relative URL of the stored export file. Resolve it against the ChurchTools installation URL and fetch it separately. Download access is checked against the template or a linked event's agenda permissions.
1039    #[serde(deserialize_with = "crate::lenient::string")]
1040    pub url: String,
1041    /// Fields not described by the spec, e.g. instance-specific DB fields.
1042    #[serde(flatten)]
1043    pub extra: serde_json::Map<String, serde_json::Value>,
1044}
1045
1046/// Options for generating a presenter archive.
1047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1048pub struct AgendaExportCreate {
1049    /// Append the selected arrangement name to exported song captions and generated fallback file names. Existing attached files retain their file names.
1050    #[serde(rename = "appendArrangement")]
1051    pub append_arrangement: bool,
1052    /// Include available song files for the target software. The first matching file of the selected arrangement is used. For SongBeamer, the song's default arrangement can provide a fallback `.sng` file. When disabled, song references point to files expected in the presenter library. No song-file conversion is performed.
1053    #[serde(rename = "exportSongs")]
1054    pub export_songs: bool,
1055    /// For `SONG_BEAMER` with `exportSongs`=`false`, prefix generated song file references with the song category as a directory. Has no effect with embedded song files or for either ProPresenter format.
1056    #[serde(rename = "withCategory")]
1057    pub with_category: bool,
1058    /// Fields not described by the spec, e.g. instance-specific DB fields.
1059    #[serde(flatten)]
1060    pub extra: serde_json::Map<String, serde_json::Value>,
1061}
1062
1063/// Response fields shared by header, text and song items. Positions and timing are calculated by ChurchTools from the shared item order and the linked events.
1064#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1065pub struct AgendaItemHeader {
1066    /// Compatibility marker included in each serialized agenda item.
1067    #[serde(rename = "@deprecated")]
1068    pub deprecated: AgendaItemTextDeprecated,
1069    /// Stored duration in seconds. For headers, zero selects `calculatedDuration` for display. Header duration is not added to the running time. An item hidden for an event does not consume time.
1070    #[serde(deserialize_with = "crate::lenient::number")]
1071    pub duration: i64,
1072    #[serde(deserialize_with = "crate::lenient::number")]
1073    pub id: i64,
1074    /// Whether the item precedes `eventStartPosition`. This is based on the shared item order, independently of visibility in a particular event.
1075    #[serde(rename = "isBeforeEvent")]
1076    pub is_before_event: bool,
1077    pub meta: MetaDataEntityId,
1078    /// Deprecated zero-based index in the complete shared items array, including headers and hidden items.
1079    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1080    #[deprecated = "deprecated in the ChurchTools API"]
1081    pub position: Option<i64>,
1082    /// Calculated position time for the requested event, or the first linked event when no event context is selected. Can still contain a time when the item is hidden; use `startTimes`\[`eventId`\] to determine visibility. `null` when there is no event timing, as for templates.
1083    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
1084    pub start: Option<chrono::DateTime<chrono::Utc>>,
1085    /// Calculated start times keyed by linked event ID, also for agendas with only one event. Null means the item is hidden for that event. Empty for an agenda without linked event timing, such as a template.
1086    #[serde(rename = "startTimes", deserialize_with = "crate::lenient::map")]
1087    pub start_times: std::collections::BTreeMap<String, Option<chrono::DateTime<chrono::Utc>>>,
1088    #[serde(deserialize_with = "crate::lenient::string")]
1089    pub title: String,
1090    /// Total duration in seconds of visible content items up to the next visible header or event start, calculated independently of the stored duration. Use for display when `duration` is zero.
1091    #[serde(rename = "calculatedDuration", deserialize_with = "crate::lenient::number")]
1092    pub calculated_duration: i64,
1093    /// Allowed values: `header`.
1094    #[serde(deserialize_with = "crate::lenient::string")]
1095    pub r#type: String,
1096    /// Fields not described by the spec, e.g. instance-specific DB fields.
1097    #[serde(flatten)]
1098    pub extra: serde_json::Map<String, serde_json::Value>,
1099}
1100
1101#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1102pub struct AgendaItemInputHeader {
1103    /// Duration in seconds. For headers, zero selects automatic calculation from the section's visible items; a positive value overrides it. Header duration does not contribute to the running time.
1104    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1105    pub duration: Option<i64>,
1106    /// Responses represent a missing title as an empty string.
1107    ///
1108    /// `None` leaves the field out, `Some(None)` sends `null`.
1109    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1110    pub title: Option<Option<String>>,
1111    /// Allowed values: `header`.
1112    #[serde(deserialize_with = "crate::lenient::string")]
1113    pub r#type: String,
1114    /// Fields not described by the spec, e.g. instance-specific DB fields.
1115    #[serde(flatten)]
1116    pub extra: serde_json::Map<String, serde_json::Value>,
1117}
1118
1119#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1120pub struct AgendaItemInputSong {
1121    /// Duration in seconds
1122    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1123    pub duration: Option<i64>,
1124    /// Responses represent a missing title as an empty string.
1125    ///
1126    /// `None` leaves the field out, `Some(None)` sends `null`.
1127    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1128    pub title: Option<Option<String>>,
1129    /// Note text.
1130    ///
1131    /// `None` leaves the field out, `Some(None)` sends `null`.
1132    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1133    pub note: Option<Option<String>>,
1134    /// Free text with optional service placeholders, such as \[Worship Leader\].
1135    ///
1136    /// `None` leaves the field out, `Some(None)` sends `null`.
1137    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1138    pub responsible: Option<Option<String>>,
1139    /// Notes to associate with service groups.
1140    #[serde(rename = "serviceGroupNotes", default, skip_serializing_if = "Option::is_none")]
1141    pub service_group_notes: Option<Vec<AgendaServiceGroupNoteCreate>>,
1142    /// Existing song arrangement to use. An unknown arrangement ID causes `422`.
1143    #[serde(rename = "arrangementId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1144    pub arrangement_id: Option<i64>,
1145    /// Allowed values: `song`.
1146    #[serde(deserialize_with = "crate::lenient::string")]
1147    pub r#type: String,
1148    /// Fields not described by the spec, e.g. instance-specific DB fields.
1149    #[serde(flatten)]
1150    pub extra: serde_json::Map<String, serde_json::Value>,
1151}
1152
1153#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1154pub struct AgendaItemInputText {
1155    /// Duration in seconds
1156    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1157    pub duration: Option<i64>,
1158    /// Responses represent a missing title as an empty string.
1159    ///
1160    /// `None` leaves the field out, `Some(None)` sends `null`.
1161    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1162    pub title: Option<Option<String>>,
1163    /// Note text.
1164    ///
1165    /// `None` leaves the field out, `Some(None)` sends `null`.
1166    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1167    pub note: Option<Option<String>>,
1168    /// Free text with optional service placeholders, such as \[Worship Leader\].
1169    ///
1170    /// `None` leaves the field out, `Some(None)` sends `null`.
1171    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1172    pub responsible: Option<Option<String>>,
1173    /// Notes to associate with service groups.
1174    #[serde(rename = "serviceGroupNotes", default, skip_serializing_if = "Option::is_none")]
1175    pub service_group_notes: Option<Vec<AgendaServiceGroupNoteCreate>>,
1176    /// Allowed values: `text`.
1177    #[serde(deserialize_with = "crate::lenient::string")]
1178    pub r#type: String,
1179    /// Fields not described by the spec, e.g. instance-specific DB fields.
1180    #[serde(flatten)]
1181    pub extra: serde_json::Map<String, serde_json::Value>,
1182}
1183
1184/// One entry in a complete replacement list. Each existing ID may occur only once. Array order determines the final item order.
1185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1186pub struct AgendaItemListUpdate {
1187    /// Existing item ID in this agenda. Unknown IDs, IDs from another agenda and repeated existing IDs cause `422`.
1188    ///
1189    /// `None` leaves the field out, `Some(None)` sends `null`.
1190    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1191    pub id: Option<Option<i64>>,
1192    /// Fields not described by the spec, e.g. instance-specific DB fields.
1193    #[serde(flatten)]
1194    pub extra: serde_json::Map<String, serde_json::Value>,
1195}
1196
1197/// Response fields shared by header, text and song items. Positions and timing are calculated by ChurchTools from the shared item order and the linked events.
1198#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1199pub struct AgendaItemSong {
1200    /// Compatibility marker included in each serialized agenda item.
1201    #[serde(rename = "@deprecated")]
1202    pub deprecated: AgendaItemTextDeprecated,
1203    /// Stored duration in seconds. For headers, zero selects `calculatedDuration` for display. Header duration is not added to the running time. An item hidden for an event does not consume time.
1204    #[serde(deserialize_with = "crate::lenient::number")]
1205    pub duration: i64,
1206    #[serde(deserialize_with = "crate::lenient::number")]
1207    pub id: i64,
1208    /// Whether the item precedes `eventStartPosition`. This is based on the shared item order, independently of visibility in a particular event.
1209    #[serde(rename = "isBeforeEvent")]
1210    pub is_before_event: bool,
1211    pub meta: MetaDataEntityId,
1212    /// Deprecated zero-based index in the complete shared items array, including headers and hidden items.
1213    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1214    #[deprecated = "deprecated in the ChurchTools API"]
1215    pub position: Option<i64>,
1216    /// Calculated position time for the requested event, or the first linked event when no event context is selected. Can still contain a time when the item is hidden; use `startTimes`\[`eventId`\] to determine visibility. `null` when there is no event timing, as for templates.
1217    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
1218    pub start: Option<chrono::DateTime<chrono::Utc>>,
1219    /// Calculated start times keyed by linked event ID, also for agendas with only one event. Null means the item is hidden for that event. Empty for an agenda without linked event timing, such as a template.
1220    #[serde(rename = "startTimes", deserialize_with = "crate::lenient::map")]
1221    pub start_times: std::collections::BTreeMap<String, Option<chrono::DateTime<chrono::Utc>>>,
1222    #[serde(deserialize_with = "crate::lenient::string")]
1223    pub title: String,
1224    #[serde(deserialize_with = "crate::lenient::string")]
1225    pub note: String,
1226    /// Raw responsibility text and optional resolved service assignments. `GET /events/{eventId}/agenda` resolves placeholders against that event; write responses do not perform this resolution and can return an empty persons array.
1227    pub responsible: AgendaResponsible,
1228    /// Notes for service groups. The event-agenda GET filters these to visible service groups; agenda write responses do not apply that filtering step.
1229    #[serde(rename = "serviceGroupNotes")]
1230    pub service_group_notes: Vec<AgendaServiceGroupNote>,
1231    /// The selected song arrangement, or `null` if no arrangement is assigned. `text` and `header` items do not include this field.
1232    #[serde(default, skip_serializing_if = "Option::is_none")]
1233    pub song: Option<AgendaItemSongArrangement>,
1234    /// Allowed values: `song`.
1235    #[serde(deserialize_with = "crate::lenient::string")]
1236    pub r#type: String,
1237    /// Fields not described by the spec, e.g. instance-specific DB fields.
1238    #[serde(flatten)]
1239    pub extra: serde_json::Map<String, serde_json::Value>,
1240}
1241
1242/// Selected arrangement of a song for this agenda item. A song can have multiple arrangements with different musical settings.
1243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1244pub struct AgendaItemSongArrangement {
1245    #[serde(deserialize_with = "crate::lenient::string")]
1246    pub arrangement: String,
1247    #[serde(rename = "arrangementId", deserialize_with = "crate::lenient::number")]
1248    pub arrangement_id: i64,
1249    /// Stored tempo in beats per minute, or `null`.
1250    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1251    pub bpm: Option<i64>,
1252    #[serde(deserialize_with = "crate::lenient::string")]
1253    pub category: String,
1254    #[serde(rename = "isDefault")]
1255    pub is_default: bool,
1256    /// Stored musical key as free text, or `null`. Values are not restricted to a fixed enum.
1257    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1258    pub key: Option<String>,
1259    #[serde(rename = "songId", deserialize_with = "crate::lenient::number")]
1260    pub song_id: i64,
1261    #[serde(deserialize_with = "crate::lenient::string")]
1262    pub title: String,
1263    /// Fields not described by the spec, e.g. instance-specific DB fields.
1264    #[serde(flatten)]
1265    pub extra: serde_json::Map<String, serde_json::Value>,
1266}
1267
1268/// Response fields shared by header, text and song items. Positions and timing are calculated by ChurchTools from the shared item order and the linked events.
1269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1270pub struct AgendaItemText {
1271    /// Compatibility marker included in each serialized agenda item.
1272    #[serde(rename = "@deprecated")]
1273    pub deprecated: AgendaItemTextDeprecated,
1274    /// Stored duration in seconds. For headers, zero selects `calculatedDuration` for display. Header duration is not added to the running time. An item hidden for an event does not consume time.
1275    #[serde(deserialize_with = "crate::lenient::number")]
1276    pub duration: i64,
1277    #[serde(deserialize_with = "crate::lenient::number")]
1278    pub id: i64,
1279    /// Whether the item precedes `eventStartPosition`. This is based on the shared item order, independently of visibility in a particular event.
1280    #[serde(rename = "isBeforeEvent")]
1281    pub is_before_event: bool,
1282    pub meta: MetaDataEntityId,
1283    /// Deprecated zero-based index in the complete shared items array, including headers and hidden items.
1284    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1285    #[deprecated = "deprecated in the ChurchTools API"]
1286    pub position: Option<i64>,
1287    /// Calculated position time for the requested event, or the first linked event when no event context is selected. Can still contain a time when the item is hidden; use `startTimes`\[`eventId`\] to determine visibility. `null` when there is no event timing, as for templates.
1288    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
1289    pub start: Option<chrono::DateTime<chrono::Utc>>,
1290    /// Calculated start times keyed by linked event ID, also for agendas with only one event. Null means the item is hidden for that event. Empty for an agenda without linked event timing, such as a template.
1291    #[serde(rename = "startTimes", deserialize_with = "crate::lenient::map")]
1292    pub start_times: std::collections::BTreeMap<String, Option<chrono::DateTime<chrono::Utc>>>,
1293    #[serde(deserialize_with = "crate::lenient::string")]
1294    pub title: String,
1295    #[serde(deserialize_with = "crate::lenient::string")]
1296    pub note: String,
1297    /// Raw responsibility text and optional resolved service assignments. `GET /events/{eventId}/agenda` resolves placeholders against that event; write responses do not perform this resolution and can return an empty persons array.
1298    pub responsible: AgendaResponsible,
1299    /// Notes for service groups. The event-agenda GET filters these to visible service groups; agenda write responses do not apply that filtering step.
1300    #[serde(rename = "serviceGroupNotes")]
1301    pub service_group_notes: Vec<AgendaServiceGroupNote>,
1302    /// Allowed values: `text`.
1303    #[serde(deserialize_with = "crate::lenient::string")]
1304    pub r#type: String,
1305    /// Fields not described by the spec, e.g. instance-specific DB fields.
1306    #[serde(flatten)]
1307    pub extra: serde_json::Map<String, serde_json::Value>,
1308}
1309
1310/// Compatibility marker included in each serialized agenda item.
1311#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1312pub struct AgendaItemTextDeprecated {
1313    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
1314    pub position: serde_json::Value,
1315    /// Fields not described by the spec, e.g. instance-specific DB fields.
1316    #[serde(flatten)]
1317    pub extra: serde_json::Map<String, serde_json::Value>,
1318}
1319
1320/// Legacy agenda-email request. Prefer `POST /events/send` with EventMailCreate.
1321#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1322pub struct AgendaMailCreate {
1323    /// HTML email body. ChurchTools appends buttons for all supplied events and any requested, available agenda and file links.
1324    #[serde(deserialize_with = "crate::lenient::string")]
1325    pub body: String,
1326    /// Events used to resolve participating recipients and message links. Every supplied event must exist. Events are not required to share an agenda.
1327    #[serde(rename = "eventIds")]
1328    pub event_ids: Vec<i64>,
1329    /// Selected person IDs. Only selected participants in visible service groups of the loaded events, or selected people the sender may otherwise view, receive the message. The response reports other IDs as rejected. Participants are not added automatically.
1330    pub recipients: Vec<i64>,
1331    /// Also include the currently logged-in person as a recipient, even if their ID is absent from recipients.
1332    #[serde(rename = "sendCopyToMe", default, skip_serializing_if = "Option::is_none")]
1333    pub send_copy_to_me: Option<bool>,
1334    /// Email subject.
1335    #[serde(deserialize_with = "crate::lenient::string")]
1336    pub subject: String,
1337    /// Append links for supplied events that have an agenda and for whose calendar the sender has "view agenda" permission.
1338    #[serde(rename = "appendAgendaButton", default, skip_serializing_if = "Option::is_none")]
1339    pub append_agenda_button: Option<bool>,
1340    /// File IDs to list as links in the message body. Only files associated with one of the supplied events are used. These are links, not binary email attachments.
1341    #[serde(default, skip_serializing_if = "Option::is_none")]
1342    pub files: Option<Vec<i64>>,
1343    /// Fields not described by the spec, e.g. instance-specific DB fields.
1344    #[serde(flatten)]
1345    pub extra: serde_json::Map<String, serde_json::Value>,
1346}
1347
1348/// Raw responsibility text and optional resolved service assignments. `GET /events/{eventId}/agenda` resolves placeholders against that event; write responses do not perform this resolution and can return an empty persons array.
1349#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1350pub struct AgendaResponsible {
1351    /// Assignments resolved from bracketed service names. Multiple slots can produce several entries for one placeholder. An unknown or unassigned service can produce a `null` person. An empty array can mean that this endpoint did not resolve responsibilities.
1352    pub persons: Vec<AgendaResponsiblePerson>,
1353    /// Free text with optional service-name placeholders in square brackets, for example \[Leader\]. The text is returned unchanged; persons contains separately resolved assignments.
1354    #[serde(deserialize_with = "crate::lenient::string")]
1355    pub text: String,
1356    /// Fields not described by the spec, e.g. instance-specific DB fields.
1357    #[serde(flatten)]
1358    pub extra: serde_json::Map<String, serde_json::Value>,
1359}
1360
1361#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1362pub struct AgendaResponsiblePerson {
1363    /// Flag to indicate if the person has accepted the service or is requested.
1364    pub accepted: bool,
1365    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
1366    pub person: serde_json::Value,
1367    /// Service placeholder including square brackets, for example \[Leader\]. If no matching assignment was found, a question mark is appended, for example \[Leader\]?. Service names are configurable and are not an enum.
1368    #[serde(deserialize_with = "crate::lenient::string")]
1369    pub service: String,
1370    /// Fields not described by the spec, e.g. instance-specific DB fields.
1371    #[serde(flatten)]
1372    pub extra: serde_json::Map<String, serde_json::Value>,
1373}
1374
1375/// Note intended for one service group, such as sound or music.
1376#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1377pub struct AgendaServiceGroupNote {
1378    #[serde(deserialize_with = "crate::lenient::string")]
1379    pub note: String,
1380    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
1381    pub service_group_id: i64,
1382    /// Fields not described by the spec, e.g. instance-specific DB fields.
1383    #[serde(flatten)]
1384    pub extra: serde_json::Map<String, serde_json::Value>,
1385}
1386
1387#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1388pub struct AgendaServiceGroupNoteCreate {
1389    /// The note text for the service group
1390    #[serde(deserialize_with = "crate::lenient::string")]
1391    pub note: String,
1392    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
1393    pub service_group_id: i64,
1394    /// Fields not described by the spec, e.g. instance-specific DB fields.
1395    #[serde(flatten)]
1396    pub extra: serde_json::Map<String, serde_json::Value>,
1397}
1398
1399/// Update or remove the note for the service group in the path. Other service-group notes on the item remain unchanged.
1400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1401pub struct AgendaServiceGroupNoteUpdate {
1402    /// Note text for the service group.
1403    ///
1404    /// `None` leaves the field out, `Some(None)` sends `null`.
1405    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1406    pub note: Option<Option<String>>,
1407    /// Fields not described by the spec, e.g. instance-specific DB fields.
1408    #[serde(flatten)]
1409    pub extra: serde_json::Map<String, serde_json::Value>,
1410}
1411
1412/// Reusable running-plan template. Items use the same header, text and song types as event agendas. Templates have no event date; copying one into an event creates independent agenda items.
1413#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1414pub struct AgendaTemplateCreate {
1415    /// Calendar that determines template visibility and editing permissions.
1416    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
1417    pub calendar_id: i64,
1418    /// Zero-based index in the complete item list where the event begins when this template is copied.
1419    #[serde(rename = "eventStartPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1420    pub event_start_position: Option<i64>,
1421    /// Initial template items in their intended order. Items are not linked to any event.
1422    #[serde(default, skip_serializing_if = "Option::is_none")]
1423    pub items: Option<Vec<serde_json::Value>>,
1424    /// Template name.
1425    #[serde(deserialize_with = "crate::lenient::string")]
1426    pub name: String,
1427    /// Optional free-text series name.
1428    ///
1429    /// `None` leaves the field out, `Some(None)` sends `null`.
1430    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1431    pub series: Option<Option<String>>,
1432    /// Fields not described by the spec, e.g. instance-specific DB fields.
1433    #[serde(flatten)]
1434    pub extra: serde_json::Map<String, serde_json::Value>,
1435}
1436
1437/// Update an existing template. The optional items array replaces the complete list.
1438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1439pub struct AgendaTemplateUpdate {
1440    /// Calendar that determines template visibility and editing permissions.
1441    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
1442    pub calendar_id: i64,
1443    /// Zero-based index in the complete item list where the event begins when this template is copied.
1444    #[serde(rename = "eventStartPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1445    pub event_start_position: Option<i64>,
1446    /// Complete replacement list in the intended order. An empty array deletes all items.
1447    #[serde(default, skip_serializing_if = "Option::is_none")]
1448    pub items: Option<Vec<AgendaItemListUpdate>>,
1449    /// Template name.
1450    #[serde(deserialize_with = "crate::lenient::string")]
1451    pub name: String,
1452    /// Optional free-text series name.
1453    ///
1454    /// `None` leaves the field out, `Some(None)` sends `null`.
1455    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1456    pub series: Option<Option<String>>,
1457    /// Fields not described by the spec, e.g. instance-specific DB fields.
1458    #[serde(flatten)]
1459    pub extra: serde_json::Map<String, serde_json::Value>,
1460}
1461
1462/// Fields accepted when updating an existing event agenda or copying an agenda. The optional items array replaces the complete item list.
1463#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1464pub struct AgendaUpdate {
1465    /// Calendar assigned to this agenda. It is not automatically taken from the event.
1466    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1467    pub calendar_id: Option<i64>,
1468    /// Zero-based index in the complete items array where the event begins, including headers and hidden items.
1469    #[serde(rename = "eventStartPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1470    pub event_start_position: Option<i64>,
1471    /// Complete replacement list in the intended order. Existing IDs retain and update those items; entries without IDs create new ones. An empty array deletes all items. Cannot be combined with either copy-source query parameter.
1472    #[serde(default, skip_serializing_if = "Option::is_none")]
1473    pub items: Option<Vec<AgendaItemListUpdate>>,
1474    /// Free-text series name.
1475    ///
1476    /// `None` leaves the field out, `Some(None)` sends `null`.
1477    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1478    pub series: Option<Option<String>>,
1479    /// Fields not described by the spec, e.g. instance-specific DB fields.
1480    #[serde(flatten)]
1481    pub extra: serde_json::Map<String, serde_json::Value>,
1482}
1483
1484/// An additional occurrence on a calendar date, using the base appointment’s local start time and duration. With isRepeated=true, the recurrence rule also runs from this additional date, for example to add a second weekday to a weekly series.
1485#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1486pub struct AppointmentAdditionalCreate {
1487    /// A simple date in ISO format, e.g. '2022-10-19'
1488    pub date: chrono::NaiveDate,
1489    #[serde(rename = "isRepeated")]
1490    pub is_repeated: bool,
1491    /// Fields not described by the spec, e.g. instance-specific DB fields.
1492    #[serde(flatten)]
1493    pub extra: serde_json::Map<String, serde_json::Value>,
1494}
1495
1496/// Stored additional date for a series.
1497#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1498pub struct AppointmentAdditionals {
1499    /// A simple date in ISO format, e.g. '2022-10-19'
1500    pub date: chrono::NaiveDate,
1501    #[serde(rename = "isRepeated")]
1502    pub is_repeated: bool,
1503    /// ID of the stored recurrence entry.
1504    #[serde(deserialize_with = "crate::lenient::number")]
1505    pub id: i64,
1506    pub meta: MetaDataEntityId,
1507    /// Fields not described by the spec, e.g. instance-specific DB fields.
1508    #[serde(flatten)]
1509    pub extra: serde_json::Map<String, serde_json::Value>,
1510}
1511
1512/// Location entered with an appointment.
1513#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1514pub struct AppointmentAddressCreate {
1515    /// `None` leaves the field out, `Some(None)` sends `null`.
1516    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1517    pub addition: Option<Option<String>>,
1518    /// `None` leaves the field out, `Some(None)` sends `null`.
1519    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1520    pub city: Option<Option<String>>,
1521    /// A country's ISO-code
1522    ///
1523    /// `None` leaves the field out, `Some(None)` sends `null`.
1524    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1525    pub country: Option<Option<String>>,
1526    /// `None` leaves the field out, `Some(None)` sends `null`.
1527    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1528    pub district: Option<Option<String>>,
1529    /// Latitude of the appointment location.
1530    ///
1531    /// `None` leaves the field out, `Some(None)` sends `null`.
1532    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1533    pub latitude: Option<Option<f64>>,
1534    /// Longitude of the appointment location.
1535    ///
1536    /// `None` leaves the field out, `Some(None)` sends `null`.
1537    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1538    pub longitude: Option<Option<f64>>,
1539    /// Legacy alias for name.
1540    ///
1541    /// `None` leaves the field out, `Some(None)` sends `null`.
1542    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1543    #[deprecated = "deprecated in the ChurchTools API"]
1544    pub meeting_at: Option<Option<String>>,
1545    /// `None` leaves the field out, `Some(None)` sends `null`.
1546    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1547    pub name: Option<Option<String>>,
1548    /// `None` leaves the field out, `Some(None)` sends `null`.
1549    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1550    pub street: Option<Option<String>>,
1551    /// `None` leaves the field out, `Some(None)` sends `null`.
1552    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1553    pub zip: Option<Option<String>>,
1554    /// Fields not described by the spec, e.g. instance-specific DB fields.
1555    #[serde(flatten)]
1556    pub extra: serde_json::Map<String, serde_json::Value>,
1557}
1558
1559/// Stored calendar appointment defining a single occurrence or a series. id identifies the whole stored appointment; pair it with a local occurrence start date to address a particular occurrence. startDate/endDate are the base occurrence, not necessarily the occurrence currently being displayed. Service-planning events, registration groups, bookings and meeting requests are separate linked resources.
1560#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1561pub struct AppointmentBase {
1562    pub additionals: Vec<AppointmentAdditionals>,
1563    /// Use 'additionals' instead
1564    #[serde(default, skip_serializing_if = "Option::is_none")]
1565    #[deprecated = "Use 'additionals' instead"]
1566    pub additions: Option<Vec<AppointmentAdditionals>>,
1567    #[serde(default, skip_serializing_if = "Option::is_none")]
1568    pub address: Option<Address>,
1569    /// True when the appointment is all-day. The serialized endDate is inclusive.
1570    #[serde(rename = "allDay")]
1571    pub all_day: bool,
1572    /// Calendar containing the appointment.
1573    pub calendar: AppointmentBaseCalendar,
1574    /// Use 'title' instead
1575    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1576    #[deprecated = "Use 'title' instead"]
1577    pub caption: Option<String>,
1578    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1579    pub description: Option<String>,
1580    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
1581    #[serde(rename = "endDate")]
1582    pub end_date: crate::DateOrDateTime,
1583    pub exceptions: Vec<AppointmentExeptions>,
1584    /// ID of the stored appointment or series.
1585    #[serde(deserialize_with = "crate::lenient::number")]
1586    pub id: i64,
1587    #[serde(default, skip_serializing_if = "Option::is_none")]
1588    pub image: Option<Image>,
1589    /// Use 'description' instead
1590    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1591    #[deprecated = "Use 'description' instead"]
1592    pub information: Option<String>,
1593    #[serde(rename = "isInternal")]
1594    pub is_internal: bool,
1595    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1596    pub link: Option<String>,
1597    pub meta: MetaDataEntityId,
1598    /// Use 'subtitle' instead
1599    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1600    #[deprecated = "Use 'subtitle' instead"]
1601    pub note: Option<String>,
1602    /// Person on whose behalf the appointment was entered, or null.
1603    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1604    pub on_behalf_of_pid: Option<i64>,
1605    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
1606    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1607    pub repeat_frequency: Option<i64>,
1608    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
1609    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
1610    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
1611    pub repeat_id: i64,
1612    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
1613    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1614    pub repeat_option: Option<i64>,
1615    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
1616    #[serde(rename = "repeatUntil", default, skip_serializing_if = "Option::is_none")]
1617    pub repeat_until: Option<chrono::NaiveDate>,
1618    /// Registration-group configuration, or null if the appointment has none.
1619    #[serde(default, skip_serializing_if = "Option::is_none")]
1620    pub signup: Option<AppointmentSignup>,
1621    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
1622    #[serde(rename = "startDate")]
1623    pub start_date: crate::DateOrDateTime,
1624    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1625    pub subtitle: Option<String>,
1626    #[serde(deserialize_with = "crate::lenient::string")]
1627    pub title: String,
1628    /// Revision counter increased by updates; not an input precondition or a per-occurrence ID.
1629    #[serde(deserialize_with = "crate::lenient::number")]
1630    pub version: i64,
1631    /// Fields not described by the spec, e.g. instance-specific DB fields.
1632    #[serde(flatten)]
1633    pub extra: serde_json::Map<String, serde_json::Value>,
1634}
1635
1636/// Calendar containing the appointment.
1637#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1638pub struct AppointmentBaseCalendar {
1639    /// Campus associated with this calendar, or null for no campus. A campus represents a ChurchTools location/site, not a calendar permission group.
1640    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1641    pub campus_id: Option<i64>,
1642    /// Display color, normally a CSS hex color such as #336699.
1643    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1644    pub color: Option<String>,
1645    /// Event type ID used by the Evangelische Termine integration, or null. This is an external event classification, not a ChurchTools calendar type.
1646    #[serde(rename = "evTermineEventTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1647    pub ev_termine_event_type_id: Option<i64>,
1648    /// Configured service-planning event template ID for this calendar, or null. This differs from an appointment template.
1649    #[serde(rename = "eventTemplateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1650    pub event_template_id: Option<i64>,
1651    /// External iCalendar feed to import. webcal:// and ical:// are normalized to https://; addresses without a scheme receive https://.
1652    #[serde(rename = "iCalSourceUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1653    pub i_cal_source_url: Option<String>,
1654    /// Calendar display name.
1655    #[serde(deserialize_with = "crate::lenient::string")]
1656    pub name: String,
1657    /// Display order. The calendar list is sorted by this value in ascending order.
1658    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
1659    pub sort_key: i64,
1660    /// Whether the Evangelische Termine integration should synchronize this calendar. This is separate from importing an iCalendar feed.
1661    #[serde(rename = "syncToEvTermine")]
1662    pub sync_to_ev_termine: bool,
1663    /// Calendar category used by ChurchTools: church for a church calendar, group for a group calendar, personal for a personal calendar. The category determines which administration permissions apply; it does not by itself grant public access or link the calendar to a particular group or person. Access is controlled separately. The type is chosen on creation and cannot be changed by PUT.
1664    /// Allowed values: `church`, `group`, `personal`.
1665    #[serde(deserialize_with = "crate::lenient::string")]
1666    pub r#type: String,
1667    /// Legacy response metadata mapping isPublic and isPrivate to type.
1668    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
1669    pub deprecated: std::collections::BTreeMap<String, String>,
1670    /// Calendar ID used in /calendars/{calendarId} and appointment URLs.
1671    #[serde(deserialize_with = "crate::lenient::number")]
1672    pub id: i64,
1673    /// Legacy category flag: true for personal calendars. Use type instead.
1674    #[serde(rename = "isPrivate", default, skip_serializing_if = "Option::is_none")]
1675    #[deprecated = "Use type instead."]
1676    pub is_private: Option<bool>,
1677    /// Legacy category flag: true for church calendars. Use type; this flag does not replace access-permission checks.
1678    #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")]
1679    #[deprecated = "Use type; this flag does not replace access-permission checks."]
1680    pub is_public: Option<bool>,
1681    pub meta: MetaDataEntityId,
1682    /// Localized display name, falling back to the stored name for ordinary calendar names.
1683    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
1684    pub name_translated: String,
1685    /// Generated token used by calendar subscription/export links. This is not a complete URL and is not the external import source address.
1686    #[serde(rename = "randomUrl", deserialize_with = "crate::lenient::string")]
1687    pub random_url: String,
1688    /// Fields not described by the spec, e.g. instance-specific DB fields.
1689    #[serde(flatten)]
1690    pub extra: serde_json::Map<String, serde_json::Value>,
1691}
1692
1693#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1694pub struct AppointmentBooking {
1695    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1696    pub id: Option<i64>,
1697    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1698    pub minpost: Option<String>,
1699    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1700    pub minpre: Option<String>,
1701    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1702    pub resource_id: Option<String>,
1703    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1704    pub status_id: Option<i64>,
1705    /// Fields not described by the spec, e.g. instance-specific DB fields.
1706    #[serde(flatten)]
1707    pub extra: serde_json::Map<String, serde_json::Value>,
1708}
1709
1710/// A reported conflict involving a resource reservation. base and conflict describe booking occurrences and may be null.
1711#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1712pub struct AppointmentBookingChangeImpact {
1713    #[serde(default, skip_serializing_if = "Option::is_none")]
1714    pub base: Option<AppointmentBookingImpactOccurrence>,
1715    #[serde(default, skip_serializing_if = "Option::is_none")]
1716    pub conflict: Option<AppointmentBookingImpactOccurrence>,
1717    /// Allowed values: `booking`.
1718    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
1719    pub domain_type: String,
1720    /// An individual bookable resource, such as a room, vehicle or item of equipment. A resource type groups similar resources. Bookings reserve this resource for specific dates.
1721    pub resource: Resource,
1722    /// Allowed values: `conflict`.
1723    #[serde(deserialize_with = "crate::lenient::string")]
1724    pub r#type: String,
1725    /// Fields not described by the spec, e.g. instance-specific DB fields.
1726    #[serde(flatten)]
1727    pub extra: serde_json::Map<String, serde_json::Value>,
1728}
1729
1730/// Book one resource for the appointment and its recurrence pattern. leadTimeMinutes and afterwardMinutes extend the resource reservation around each occurrence.
1731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1732pub struct AppointmentBookingCreate {
1733    /// Minutes after the appointment during which the resource is blocked.
1734    #[serde(rename = "afterwardMinutes", deserialize_with = "crate::lenient::number")]
1735    pub afterward_minutes: i64,
1736    /// Minutes before the appointment during which the resource is blocked.
1737    #[serde(rename = "leadTimeMinutes", deserialize_with = "crate::lenient::number")]
1738    pub lead_time_minutes: i64,
1739    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1740    pub quantity: Option<i64>,
1741    /// ID of the resource to reserve; use each resource only once.
1742    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
1743    pub resource_id: i64,
1744    /// Resource booking state: 1 = pending, 2 = approved, 3 = rejected. The requested state is subject to booking permissions.
1745    /// Allowed values: `1`, `2`, `3`.
1746    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
1747    pub status_id: i64,
1748    /// Fields not described by the spec, e.g. instance-specific DB fields.
1749    #[serde(flatten)]
1750    pub extra: serde_json::Map<String, serde_json::Value>,
1751}
1752
1753#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1754pub struct AppointmentBookingImpactOccurrence {
1755    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
1756    #[serde(rename = "endDate", serialize_with = "crate::datetime::serialize_utc")]
1757    pub end_date: chrono::DateTime<chrono::Utc>,
1758    /// Booking ID.
1759    #[serde(deserialize_with = "crate::lenient::number")]
1760    pub id: i64,
1761    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
1762    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
1763    pub start_date: chrono::DateTime<chrono::Utc>,
1764    /// Fields not described by the spec, e.g. instance-specific DB fields.
1765    #[serde(flatten)]
1766    pub extra: serde_json::Map<String, serde_json::Value>,
1767}
1768
1769/// A stored appointment plus all calculated occurrence dates keyed by local YYYY-MM-DD. Unlike occurrence endpoints, dates inside calculatedDates are always UTC timestamps, including all-day appointments. Optional enrichments are attached to their occurrence; tags are returned in additionalInfos.
1770#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1771pub struct AppointmentCalculated {
1772    /// Series-level enrichments, currently tags when requested.
1773    #[serde(rename = "additionalInfos", default, skip_serializing_if = "serde_json::Value::is_null")]
1774    pub additional_infos: serde_json::Value,
1775    /// Stored calendar appointment defining a single occurrence or a series. id identifies the whole stored appointment; pair it with a local occurrence start date to address a particular occurrence. startDate/endDate are the base occurrence, not necessarily the occurrence currently being displayed. Service-planning events, registration groups, bookings and meeting requests are separate linked resources.
1776    pub appointment: AppointmentBase,
1777    /// Occurrences keyed by their local start date.
1778    #[serde(rename = "calculatedDates", default, skip_serializing_if = "serde_json::Value::is_null")]
1779    pub calculated_dates: serde_json::Value,
1780    /// Fields not described by the spec, e.g. instance-specific DB fields.
1781    #[serde(flatten)]
1782    pub extra: serde_json::Map<String, serde_json::Value>,
1783}
1784
1785#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1786pub struct AppointmentCalculatedCalculatedDatesVariant1Value {
1787    #[serde(default, skip_serializing_if = "Option::is_none")]
1788    pub bookings: Option<Vec<BookingCalculated>>,
1789    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
1790    #[serde(rename = "endDate", serialize_with = "crate::datetime::serialize_utc")]
1791    pub end_date: chrono::DateTime<chrono::Utc>,
1792    /// Event as Domain Object
1793    #[serde(default, skip_serializing_if = "Option::is_none")]
1794    pub event: Option<DomainObjectEvent>,
1795    #[serde(default, skip_serializing_if = "Option::is_none")]
1796    pub group: Option<DomainObjectGroup>,
1797    #[serde(rename = "iCalUid", deserialize_with = "crate::lenient::string")]
1798    pub i_cal_uid: String,
1799    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
1800    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
1801    pub start_date: chrono::DateTime<chrono::Utc>,
1802    #[serde(rename = "titleSuffix", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1803    pub title_suffix: Option<String>,
1804    /// Fields not described by the spec, e.g. instance-specific DB fields.
1805    #[serde(flatten)]
1806    pub extra: serde_json::Map<String, serde_json::Value>,
1807}
1808
1809/// Proposed schedule to inspect without saving the appointment. This endpoint reports supported impacts, not a complete validation of an update.
1810#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1811pub struct AppointmentChangeImpactCreate {
1812    #[serde(default, skip_serializing_if = "Option::is_none")]
1813    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
1814    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
1815    #[serde(rename = "endDate")]
1816    pub end_date: crate::DateOrDateTime,
1817    #[serde(default, skip_serializing_if = "Option::is_none")]
1818    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
1819    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
1820    ///
1821    /// `None` leaves the field out, `Some(None)` sends `null`.
1822    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1823    pub repeat_frequency: Option<Option<i64>>,
1824    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
1825    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
1826    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1827    pub repeat_id: Option<i64>,
1828    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
1829    ///
1830    /// `None` leaves the field out, `Some(None)` sends `null`.
1831    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1832    pub repeat_option: Option<Option<i64>>,
1833    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
1834    ///
1835    /// `None` leaves the field out, `Some(None)` sends `null`.
1836    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1837    pub repeat_until: Option<Option<chrono::NaiveDate>>,
1838    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
1839    #[serde(rename = "startDate")]
1840    pub start_date: crate::DateOrDateTime,
1841    /// Optional local date at which the series would be split.
1842    ///
1843    /// `None` leaves the field out, `Some(None)` sends `null`.
1844    #[serde(rename = "splitDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1845    pub split_date: Option<Option<chrono::NaiveDate>>,
1846    /// When splitting, use true for this and future occurrences or false for this occurrence only.
1847    ///
1848    /// `None` leaves the field out, `Some(None)` sends `null`.
1849    #[serde(rename = "splitUntilEnd", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1850    pub split_until_end: Option<Option<bool>>,
1851    /// Fields not described by the spec, e.g. instance-specific DB fields.
1852    #[serde(flatten)]
1853    pub extra: serde_json::Map<String, serde_json::Value>,
1854}
1855
1856/// Create the base appointment and optional linked resources in the calendar selected by the path.
1857#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1858pub struct AppointmentCreate {
1859    #[serde(default, skip_serializing_if = "Option::is_none")]
1860    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
1861    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
1862    #[serde(rename = "endDate")]
1863    pub end_date: crate::DateOrDateTime,
1864    #[serde(default, skip_serializing_if = "Option::is_none")]
1865    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
1866    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
1867    ///
1868    /// `None` leaves the field out, `Some(None)` sends `null`.
1869    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1870    pub repeat_frequency: Option<Option<i64>>,
1871    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
1872    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
1873    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1874    pub repeat_id: Option<i64>,
1875    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
1876    ///
1877    /// `None` leaves the field out, `Some(None)` sends `null`.
1878    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1879    pub repeat_option: Option<Option<i64>>,
1880    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
1881    ///
1882    /// `None` leaves the field out, `Some(None)` sends `null`.
1883    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1884    pub repeat_until: Option<Option<chrono::NaiveDate>>,
1885    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
1886    #[serde(rename = "startDate")]
1887    pub start_date: crate::DateOrDateTime,
1888    /// Location entered with an appointment.
1889    #[serde(default, skip_serializing_if = "Option::is_none")]
1890    pub address: Option<AppointmentAddressCreate>,
1891    /// Resource reservations matched by resourceId.
1892    #[serde(default, skip_serializing_if = "Option::is_none")]
1893    pub bookings: Option<Vec<AppointmentBookingCreate>>,
1894    /// Description of the appointment.
1895    ///
1896    /// `None` leaves the field out, `Some(None)` sends `null`.
1897    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1898    pub description: Option<Option<String>>,
1899    /// Only new service-planning events to create. Existing linked events are updated separately when the appointment changes; events no longer matching the series may be deleted.
1900    #[serde(default, skip_serializing_if = "Option::is_none")]
1901    pub events: Option<Vec<AppointmentEventCreate>>,
1902    /// Send an information email to the person on whose behalf the appointment is managed, or its original creator. The workflow skips inactive recipients, the acting user and changes without notable differences.
1903    #[serde(rename = "informOwner", default, skip_serializing_if = "Option::is_none")]
1904    pub inform_owner: Option<bool>,
1905    /// Set `false` for a regular appointment. Use `true` only when the appointment is intended to be visible exclusively to signed-in users.
1906    #[serde(rename = "isInternal")]
1907    pub is_internal: bool,
1908    /// `None` leaves the field out, `Some(None)` sends `null`.
1909    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1910    pub link: Option<Option<String>>,
1911    /// Invitees for the appointment or series. The field name is lowercase.
1912    #[serde(default, skip_serializing_if = "Option::is_none")]
1913    pub meetingrequests: Option<Vec<MeetingRequestCreate>>,
1914    /// Person ID on whose behalf the appointment is created. This person is also used as inviter for meeting requests.
1915    ///
1916    /// `None` leaves the field out, `Some(None)` sends `null`.
1917    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1918    pub on_behalf_of_pid: Option<Option<i64>>,
1919    /// Configure groups used to collect registrations for individual appointment occurrences. These are separate ChurchTools groups, not meeting invitations or service-planning events.
1920    #[serde(default, skip_serializing_if = "Option::is_none")]
1921    pub signup: Option<AppointmentSignupCreate>,
1922    /// `None` leaves the field out, `Some(None)` sends `null`.
1923    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1924    pub subtitle: Option<Option<String>>,
1925    /// Appointment tags to add, as IDs, names or objects containing id.
1926    #[serde(default, skip_serializing_if = "Option::is_none")]
1927    pub tags: Option<Vec<serde_json::Value>>,
1928    #[serde(deserialize_with = "crate::lenient::string")]
1929    pub title: String,
1930    /// Fields not described by the spec, e.g. instance-specific DB fields.
1931    #[serde(flatten)]
1932    pub extra: serde_json::Map<String, serde_json::Value>,
1933}
1934
1935#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1936pub struct AppointmentEvent {
1937    #[serde(rename = "eventTemplate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
1938    pub event_template: Option<String>,
1939    /// Fields not described by the spec, e.g. instance-specific DB fields.
1940    #[serde(flatten)]
1941    pub extra: serde_json::Map<String, serde_json::Value>,
1942}
1943
1944/// An existing service-planning event would no longer match the resulting series.
1945#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1946pub struct AppointmentEventChangeImpact {
1947    /// Allowed values: `event`.
1948    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
1949    pub domain_type: String,
1950    pub event: AppointmentEventChangeImpactEvent,
1951    /// Allowed values: `deletion`.
1952    #[serde(deserialize_with = "crate::lenient::string")]
1953    pub r#type: String,
1954    /// Fields not described by the spec, e.g. instance-specific DB fields.
1955    #[serde(flatten)]
1956    pub extra: serde_json::Map<String, serde_json::Value>,
1957}
1958
1959#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1960pub struct AppointmentEventChangeImpactEvent {
1961    #[serde(deserialize_with = "crate::lenient::string")]
1962    pub guid: String,
1963    #[serde(deserialize_with = "crate::lenient::number")]
1964    pub id: i64,
1965    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
1966    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
1967    pub start_date: chrono::DateTime<chrono::Utc>,
1968    /// Fields not described by the spec, e.g. instance-specific DB fields.
1969    #[serde(flatten)]
1970    pub extra: serde_json::Map<String, serde_json::Value>,
1971}
1972
1973/// Create a service-planning event for one occurrence. This is a separate ChurchTools resource linked to the calendar appointment; existing events must not be submitted again.
1974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1975pub struct AppointmentEventCreate {
1976    /// Person IDs of the event administrators.
1977    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
1978    pub admin_ids: Option<Vec<i64>>,
1979    /// `None` leaves the field out, `Some(None)` sends `null`.
1980    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1981    pub description: Option<Option<String>>,
1982    /// Optional service-planning event template to apply.
1983    #[serde(rename = "eventTemplateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
1984    pub event_template_id: Option<i64>,
1985    /// Event fact values keyed by configured fact ID. Allowed values depend on the fact’s number or select type.
1986    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
1987    pub facts: Option<std::collections::BTreeMap<String, serde_json::Value>>,
1988    /// Use `description` instead.
1989    ///
1990    /// `None` leaves the field out, `Some(None)` sends `null`.
1991    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
1992    #[deprecated = "Use `description` instead."]
1993    pub note: Option<Option<String>>,
1994    #[serde(default, skip_serializing_if = "Option::is_none")]
1995    pub services: Option<Vec<AppointmentEventCreateServicesItem>>,
1996    /// Exact UTC start of an occurrence in the resulting appointment; seconds are discarded. A duplicate event or a date outside the series produces 422.
1997    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
1998    pub start_date: chrono::DateTime<chrono::Utc>,
1999    /// Fields not described by the spec, e.g. instance-specific DB fields.
2000    #[serde(flatten)]
2001    pub extra: serde_json::Map<String, serde_json::Value>,
2002}
2003
2004#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2005pub struct AppointmentEventCreateServicesItem {
2006    #[serde(deserialize_with = "crate::lenient::number")]
2007    pub count: i64,
2008    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
2009    pub service_id: i64,
2010    /// Fields not described by the spec, e.g. instance-specific DB fields.
2011    #[serde(flatten)]
2012    pub extra: serde_json::Map<String, serde_json::Value>,
2013}
2014
2015/// An accepted service assignment associated with the appointment. The calculator reports these as move impacts; this is not a detailed before/after diff.
2016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2017pub struct AppointmentEventServiceChangeImpact {
2018    /// Allowed values: `eventService`.
2019    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
2020    pub domain_type: String,
2021    #[serde(rename = "eventService")]
2022    pub event_service: EventService,
2023    /// Start of the assignment’s current event.
2024    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
2025    pub start_date: chrono::DateTime<chrono::Utc>,
2026    /// Allowed values: `move`.
2027    #[serde(deserialize_with = "crate::lenient::string")]
2028    pub r#type: String,
2029    /// Fields not described by the spec, e.g. instance-specific DB fields.
2030    #[serde(flatten)]
2031    pub extra: serde_json::Map<String, serde_json::Value>,
2032}
2033
2034/// Exclude occurrences starting on this local calendar date, including matches generated from additionals.
2035#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2036pub struct AppointmentExceptionCreate {
2037    /// A simple date in ISO format, e.g. '2022-10-19'
2038    pub date: chrono::NaiveDate,
2039    /// Fields not described by the spec, e.g. instance-specific DB fields.
2040    #[serde(flatten)]
2041    pub extra: serde_json::Map<String, serde_json::Value>,
2042}
2043
2044/// Stored exclusion date for a series.
2045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2046pub struct AppointmentExeptions {
2047    /// A simple date in ISO format, e.g. '2022-10-19'
2048    pub date: chrono::NaiveDate,
2049    /// ID of the stored recurrence entry.
2050    #[serde(deserialize_with = "crate::lenient::number")]
2051    pub id: i64,
2052    pub meta: MetaDataEntityId,
2053    /// Fields not described by the spec, e.g. instance-specific DB fields.
2054    #[serde(flatten)]
2055    pub extra: serde_json::Map<String, serde_json::Value>,
2056}
2057
2058/// One calculated occurrence and optional linked resources.
2059#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2060pub struct AppointmentOccurrence {
2061    pub appointment: AppointmentOccurrenceListAppointment,
2062    /// Resource-booking occurrences, when requested and visible.
2063    #[serde(default, skip_serializing_if = "Option::is_none")]
2064    pub bookings: Option<Vec<BookingCalculated>>,
2065    /// Service-planning event for this occurrence, or null.
2066    #[serde(default, skip_serializing_if = "Option::is_none")]
2067    pub event: Option<DomainObjectEvent>,
2068    /// Visible registration group for this occurrence, or null.
2069    #[serde(default, skip_serializing_if = "Option::is_none")]
2070    pub group: Option<DomainObjectGroup>,
2071    /// Requests for the whole appointment or series.
2072    #[serde(rename = "meetingRequests", default, skip_serializing_if = "Option::is_none")]
2073    pub meeting_requests: Option<Vec<MeetingRequest>>,
2074    /// Tags assigned to the stored appointment, included with tags.
2075    #[serde(default, skip_serializing_if = "Option::is_none")]
2076    pub tags: Option<Vec<Tag>>,
2077    /// Text derived from configured service assignments, included with titleSuffix.
2078    #[serde(rename = "titleSuffix", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2079    pub title_suffix: Option<String>,
2080    /// Fields not described by the spec, e.g. instance-specific DB fields.
2081    #[serde(flatten)]
2082    pub extra: serde_json::Map<String, serde_json::Value>,
2083}
2084
2085/// Calculated start/end for one occurrence. All-day dates use YYYY-MM-DD with an inclusive end; timed dates use UTC timestamps.
2086#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2087pub struct AppointmentOccurrenceDate {
2088    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
2089    #[serde(rename = "endDate")]
2090    pub end_date: crate::DateOrDateTime,
2091    /// Stable iCalendar UID for this occurrence.
2092    #[serde(rename = "iCalUid", deserialize_with = "crate::lenient::string")]
2093    pub i_cal_uid: String,
2094    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
2095    #[serde(rename = "startDate")]
2096    pub start_date: crate::DateOrDateTime,
2097    /// Fields not described by the spec, e.g. instance-specific DB fields.
2098    #[serde(flatten)]
2099    pub extra: serde_json::Map<String, serde_json::Value>,
2100}
2101
2102/// Calculated occurrence returned by appointment list endpoints.
2103#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2104pub struct AppointmentOccurrenceList {
2105    pub appointment: AppointmentOccurrenceListAppointment,
2106    /// Resource-booking occurrences, when requested and visible.
2107    #[serde(default, skip_serializing_if = "Option::is_none")]
2108    pub bookings: Option<Vec<BookingCalculated>>,
2109    /// Service-planning event for this occurrence, or null.
2110    #[serde(default, skip_serializing_if = "Option::is_none")]
2111    pub event: Option<DomainObjectEvent>,
2112    /// Visible registration group for this occurrence, or null.
2113    #[serde(default, skip_serializing_if = "Option::is_none")]
2114    pub group: Option<DomainObjectGroup>,
2115    /// Requests for the whole appointment or series.
2116    #[serde(rename = "meetingRequests", default, skip_serializing_if = "Option::is_none")]
2117    pub meeting_requests: Option<Vec<MeetingRequest>>,
2118    /// Tags assigned to the stored appointment, included with tags.
2119    #[serde(default, skip_serializing_if = "Option::is_none")]
2120    pub tags: Option<Vec<Tag>>,
2121    /// Text derived from configured service assignments, included with titleSuffix.
2122    #[serde(rename = "titleSuffix", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2123    pub title_suffix: Option<String>,
2124    /// Legacy alias for appointment.base.
2125    #[serde(default, skip_serializing_if = "Option::is_none")]
2126    #[deprecated = "deprecated in the ChurchTools API"]
2127    pub base: Option<AppointmentOccurrenceListBase>,
2128    /// Legacy alias for appointment.calculated.
2129    #[serde(default, skip_serializing_if = "Option::is_none")]
2130    #[deprecated = "deprecated in the ChurchTools API"]
2131    pub calculated: Option<AppointmentOccurrenceListCalculated>,
2132    /// Fields not described by the spec, e.g. instance-specific DB fields.
2133    #[serde(flatten)]
2134    pub extra: serde_json::Map<String, serde_json::Value>,
2135}
2136
2137#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2138pub struct AppointmentOccurrenceListAppointment {
2139    /// Stored calendar appointment defining a single occurrence or a series. id identifies the whole stored appointment; pair it with a local occurrence start date to address a particular occurrence. startDate/endDate are the base occurrence, not necessarily the occurrence currently being displayed. Service-planning events, registration groups, bookings and meeting requests are separate linked resources.
2140    pub base: AppointmentBase,
2141    /// Calculated start/end for one occurrence. All-day dates use YYYY-MM-DD with an inclusive end; timed dates use UTC timestamps.
2142    pub calculated: AppointmentOccurrenceDate,
2143    /// Fields not described by the spec, e.g. instance-specific DB fields.
2144    #[serde(flatten)]
2145    pub extra: serde_json::Map<String, serde_json::Value>,
2146}
2147
2148/// Legacy alias for appointment.base.
2149#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2150pub struct AppointmentOccurrenceListBase {
2151    pub additionals: Vec<AppointmentAdditionals>,
2152    /// Use 'additionals' instead
2153    #[serde(default, skip_serializing_if = "Option::is_none")]
2154    #[deprecated = "Use 'additionals' instead"]
2155    pub additions: Option<Vec<AppointmentAdditionals>>,
2156    #[serde(default, skip_serializing_if = "Option::is_none")]
2157    pub address: Option<Address>,
2158    /// True when the appointment is all-day. The serialized endDate is inclusive.
2159    #[serde(rename = "allDay")]
2160    pub all_day: bool,
2161    /// Calendar containing the appointment.
2162    pub calendar: AppointmentBaseCalendar,
2163    /// Use 'title' instead
2164    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2165    #[deprecated = "Use 'title' instead"]
2166    pub caption: Option<String>,
2167    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2168    pub description: Option<String>,
2169    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
2170    #[serde(rename = "endDate")]
2171    pub end_date: crate::DateOrDateTime,
2172    pub exceptions: Vec<AppointmentExeptions>,
2173    /// ID of the stored appointment or series.
2174    #[serde(deserialize_with = "crate::lenient::number")]
2175    pub id: i64,
2176    #[serde(default, skip_serializing_if = "Option::is_none")]
2177    pub image: Option<Image>,
2178    /// Use 'description' instead
2179    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2180    #[deprecated = "Use 'description' instead"]
2181    pub information: Option<String>,
2182    #[serde(rename = "isInternal")]
2183    pub is_internal: bool,
2184    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2185    pub link: Option<String>,
2186    pub meta: MetaDataEntityId,
2187    /// Use 'subtitle' instead
2188    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2189    #[deprecated = "Use 'subtitle' instead"]
2190    pub note: Option<String>,
2191    /// Person on whose behalf the appointment was entered, or null.
2192    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2193    pub on_behalf_of_pid: Option<i64>,
2194    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
2195    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2196    pub repeat_frequency: Option<i64>,
2197    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
2198    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
2199    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
2200    pub repeat_id: i64,
2201    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
2202    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2203    pub repeat_option: Option<i64>,
2204    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
2205    #[serde(rename = "repeatUntil", default, skip_serializing_if = "Option::is_none")]
2206    pub repeat_until: Option<chrono::NaiveDate>,
2207    /// Registration-group configuration, or null if the appointment has none.
2208    #[serde(default, skip_serializing_if = "Option::is_none")]
2209    pub signup: Option<AppointmentSignup>,
2210    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
2211    #[serde(rename = "startDate")]
2212    pub start_date: crate::DateOrDateTime,
2213    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2214    pub subtitle: Option<String>,
2215    #[serde(deserialize_with = "crate::lenient::string")]
2216    pub title: String,
2217    /// Revision counter increased by updates; not an input precondition or a per-occurrence ID.
2218    #[serde(deserialize_with = "crate::lenient::number")]
2219    pub version: i64,
2220    /// Fields not described by the spec, e.g. instance-specific DB fields.
2221    #[serde(flatten)]
2222    pub extra: serde_json::Map<String, serde_json::Value>,
2223}
2224
2225/// Legacy alias for appointment.calculated.
2226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2227pub struct AppointmentOccurrenceListCalculated {
2228    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
2229    #[serde(rename = "endDate")]
2230    pub end_date: crate::DateOrDateTime,
2231    /// Stable iCalendar UID for this occurrence.
2232    #[serde(rename = "iCalUid", deserialize_with = "crate::lenient::string")]
2233    pub i_cal_uid: String,
2234    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
2235    #[serde(rename = "startDate")]
2236    pub start_date: crate::DateOrDateTime,
2237    /// Fields not described by the spec, e.g. instance-specific DB fields.
2238    #[serde(flatten)]
2239    pub extra: serde_json::Map<String, serde_json::Value>,
2240}
2241
2242#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2243pub struct AppointmentSignup {
2244    #[serde(rename = "signupDaysArchiveGroupNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2245    pub signup_days_archive_group_no: Option<i64>,
2246    #[serde(rename = "signupDaysForwardNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2247    pub signup_days_forward_no: Option<i64>,
2248    #[serde(rename = "signupGroupTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2249    pub signup_group_type_id: Option<i64>,
2250    #[serde(rename = "signupTemplateGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2251    pub signup_template_group_id: Option<i64>,
2252    /// Use 'signupDaysForwardNo' instead. Misspelled legacy field.
2253    #[serde(rename = "singupDaysForwardNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2254    #[deprecated = "Use 'signupDaysForwardNo' instead."]
2255    pub singup_days_forward_no: Option<i64>,
2256    /// Fields not described by the spec, e.g. instance-specific DB fields.
2257    #[serde(flatten)]
2258    pub extra: serde_json::Map<String, serde_json::Value>,
2259}
2260
2261/// Configure groups used to collect registrations for individual appointment occurrences. These are separate ChurchTools groups, not meeting invitations or service-planning events.
2262#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2263pub struct AppointmentSignupCreate {
2264    /// How many days after the appointment registration groups are archived.
2265    #[serde(rename = "signupDaysArchiveGroupNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2266    pub signup_days_archive_group_no: Option<i64>,
2267    /// How many days ahead registration groups are created.
2268    #[serde(rename = "signupDaysForwardNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2269    pub signup_days_forward_no: Option<i64>,
2270    /// Group type used for the registration groups.
2271    #[serde(rename = "signupGroupTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2272    pub signup_group_type_id: Option<i64>,
2273    /// Group used as a template for registration groups.
2274    #[serde(rename = "signupTemplateGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2275    pub signup_template_group_id: Option<i64>,
2276    /// Fields not described by the spec, e.g. instance-specific DB fields.
2277    #[serde(flatten)]
2278    pub extra: serde_json::Map<String, serde_json::Value>,
2279}
2280
2281/// New appointment data plus the scope removed from the original series. The response identifies the newly created appointment; the original retains the unaffected dates.
2282#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2283pub struct AppointmentSplitUpdate {
2284    #[serde(default, skip_serializing_if = "Option::is_none")]
2285    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
2286    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
2287    #[serde(rename = "endDate")]
2288    pub end_date: crate::DateOrDateTime,
2289    #[serde(default, skip_serializing_if = "Option::is_none")]
2290    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
2291    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
2292    ///
2293    /// `None` leaves the field out, `Some(None)` sends `null`.
2294    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2295    pub repeat_frequency: Option<Option<i64>>,
2296    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
2297    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
2298    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2299    pub repeat_id: Option<i64>,
2300    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
2301    ///
2302    /// `None` leaves the field out, `Some(None)` sends `null`.
2303    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2304    pub repeat_option: Option<Option<i64>>,
2305    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
2306    ///
2307    /// `None` leaves the field out, `Some(None)` sends `null`.
2308    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2309    pub repeat_until: Option<Option<chrono::NaiveDate>>,
2310    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
2311    #[serde(rename = "startDate")]
2312    pub start_date: crate::DateOrDateTime,
2313    /// Location entered with an appointment.
2314    #[serde(default, skip_serializing_if = "Option::is_none")]
2315    pub address: Option<AppointmentAddressCreate>,
2316    /// Resource reservations matched by resourceId.
2317    #[serde(default, skip_serializing_if = "Option::is_none")]
2318    pub bookings: Option<Vec<AppointmentBookingCreate>>,
2319    /// Description of the appointment.
2320    ///
2321    /// `None` leaves the field out, `Some(None)` sends `null`.
2322    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2323    pub description: Option<Option<String>>,
2324    /// Only new service-planning events to create. Existing linked events are updated separately when the appointment changes; events no longer matching the series may be deleted.
2325    #[serde(default, skip_serializing_if = "Option::is_none")]
2326    pub events: Option<Vec<AppointmentEventCreate>>,
2327    /// Send an information email to the person on whose behalf the appointment is managed, or its original creator. The workflow skips inactive recipients, the acting user and changes without notable differences.
2328    #[serde(rename = "informOwner", default, skip_serializing_if = "Option::is_none")]
2329    pub inform_owner: Option<bool>,
2330    /// Set `false` for a regular appointment. Use `true` only when the appointment is intended to be visible exclusively to signed-in users.
2331    #[serde(rename = "isInternal")]
2332    pub is_internal: bool,
2333    /// `None` leaves the field out, `Some(None)` sends `null`.
2334    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2335    pub link: Option<Option<String>>,
2336    /// Invitees for the appointment or series. The field name is lowercase.
2337    #[serde(default, skip_serializing_if = "Option::is_none")]
2338    pub meetingrequests: Option<Vec<MeetingRequestCreate>>,
2339    /// Person ID on whose behalf the appointment is created. This person is also used as inviter for meeting requests.
2340    ///
2341    /// `None` leaves the field out, `Some(None)` sends `null`.
2342    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2343    pub on_behalf_of_pid: Option<Option<i64>>,
2344    /// Configure groups used to collect registrations for individual appointment occurrences. These are separate ChurchTools groups, not meeting invitations or service-planning events.
2345    #[serde(default, skip_serializing_if = "Option::is_none")]
2346    pub signup: Option<AppointmentSignupCreate>,
2347    /// `None` leaves the field out, `Some(None)` sends `null`.
2348    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2349    pub subtitle: Option<Option<String>>,
2350    /// Appointment tags to add, as IDs, names or objects containing id.
2351    #[serde(default, skip_serializing_if = "Option::is_none")]
2352    pub tags: Option<Vec<serde_json::Value>>,
2353    #[serde(deserialize_with = "crate::lenient::string")]
2354    pub title: String,
2355    /// IDs of existing appointment bookings to delete. These are booking IDs, not resource IDs. In a split request, the selected scope is removed from these bookings and not recreated for the new appointment.
2356    #[serde(rename = "bookingsToDelete", default, skip_serializing_if = "Option::is_none")]
2357    pub bookings_to_delete: Option<Vec<i64>>,
2358    /// Local date identifying the original occurrence or start of the split segment.
2359    #[serde(rename = "splitDate")]
2360    pub split_date: chrono::NaiveDate,
2361    /// true cuts the original series off on the day before splitDate; false adds an exception for splitDate only. Supply the complete recurrence of the new part in either case.
2362    #[serde(rename = "splitUntilEnd")]
2363    pub split_until_end: bool,
2364    /// Fields not described by the spec, e.g. instance-specific DB fields.
2365    #[serde(flatten)]
2366    pub extra: serde_json::Map<String, serde_json::Value>,
2367}
2368
2369/// Saved appointment defaults plus the template ID and metadata.
2370#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2371pub struct AppointmentTemplate {
2372    /// Location entered with an appointment template.
2373    #[serde(default, skip_serializing_if = "Option::is_none")]
2374    pub address: Option<AppointmentTemplateAddressCreate>,
2375    /// Whether the template proposes an all-day appointment.
2376    #[serde(rename = "allDay", default, skip_serializing_if = "Option::is_none")]
2377    pub all_day: Option<bool>,
2378    /// Stored resource-booking defaults in the legacy template format.
2379    #[serde(default, skip_serializing_if = "Option::is_none")]
2380    pub bookings: Option<Vec<AppointmentBooking>>,
2381    /// Calendar for which the template provides defaults.
2382    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
2383    pub calendar_id: i64,
2384    /// Days after the appointment for archiving registration groups.
2385    #[serde(rename = "daysArchiveGroupNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2386    pub days_archive_group_no: Option<i64>,
2387    /// Days ahead for creating registration groups.
2388    #[serde(rename = "daysForwardNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2389    pub days_forward_no: Option<i64>,
2390    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2391    pub description: Option<String>,
2392    /// Difference between end and start in seconds. With allDay=true, 0 represents one all-day date because the appointment end date is inclusive.
2393    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2394    pub duration: Option<i64>,
2395    /// Stored service-planning event template selections. Applying them is part of appointment creation, not saving this template.
2396    #[serde(default, skip_serializing_if = "Option::is_none")]
2397    pub events: Option<Vec<AppointmentEvent>>,
2398    /// Group type for registration groups created for appointment occurrences.
2399    #[serde(rename = "grouptypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2400    pub grouptype_id: Option<i64>,
2401    #[serde(rename = "isInternal", default, skip_serializing_if = "Option::is_none")]
2402    pub is_internal: Option<bool>,
2403    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2404    pub link: Option<String>,
2405    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2406    pub on_behalf_of_pid: Option<i64>,
2407    /// Seconds from the chosen appointment start to the series end used when applying this template.
2408    #[serde(rename = "repeatDuration", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2409    pub repeat_duration: Option<i64>,
2410    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
2411    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2412    pub repeat_frequency: Option<i64>,
2413    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
2414    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
2415    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
2416    pub repeat_id: i64,
2417    /// Monthly-by-weekday ordinal, using the template field name repeatOptionId. The resulting appointment uses repeatOption.
2418    #[serde(rename = "repeatOptionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2419    pub repeat_option_id: Option<i64>,
2420    /// Local start time used when applying the template, conventionally HH:mm.
2421    #[serde(rename = "startTime", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2422    pub start_time: Option<String>,
2423    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2424    pub subtitle: Option<String>,
2425    /// Existing appointment-tag IDs saved in the template.
2426    #[serde(default, skip_serializing_if = "Option::is_none")]
2427    pub tags: Option<Vec<i64>>,
2428    /// Group used as a template for registration groups.
2429    #[serde(rename = "templateGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2430    pub template_group_id: Option<i64>,
2431    /// Title proposed for appointments created from this template.
2432    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2433    pub title: Option<String>,
2434    /// Use `calendarId` instead.
2435    #[serde(rename = "categoryId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2436    #[deprecated = "Use `calendarId` instead."]
2437    pub category_id: Option<i64>,
2438    /// Template ID; not an appointment ID.
2439    #[serde(deserialize_with = "crate::lenient::number")]
2440    pub id: i64,
2441    #[serde(default, skip_serializing_if = "Option::is_none")]
2442    pub image: Option<AppointmentTemplateImage>,
2443    pub meta: MetaDataEntityId,
2444    /// Fields not described by the spec, e.g. instance-specific DB fields.
2445    #[serde(flatten)]
2446    pub extra: serde_json::Map<String, serde_json::Value>,
2447}
2448
2449/// Location entered with an appointment template.
2450#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2451pub struct AppointmentTemplateAddressCreate {
2452    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2453    pub addition: Option<String>,
2454    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2455    pub city: Option<String>,
2456    /// A country's ISO-code
2457    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2458    pub country: Option<String>,
2459    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2460    pub district: Option<String>,
2461    /// Coordinate stored as text in appointment templates.
2462    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2463    pub latitude: Option<String>,
2464    /// Coordinate stored as text in appointment templates.
2465    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2466    pub longitude: Option<String>,
2467    /// Legacy alias for name.
2468    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2469    #[deprecated = "deprecated in the ChurchTools API"]
2470    pub meeting_at: Option<String>,
2471    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2472    pub name: Option<String>,
2473    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2474    pub street: Option<String>,
2475    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2476    pub zip: Option<String>,
2477    /// Fields not described by the spec, e.g. instance-specific DB fields.
2478    #[serde(flatten)]
2479    pub extra: serde_json::Map<String, serde_json::Value>,
2480}
2481
2482/// Save reusable appointment defaults without creating appointments or their linked resources.
2483#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2484pub struct AppointmentTemplateCreate {
2485    /// Location entered with an appointment template.
2486    #[serde(default, skip_serializing_if = "Option::is_none")]
2487    pub address: Option<AppointmentTemplateAddressCreate>,
2488    /// Whether the template proposes an all-day appointment.
2489    ///
2490    /// `None` leaves the field out, `Some(None)` sends `null`.
2491    #[serde(rename = "allDay", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2492    pub all_day: Option<Option<bool>>,
2493    /// Stored resource-booking defaults in the legacy template format.
2494    ///
2495    /// `None` leaves the field out, `Some(None)` sends `null`.
2496    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2497    pub bookings: Option<Option<Vec<AppointmentBooking>>>,
2498    /// Calendar for which the template provides defaults.
2499    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
2500    pub calendar_id: i64,
2501    /// Days after the appointment for archiving registration groups.
2502    ///
2503    /// `None` leaves the field out, `Some(None)` sends `null`.
2504    #[serde(rename = "daysArchiveGroupNo", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2505    pub days_archive_group_no: Option<Option<i64>>,
2506    /// Days ahead for creating registration groups.
2507    ///
2508    /// `None` leaves the field out, `Some(None)` sends `null`.
2509    #[serde(rename = "daysForwardNo", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2510    pub days_forward_no: Option<Option<i64>>,
2511    /// `None` leaves the field out, `Some(None)` sends `null`.
2512    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2513    pub description: Option<Option<String>>,
2514    /// Difference between end and start in seconds. With allDay=true, 0 represents one all-day date because the appointment end date is inclusive.
2515    #[serde(deserialize_with = "crate::lenient::number")]
2516    pub duration: i64,
2517    /// Stored service-planning event template selections. Applying them is part of appointment creation, not saving this template.
2518    ///
2519    /// `None` leaves the field out, `Some(None)` sends `null`.
2520    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2521    pub events: Option<Option<Vec<AppointmentEvent>>>,
2522    /// Group type for registration groups created for appointment occurrences.
2523    ///
2524    /// `None` leaves the field out, `Some(None)` sends `null`.
2525    #[serde(rename = "grouptypeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2526    pub grouptype_id: Option<Option<i64>>,
2527    /// `None` leaves the field out, `Some(None)` sends `null`.
2528    #[serde(rename = "isInternal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2529    pub is_internal: Option<Option<bool>>,
2530    /// `None` leaves the field out, `Some(None)` sends `null`.
2531    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2532    pub link: Option<Option<String>>,
2533    /// `None` leaves the field out, `Some(None)` sends `null`.
2534    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2535    pub on_behalf_of_pid: Option<Option<i64>>,
2536    /// Seconds from the chosen appointment start to the series end used when applying this template.
2537    ///
2538    /// `None` leaves the field out, `Some(None)` sends `null`.
2539    #[serde(rename = "repeatDuration", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2540    pub repeat_duration: Option<Option<i64>>,
2541    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
2542    ///
2543    /// `None` leaves the field out, `Some(None)` sends `null`.
2544    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2545    pub repeat_frequency: Option<Option<i64>>,
2546    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
2547    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
2548    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2549    pub repeat_id: Option<i64>,
2550    /// Monthly-by-weekday ordinal, using the template field name repeatOptionId. The resulting appointment uses repeatOption.
2551    ///
2552    /// `None` leaves the field out, `Some(None)` sends `null`.
2553    #[serde(rename = "repeatOptionId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2554    pub repeat_option_id: Option<Option<i64>>,
2555    /// Local start time used when applying the template, conventionally HH:mm.
2556    #[serde(rename = "startTime", deserialize_with = "crate::lenient::string")]
2557    pub start_time: String,
2558    /// `None` leaves the field out, `Some(None)` sends `null`.
2559    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2560    pub subtitle: Option<Option<String>>,
2561    /// Existing appointment-tag IDs saved in the template.
2562    ///
2563    /// `None` leaves the field out, `Some(None)` sends `null`.
2564    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2565    pub tags: Option<Option<Vec<i64>>>,
2566    /// Group used as a template for registration groups.
2567    ///
2568    /// `None` leaves the field out, `Some(None)` sends `null`.
2569    #[serde(rename = "templateGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2570    pub template_group_id: Option<Option<i64>>,
2571    /// Title proposed for appointments created from this template.
2572    #[serde(deserialize_with = "crate::lenient::string")]
2573    pub title: String,
2574    /// Fields not described by the spec, e.g. instance-specific DB fields.
2575    #[serde(flatten)]
2576    pub extra: serde_json::Map<String, serde_json::Value>,
2577}
2578
2579/// Image file associated with an appointment template, managed separately from template create/update.
2580#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2581pub struct AppointmentTemplateImage {
2582    #[serde(rename = "domainId", deserialize_with = "crate::lenient::string")]
2583    pub domain_id: String,
2584    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
2585    pub domain_type: String,
2586    #[serde(rename = "fileUrl", deserialize_with = "crate::lenient::string")]
2587    pub file_url: String,
2588    #[serde(deserialize_with = "crate::lenient::number")]
2589    pub id: i64,
2590    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2591    pub image_url: Option<String>,
2592    #[serde(deserialize_with = "crate::lenient::string")]
2593    pub name: String,
2594    /// Fields not described by the spec, e.g. instance-specific DB fields.
2595    #[serde(flatten)]
2596    pub extra: serde_json::Map<String, serde_json::Value>,
2597}
2598
2599/// Replace the saved appointment-template defaults.
2600#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2601pub struct AppointmentTemplateUpdate {
2602    /// Location entered with an appointment template.
2603    #[serde(default, skip_serializing_if = "Option::is_none")]
2604    pub address: Option<AppointmentTemplateAddressCreate>,
2605    /// Whether the template proposes an all-day appointment.
2606    ///
2607    /// `None` leaves the field out, `Some(None)` sends `null`.
2608    #[serde(rename = "allDay", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2609    pub all_day: Option<Option<bool>>,
2610    /// Stored resource-booking defaults in the legacy template format.
2611    ///
2612    /// `None` leaves the field out, `Some(None)` sends `null`.
2613    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2614    pub bookings: Option<Option<Vec<AppointmentBooking>>>,
2615    /// Calendar for which the template provides defaults.
2616    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
2617    pub calendar_id: i64,
2618    /// Days after the appointment for archiving registration groups.
2619    ///
2620    /// `None` leaves the field out, `Some(None)` sends `null`.
2621    #[serde(rename = "daysArchiveGroupNo", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2622    pub days_archive_group_no: Option<Option<i64>>,
2623    /// Days ahead for creating registration groups.
2624    ///
2625    /// `None` leaves the field out, `Some(None)` sends `null`.
2626    #[serde(rename = "daysForwardNo", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2627    pub days_forward_no: Option<Option<i64>>,
2628    /// `None` leaves the field out, `Some(None)` sends `null`.
2629    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2630    pub description: Option<Option<String>>,
2631    /// Difference between end and start in seconds. With allDay=true, 0 represents one all-day date because the appointment end date is inclusive.
2632    #[serde(deserialize_with = "crate::lenient::number")]
2633    pub duration: i64,
2634    /// Stored service-planning event template selections. Applying them is part of appointment creation, not saving this template.
2635    ///
2636    /// `None` leaves the field out, `Some(None)` sends `null`.
2637    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2638    pub events: Option<Option<Vec<AppointmentEvent>>>,
2639    /// Group type for registration groups created for appointment occurrences.
2640    ///
2641    /// `None` leaves the field out, `Some(None)` sends `null`.
2642    #[serde(rename = "grouptypeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2643    pub grouptype_id: Option<Option<i64>>,
2644    /// `None` leaves the field out, `Some(None)` sends `null`.
2645    #[serde(rename = "isInternal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2646    pub is_internal: Option<Option<bool>>,
2647    /// `None` leaves the field out, `Some(None)` sends `null`.
2648    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2649    pub link: Option<Option<String>>,
2650    /// `None` leaves the field out, `Some(None)` sends `null`.
2651    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2652    pub on_behalf_of_pid: Option<Option<i64>>,
2653    /// Seconds from the chosen appointment start to the series end used when applying this template.
2654    ///
2655    /// `None` leaves the field out, `Some(None)` sends `null`.
2656    #[serde(rename = "repeatDuration", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2657    pub repeat_duration: Option<Option<i64>>,
2658    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
2659    ///
2660    /// `None` leaves the field out, `Some(None)` sends `null`.
2661    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2662    pub repeat_frequency: Option<Option<i64>>,
2663    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
2664    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
2665    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2666    pub repeat_id: Option<i64>,
2667    /// Monthly-by-weekday ordinal, using the template field name repeatOptionId. The resulting appointment uses repeatOption.
2668    ///
2669    /// `None` leaves the field out, `Some(None)` sends `null`.
2670    #[serde(rename = "repeatOptionId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2671    pub repeat_option_id: Option<Option<i64>>,
2672    /// Local start time used when applying the template, conventionally HH:mm.
2673    #[serde(rename = "startTime", deserialize_with = "crate::lenient::string")]
2674    pub start_time: String,
2675    /// `None` leaves the field out, `Some(None)` sends `null`.
2676    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2677    pub subtitle: Option<Option<String>>,
2678    /// Existing appointment-tag IDs saved in the template.
2679    ///
2680    /// `None` leaves the field out, `Some(None)` sends `null`.
2681    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2682    pub tags: Option<Option<Vec<i64>>>,
2683    /// Group used as a template for registration groups.
2684    ///
2685    /// `None` leaves the field out, `Some(None)` sends `null`.
2686    #[serde(rename = "templateGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2687    pub template_group_id: Option<Option<i64>>,
2688    /// Title proposed for appointments created from this template.
2689    #[serde(deserialize_with = "crate::lenient::string")]
2690    pub title: String,
2691    /// Fields not described by the spec, e.g. instance-specific DB fields.
2692    #[serde(flatten)]
2693    pub extra: serde_json::Map<String, serde_json::Value>,
2694}
2695
2696/// Appointment template returned immediately after a write.
2697#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2698pub struct AppointmentTemplateWritten {
2699    /// Location entered with an appointment template.
2700    #[serde(default, skip_serializing_if = "Option::is_none")]
2701    pub address: Option<AppointmentTemplateAddressCreate>,
2702    /// Whether the template proposes an all-day appointment.
2703    #[serde(rename = "allDay", default, skip_serializing_if = "Option::is_none")]
2704    pub all_day: Option<bool>,
2705    /// Stored resource-booking defaults in the legacy template format.
2706    #[serde(default, skip_serializing_if = "Option::is_none")]
2707    pub bookings: Option<Vec<AppointmentBooking>>,
2708    /// Calendar for which the template provides defaults.
2709    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
2710    pub calendar_id: i64,
2711    /// Days after the appointment for archiving registration groups.
2712    #[serde(rename = "daysArchiveGroupNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2713    pub days_archive_group_no: Option<i64>,
2714    /// Days ahead for creating registration groups.
2715    #[serde(rename = "daysForwardNo", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2716    pub days_forward_no: Option<i64>,
2717    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2718    pub description: Option<String>,
2719    /// Difference between end and start in seconds. With allDay=true, 0 represents one all-day date because the appointment end date is inclusive.
2720    #[serde(deserialize_with = "crate::lenient::number")]
2721    pub duration: i64,
2722    /// Stored service-planning event template selections. Applying them is part of appointment creation, not saving this template.
2723    #[serde(default, skip_serializing_if = "Option::is_none")]
2724    pub events: Option<Vec<AppointmentEvent>>,
2725    /// Group type for registration groups created for appointment occurrences.
2726    #[serde(rename = "grouptypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2727    pub grouptype_id: Option<i64>,
2728    #[serde(rename = "isInternal", default, skip_serializing_if = "Option::is_none")]
2729    pub is_internal: Option<bool>,
2730    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2731    pub link: Option<String>,
2732    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2733    pub on_behalf_of_pid: Option<i64>,
2734    /// Seconds from the chosen appointment start to the series end used when applying this template.
2735    #[serde(rename = "repeatDuration", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2736    pub repeat_duration: Option<i64>,
2737    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
2738    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2739    pub repeat_frequency: Option<i64>,
2740    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
2741    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
2742    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
2743    pub repeat_id: i64,
2744    /// Monthly-by-weekday ordinal, using the template field name repeatOptionId. The resulting appointment uses repeatOption.
2745    #[serde(rename = "repeatOptionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2746    pub repeat_option_id: Option<i64>,
2747    /// Local start time used when applying the template, conventionally HH:mm.
2748    #[serde(rename = "startTime", deserialize_with = "crate::lenient::string")]
2749    pub start_time: String,
2750    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2751    pub subtitle: Option<String>,
2752    /// Existing appointment-tag IDs saved in the template.
2753    #[serde(default, skip_serializing_if = "Option::is_none")]
2754    pub tags: Option<Vec<i64>>,
2755    /// Group used as a template for registration groups.
2756    #[serde(rename = "templateGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2757    pub template_group_id: Option<i64>,
2758    /// Title proposed for appointments created from this template.
2759    #[serde(deserialize_with = "crate::lenient::string")]
2760    pub title: String,
2761    /// Use `calendarId` instead.
2762    #[serde(rename = "categoryId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2763    #[deprecated = "Use `calendarId` instead."]
2764    pub category_id: Option<i64>,
2765    /// Template ID; not an appointment ID.
2766    #[serde(deserialize_with = "crate::lenient::number")]
2767    pub id: i64,
2768    #[serde(default, skip_serializing_if = "Option::is_none")]
2769    pub image: Option<AppointmentTemplateImage>,
2770    pub meta: MetaDataEntityId,
2771    /// Fields not described by the spec, e.g. instance-specific DB fields.
2772    #[serde(flatten)]
2773    pub extra: serde_json::Map<String, serde_json::Value>,
2774}
2775
2776/// Full update of an appointment or series. Existing linked bookings and events follow the new schedule. The events list contains only new events; meetingrequests has separate replacement semantics.
2777#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2778pub struct AppointmentUpdate {
2779    #[serde(default, skip_serializing_if = "Option::is_none")]
2780    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
2781    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
2782    #[serde(rename = "endDate")]
2783    pub end_date: crate::DateOrDateTime,
2784    #[serde(default, skip_serializing_if = "Option::is_none")]
2785    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
2786    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
2787    ///
2788    /// `None` leaves the field out, `Some(None)` sends `null`.
2789    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2790    pub repeat_frequency: Option<Option<i64>>,
2791    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
2792    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
2793    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2794    pub repeat_id: Option<i64>,
2795    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
2796    ///
2797    /// `None` leaves the field out, `Some(None)` sends `null`.
2798    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2799    pub repeat_option: Option<Option<i64>>,
2800    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
2801    ///
2802    /// `None` leaves the field out, `Some(None)` sends `null`.
2803    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2804    pub repeat_until: Option<Option<chrono::NaiveDate>>,
2805    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
2806    #[serde(rename = "startDate")]
2807    pub start_date: crate::DateOrDateTime,
2808    /// Location entered with an appointment.
2809    #[serde(default, skip_serializing_if = "Option::is_none")]
2810    pub address: Option<AppointmentAddressCreate>,
2811    /// Resource reservations matched by resourceId.
2812    #[serde(default, skip_serializing_if = "Option::is_none")]
2813    pub bookings: Option<Vec<AppointmentBookingCreate>>,
2814    /// Description of the appointment.
2815    ///
2816    /// `None` leaves the field out, `Some(None)` sends `null`.
2817    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2818    pub description: Option<Option<String>>,
2819    /// Only new service-planning events to create. Existing linked events are updated separately when the appointment changes; events no longer matching the series may be deleted.
2820    #[serde(default, skip_serializing_if = "Option::is_none")]
2821    pub events: Option<Vec<AppointmentEventCreate>>,
2822    /// Send an information email to the person on whose behalf the appointment is managed, or its original creator. The workflow skips inactive recipients, the acting user and changes without notable differences.
2823    #[serde(rename = "informOwner", default, skip_serializing_if = "Option::is_none")]
2824    pub inform_owner: Option<bool>,
2825    /// Set `false` for a regular appointment. Use `true` only when the appointment is intended to be visible exclusively to signed-in users.
2826    #[serde(rename = "isInternal")]
2827    pub is_internal: bool,
2828    /// `None` leaves the field out, `Some(None)` sends `null`.
2829    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2830    pub link: Option<Option<String>>,
2831    /// Invitees for the appointment or series. The field name is lowercase.
2832    #[serde(default, skip_serializing_if = "Option::is_none")]
2833    pub meetingrequests: Option<Vec<MeetingRequestCreate>>,
2834    /// Person ID on whose behalf the appointment is created. This person is also used as inviter for meeting requests.
2835    ///
2836    /// `None` leaves the field out, `Some(None)` sends `null`.
2837    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2838    pub on_behalf_of_pid: Option<Option<i64>>,
2839    /// Configure groups used to collect registrations for individual appointment occurrences. These are separate ChurchTools groups, not meeting invitations or service-planning events.
2840    #[serde(default, skip_serializing_if = "Option::is_none")]
2841    pub signup: Option<AppointmentSignupCreate>,
2842    /// `None` leaves the field out, `Some(None)` sends `null`.
2843    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2844    pub subtitle: Option<Option<String>>,
2845    /// Appointment tags to add, as IDs, names or objects containing id.
2846    #[serde(default, skip_serializing_if = "Option::is_none")]
2847    pub tags: Option<Vec<serde_json::Value>>,
2848    #[serde(deserialize_with = "crate::lenient::string")]
2849    pub title: String,
2850    /// IDs of existing appointment bookings to delete. These are booking IDs, not resource IDs. In a split request, the selected scope is removed from these bookings and not recreated for the new appointment.
2851    #[serde(rename = "bookingsToDelete", default, skip_serializing_if = "Option::is_none")]
2852    pub bookings_to_delete: Option<Vec<i64>>,
2853    /// Fields not described by the spec, e.g. instance-specific DB fields.
2854    #[serde(flatten)]
2855    pub extra: serde_json::Map<String, serde_json::Value>,
2856}
2857
2858/// One musical version of a song. Event agenda song items refer to an arrangement ID, allowing different keys, instruments or sources for the same song.
2859#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2860pub struct Arrangement {
2861    /// Free-text time signature, such as `4/4` or `6/8`.
2862    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2863    pub beat: Option<String>,
2864    /// Notes about performing this arrangement.
2865    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2866    pub description: Option<String>,
2867    /// Expected duration in seconds.
2868    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2869    pub duration: Option<i64>,
2870    /// Musical key using the API spelling.
2871    /// 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`, ….
2872    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2873    pub key: Option<String>,
2874    /// Name distinguishing this version from other arrangements.
2875    #[serde(deserialize_with = "crate::lenient::string")]
2876    pub name: String,
2877    /// ID of a song source, such as a hymnal or songbook, from GET /song/sources.
2878    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2879    pub source_id: Option<i64>,
2880    /// Location within the selected source, such as a song number or page. Only used with sourceId.
2881    #[serde(rename = "sourceReference", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2882    pub source_reference: Option<String>,
2883    /// Tempo in beats per minute.
2884    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
2885    pub tempo: Option<i64>,
2886    #[serde(rename = "@deprecated")]
2887    pub deprecated: ArrangementDeprecated,
2888    /// Compatibility alias for tempo, serialized as a string or `null`.
2889    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2890    #[deprecated = "deprecated in the ChurchTools API"]
2891    pub bpm: Option<String>,
2892    /// List of files uploaded to that arrangement
2893    pub files: Vec<FileOrLink>,
2894    #[serde(deserialize_with = "crate::lenient::number")]
2895    pub id: i64,
2896    /// Whether this arrangement is marked as a default for its song.
2897    #[serde(rename = "isDefault")]
2898    pub is_default: bool,
2899    /// Use 'key' instead
2900    /// 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`, ….
2901    #[serde(rename = "keyOfArrangement", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2902    #[deprecated = "Use 'key' instead"]
2903    pub key_of_arrangement: Option<String>,
2904    /// List of links "uploaded" to that arrangement
2905    pub links: Vec<FileOrLink>,
2906    pub meta: MetaDataEntityId,
2907    /// Use 'description' instead
2908    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2909    #[deprecated = "Use 'description' instead"]
2910    pub note: Option<String>,
2911    /// Source associated with this arrangement, or `null` when none is assigned.
2912    #[serde(default, skip_serializing_if = "Option::is_none")]
2913    pub source: Option<SongSource>,
2914    /// Source abbreviation if set, otherwise its name, or `null` when no source is assigned.
2915    #[serde(rename = "sourceName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
2916    #[deprecated = "deprecated in the ChurchTools API"]
2917    pub source_name: Option<String>,
2918    /// Fields not described by the spec, e.g. instance-specific DB fields.
2919    #[serde(flatten)]
2920    pub extra: serde_json::Map<String, serde_json::Value>,
2921}
2922
2923/// A new musical version of a song, optionally assigning existing files.
2924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2925pub struct ArrangementCreate {
2926    /// Free-text time signature, such as `4/4` or `6/8`.
2927    ///
2928    /// `None` leaves the field out, `Some(None)` sends `null`.
2929    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2930    pub beat: Option<Option<String>>,
2931    /// Notes about performing this arrangement.
2932    ///
2933    /// `None` leaves the field out, `Some(None)` sends `null`.
2934    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2935    pub description: Option<Option<String>>,
2936    /// Expected duration in seconds.
2937    ///
2938    /// `None` leaves the field out, `Some(None)` sends `null`.
2939    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2940    pub duration: Option<Option<i64>>,
2941    /// Musical key using the API spelling.
2942    /// 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`, ….
2943    ///
2944    /// `None` leaves the field out, `Some(None)` sends `null`.
2945    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2946    pub key: Option<Option<String>>,
2947    /// Name distinguishing this version from other arrangements.
2948    #[serde(deserialize_with = "crate::lenient::string")]
2949    pub name: String,
2950    /// ID of a song source, such as a hymnal or songbook, from GET /song/sources.
2951    ///
2952    /// `None` leaves the field out, `Some(None)` sends `null`.
2953    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2954    pub source_id: Option<Option<i64>>,
2955    /// Location within the selected source, such as a song number or page. Only used with sourceId.
2956    ///
2957    /// `None` leaves the field out, `Some(None)` sends `null`.
2958    #[serde(rename = "sourceReference", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2959    pub source_reference: Option<Option<String>>,
2960    /// Tempo in beats per minute.
2961    ///
2962    /// `None` leaves the field out, `Some(None)` sends `null`.
2963    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
2964    pub tempo: Option<Option<i64>>,
2965    /// IDs of existing files to assign to the arrangement.
2966    #[serde(rename = "fileIds", default, skip_serializing_if = "Option::is_none")]
2967    pub file_ids: Option<Vec<i64>>,
2968    /// `true` makes this the song's only default arrangement. The first arrangement of a song becomes the default regardless of this value.
2969    #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")]
2970    pub is_default: Option<bool>,
2971    /// Fields not described by the spec, e.g. instance-specific DB fields.
2972    #[serde(flatten)]
2973    pub extra: serde_json::Map<String, serde_json::Value>,
2974}
2975
2976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2977pub struct ArrangementDeprecated {
2978    /// Allowed values: `tempo`.
2979    #[serde(deserialize_with = "crate::lenient::string")]
2980    pub bpm: String,
2981    /// Allowed values: `key`.
2982    #[serde(rename = "keyOfArrangement", deserialize_with = "crate::lenient::string")]
2983    pub key_of_arrangement: String,
2984    /// Allowed values: `description`.
2985    #[serde(deserialize_with = "crate::lenient::string")]
2986    pub note: String,
2987    /// Allowed values: `source.name`.
2988    #[serde(rename = "sourceName", deserialize_with = "crate::lenient::string")]
2989    pub source_name: String,
2990    /// Fields not described by the spec, e.g. instance-specific DB fields.
2991    #[serde(flatten)]
2992    pub extra: serde_json::Map<String, serde_json::Value>,
2993}
2994
2995/// Result of synchronous audio transposition. These fields are returned directly at the top level, without a data or meta wrapper.
2996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2997pub struct ArrangementFileTranspose {
2998    /// Display filename with the signed semitone count inserted before the original extension. For example, down2 changes Rehearsal.mp3 to Rehearsal-2.mp3.
2999    #[serde(deserialize_with = "crate::lenient::string")]
3000    pub bezeichnung: String,
3001    /// Storage filename of the new file, currently a content hash. Use bezeichnung for the human-readable name.
3002    #[serde(deserialize_with = "crate::lenient::string")]
3003    pub filename: String,
3004    /// ID of the newly created file.
3005    #[serde(deserialize_with = "crate::lenient::number")]
3006    pub id: i64,
3007    /// Modification timestamp of the new file.
3008    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
3009    pub modified_date: chrono::DateTime<chrono::Utc>,
3010    /// True when conversion and saving the new file succeeded. Failures use an error response.
3011    pub success: bool,
3012    /// Relative download URL of the new file, resolved against the ChurchTools installation URL.
3013    #[serde(deserialize_with = "crate::lenient::string")]
3014    pub url: String,
3015    /// Fields not described by the spec, e.g. instance-specific DB fields.
3016    #[serde(flatten)]
3017    pub extra: serde_json::Map<String, serde_json::Value>,
3018}
3019
3020/// Creates a transposed audio copy from an existing file. No file upload is included in this request.
3021#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3022pub struct ArrangementFileTransposeCreate {
3023    /// Pitch shift in semitones: up1 through up6 raise the pitch by one to six semitones, down1 through down6 lower it. For example, up2 moves C to D. Zero and shifts beyond six semitones are not accepted.
3024    /// Allowed values: `down1`, `down2`, `down3`, `down4`, `down5`, `down6`, `up1`, `up2`, `up3`, `up4`, `up5`, `up6`.
3025    #[serde(rename = "transpose-interval", deserialize_with = "crate::lenient::string")]
3026    pub transpose_interval: String,
3027    /// Fields not described by the spec, e.g. instance-specific DB fields.
3028    #[serde(flatten)]
3029    pub extra: serde_json::Map<String, serde_json::Value>,
3030}
3031
3032/// Musical details of one song version. Files, links and the default flag are managed separately.
3033#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3034pub struct ArrangementUpdate {
3035    /// Free-text time signature, such as `4/4` or `6/8`.
3036    ///
3037    /// `None` leaves the field out, `Some(None)` sends `null`.
3038    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3039    pub beat: Option<Option<String>>,
3040    /// Notes about performing this arrangement.
3041    ///
3042    /// `None` leaves the field out, `Some(None)` sends `null`.
3043    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3044    pub description: Option<Option<String>>,
3045    /// Expected duration in seconds.
3046    ///
3047    /// `None` leaves the field out, `Some(None)` sends `null`.
3048    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3049    pub duration: Option<Option<i64>>,
3050    /// Musical key using the API spelling.
3051    /// 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`, ….
3052    ///
3053    /// `None` leaves the field out, `Some(None)` sends `null`.
3054    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3055    pub key: Option<Option<String>>,
3056    /// Name distinguishing this version from other arrangements.
3057    #[serde(deserialize_with = "crate::lenient::string")]
3058    pub name: String,
3059    /// ID of a song source, such as a hymnal or songbook, from GET /song/sources.
3060    ///
3061    /// `None` leaves the field out, `Some(None)` sends `null`.
3062    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3063    pub source_id: Option<Option<i64>>,
3064    /// Location within the selected source, such as a song number or page. Only used with sourceId.
3065    ///
3066    /// `None` leaves the field out, `Some(None)` sends `null`.
3067    #[serde(rename = "sourceReference", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3068    pub source_reference: Option<Option<String>>,
3069    /// Tempo in beats per minute.
3070    ///
3071    /// `None` leaves the field out, `Some(None)` sends `null`.
3072    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3073    pub tempo: Option<Option<i64>>,
3074    /// Fields not described by the spec, e.g. instance-specific DB fields.
3075    #[serde(flatten)]
3076    pub extra: serde_json::Map<String, serde_json::Value>,
3077}
3078
3079#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3080pub struct Association {
3081    #[serde(deserialize_with = "crate::lenient::string")]
3082    pub abbreviation: String,
3083    /// ISO 3166-1 alpha-2 country code of the association.
3084    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3085    pub country: Option<String>,
3086    #[serde(deserialize_with = "crate::lenient::number")]
3087    pub id: i64,
3088    #[serde(deserialize_with = "crate::lenient::string")]
3089    pub key: String,
3090    #[serde(deserialize_with = "crate::lenient::string")]
3091    pub name: String,
3092    /// Fields not described by the spec, e.g. instance-specific DB fields.
3093    #[serde(flatten)]
3094    pub extra: serde_json::Map<String, serde_json::Value>,
3095}
3096
3097/// Balance-sheet selection. The API parses both dates but does not reject reversed or out-of-period ranges.
3098#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3099pub struct BalanceReportCreate {
3100    /// Account-type IDs. Omission, null or \[\] selects all types. Existing IDs must be JSON integers; numeric strings do not match. Unknown IDs are ignored.
3101    ///
3102    /// `None` leaves the field out, `Some(None)` sends `null`.
3103    #[serde(rename = "accountTypes", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3104    pub account_types: Option<Option<Vec<i64>>>,
3105    /// Accounting period owning the accounts. Requires finance edit masterdata or explicit view/edit permission for this period.
3106    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
3107    pub accounting_period_id: i64,
3108    /// PDF creates a file and returns its URL with HTTP 201. CSV/XLSX return the file directly with HTTP 200. Accept: text/html overrides this selection.
3109    /// Allowed values: `csv`, `pdf`, `xlsx`.
3110    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3111    pub format: Option<String>,
3112    /// Include account-group grouping/columns in the report.
3113    #[serde(rename = "showAccountGroups", default, skip_serializing_if = "Option::is_none")]
3114    pub show_account_groups: Option<bool>,
3115    /// Include zero-value accounts according to the selected report’s balance/activity calculation.
3116    #[serde(rename = "showEmptyAccounts", default, skip_serializing_if = "Option::is_none")]
3117    pub show_empty_accounts: Option<bool>,
3118    /// Last document date to include.
3119    #[serde(rename = "endDate")]
3120    pub end_date: chrono::NaiveDate,
3121    /// First document date to include.
3122    #[serde(rename = "startDate")]
3123    pub start_date: chrono::NaiveDate,
3124    /// Fields not described by the spec, e.g. instance-specific DB fields.
3125    #[serde(flatten)]
3126    pub extra: serde_json::Map<String, serde_json::Value>,
3127}
3128
3129/// Supporting document (Beleg) attached to a finance booking or booking suggestion. This represents the uploaded evidence, not an invoice or payment request.
3130#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3131pub struct Bill {
3132    /// Accounting period shared by the linked booking or suggestion.
3133    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
3134    pub accounting_period_id: i64,
3135    /// File attached to a bill. This embedded representation has no file ID; use its fileUrl to download the document.
3136    pub file: BillFile,
3137    #[serde(deserialize_with = "crate::lenient::number")]
3138    pub id: i64,
3139    pub meta: MetaDataEntityId,
3140    /// Linked split transaction, covering its component transactions. Null when no such link is stored.
3141    #[serde(rename = "splitTransactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3142    pub split_transaction_id: Option<i64>,
3143    /// Date the supporting document was submitted, independently of the booking date.
3144    #[serde(rename = "submittedDate")]
3145    pub submitted_date: chrono::NaiveDate,
3146    /// Person who submitted the document. Must exist and be visible to the caller.
3147    #[serde(rename = "submittedPid", deserialize_with = "crate::lenient::number")]
3148    pub submitted_pid: i64,
3149    /// Linked ordinary transaction. Null when no such link is stored.
3150    #[serde(rename = "transactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3151    pub transaction_id: Option<i64>,
3152    /// Linked booking suggestion from an account statement. Null when no such link is stored.
3153    #[serde(rename = "transactionSuggestionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3154    pub transaction_suggestion_id: Option<i64>,
3155    /// Fields not described by the spec, e.g. instance-specific DB fields.
3156    #[serde(flatten)]
3157    pub extra: serde_json::Map<String, serde_json::Value>,
3158}
3159
3160#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3161pub struct BillCreateWithSplit {
3162    /// Accounting period shared by the linked booking or suggestion.
3163    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
3164    pub accounting_period_id: i64,
3165    /// Existing uploaded file. A file in the unknown domain is reassigned to the bill; a file in another domain is copied before assignment.
3166    #[serde(rename = "fileId", deserialize_with = "crate::lenient::number")]
3167    pub file_id: i64,
3168    /// Optional new display name for the attached file. Omission or null retains its name.
3169    ///
3170    /// `None` leaves the field out, `Some(None)` sends `null`.
3171    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3172    pub filename: Option<Option<String>>,
3173    #[serde(rename = "splitTransactionId", deserialize_with = "crate::lenient::number")]
3174    pub split_transaction_id: i64,
3175    /// Date the supporting document was submitted, independently of the booking date.
3176    #[serde(rename = "submittedDate")]
3177    pub submitted_date: chrono::NaiveDate,
3178    /// Person who submitted the document. Must exist and be visible to the caller.
3179    #[serde(rename = "submittedPid", deserialize_with = "crate::lenient::number")]
3180    pub submitted_pid: i64,
3181    /// Must be omitted or null when another booking link is selected.
3182    #[serde(rename = "transactionId", default, skip_serializing_if = "serde_json::Value::is_null")]
3183    pub transaction_id: serde_json::Value,
3184    /// Must be omitted or null when another booking link is selected.
3185    #[serde(rename = "transactionSuggestionId", default, skip_serializing_if = "serde_json::Value::is_null")]
3186    pub transaction_suggestion_id: serde_json::Value,
3187    /// Fields not described by the spec, e.g. instance-specific DB fields.
3188    #[serde(flatten)]
3189    pub extra: serde_json::Map<String, serde_json::Value>,
3190}
3191
3192#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3193pub struct BillCreateWithSuggestion {
3194    /// Accounting period shared by the linked booking or suggestion.
3195    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
3196    pub accounting_period_id: i64,
3197    /// Existing uploaded file. A file in the unknown domain is reassigned to the bill; a file in another domain is copied before assignment.
3198    #[serde(rename = "fileId", deserialize_with = "crate::lenient::number")]
3199    pub file_id: i64,
3200    /// Optional new display name for the attached file. Omission or null retains its name.
3201    ///
3202    /// `None` leaves the field out, `Some(None)` sends `null`.
3203    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3204    pub filename: Option<Option<String>>,
3205    /// Must be omitted or null when another booking link is selected.
3206    #[serde(rename = "splitTransactionId", default, skip_serializing_if = "serde_json::Value::is_null")]
3207    pub split_transaction_id: serde_json::Value,
3208    /// Date the supporting document was submitted, independently of the booking date.
3209    #[serde(rename = "submittedDate")]
3210    pub submitted_date: chrono::NaiveDate,
3211    /// Person who submitted the document. Must exist and be visible to the caller.
3212    #[serde(rename = "submittedPid", deserialize_with = "crate::lenient::number")]
3213    pub submitted_pid: i64,
3214    /// Must be omitted or null when another booking link is selected.
3215    #[serde(rename = "transactionId", default, skip_serializing_if = "serde_json::Value::is_null")]
3216    pub transaction_id: serde_json::Value,
3217    #[serde(rename = "transactionSuggestionId", deserialize_with = "crate::lenient::number")]
3218    pub transaction_suggestion_id: i64,
3219    /// Fields not described by the spec, e.g. instance-specific DB fields.
3220    #[serde(flatten)]
3221    pub extra: serde_json::Map<String, serde_json::Value>,
3222}
3223
3224#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3225pub struct BillCreateWithTransaction {
3226    /// Accounting period shared by the linked booking or suggestion.
3227    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
3228    pub accounting_period_id: i64,
3229    /// Existing uploaded file. A file in the unknown domain is reassigned to the bill; a file in another domain is copied before assignment.
3230    #[serde(rename = "fileId", deserialize_with = "crate::lenient::number")]
3231    pub file_id: i64,
3232    /// Optional new display name for the attached file. Omission or null retains its name.
3233    ///
3234    /// `None` leaves the field out, `Some(None)` sends `null`.
3235    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3236    pub filename: Option<Option<String>>,
3237    /// Must be omitted or null when another booking link is selected.
3238    #[serde(rename = "splitTransactionId", default, skip_serializing_if = "serde_json::Value::is_null")]
3239    pub split_transaction_id: serde_json::Value,
3240    /// Date the supporting document was submitted, independently of the booking date.
3241    #[serde(rename = "submittedDate")]
3242    pub submitted_date: chrono::NaiveDate,
3243    /// Person who submitted the document. Must exist and be visible to the caller.
3244    #[serde(rename = "submittedPid", deserialize_with = "crate::lenient::number")]
3245    pub submitted_pid: i64,
3246    #[serde(rename = "transactionId", deserialize_with = "crate::lenient::number")]
3247    pub transaction_id: i64,
3248    /// Must be omitted or null when another booking link is selected.
3249    #[serde(rename = "transactionSuggestionId", default, skip_serializing_if = "serde_json::Value::is_null")]
3250    pub transaction_suggestion_id: serde_json::Value,
3251    /// Fields not described by the spec, e.g. instance-specific DB fields.
3252    #[serde(flatten)]
3253    pub extra: serde_json::Map<String, serde_json::Value>,
3254}
3255
3256/// File attached to a bill. This embedded representation has no file ID; use its fileUrl to download the document.
3257#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3258pub struct BillFile {
3259    /// Bill ID stored as a file-domain string.
3260    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3261    pub domain_id: Option<String>,
3262    /// Allowed values: `bill`.
3263    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
3264    pub domain_type: String,
3265    #[serde(rename = "fileUrl", deserialize_with = "crate::lenient::string")]
3266    pub file_url: String,
3267    /// Stored filename, or null when unavailable.
3268    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3269    pub filename: Option<String>,
3270    /// Image preview URL when available; otherwise null.
3271    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3272    pub image_url: Option<String>,
3273    /// File modification metadata. Creation metadata is not serialized.
3274    pub meta: BillFileMetaData,
3275    #[serde(deserialize_with = "crate::lenient::string")]
3276    pub name: String,
3277    /// Fields not described by the spec, e.g. instance-specific DB fields.
3278    #[serde(flatten)]
3279    pub extra: serde_json::Map<String, serde_json::Value>,
3280}
3281
3282/// File modification metadata. Creation metadata is not serialized.
3283#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3284pub struct BillFileMetaData {
3285    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
3286    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
3287    pub modified_date: chrono::DateTime<chrono::Utc>,
3288    #[serde(rename = "modifiedPerson")]
3289    pub modified_person: MetaDataPersonId,
3290    /// Fields not described by the spec, e.g. instance-specific DB fields.
3291    #[serde(flatten)]
3292    pub extra: serde_json::Map<String, serde_json::Value>,
3293}
3294
3295/// Updates submission details and optionally changes the booking link. Omitted or null link IDs retain the current link. Supply at most one new link: when multiple IDs are supplied, the service gives splitTransactionId precedence over transactionId over transactionSuggestionId. Setting only a suggestion currently does not clear existing transaction links. The accounting period and attached file cannot be replaced here.
3296#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3297pub struct BillUpdate {
3298    /// Optional new display name for the attached file. Omission or null retains its name.
3299    ///
3300    /// `None` leaves the field out, `Some(None)` sends `null`.
3301    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3302    pub filename: Option<Option<String>>,
3303    /// Linked split transaction, covering its component transactions.
3304    ///
3305    /// `None` leaves the field out, `Some(None)` sends `null`.
3306    #[serde(rename = "splitTransactionId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3307    pub split_transaction_id: Option<Option<i64>>,
3308    /// Date the supporting document was submitted, independently of the booking date.
3309    #[serde(rename = "submittedDate")]
3310    pub submitted_date: chrono::NaiveDate,
3311    /// Person who submitted the document. Must exist and be visible to the caller.
3312    #[serde(rename = "submittedPid", deserialize_with = "crate::lenient::number")]
3313    pub submitted_pid: i64,
3314    /// Linked ordinary transaction.
3315    ///
3316    /// `None` leaves the field out, `Some(None)` sends `null`.
3317    #[serde(rename = "transactionId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3318    pub transaction_id: Option<Option<i64>>,
3319    /// Linked booking suggestion from an account statement.
3320    ///
3321    /// `None` leaves the field out, `Some(None)` sends `null`.
3322    #[serde(rename = "transactionSuggestionId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3323    pub transaction_suggestion_id: Option<Option<i64>>,
3324    /// Fields not described by the spec, e.g. instance-specific DB fields.
3325    #[serde(flatten)]
3326    pub extra: serde_json::Map<String, serde_json::Value>,
3327}
3328
3329#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3330pub struct BlogItem {
3331    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3332    pub author: Option<String>,
3333    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3334    pub content: Option<String>,
3335    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3336    pub date: Option<String>,
3337    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3338    pub description: Option<String>,
3339    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3340    pub image: Option<String>,
3341    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3342    pub link: Option<String>,
3343    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3344    pub title: Option<String>,
3345    /// Fields not described by the spec, e.g. instance-specific DB fields.
3346    #[serde(flatten)]
3347    pub extra: serde_json::Map<String, serde_json::Value>,
3348}
3349
3350/// Stored additional booking date. Its legacy metadata contains the modifier ID directly.
3351#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3352pub struct BookingAdditional {
3353    /// A simple date in ISO format, e.g. '2022-10-19'
3354    pub date: chrono::NaiveDate,
3355    #[serde(rename = "isRepeated")]
3356    pub is_repeated: bool,
3357    #[serde(deserialize_with = "crate::lenient::number")]
3358    pub id: i64,
3359    pub meta: BookingAdditionalMeta,
3360    /// Fields not described by the spec, e.g. instance-specific DB fields.
3361    #[serde(flatten)]
3362    pub extra: serde_json::Map<String, serde_json::Value>,
3363}
3364
3365#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3366pub struct BookingAdditionalMeta {
3367    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
3368    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
3369    pub modified_date: chrono::DateTime<chrono::Utc>,
3370    #[serde(rename = "modifiedPid", deserialize_with = "crate::lenient::number")]
3371    pub modified_pid: i64,
3372    /// Fields not described by the spec, e.g. instance-specific DB fields.
3373    #[serde(flatten)]
3374    pub extra: serde_json::Map<String, serde_json::Value>,
3375}
3376
3377/// For an appointment-linked booking, only status and description can be changed here. Change the resource and schedule through the linked appointment.
3378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3379pub struct BookingAppointmentUpdate {
3380    /// Booking notes.
3381    ///
3382    /// `None` leaves the field out, `Some(None)` sends `null`.
3383    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3384    pub description: Option<Option<String>>,
3385    /// Booking status: 1 = pending approval, 2 = approved, 3 = rejected. Rejected bookings are excluded from conflict checks.
3386    /// Allowed values: `1`, `2`, `3`.
3387    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3388    pub status_id: Option<i64>,
3389    /// Fields not described by the spec, e.g. instance-specific DB fields.
3390    #[serde(flatten)]
3391    pub extra: serde_json::Map<String, serde_json::Value>,
3392}
3393
3394/// Stored resource booking, which may represent a recurring series. A booking reserves one resource. `appointment` links it to a calendar appointment; `null` identifies an independent booking. Use calculated occurrence dates when displaying a series in a date range.
3395#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3396pub struct BookingBase {
3397    pub additionals: Vec<BookingAdditional>,
3398    #[serde(rename = "allDay")]
3399    pub all_day: bool,
3400    /// When the current approval or rejection was recorded; null while unanswered.
3401    #[serde(rename = "answeredDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
3402    pub answered_date: Option<chrono::DateTime<chrono::Utc>>,
3403    /// Person who recorded the answer, including the system user for automatic approval; null while unanswered.
3404    #[serde(rename = "answeredPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3405    pub answered_pid: Option<i64>,
3406    /// Linked calendar appointment, or null for an independent booking.
3407    #[serde(default, skip_serializing_if = "Option::is_none")]
3408    pub appointment: Option<SimpleAppointment>,
3409    /// Use `appointment` instead.
3410    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3411    #[deprecated = "Use `appointment` instead."]
3412    pub appointment_id: Option<i64>,
3413    /// Use `title` instead.
3414    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3415    #[deprecated = "Use `title` instead."]
3416    pub caption: Option<String>,
3417    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3418    pub description: Option<String>,
3419    #[serde(rename = "endDate")]
3420    pub end_date: crate::DateOrDateTime,
3421    pub exceptions: Vec<BookingException>,
3422    #[serde(deserialize_with = "crate::lenient::number")]
3423    pub id: i64,
3424    /// Included with `include[]=involvedPersonsDomainObjects`. The person for whom the booking was made and the person who answered can be null.
3425    #[serde(rename = "involvedPersonsDomainObjects", default, skip_serializing_if = "Option::is_none")]
3426    pub involved_persons_domain_objects: Option<BookingCalculatedWithIncludesBaseInvolvedPersonsDomainObjects>,
3427    /// True when the reader may see availability but booking title, subtitle and description are hidden. This can result from missing access to the linked calendar or public-user anonymization settings.
3428    #[serde(rename = "isAnonymized")]
3429    pub is_anonymized: bool,
3430    /// Use `subtitle` instead.
3431    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3432    #[deprecated = "Use `subtitle` instead."]
3433    pub location: Option<String>,
3434    pub meta: MetaDataEntityId,
3435    /// Use `description` instead.
3436    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3437    #[deprecated = "Use `description` instead."]
3438    pub note: Option<String>,
3439    /// Person for whom the booking is made.
3440    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3441    pub on_behalf_of_pid: Option<i64>,
3442    #[serde(deserialize_with = "crate::lenient::number")]
3443    pub quantity: i64,
3444    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
3445    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3446    pub repeat_frequency: Option<i64>,
3447    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
3448    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
3449    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
3450    pub repeat_id: i64,
3451    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
3452    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3453    pub repeat_option: Option<i64>,
3454    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
3455    #[serde(rename = "repeatUntil", default, skip_serializing_if = "Option::is_none")]
3456    pub repeat_until: Option<chrono::NaiveDate>,
3457    /// Use `resourceId` instead.
3458    #[serde(default, skip_serializing_if = "Option::is_none")]
3459    #[deprecated = "Use `resourceId` instead."]
3460    pub resource: Option<BookingCalculatedWithIncludesBaseResource>,
3461    /// Resource to reserve, such as a room, vehicle or piece of equipment.
3462    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
3463    pub resource_id: i64,
3464    /// Whether the booking is marked for display in the calendar. This does not create or link a calendar appointment.
3465    #[serde(rename = "showInCal")]
3466    pub show_in_cal: bool,
3467    #[serde(rename = "startDate")]
3468    pub start_date: crate::DateOrDateTime,
3469    /// Booking status: 1 = pending approval, 2 = approved, 3 = rejected. Rejected bookings are excluded from conflict checks.
3470    /// Allowed values: `1`, `2`, `3`.
3471    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
3472    pub status_id: i64,
3473    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3474    pub subtitle: Option<String>,
3475    #[serde(deserialize_with = "crate::lenient::string")]
3476    pub title: String,
3477    /// Version counter increased by booking updates and status changes.
3478    #[serde(deserialize_with = "crate::lenient::number")]
3479    pub version: i64,
3480    /// Fields not described by the spec, e.g. instance-specific DB fields.
3481    #[serde(flatten)]
3482    pub extra: serde_json::Map<String, serde_json::Value>,
3483}
3484
3485/// One occurrence: base describes the stored series, calculated contains the dates of this occurrence.
3486#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3487pub struct BookingCalculated {
3488    /// Stored resource booking, which may represent a recurring series. A booking reserves one resource. `appointment` links it to a calendar appointment; `null` identifies an independent booking. Use calculated occurrence dates when displaying a series in a date range.
3489    pub base: BookingBase,
3490    pub calculated: BookingCalculatedCalculated,
3491    /// Fields not described by the spec, e.g. instance-specific DB fields.
3492    #[serde(flatten)]
3493    pub extra: serde_json::Map<String, serde_json::Value>,
3494}
3495
3496#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3497pub struct BookingCalculatedCalculated {
3498    #[serde(rename = "endDate")]
3499    pub end_date: crate::DateOrDateTime,
3500    #[serde(rename = "startDate")]
3501    pub start_date: crate::DateOrDateTime,
3502    /// Fields not described by the spec, e.g. instance-specific DB fields.
3503    #[serde(flatten)]
3504    pub extra: serde_json::Map<String, serde_json::Value>,
3505}
3506
3507#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3508pub struct BookingCalculatedWithIncludes {
3509    /// Use booking.base.
3510    #[serde(default, skip_serializing_if = "Option::is_none")]
3511    #[deprecated = "Use booking."]
3512    pub base: Option<BookingCalculatedWithIncludesBase>,
3513    /// One occurrence: base describes the stored series, calculated contains the dates of this occurrence.
3514    pub booking: BookingCalculated,
3515    /// Use booking.calculated.
3516    #[serde(default, skip_serializing_if = "Option::is_none")]
3517    #[deprecated = "Use booking."]
3518    pub calculated: Option<BookingCalculatedWithIncludesCalculated>,
3519    /// Included with `include[]=conflicts`. Conflicts are collected for the booking ID across the requested range, so multiple occurrences of the same series can carry the same list.
3520    #[serde(default, skip_serializing_if = "Option::is_none")]
3521    pub conflicts: Option<Vec<BookingConflict>>,
3522    /// Fields not described by the spec, e.g. instance-specific DB fields.
3523    #[serde(flatten)]
3524    pub extra: serde_json::Map<String, serde_json::Value>,
3525}
3526
3527/// Use booking.base.
3528#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3529pub struct BookingCalculatedWithIncludesBase {
3530    pub additionals: Vec<BookingAdditional>,
3531    #[serde(rename = "allDay")]
3532    pub all_day: bool,
3533    /// When the current approval or rejection was recorded; null while unanswered.
3534    #[serde(rename = "answeredDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
3535    pub answered_date: Option<chrono::DateTime<chrono::Utc>>,
3536    /// Person who recorded the answer, including the system user for automatic approval; null while unanswered.
3537    #[serde(rename = "answeredPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3538    pub answered_pid: Option<i64>,
3539    /// Linked calendar appointment, or null for an independent booking.
3540    #[serde(default, skip_serializing_if = "Option::is_none")]
3541    pub appointment: Option<SimpleAppointment>,
3542    /// Use `appointment` instead.
3543    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3544    #[deprecated = "Use `appointment` instead."]
3545    pub appointment_id: Option<i64>,
3546    /// Use `title` instead.
3547    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3548    #[deprecated = "Use `title` instead."]
3549    pub caption: Option<String>,
3550    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3551    pub description: Option<String>,
3552    #[serde(rename = "endDate")]
3553    pub end_date: crate::DateOrDateTime,
3554    pub exceptions: Vec<BookingException>,
3555    #[serde(deserialize_with = "crate::lenient::number")]
3556    pub id: i64,
3557    /// Included with `include[]=involvedPersonsDomainObjects`. The person for whom the booking was made and the person who answered can be null.
3558    #[serde(rename = "involvedPersonsDomainObjects", default, skip_serializing_if = "Option::is_none")]
3559    pub involved_persons_domain_objects: Option<BookingCalculatedWithIncludesBaseInvolvedPersonsDomainObjects>,
3560    /// True when the reader may see availability but booking title, subtitle and description are hidden. This can result from missing access to the linked calendar or public-user anonymization settings.
3561    #[serde(rename = "isAnonymized")]
3562    pub is_anonymized: bool,
3563    /// Use `subtitle` instead.
3564    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3565    #[deprecated = "Use `subtitle` instead."]
3566    pub location: Option<String>,
3567    pub meta: MetaDataEntityId,
3568    /// Use `description` instead.
3569    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3570    #[deprecated = "Use `description` instead."]
3571    pub note: Option<String>,
3572    /// Person for whom the booking is made.
3573    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3574    pub on_behalf_of_pid: Option<i64>,
3575    #[serde(deserialize_with = "crate::lenient::number")]
3576    pub quantity: i64,
3577    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
3578    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3579    pub repeat_frequency: Option<i64>,
3580    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
3581    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
3582    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
3583    pub repeat_id: i64,
3584    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
3585    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3586    pub repeat_option: Option<i64>,
3587    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
3588    #[serde(rename = "repeatUntil", default, skip_serializing_if = "Option::is_none")]
3589    pub repeat_until: Option<chrono::NaiveDate>,
3590    /// Use `resourceId` instead.
3591    #[serde(default, skip_serializing_if = "Option::is_none")]
3592    #[deprecated = "Use `resourceId` instead."]
3593    pub resource: Option<BookingCalculatedWithIncludesBaseResource>,
3594    /// Resource to reserve, such as a room, vehicle or piece of equipment.
3595    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
3596    pub resource_id: i64,
3597    /// Whether the booking is marked for display in the calendar. This does not create or link a calendar appointment.
3598    #[serde(rename = "showInCal")]
3599    pub show_in_cal: bool,
3600    #[serde(rename = "startDate")]
3601    pub start_date: crate::DateOrDateTime,
3602    /// Booking status: 1 = pending approval, 2 = approved, 3 = rejected. Rejected bookings are excluded from conflict checks.
3603    /// Allowed values: `1`, `2`, `3`.
3604    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
3605    pub status_id: i64,
3606    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3607    pub subtitle: Option<String>,
3608    #[serde(deserialize_with = "crate::lenient::string")]
3609    pub title: String,
3610    /// Version counter increased by booking updates and status changes.
3611    #[serde(deserialize_with = "crate::lenient::number")]
3612    pub version: i64,
3613    /// Fields not described by the spec, e.g. instance-specific DB fields.
3614    #[serde(flatten)]
3615    pub extra: serde_json::Map<String, serde_json::Value>,
3616}
3617
3618/// Included with `include[]=involvedPersonsDomainObjects`. The person for whom the booking was made and the person who answered can be null.
3619#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3620pub struct BookingCalculatedWithIncludesBaseInvolvedPersonsDomainObjects {
3621    #[serde(rename = "answeredBy", default, skip_serializing_if = "Option::is_none")]
3622    pub answered_by: Option<DomainObjectPerson>,
3623    /// Person as Domain Object
3624    #[serde(rename = "createdBy")]
3625    pub created_by: DomainObjectPerson,
3626    /// Person as Domain Object
3627    #[serde(rename = "modifiedBy")]
3628    pub modified_by: DomainObjectPerson,
3629    #[serde(rename = "onBehalfOf", default, skip_serializing_if = "Option::is_none")]
3630    pub on_behalf_of: Option<DomainObjectPerson>,
3631    /// Fields not described by the spec, e.g. instance-specific DB fields.
3632    #[serde(flatten)]
3633    pub extra: serde_json::Map<String, serde_json::Value>,
3634}
3635
3636/// Use `resourceId` instead.
3637#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3638pub struct BookingCalculatedWithIncludesBaseResource {
3639    /// Persons responsible for this resource. Resource administrators can view and administer its bookings; changing resource settings still requires permission to edit resource master data.
3640    #[serde(rename = "adminIds")]
3641    pub admin_ids: Vec<i64>,
3642    /// Additional information about the resource, such as capacity or available equipment.
3643    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3644    pub description: Option<String>,
3645    /// Location text used in the resource’s iCalendar export.
3646    #[serde(rename = "iCalLocation", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3647    pub i_cal_location: Option<String>,
3648    /// Automatically approves pending bookings when there are no conflicts. For virtual resources, automatic approval bypasses the conflict check. This does not grant permission to edit resource settings.
3649    #[serde(rename = "isAutoAccept")]
3650    pub is_auto_accept: bool,
3651    /// Whether this is a virtual resource. Virtual bookings have a separate creation permission and bypass conflicts when checking automatic approval.
3652    #[serde(rename = "isVirtual")]
3653    pub is_virtual: bool,
3654    /// Internal location of the resource.
3655    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3656    pub location: Option<String>,
3657    /// Name of the individual resource, for example a room or vehicle.
3658    #[serde(deserialize_with = "crate::lenient::string")]
3659    pub name: String,
3660    /// Number of units available for simultaneous bookings.
3661    #[serde(deserialize_with = "crate::lenient::number")]
3662    pub quantity: i64,
3663    /// Access token used by the legacy public iCalendar export. Changing or clearing it invalidates subscriptions using the previous token.
3664    #[serde(rename = "randomString", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
3665    pub random_string: Option<String>,
3666    /// Resource type used to group this resource, such as rooms or vehicles. Resource types are available from `/resourcetypes`.
3667    #[serde(rename = "resourceTypeId", deserialize_with = "crate::lenient::number")]
3668    pub resource_type_id: i64,
3669    /// Sort value for displaying resources.
3670    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
3671    pub sort_key: i64,
3672    /// Use `needsAppointment` instead.
3673    #[serde(rename = "doesRequireCalEntry", default, skip_serializing_if = "Option::is_none")]
3674    #[deprecated = "Use `needsAppointment` instead."]
3675    pub does_require_cal_entry: Option<bool>,
3676    #[serde(deserialize_with = "crate::lenient::number")]
3677    pub id: i64,
3678    /// Included with `include[]=involvedPersonsDomainObjects`. Contains person references for resolvable `adminIds`; missing persons are omitted.
3679    #[serde(rename = "involvedPersonsDomainObjects", default, skip_serializing_if = "Option::is_none")]
3680    pub involved_persons_domain_objects: Option<BookingCalculatedWithIncludesBaseResourceInvolvedPersonsDomainObjects>,
3681    pub meta: MetaDataEntityId,
3682    /// Resource name translated for the current language, falling back to name.
3683    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
3684    pub name_translated: String,
3685    /// Whether bookings must be linked to a calendar appointment. Legacy resources can return null.
3686    #[serde(rename = "needsAppointment", default, skip_serializing_if = "Option::is_none")]
3687    pub needs_appointment: Option<bool>,
3688    /// Fields not described by the spec, e.g. instance-specific DB fields.
3689    #[serde(flatten)]
3690    pub extra: serde_json::Map<String, serde_json::Value>,
3691}
3692
3693/// Included with `include[]=involvedPersonsDomainObjects`. Contains person references for resolvable `adminIds`; missing persons are omitted.
3694#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3695pub struct BookingCalculatedWithIncludesBaseResourceInvolvedPersonsDomainObjects {
3696    pub admins: Vec<DomainObjectPerson>,
3697    /// Fields not described by the spec, e.g. instance-specific DB fields.
3698    #[serde(flatten)]
3699    pub extra: serde_json::Map<String, serde_json::Value>,
3700}
3701
3702/// Use booking.calculated.
3703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3704pub struct BookingCalculatedWithIncludesCalculated {
3705    #[serde(rename = "endDate")]
3706    pub end_date: crate::DateOrDateTime,
3707    #[serde(rename = "startDate")]
3708    pub start_date: crate::DateOrDateTime,
3709    /// Fields not described by the spec, e.g. instance-specific DB fields.
3710    #[serde(flatten)]
3711    pub extra: serde_json::Map<String, serde_json::Value>,
3712}
3713
3714/// An overlapping occurrence of another pending or approved booking for the same resource. Adjacent timed bookings do not conflict. Dates retain their timezone offset.
3715#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3716pub struct BookingConflict {
3717    #[serde(rename = "bookingId", deserialize_with = "crate::lenient::number")]
3718    pub booking_id: i64,
3719    #[serde(rename = "endDate", serialize_with = "crate::datetime::serialize_utc")]
3720    pub end_date: chrono::DateTime<chrono::Utc>,
3721    /// True when title is replaced by the translated unknown-appointment label.
3722    #[serde(rename = "isAnonymized")]
3723    pub is_anonymized: bool,
3724    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
3725    pub start_date: chrono::DateTime<chrono::Utc>,
3726    /// Booking status: 1 = pending approval, 2 = approved, 3 = rejected. Rejected bookings are excluded from conflict checks.
3727    /// Allowed values: `1`, `2`, `3`.
3728    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
3729    pub status_id: i64,
3730    #[serde(deserialize_with = "crate::lenient::string")]
3731    pub title: String,
3732    /// Fields not described by the spec, e.g. instance-specific DB fields.
3733    #[serde(flatten)]
3734    pub extra: serde_json::Map<String, serde_json::Value>,
3735}
3736
3737/// Preview conflicts for a proposed booking without saving it.
3738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3739pub struct BookingConflictRequestBody {
3740    #[serde(default, skip_serializing_if = "Option::is_none")]
3741    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
3742    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
3743    #[serde(rename = "endDate")]
3744    pub end_date: crate::DateOrDateTime,
3745    #[serde(default, skip_serializing_if = "Option::is_none")]
3746    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
3747    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
3748    ///
3749    /// `None` leaves the field out, `Some(None)` sends `null`.
3750    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3751    pub repeat_frequency: Option<Option<i64>>,
3752    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
3753    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
3754    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3755    pub repeat_id: Option<i64>,
3756    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
3757    ///
3758    /// `None` leaves the field out, `Some(None)` sends `null`.
3759    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3760    pub repeat_option: Option<Option<i64>>,
3761    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
3762    ///
3763    /// `None` leaves the field out, `Some(None)` sends `null`.
3764    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3765    pub repeat_until: Option<Option<chrono::NaiveDate>>,
3766    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
3767    #[serde(rename = "startDate")]
3768    pub start_date: crate::DateOrDateTime,
3769    /// Number of resource units reserved by each occurrence.
3770    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3771    pub quantity: Option<i64>,
3772    /// Resource to reserve, such as a room, vehicle or piece of equipment.
3773    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
3774    pub resource_id: i64,
3775    /// Fields not described by the spec, e.g. instance-specific DB fields.
3776    #[serde(flatten)]
3777    pub extra: serde_json::Map<String, serde_json::Value>,
3778}
3779
3780/// Replacement schedule to preview against the stored booking’s resource. The current booking is excluded from conflicts. No data is saved and resourceId is not used.
3781#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3782pub struct BookingConflictUpdate {
3783    #[serde(default, skip_serializing_if = "Option::is_none")]
3784    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
3785    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
3786    #[serde(rename = "endDate")]
3787    pub end_date: crate::DateOrDateTime,
3788    #[serde(default, skip_serializing_if = "Option::is_none")]
3789    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
3790    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
3791    ///
3792    /// `None` leaves the field out, `Some(None)` sends `null`.
3793    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3794    pub repeat_frequency: Option<Option<i64>>,
3795    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
3796    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
3797    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3798    pub repeat_id: Option<i64>,
3799    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
3800    ///
3801    /// `None` leaves the field out, `Some(None)` sends `null`.
3802    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3803    pub repeat_option: Option<Option<i64>>,
3804    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
3805    ///
3806    /// `None` leaves the field out, `Some(None)` sends `null`.
3807    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3808    pub repeat_until: Option<Option<chrono::NaiveDate>>,
3809    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
3810    #[serde(rename = "startDate")]
3811    pub start_date: crate::DateOrDateTime,
3812    /// Number of resource units reserved by each occurrence.
3813    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3814    pub quantity: Option<i64>,
3815    /// Fields not described by the spec, e.g. instance-specific DB fields.
3816    #[serde(flatten)]
3817    pub extra: serde_json::Map<String, serde_json::Value>,
3818}
3819
3820/// Create an independent resource booking. A resource requiring an appointment must instead be booked through the appointment APIs.
3821#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3822pub struct BookingCreate {
3823    #[serde(default, skip_serializing_if = "Option::is_none")]
3824    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
3825    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
3826    #[serde(rename = "endDate")]
3827    pub end_date: crate::DateOrDateTime,
3828    #[serde(default, skip_serializing_if = "Option::is_none")]
3829    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
3830    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
3831    ///
3832    /// `None` leaves the field out, `Some(None)` sends `null`.
3833    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3834    pub repeat_frequency: Option<Option<i64>>,
3835    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
3836    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
3837    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3838    pub repeat_id: Option<i64>,
3839    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
3840    ///
3841    /// `None` leaves the field out, `Some(None)` sends `null`.
3842    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3843    pub repeat_option: Option<Option<i64>>,
3844    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
3845    ///
3846    /// `None` leaves the field out, `Some(None)` sends `null`.
3847    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3848    pub repeat_until: Option<Option<chrono::NaiveDate>>,
3849    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
3850    #[serde(rename = "startDate")]
3851    pub start_date: crate::DateOrDateTime,
3852    /// Number of resource units reserved by each occurrence.
3853    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3854    pub quantity: Option<i64>,
3855    /// Booking notes.
3856    ///
3857    /// `None` leaves the field out, `Some(None)` sends `null`.
3858    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3859    pub description: Option<Option<String>>,
3860    /// Person for whom the booking is made.
3861    ///
3862    /// `None` leaves the field out, `Some(None)` sends `null`.
3863    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3864    pub on_behalf_of_pid: Option<Option<i64>>,
3865    /// Resource to reserve, such as a room, vehicle or piece of equipment.
3866    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
3867    pub resource_id: i64,
3868    /// Whether the booking is marked for display in the calendar. This does not create or link a calendar appointment.
3869    #[serde(rename = "showInCal")]
3870    pub show_in_cal: bool,
3871    /// Booking status: 1 = pending approval, 2 = approved, 3 = rejected. Rejected bookings are excluded from conflict checks.
3872    /// Allowed values: `1`, `2`, `3`.
3873    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
3874    pub status_id: i64,
3875    /// Optional booking subtitle.
3876    ///
3877    /// `None` leaves the field out, `Some(None)` sends `null`.
3878    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3879    pub subtitle: Option<Option<String>>,
3880    /// Booking title shown in resource planning.
3881    #[serde(deserialize_with = "crate::lenient::string")]
3882    pub title: String,
3883    /// Fields not described by the spec, e.g. instance-specific DB fields.
3884    #[serde(flatten)]
3885    pub extra: serde_json::Map<String, serde_json::Value>,
3886}
3887
3888/// Stored date excluded from a booking series.
3889#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3890pub struct BookingException {
3891    /// A simple date in ISO format, e.g. '2022-10-19'
3892    pub date: chrono::NaiveDate,
3893    #[serde(deserialize_with = "crate::lenient::number")]
3894    pub id: i64,
3895    pub meta: MetaDataEntityId,
3896    /// Fields not described by the spec, e.g. instance-specific DB fields.
3897    #[serde(flatten)]
3898    pub extra: serde_json::Map<String, serde_json::Value>,
3899}
3900
3901/// Replacement booking and the scope to remove from the original series. The returned booking has a new ID.
3902#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3903pub struct BookingSplitCreate {
3904    #[serde(default, skip_serializing_if = "Option::is_none")]
3905    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
3906    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
3907    #[serde(rename = "endDate")]
3908    pub end_date: crate::DateOrDateTime,
3909    #[serde(default, skip_serializing_if = "Option::is_none")]
3910    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
3911    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
3912    ///
3913    /// `None` leaves the field out, `Some(None)` sends `null`.
3914    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3915    pub repeat_frequency: Option<Option<i64>>,
3916    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
3917    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
3918    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3919    pub repeat_id: Option<i64>,
3920    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
3921    ///
3922    /// `None` leaves the field out, `Some(None)` sends `null`.
3923    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3924    pub repeat_option: Option<Option<i64>>,
3925    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
3926    ///
3927    /// `None` leaves the field out, `Some(None)` sends `null`.
3928    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3929    pub repeat_until: Option<Option<chrono::NaiveDate>>,
3930    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
3931    #[serde(rename = "startDate")]
3932    pub start_date: crate::DateOrDateTime,
3933    /// Number of resource units reserved by each occurrence.
3934    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3935    pub quantity: Option<i64>,
3936    /// Booking notes.
3937    ///
3938    /// `None` leaves the field out, `Some(None)` sends `null`.
3939    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3940    pub description: Option<Option<String>>,
3941    /// Person for whom the booking is made.
3942    ///
3943    /// `None` leaves the field out, `Some(None)` sends `null`.
3944    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3945    pub on_behalf_of_pid: Option<Option<i64>>,
3946    /// Resource to reserve, such as a room, vehicle or piece of equipment.
3947    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
3948    pub resource_id: i64,
3949    /// Whether the booking is marked for display in the calendar. This does not create or link a calendar appointment.
3950    #[serde(rename = "showInCal")]
3951    pub show_in_cal: bool,
3952    /// Booking status: 1 = pending approval, 2 = approved, 3 = rejected. Rejected bookings are excluded from conflict checks.
3953    /// Allowed values: `1`, `2`, `3`.
3954    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
3955    pub status_id: i64,
3956    /// Optional booking subtitle.
3957    ///
3958    /// `None` leaves the field out, `Some(None)` sends `null`.
3959    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3960    pub subtitle: Option<Option<String>>,
3961    /// Booking title shown in resource planning.
3962    #[serde(deserialize_with = "crate::lenient::string")]
3963    pub title: String,
3964    /// Local start date of the occurrence to remove or the first date to cut from the series.
3965    #[serde(rename = "splitDate")]
3966    pub split_date: chrono::NaiveDate,
3967    /// False excludes splitDate only. True truncates the original series before splitDate and removes its additional dates and exceptions on or after that day.
3968    #[serde(rename = "splitUntilEnd")]
3969    pub split_until_end: bool,
3970    /// Fields not described by the spec, e.g. instance-specific DB fields.
3971    #[serde(flatten)]
3972    pub extra: serde_json::Map<String, serde_json::Value>,
3973}
3974
3975/// Complete replacement input for a booking without a linked appointment. Include every recurrence entry to retain.
3976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3977pub struct BookingStandaloneUpdate {
3978    #[serde(default, skip_serializing_if = "Option::is_none")]
3979    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
3980    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
3981    #[serde(rename = "endDate")]
3982    pub end_date: crate::DateOrDateTime,
3983    #[serde(default, skip_serializing_if = "Option::is_none")]
3984    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
3985    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
3986    ///
3987    /// `None` leaves the field out, `Some(None)` sends `null`.
3988    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3989    pub repeat_frequency: Option<Option<i64>>,
3990    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
3991    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
3992    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
3993    pub repeat_id: Option<i64>,
3994    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
3995    ///
3996    /// `None` leaves the field out, `Some(None)` sends `null`.
3997    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
3998    pub repeat_option: Option<Option<i64>>,
3999    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
4000    ///
4001    /// `None` leaves the field out, `Some(None)` sends `null`.
4002    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4003    pub repeat_until: Option<Option<chrono::NaiveDate>>,
4004    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
4005    #[serde(rename = "startDate")]
4006    pub start_date: crate::DateOrDateTime,
4007    /// Number of resource units reserved by each occurrence.
4008    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4009    pub quantity: Option<i64>,
4010    /// Booking notes.
4011    ///
4012    /// `None` leaves the field out, `Some(None)` sends `null`.
4013    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4014    pub description: Option<Option<String>>,
4015    /// Person for whom the booking is made.
4016    ///
4017    /// `None` leaves the field out, `Some(None)` sends `null`.
4018    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4019    pub on_behalf_of_pid: Option<Option<i64>>,
4020    /// Resource to reserve, such as a room, vehicle or piece of equipment.
4021    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
4022    pub resource_id: i64,
4023    /// Whether the booking is marked for display in the calendar. This does not create or link a calendar appointment.
4024    #[serde(rename = "showInCal")]
4025    pub show_in_cal: bool,
4026    /// Booking status: 1 = pending approval, 2 = approved, 3 = rejected. Rejected bookings are excluded from conflict checks.
4027    /// Allowed values: `1`, `2`, `3`.
4028    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
4029    pub status_id: i64,
4030    /// Optional booking subtitle.
4031    ///
4032    /// `None` leaves the field out, `Some(None)` sends `null`.
4033    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4034    pub subtitle: Option<Option<String>>,
4035    /// Booking title shown in resource planning.
4036    #[serde(deserialize_with = "crate::lenient::string")]
4037    pub title: String,
4038    /// Fields not described by the spec, e.g. instance-specific DB fields.
4039    #[serde(flatten)]
4040    pub extra: serde_json::Map<String, serde_json::Value>,
4041}
4042
4043#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4044pub struct BookingWithIncludes {
4045    /// With `include[]=conflicts`, contains conflicts across the complete series. Otherwise serialized as \[\]. Person includes are attached to booking itself.
4046    #[serde(rename = "additionalInfos", default, skip_serializing_if = "serde_json::Value::is_null")]
4047    pub additional_infos: serde_json::Value,
4048    /// Stored resource booking, which may represent a recurring series. A booking reserves one resource. `appointment` links it to a calendar appointment; `null` identifies an independent booking. Use calculated occurrence dates when displaying a series in a date range.
4049    pub booking: BookingBase,
4050    /// Occurrences indexed by their local start date (YYYY-MM-DD). Values are UTC timestamps, including for all-day bookings. An empty result is serialized as \[\].
4051    #[serde(rename = "calculatedDates", default, skip_serializing_if = "serde_json::Value::is_null")]
4052    pub calculated_dates: serde_json::Value,
4053    /// Fields not described by the spec, e.g. instance-specific DB fields.
4054    #[serde(flatten)]
4055    pub extra: serde_json::Map<String, serde_json::Value>,
4056}
4057
4058#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4059pub struct BookingWithIncludesAdditionalInfosVariant1 {
4060    pub conflicts: Vec<BookingConflict>,
4061    /// Fields not described by the spec, e.g. instance-specific DB fields.
4062    #[serde(flatten)]
4063    pub extra: serde_json::Map<String, serde_json::Value>,
4064}
4065
4066#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4067pub struct BookingWithIncludesCalculatedDatesVariant1Value {
4068    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
4069    #[serde(rename = "endDate", serialize_with = "crate::datetime::serialize_utc")]
4070    pub end_date: chrono::DateTime<chrono::Utc>,
4071    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
4072    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
4073    pub start_date: chrono::DateTime<chrono::Utc>,
4074    /// Fields not described by the spec, e.g. instance-specific DB fields.
4075    #[serde(flatten)]
4076    pub extra: serde_json::Map<String, serde_json::Value>,
4077}
4078
4079/// `event`/`declineEvent`: Cancels or deletes service-planning events. Selected IDs are event IDs, not appointment IDs.
4080#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4081pub struct BulkEventDeclineUpdate {
4082    /// Delete the event when true; otherwise invalidate it. Deletion delegates to the event service.
4083    #[serde(rename = "deleteCalEntry")]
4084    pub delete_cal_entry: bool,
4085    /// Notify assigned persons after processing.
4086    #[serde(rename = "informDeleteEvent")]
4087    pub inform_delete_event: bool,
4088    /// Fields not described by the spec, e.g. instance-specific DB fields.
4089    #[serde(flatten)]
4090    pub extra: serde_json::Map<String, serde_json::Value>,
4091}
4092
4093/// `event`/`addPersonToService`: Assigns a person or free-text name to a service position in each event. Exactly one of `personId` or `personName` must be specified.
4094#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4095pub struct BulkEventServiceAssignmentCreate {
4096    /// never requires a reusable slot; newIfNeeded creates one if needed; alwaysNew adds a slot unless the same assignee already has a valid assignment.
4097    /// Allowed values: `alwaysNew`, `never`, `newIfNeeded`.
4098    #[serde(deserialize_with = "crate::lenient::string")]
4099    pub option: String,
4100    /// Registered person ID.
4101    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4102    pub person_id: Option<i64>,
4103    /// Free-text assignee.
4104    #[serde(rename = "personName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4105    pub person_name: Option<String>,
4106    /// Service-definition ID.
4107    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
4108    pub service_id: i64,
4109    /// Fields not described by the spec, e.g. instance-specific DB fields.
4110    #[serde(flatten)]
4111    pub extra: serde_json::Map<String, serde_json::Value>,
4112}
4113
4114/// For `create-follow-up`. Supply exactly one of `dueDate` or `duration`; `duration` must contain a supported day, month, or year count. `actionContext.groupId` is the originating group.
4115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4116pub struct BulkFollowUpActionCreate {
4117    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
4118    ///
4119    /// `None` leaves the field out, `Some(None)` sends `null`.
4120    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4121    pub color: Option<Option<String>>,
4122    /// Allowed values: `immediately`, `when-completed`.
4123    #[serde(rename = "continuationType", deserialize_with = "crate::lenient::string")]
4124    pub continuation_type: String,
4125    /// `None` leaves the field out, `Some(None)` sends `null`.
4126    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4127    pub description: Option<Option<String>>,
4128    /// Exactly one of `dueDate` or `duration` must be specified.
4129    #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")]
4130    pub due_date: Option<chrono::NaiveDate>,
4131    /// Exactly one of `dueDate` or `duration` must be specified. Within `duration`, at least one of `numDays`, `numMonths`, or `numYears` must be specified.
4132    #[serde(default, skip_serializing_if = "Option::is_none")]
4133    pub duration: Option<BulkFollowUpActionCreateDuration>,
4134    /// `None` leaves the field out, `Some(None)` sends `null`.
4135    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4136    pub icon: Option<Option<String>>,
4137    /// `None` leaves the field out, `Some(None)` sends `null`.
4138    #[serde(rename = "successGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4139    pub success_group_id: Option<Option<i64>>,
4140    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
4141    ///
4142    /// `None` leaves the field out, `Some(None)` sends `null`.
4143    #[serde(rename = "successGroupMemberStatus", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4144    pub success_group_member_status: Option<Option<String>>,
4145    /// `None` leaves the field out, `Some(None)` sends `null`.
4146    #[serde(rename = "successGroupOfGroupTypeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4147    pub success_group_of_group_type_id: Option<Option<i64>>,
4148    /// `None` leaves the field out, `Some(None)` sends `null`.
4149    #[serde(rename = "successRoleId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4150    pub success_role_id: Option<Option<i64>>,
4151    #[serde(deserialize_with = "crate::lenient::string")]
4152    pub title: String,
4153    /// Fields not described by the spec, e.g. instance-specific DB fields.
4154    #[serde(flatten)]
4155    pub extra: serde_json::Map<String, serde_json::Value>,
4156}
4157
4158/// Exactly one of `dueDate` or `duration` must be specified. Within `duration`, at least one of `numDays`, `numMonths`, or `numYears` must be specified.
4159#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4160pub struct BulkFollowUpActionCreateDuration {
4161    #[serde(rename = "numDays", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4162    pub num_days: Option<i64>,
4163    #[serde(rename = "numMonths", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4164    pub num_months: Option<i64>,
4165    #[serde(rename = "numYears", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4166    pub num_years: Option<i64>,
4167    /// Fields not described by the spec, e.g. instance-specific DB fields.
4168    #[serde(flatten)]
4169    pub extra: serde_json::Map<String, serde_json::Value>,
4170}
4171
4172/// `group`/`addParentGroup`: Applies the setting to each selected group.
4173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4174pub struct BulkGroupAddParentGroupUpdate {
4175    /// Parent group ID to add.
4176    #[serde(rename = "parentGroupId", deserialize_with = "crate::lenient::number")]
4177    pub parent_group_id: i64,
4178    /// Fields not described by the spec, e.g. instance-specific DB fields.
4179    #[serde(flatten)]
4180    pub extra: serde_json::Map<String, serde_json::Value>,
4181}
4182
4183/// `group`/`setAgeGroups`: Changes selected age groups.
4184#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4185pub struct BulkGroupAgeGroupsUpdate {
4186    #[serde(rename = "ageGroupIds")]
4187    pub age_group_ids: Vec<i64>,
4188    /// Replace the selection, add choices, or remove choices.
4189    /// Allowed values: `add`, `del`, `overwrite`.
4190    #[serde(rename = "writeOption", deserialize_with = "crate::lenient::string")]
4191    pub write_option: String,
4192    /// Fields not described by the spec, e.g. instance-specific DB fields.
4193    #[serde(flatten)]
4194    pub extra: serde_json::Map<String, serde_json::Value>,
4195}
4196
4197/// `group`/`delTag`: Applies the setting to each selected group.
4198#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4199pub struct BulkGroupDelTagUpdate {
4200    /// Existing group-tag ID to remove.
4201    #[serde(rename = "tagId", deserialize_with = "crate::lenient::number")]
4202    pub tag_id: i64,
4203    /// Fields not described by the spec, e.g. instance-specific DB fields.
4204    #[serde(flatten)]
4205    pub extra: serde_json::Map<String, serde_json::Value>,
4206}
4207
4208/// `group`/`setMeetingTime`: Changes the free-text meeting time.
4209#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4210pub struct BulkGroupMeetingTimeUpdate {
4211    /// Free-text meeting time, not a structured timestamp.
4212    #[serde(rename = "meetingTime", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4213    pub meeting_time: Option<String>,
4214    /// Fields not described by the spec, e.g. instance-specific DB fields.
4215    #[serde(flatten)]
4216    pub extra: serde_json::Map<String, serde_json::Value>,
4217}
4218
4219/// `group`/`setCampus`: Applies the setting to each selected group.
4220#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4221pub struct BulkGroupSetCampusUpdate {
4222    /// Campus ID.
4223    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4224    pub campus_id: Option<i64>,
4225    /// Fields not described by the spec, e.g. instance-specific DB fields.
4226    #[serde(flatten)]
4227    pub extra: serde_json::Map<String, serde_json::Value>,
4228}
4229
4230/// `group`/`setGroupCategory`: Applies the setting to each selected group.
4231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4232pub struct BulkGroupSetGroupCategoryUpdate {
4233    /// Group-category ID.
4234    #[serde(rename = "groupCategoryId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4235    pub group_category_id: Option<i64>,
4236    /// Fields not described by the spec, e.g. instance-specific DB fields.
4237    #[serde(flatten)]
4238    pub extra: serde_json::Map<String, serde_json::Value>,
4239}
4240
4241/// `group`/`setInformLeader`: Applies the setting to each selected group.
4242#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4243pub struct BulkGroupSetInformLeaderUpdate {
4244    /// Enable leader notifications.
4245    #[serde(rename = "informLeader")]
4246    pub inform_leader: bool,
4247    /// Fields not described by the spec, e.g. instance-specific DB fields.
4248    #[serde(flatten)]
4249    pub extra: serde_json::Map<String, serde_json::Value>,
4250}
4251
4252/// `group`/`setMaxMembers`: Applies the setting to each selected group.
4253#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4254pub struct BulkGroupSetMaxMembersUpdate {
4255    /// Maximum number of members.
4256    #[serde(rename = "maxMembers", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4257    pub max_members: Option<i64>,
4258    /// Fields not described by the spec, e.g. instance-specific DB fields.
4259    #[serde(flatten)]
4260    pub extra: serde_json::Map<String, serde_json::Value>,
4261}
4262
4263/// `group`/`setShowInMemberStatistic`: Applies the setting to each selected group.
4264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4265pub struct BulkGroupSetShowInMemberStatisticUpdate {
4266    /// Include the group in membership statistics.
4267    #[serde(rename = "inStatistic")]
4268    pub in_statistic: bool,
4269    /// Fields not described by the spec, e.g. instance-specific DB fields.
4270    #[serde(flatten)]
4271    pub extra: serde_json::Map<String, serde_json::Value>,
4272}
4273
4274/// `group`/`setSignUpOpen`: Applies the setting to each selected group.
4275#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4276pub struct BulkGroupSetSignUpOpenUpdate {
4277    /// Open or close signup now by updating the group’s signup dates; this is not a persistent independent boolean.
4278    #[serde(rename = "isOpenForMembers")]
4279    pub is_open_for_members: bool,
4280    /// Fields not described by the spec, e.g. instance-specific DB fields.
4281    #[serde(flatten)]
4282    pub extra: serde_json::Map<String, serde_json::Value>,
4283}
4284
4285/// `group`/`setTargetGroup`: Applies the setting to each selected group.
4286#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4287pub struct BulkGroupSetTargetGroupUpdate {
4288    /// Target-group masterdata ID.
4289    #[serde(rename = "targetGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4290    pub target_group_id: Option<i64>,
4291    /// Fields not described by the spec, e.g. instance-specific DB fields.
4292    #[serde(flatten)]
4293    pub extra: serde_json::Map<String, serde_json::Value>,
4294}
4295
4296/// `group`/`setWeeklyMeeting`: Applies the setting to each selected group.
4297#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4298pub struct BulkGroupSetWeeklyMeetingUpdate {
4299    /// Enable weekly meeting generation.
4300    #[serde(rename = "createWeeklyGroupMeetings")]
4301    pub create_weekly_group_meetings: bool,
4302    /// Fields not described by the spec, e.g. instance-specific DB fields.
4303    #[serde(flatten)]
4304    pub extra: serde_json::Map<String, serde_json::Value>,
4305}
4306
4307/// `group`/`setStatus`: Changes group status; identical status leaves the group and side-effect settings unchanged.
4308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4309pub struct BulkGroupStatusUpdate {
4310    /// Deactivate the chat when finishing the group.
4311    #[serde(default, skip_serializing_if = "Option::is_none")]
4312    pub deactivate_chat_on_status_finished: Option<bool>,
4313    /// Deactivate routines when finishing; execution additionally checks routine-administration permission.
4314    #[serde(default, skip_serializing_if = "Option::is_none")]
4315    pub deactivate_routines_on_status_finished: Option<bool>,
4316    /// Group-status ID.
4317    #[serde(rename = "groupStatusId", deserialize_with = "crate::lenient::number")]
4318    pub group_status_id: i64,
4319    /// Fields not described by the spec, e.g. instance-specific DB fields.
4320    #[serde(flatten)]
4321    pub extra: serde_json::Map<String, serde_json::Value>,
4322}
4323
4324/// `group`/`setVisibility`: Changes group visibility.
4325#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4326pub struct BulkGroupVisibilityUpdate {
4327    /// Passes the visibility-change option for the current user’s posts to the group update.
4328    #[serde(default, skip_serializing_if = "Option::is_none")]
4329    pub skip_my_posts_reducing_visibility: Option<bool>,
4330    /// The visibility of a group.
4331    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
4332    #[serde(deserialize_with = "crate::lenient::string")]
4333    pub visibility: String,
4334    /// Fields not described by the spec, e.g. instance-specific DB fields.
4335    #[serde(flatten)]
4336    pub extra: serde_json::Map<String, serde_json::Value>,
4337}
4338
4339/// `group`/`setWeekday`: Changes the meeting weekday.
4340#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4341pub struct BulkGroupWeekdayUpdate {
4342    /// Weekday numbered 0–6.
4343    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4344    pub weekday: Option<i64>,
4345    /// Fields not described by the spec, e.g. instance-specific DB fields.
4346    #[serde(flatten)]
4347    pub extra: serde_json::Map<String, serde_json::Value>,
4348}
4349
4350/// Permission-preview result. Targets without permission are omitted.
4351#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4352pub struct BulkInfos {
4353    /// Allowed IDs in original order, with duplicates retained and native bulk IDs cast to integers.
4354    #[serde(rename = "allowedDomainObjectIdentifiers")]
4355    pub allowed_domain_object_identifiers: Vec<serde_json::Value>,
4356    /// Fields not described by the spec, e.g. instance-specific DB fields.
4357    #[serde(flatten)]
4358    pub extra: serde_json::Map<String, serde_json::Value>,
4359}
4360
4361/// Request body for permission previews and queued bulk operations. The `domainType` and `jobKey` URL parameters determine the required `jobData` schema; use the exact mapping below. Send `{}` for operations without additional data. Target identifiers retain their request order and duplicates. Built-in bulk jobs cast target identifiers to integers; action-based operations expect integer identifiers.
4362///
4363/// Built-in bulk jobs:
4364///
4365/// | domainType | jobKey | jobData schema |
4366/// | --- | --- | --- |
4367/// | group | addParentGroup | BulkGroupAddParentGroupUpdate |
4368/// | group | addTag | BulkTagCreate |
4369/// | group | delete | BulkEmptyData |
4370/// | group | delTag | BulkGroupDelTagUpdate |
4371/// | group | setAgeGroups | BulkGroupAgeGroupsUpdate |
4372/// | group | setCampus | BulkGroupSetCampusUpdate |
4373/// | group | setGroupCategory | BulkGroupSetGroupCategoryUpdate |
4374/// | group | setInformLeader | BulkGroupSetInformLeaderUpdate |
4375/// | group | setMaxMembers | BulkGroupSetMaxMembersUpdate |
4376/// | group | setMeetingTime | BulkGroupMeetingTimeUpdate |
4377/// | group | setShowInMemberStatistic | BulkGroupSetShowInMemberStatisticUpdate |
4378/// | group | setSignUpOpen | BulkGroupSetSignUpOpenUpdate |
4379/// | group | setStatus | BulkGroupStatusUpdate |
4380/// | group | setTargetGroup | BulkGroupSetTargetGroupUpdate |
4381/// | group | setVisibility | BulkGroupVisibilityUpdate |
4382/// | group | setWeekday | BulkGroupWeekdayUpdate |
4383/// | group | setWeeklyMeeting | BulkGroupSetWeeklyMeetingUpdate |
4384/// | person | addPersonAuth | BulkPersonAddPersonAuthUpdate |
4385/// | person | addDepartment | BulkPersonAddDepartmentUpdate |
4386/// | person | addPersonTag | BulkTagCreate |
4387/// | person | addToGroup | BulkPersonMembershipCreate |
4388/// | person | archivePerson | BulkEmptyData |
4389/// | person | changeCampus | BulkPersonChangeCampusUpdate |
4390/// | person | changeFamilyStatus | BulkPersonChangeFamilyStatusUpdate |
4391/// | person | changeGroupRoleAndStatus | BulkPersonMembershipUpdate |
4392/// | person | changeNationality | BulkPersonChangeNationalityUpdate |
4393/// | person | changeSex | BulkPersonChangeSexUpdate |
4394/// | person | changeStatus | BulkPersonChangeStatusUpdate |
4395/// | person | deleteDepartment | BulkPersonDeleteDepartmentUpdate |
4396/// | person | deleteFromGroup | BulkPersonDeleteFromGroupUpdate |
4397/// | person | deletePerson | BulkEmptyData |
4398/// | person | delPersonTag | BulkPersonDelPersonTagUpdate |
4399/// | person | forceTwoFactor | BulkEmptyData |
4400/// | person | invitePerson | BulkEmptyData |
4401/// | person | changeGroupMemberField | BulkPersonMembershipFieldUpdate |
4402/// | person | deactivateForceTwoFactor | BulkEmptyData |
4403/// | person | undoArchivePerson | BulkEmptyData |
4404/// | event | addPersonToService | BulkEventServiceAssignmentCreate |
4405/// | event | declineEvent | BulkEventDeclineUpdate |
4406///
4407/// Actions (discoverable through `POST /actions`):
4408///
4409/// | domainType | jobKey | jobData schema |
4410/// | --- | --- | --- |
4411/// | group_membership | add-member-to-group | BulkMembershipActionCreate |
4412/// | group_membership | archive-member | BulkEmptyData |
4413/// | group_membership | change-member-status-active-requested | BulkEmptyData |
4414/// | group_membership | change-member-status-active-to_delete | BulkEmptyData |
4415/// | group_membership | change-member-status-requested-active | BulkEmptyData |
4416/// | group_membership | change-member-status-requested-to_delete | BulkEmptyData |
4417/// | group_membership | change-member-status-requested-waiting | BulkEmptyData |
4418/// | group_membership | change-member-status-to_delete-active | BulkEmptyData |
4419/// | group_membership | change-member-status-to_delete-requested | BulkEmptyData |
4420/// | group_membership | change-member-status-waiting-active | BulkEmptyData |
4421/// | group_membership | change-member-status-waiting-requested | BulkEmptyData |
4422/// | group_membership | change-member-status-waiting-to_delete | BulkEmptyData |
4423/// | group_membership | create-follow-up | BulkFollowUpActionCreate |
4424/// | group_membership | edit-group-membership | BulkMembershipActionUpdate |
4425/// | group_membership | edit-member | BulkPersonActionUpdate |
4426/// | group_membership | edit-tags-for-member | BulkPersonTagsActionUpdate |
4427/// | group_membership | invite-member | BulkEmptyData |
4428/// | group_membership | remove-member | BulkEmptyData |
4429/// | group_membership | send-member-email | BulkMemberEmailActionCreate |
4430/// | person | add-person-to-group | BulkMembershipActionCreate |
4431/// | person | edit-person | BulkPersonActionUpdate |
4432/// | person | invite-person | BulkEmptyData |
4433/// | person | archive-person | BulkEmptyData |
4434/// | person | edit-tags-for-person | BulkPersonTagsActionUpdate |
4435#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4436pub struct BulkJobCreate {
4437    /// Context for action-based operations. Membership actions commonly require `groupId`.
4438    #[serde(rename = "actionContext", default, skip_serializing_if = "Option::is_none")]
4439    pub action_context: Option<BulkJobCreateActionContext>,
4440    /// Targets to check or queue, in request order. Empty arrays are accepted. Prefer integer IDs for the registered jobs/actions.
4441    #[serde(rename = "domainObjectIdentifiers")]
4442    pub domain_object_identifiers: Vec<serde_json::Value>,
4443    /// Payload selected by the domain/key table.
4444    #[serde(rename = "jobData", default, skip_serializing_if = "serde_json::Value::is_null")]
4445    pub job_data: serde_json::Value,
4446    /// Fields not described by the spec, e.g. instance-specific DB fields.
4447    #[serde(flatten)]
4448    pub extra: serde_json::Map<String, serde_json::Value>,
4449}
4450
4451/// Context for action-based operations. Membership actions commonly require `groupId`.
4452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4453pub struct BulkJobCreateActionContext {
4454    /// Group of the selected memberships for context-dependent membership actions.
4455    #[serde(rename = "groupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4456    pub group_id: Option<i64>,
4457    /// Fields not described by the spec, e.g. instance-specific DB fields.
4458    #[serde(flatten)]
4459    pub extra: serde_json::Map<String, serde_json::Value>,
4460}
4461
4462/// Queue acknowledgment, not execution results. No allowed targets still produces a GUID/group and zero queued jobs.
4463#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4464pub struct BulkJobQueued {
4465    /// Queue group formed from the resolved domain, job key and GUID.
4466    #[serde(rename = "jobGroup", deserialize_with = "crate::lenient::string")]
4467    pub job_group: String,
4468    /// Identifier shared by all chunks and their job logs.
4469    #[serde(rename = "jobGuid", deserialize_with = "crate::lenient::string")]
4470    pub job_guid: String,
4471    /// Number of queued chunks, not number of affected objects. Normally up to 50 IDs per chunk; group/delete uses up to 5.
4472    #[serde(rename = "numberOfQueuedJobs", deserialize_with = "crate::lenient::number")]
4473    pub number_of_queued_jobs: i64,
4474    /// Fields not described by the spec, e.g. instance-specific DB fields.
4475    #[serde(flatten)]
4476    pub extra: serde_json::Map<String, serde_json::Value>,
4477}
4478
4479/// Payload for `send-member-email`.
4480#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4481pub struct BulkMemberEmailActionCreate {
4482    /// Include a sign-out URL when available.
4483    #[serde(rename = "addSignOutUrl", default, skip_serializing_if = "Option::is_none")]
4484    pub add_sign_out_url: Option<bool>,
4485    #[serde(rename = "attachmentIds", default, skip_serializing_if = "Option::is_none")]
4486    pub attachment_ids: Option<Vec<i64>>,
4487    /// Email body.
4488    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4489    pub body: Option<String>,
4490    /// Optional sender person ID.
4491    #[serde(rename = "senderId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4492    pub sender_id: Option<i64>,
4493    #[serde(deserialize_with = "crate::lenient::string")]
4494    pub subject: String,
4495    /// Optional global template ID.
4496    #[serde(rename = "templateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4497    pub template_id: Option<i64>,
4498    /// Fields not described by the spec, e.g. instance-specific DB fields.
4499    #[serde(flatten)]
4500    pub extra: serde_json::Map<String, serde_json::Value>,
4501}
4502
4503/// For add-person-to-group and add-member-to-group. groupId selects the destination; custom field keys are destination-field reference names. Existing membership leaves the person unchanged. The member variant resolves the person from the selected membership IDs.
4504#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4505pub struct BulkMembershipActionCreate {
4506    /// Membership comment.
4507    ///
4508    /// `None` leaves the field out, `Some(None)` sends `null`.
4509    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4510    pub comment: Option<Option<String>>,
4511    /// Member-field values keyed by reference name.
4512    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
4513    pub fields: Option<std::collections::BTreeMap<String, serde_json::Value>>,
4514    /// Target group ID; must be a JSON integer before action validation starts.
4515    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
4516    pub group_id: i64,
4517    /// Notify leaders; execution defaults to true.
4518    #[serde(rename = "informLeader", default, skip_serializing_if = "Option::is_none")]
4519    pub inform_leader: Option<bool>,
4520    /// A simple date in ISO format, e.g. '2022-10-19'
4521    #[serde(rename = "memberEndDate", default, skip_serializing_if = "Option::is_none")]
4522    pub member_end_date: Option<chrono::NaiveDate>,
4523    /// A simple date in ISO format, e.g. '2022-10-19'
4524    #[serde(rename = "memberStartDate", default, skip_serializing_if = "Option::is_none")]
4525    pub member_start_date: Option<chrono::NaiveDate>,
4526    /// Target group-type role ID.
4527    #[serde(rename = "roleId", deserialize_with = "crate::lenient::number")]
4528    pub role_id: i64,
4529    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
4530    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
4531    #[serde(deserialize_with = "crate::lenient::string")]
4532    pub status: String,
4533    /// Waiting-list position; -1 requests the next available position.
4534    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4535    pub waitinglist_position: Option<i64>,
4536    /// Fields not described by the spec, e.g. instance-specific DB fields.
4537    #[serde(flatten)]
4538    pub extra: serde_json::Map<String, serde_json::Value>,
4539}
4540
4541/// For edit-group-membership. actionContext.groupId must identify the actual group of every selected membership. Custom fields are keyed by reference name, not numeric field ID.
4542#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4543pub struct BulkMembershipActionUpdate {
4544    /// Membership comment.
4545    ///
4546    /// `None` leaves the field out, `Some(None)` sends `null`.
4547    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4548    pub comment: Option<Option<String>>,
4549    /// Member-field values keyed by reference name.
4550    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
4551    pub fields: Option<std::collections::BTreeMap<String, serde_json::Value>>,
4552    /// Notify leaders; execution defaults to true.
4553    #[serde(rename = "informLeader", default, skip_serializing_if = "Option::is_none")]
4554    pub inform_leader: Option<bool>,
4555    /// A simple date in ISO format, e.g. '2022-10-19'
4556    #[serde(rename = "memberEndDate", default, skip_serializing_if = "Option::is_none")]
4557    pub member_end_date: Option<chrono::NaiveDate>,
4558    /// A simple date in ISO format, e.g. '2022-10-19'
4559    #[serde(rename = "memberStartDate", default, skip_serializing_if = "Option::is_none")]
4560    pub member_start_date: Option<chrono::NaiveDate>,
4561    /// Replacement group-type role ID.
4562    #[serde(rename = "roleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4563    pub role_id: Option<i64>,
4564    /// Waiting-list position; -1 requests the next available position.
4565    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4566    pub waitinglist_position: Option<i64>,
4567    /// Fields not described by the spec, e.g. instance-specific DB fields.
4568    #[serde(flatten)]
4569    pub extra: serde_json::Map<String, serde_json::Value>,
4570}
4571
4572/// person/addDepartment: Applies this operation to each selected person.
4573#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4574pub struct BulkPersonAddDepartmentUpdate {
4575    /// Department ID to add. Note the key department, unlike departmentId used for removal.
4576    #[serde(deserialize_with = "crate::lenient::number")]
4577    pub department: i64,
4578    /// Fields not described by the spec, e.g. instance-specific DB fields.
4579    #[serde(flatten)]
4580    pub extra: serde_json::Map<String, serde_json::Value>,
4581}
4582
4583/// person/addPersonAuth: Applies this operation to each selected person.
4584#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4585pub struct BulkPersonAddPersonAuthUpdate {
4586    /// Authorization ID to assign.
4587    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
4588    pub auth_id: i64,
4589    /// Fields not described by the spec, e.g. instance-specific DB fields.
4590    #[serde(flatten)]
4591    pub extra: serde_json::Map<String, serde_json::Value>,
4592}
4593
4594/// person/changeCampus: Applies this operation to each selected person.
4595#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4596pub struct BulkPersonChangeCampusUpdate {
4597    /// Campus ID.
4598    #[serde(rename = "campusId", deserialize_with = "crate::lenient::number")]
4599    pub campus_id: i64,
4600    /// Fields not described by the spec, e.g. instance-specific DB fields.
4601    #[serde(flatten)]
4602    pub extra: serde_json::Map<String, serde_json::Value>,
4603}
4604
4605/// `person`/`changeFamilyStatus`: Applies this operation to each selected person.
4606#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4607pub struct BulkPersonChangeFamilyStatusUpdate {
4608    /// Family-status masterdata ID.
4609    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4610    pub family_status_id: Option<i64>,
4611    /// Fields not described by the spec, e.g. instance-specific DB fields.
4612    #[serde(flatten)]
4613    pub extra: serde_json::Map<String, serde_json::Value>,
4614}
4615
4616/// `person`/`changeNationality`: Applies this operation to each selected person.
4617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4618pub struct BulkPersonChangeNationalityUpdate {
4619    /// Nationality masterdata ID.
4620    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4621    pub nationality_id: Option<i64>,
4622    /// Fields not described by the spec, e.g. instance-specific DB fields.
4623    #[serde(flatten)]
4624    pub extra: serde_json::Map<String, serde_json::Value>,
4625}
4626
4627/// `person`/`changeSex`: Applies this operation to each selected person.
4628#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4629pub struct BulkPersonChangeSexUpdate {
4630    /// Sex masterdata ID.
4631    #[serde(rename = "sexId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4632    pub sex_id: Option<i64>,
4633    /// Fields not described by the spec, e.g. instance-specific DB fields.
4634    #[serde(flatten)]
4635    pub extra: serde_json::Map<String, serde_json::Value>,
4636}
4637
4638/// person/changeStatus: Applies this operation to each selected person.
4639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4640pub struct BulkPersonChangeStatusUpdate {
4641    /// Person-status ID.
4642    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
4643    pub status_id: i64,
4644    /// Fields not described by the spec, e.g. instance-specific DB fields.
4645    #[serde(flatten)]
4646    pub extra: serde_json::Map<String, serde_json::Value>,
4647}
4648
4649/// person/delPersonTag: Applies this operation to each selected person.
4650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4651pub struct BulkPersonDelPersonTagUpdate {
4652    /// Person-tag ID to remove.
4653    #[serde(rename = "tagId", deserialize_with = "crate::lenient::number")]
4654    pub tag_id: i64,
4655    /// Fields not described by the spec, e.g. instance-specific DB fields.
4656    #[serde(flatten)]
4657    pub extra: serde_json::Map<String, serde_json::Value>,
4658}
4659
4660/// person/deleteDepartment: Applies this operation to each selected person.
4661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4662pub struct BulkPersonDeleteDepartmentUpdate {
4663    /// Department ID to remove. The last remaining department is retained.
4664    #[serde(rename = "departmentId", deserialize_with = "crate::lenient::number")]
4665    pub department_id: i64,
4666    /// Fields not described by the spec, e.g. instance-specific DB fields.
4667    #[serde(flatten)]
4668    pub extra: serde_json::Map<String, serde_json::Value>,
4669}
4670
4671/// person/deleteFromGroup: Applies this operation to each selected person.
4672#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4673pub struct BulkPersonDeleteFromGroupUpdate {
4674    /// Group ID from which to remove the selected persons.
4675    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
4676    pub group_id: i64,
4677    /// Fields not described by the spec, e.g. instance-specific DB fields.
4678    #[serde(flatten)]
4679    pub extra: serde_json::Map<String, serde_json::Value>,
4680}
4681
4682/// `person`/`addToGroup`: Adds persons to the selected group; existing memberships are unchanged.
4683#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4684pub struct BulkPersonMembershipCreate {
4685    /// Target group ID.
4686    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
4687    pub group_id: i64,
4688    /// Role ID belonging to the target group type.
4689    #[serde(rename = "roleId", deserialize_with = "crate::lenient::number")]
4690    pub role_id: i64,
4691    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
4692    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
4693    #[serde(deserialize_with = "crate::lenient::string")]
4694    pub status: String,
4695    /// Fields not described by the spec, e.g. instance-specific DB fields.
4696    #[serde(flatten)]
4697    pub extra: serde_json::Map<String, serde_json::Value>,
4698}
4699
4700/// `person`/`changeGroupMemberField`: Changes a group-member custom field. Selected identifiers are person IDs, not membership IDs. The value is validated against the actual field at execution time. For multiselect, use an array; other fields use the scalar or first nonempty array element.
4701#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4702pub struct BulkPersonMembershipFieldUpdate {
4703    /// Group-member field ID belonging to the group.
4704    #[serde(rename = "customFieldId", deserialize_with = "crate::lenient::number")]
4705    pub custom_field_id: i64,
4706    /// Group ID.
4707    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
4708    pub group_id: i64,
4709    /// Value matching the field’s configured type and options.
4710    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
4711    pub value: serde_json::Value,
4712    /// For multiselect fields, replace, add, or remove values.
4713    /// Allowed values: `add`, `del`, `overwrite`.
4714    #[serde(rename = "writeOption", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4715    pub write_option: Option<String>,
4716    /// Fields not described by the spec, e.g. instance-specific DB fields.
4717    #[serde(flatten)]
4718    pub extra: serde_json::Map<String, serde_json::Value>,
4719}
4720
4721/// `person`/`changeGroupRoleAndStatus`: Changes only memberships matching `oldStatus` and, when set, `oldRoleId`.
4722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4723pub struct BulkPersonMembershipUpdate {
4724    /// Group ID.
4725    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
4726    pub group_id: i64,
4727    /// Optional replacement role.
4728    #[serde(rename = "newRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4729    pub new_role_id: Option<i64>,
4730    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
4731    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
4732    #[serde(rename = "newStatus", deserialize_with = "crate::lenient::string")]
4733    pub new_status: String,
4734    /// Optional old-role filter.
4735    #[serde(rename = "oldRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4736    pub old_role_id: Option<i64>,
4737    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
4738    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
4739    #[serde(rename = "oldStatus", deserialize_with = "crate::lenient::string")]
4740    pub old_status: String,
4741    /// Fields not described by the spec, e.g. instance-specific DB fields.
4742    #[serde(flatten)]
4743    pub extra: serde_json::Map<String, serde_json::Value>,
4744}
4745
4746/// For `edit-tags-for-person` and `edit-tags-for-member`. Supply either tag IDs or tag names.
4747#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4748pub struct BulkPersonTagsActionUpdate {
4749    #[serde(rename = "tagIds", default, skip_serializing_if = "Option::is_none")]
4750    pub tag_ids: Option<Vec<i64>>,
4751    #[serde(rename = "tagNames", default, skip_serializing_if = "Option::is_none")]
4752    pub tag_names: Option<Vec<String>>,
4753    /// Allowed values: `add`, `remove`.
4754    #[serde(deserialize_with = "crate::lenient::string")]
4755    pub r#type: String,
4756    /// Fields not described by the spec, e.g. instance-specific DB fields.
4757    #[serde(flatten)]
4758    pub extra: serde_json::Map<String, serde_json::Value>,
4759}
4760
4761/// For `group`/`addTag` and `person`/`addPersonTag`. Supply an existing tag ID or a name for a new tag.
4762#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4763pub struct BulkTagCreate {
4764    /// Existing tag ID.
4765    #[serde(rename = "tagId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4766    pub tag_id: Option<i64>,
4767    /// New tag name.
4768    #[serde(rename = "tagName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4769    pub tag_name: Option<String>,
4770    /// Fields not described by the spec, e.g. instance-specific DB fields.
4771    #[serde(flatten)]
4772    pub extra: serde_json::Map<String, serde_json::Value>,
4773}
4774
4775/// A mail-merge rendering job. Generates one PDF per selected recipient (or address group) and makes those PDFs available together in a ZIP archive. It does not send email or postal mail. The legacy response uses mixed snake_case and camelCase fields.
4776#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4777pub struct Bulkletter {
4778    /// HTML content of the bulkletter, may contain placeholders.
4779    #[serde(deserialize_with = "crate::lenient::string")]
4780    pub content: String,
4781    /// Legacy database timestamp in Y-m-d H:i:s format, without timezone; nullable in storage.
4782    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4783    pub created: Option<String>,
4784    /// ID of the person that created the bulkletter (returned as string).
4785    #[serde(deserialize_with = "crate::lenient::string")]
4786    pub created_pid: String,
4787    /// Generated ZIP archive file ID, or 0 before a file has been stored.
4788    #[serde(rename = "fileId", deserialize_with = "crate::lenient::number")]
4789    pub file_id: i64,
4790    /// Optional group the bulkletter is associated with. `0` if no group is set.
4791    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
4792    pub group_id: i64,
4793    /// ID of the HTML template used to render the bulkletter.
4794    #[serde(rename = "htmlTemplateId", deserialize_with = "crate::lenient::number")]
4795    pub html_template_id: i64,
4796    #[serde(deserialize_with = "crate::lenient::number")]
4797    pub id: i64,
4798    #[serde(deserialize_with = "crate::lenient::string")]
4799    pub name: String,
4800    /// Rendering lifecycle: TODO, IN_PROGRESS, DONE or ERROR. Completion and storing the archive are separate steps; check fileId/url as well as status.
4801    /// Allowed values: `DONE`, `ERROR`, `IN_PROGRESS`, `TODO`.
4802    #[serde(deserialize_with = "crate::lenient::string")]
4803    pub status: String,
4804    /// Legacy database timestamp in Y-m-d H:i:s format, without timezone; nullable in storage.
4805    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4806    pub updated: Option<String>,
4807    /// Relative download URL of the ZIP archive containing individual PDFs. May be empty or null before the archive is available; resolve relative to the CT base URL.
4808    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4809    pub url: Option<String>,
4810    /// Fields not described by the spec, e.g. instance-specific DB fields.
4811    #[serde(flatten)]
4812    pub extra: serde_json::Map<String, serde_json::Value>,
4813}
4814
4815/// Creates a mail-merge job using an HTML template and selected person IDs. Requires edit bulkletter permission and visibility of the template. Successful creation only schedules rendering.
4816#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4817pub struct BulkletterCreate {
4818    /// HTML inserted into the template’s {{content}} slot. Supports person/group placeholders. Non-empty; the literal string 0 is rejected.
4819    #[serde(deserialize_with = "crate::lenient::string")]
4820    pub content: String,
4821    /// Group persons by identical street, address addition, postal code, city and country. Only persons with street, postal code and city are grouped. The first person returned for each address represents it; this is not a family-relationship or household-head calculation.
4822    #[serde(rename = "groupByHousehold")]
4823    pub group_by_household: bool,
4824    /// Optional group used as placeholder context, not as a restriction on personIds.
4825    ///
4826    /// `None` leaves the field out, `Some(None)` sends `null`.
4827    #[serde(rename = "groupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4828    pub group_id: Option<Option<i64>>,
4829    /// ID of the HTML template used to render the bulkletter.
4830    #[serde(rename = "htmlTemplateId", deserialize_with = "crate::lenient::number")]
4831    pub html_template_id: i64,
4832    /// Job name. Non-empty; the literal string 0 is rejected by the current validator.
4833    #[serde(deserialize_with = "crate::lenient::string")]
4834    pub name: String,
4835    /// Person IDs to render. Duplicate IDs are resolved through the person lookup; unknown IDs do not create recipient rows.
4836    #[serde(rename = "personIds")]
4837    pub person_ids: Vec<i64>,
4838    /// Fields not described by the spec, e.g. instance-specific DB fields.
4839    #[serde(flatten)]
4840    pub extra: serde_json::Map<String, serde_json::Value>,
4841}
4842
4843/// Acknowledges the newly scheduled job. Read its Location URL for status and the eventual ZIP download.
4844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4845pub struct BulkletterCreated {
4846    #[serde(deserialize_with = "crate::lenient::number")]
4847    pub id: i64,
4848    /// Fields not described by the spec, e.g. instance-specific DB fields.
4849    #[serde(flatten)]
4850    pub extra: serde_json::Map<String, serde_json::Value>,
4851}
4852
4853/// Legacy address fields for a scheduled recipient. Values are read from the current person record, not a saved address snapshot.
4854#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4855pub struct BulkletterReceiver {
4856    /// Person ID (returned as string).
4857    #[serde(deserialize_with = "crate::lenient::string")]
4858    pub id: String,
4859    /// Last name of the person.
4860    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4861    pub name: Option<String>,
4862    /// City of the person.
4863    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4864    pub ort: Option<String>,
4865    /// Postal code of the person.
4866    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4867    pub plz: Option<String>,
4868    /// Street address of the person.
4869    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4870    pub strasse: Option<String>,
4871    /// First name of the person.
4872    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4873    pub vorname: Option<String>,
4874    /// Additional address line of the person.
4875    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4876    pub zusatz: Option<String>,
4877    /// Fields not described by the spec, e.g. instance-specific DB fields.
4878    #[serde(flatten)]
4879    pub extra: serde_json::Map<String, serde_json::Value>,
4880}
4881
4882/// Calendar containing appointments and their series. Calendar settings, appointment editing and calendar administration are separate concerns. The type selects the applicable administration category; effective visibility depends on permissions. This object is also embedded in appointment responses.
4883#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4884pub struct Calendar {
4885    /// Campus associated with this calendar, or null for no campus. A campus represents a ChurchTools location/site, not a calendar permission group.
4886    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4887    pub campus_id: Option<i64>,
4888    /// Display color, normally a CSS hex color such as #336699.
4889    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4890    pub color: Option<String>,
4891    /// Event type ID used by the Evangelische Termine integration, or null. This is an external event classification, not a ChurchTools calendar type.
4892    #[serde(rename = "evTermineEventTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4893    pub ev_termine_event_type_id: Option<i64>,
4894    /// Configured service-planning event template ID for this calendar, or null. This differs from an appointment template.
4895    #[serde(rename = "eventTemplateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
4896    pub event_template_id: Option<i64>,
4897    /// External iCalendar feed to import. webcal:// and ical:// are normalized to https://; addresses without a scheme receive https://.
4898    #[serde(rename = "iCalSourceUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
4899    pub i_cal_source_url: Option<String>,
4900    /// Calendar display name.
4901    #[serde(deserialize_with = "crate::lenient::string")]
4902    pub name: String,
4903    /// Display order. The calendar list is sorted by this value in ascending order.
4904    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
4905    pub sort_key: i64,
4906    /// Whether the Evangelische Termine integration should synchronize this calendar. This is separate from importing an iCalendar feed.
4907    #[serde(rename = "syncToEvTermine")]
4908    pub sync_to_ev_termine: bool,
4909    /// Calendar category used by ChurchTools: church for a church calendar, group for a group calendar, personal for a personal calendar. The category determines which administration permissions apply; it does not by itself grant public access or link the calendar to a particular group or person. Access is controlled separately. The type is chosen on creation and cannot be changed by PUT.
4910    /// Allowed values: `church`, `group`, `personal`.
4911    #[serde(deserialize_with = "crate::lenient::string")]
4912    pub r#type: String,
4913    /// Legacy response metadata mapping isPublic and isPrivate to type.
4914    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
4915    pub deprecated: std::collections::BTreeMap<String, String>,
4916    /// Calendar ID used in /calendars/{calendarId} and appointment URLs.
4917    #[serde(deserialize_with = "crate::lenient::number")]
4918    pub id: i64,
4919    /// Legacy category flag: true for personal calendars. Use type instead.
4920    #[serde(rename = "isPrivate", default, skip_serializing_if = "Option::is_none")]
4921    #[deprecated = "Use type instead."]
4922    pub is_private: Option<bool>,
4923    /// Legacy category flag: true for church calendars. Use type; this flag does not replace access-permission checks.
4924    #[serde(rename = "isPublic", default, skip_serializing_if = "Option::is_none")]
4925    #[deprecated = "Use type; this flag does not replace access-permission checks."]
4926    pub is_public: Option<bool>,
4927    pub meta: MetaDataEntityId,
4928    /// Localized display name, falling back to the stored name for ordinary calendar names.
4929    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
4930    pub name_translated: String,
4931    /// Generated token used by calendar subscription/export links. This is not a complete URL and is not the external import source address.
4932    #[serde(rename = "randomUrl", deserialize_with = "crate::lenient::string")]
4933    pub random_url: String,
4934    /// Fields not described by the spec, e.g. instance-specific DB fields.
4935    #[serde(flatten)]
4936    pub extra: serde_json::Map<String, serde_json::Value>,
4937}
4938
4939/// Create a calendar with its category and settings. The creator receives permission to edit its appointments. Calendar creation does not itself create appointments, except when an iCalSourceUrl initiates a feed import.
4940#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4941pub struct CalendarCreate {
4942    /// Campus associated with this calendar, or null for no campus. A campus represents a ChurchTools location/site, not a calendar permission group.
4943    ///
4944    /// `None` leaves the field out, `Some(None)` sends `null`.
4945    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4946    pub campus_id: Option<Option<i64>>,
4947    /// Display color, normally a CSS hex color such as #336699.
4948    ///
4949    /// `None` leaves the field out, `Some(None)` sends `null`.
4950    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4951    pub color: Option<Option<String>>,
4952    /// Event type ID used by the Evangelische Termine integration, or null. This is an external event classification, not a ChurchTools calendar type.
4953    ///
4954    /// `None` leaves the field out, `Some(None)` sends `null`.
4955    #[serde(rename = "evTermineEventTypeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4956    pub ev_termine_event_type_id: Option<Option<i64>>,
4957    /// Configured service-planning event template ID for this calendar, or null. This differs from an appointment template.
4958    ///
4959    /// `None` leaves the field out, `Some(None)` sends `null`.
4960    #[serde(rename = "eventTemplateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4961    pub event_template_id: Option<Option<i64>>,
4962    /// External iCalendar feed to import. webcal:// and ical:// are normalized to https://; addresses without a scheme receive https://.
4963    ///
4964    /// `None` leaves the field out, `Some(None)` sends `null`.
4965    #[serde(rename = "iCalSourceUrl", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4966    pub i_cal_source_url: Option<Option<String>>,
4967    /// Calendar display name.
4968    #[serde(deserialize_with = "crate::lenient::string")]
4969    pub name: String,
4970    /// Display order. The calendar list is sorted by this value in ascending order.
4971    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
4972    pub sort_key: i64,
4973    /// Whether the Evangelische Termine integration should synchronize this calendar. This is separate from importing an iCalendar feed.
4974    #[serde(rename = "syncToEvTermine", default, skip_serializing_if = "Option::is_none")]
4975    pub sync_to_ev_termine: Option<bool>,
4976    /// Calendar category used by ChurchTools: church for a church calendar, group for a group calendar, personal for a personal calendar. The category determines which administration permissions apply; it does not by itself grant public access or link the calendar to a particular group or person. Access is controlled separately. The type is chosen on creation and cannot be changed by PUT.
4977    /// Allowed values: `church`, `group`, `personal`.
4978    #[serde(deserialize_with = "crate::lenient::string")]
4979    pub r#type: String,
4980    /// Fields not described by the spec, e.g. instance-specific DB fields.
4981    #[serde(flatten)]
4982    pub extra: serde_json::Map<String, serde_json::Value>,
4983}
4984
4985/// Editable calendar settings. The calendar type cannot be changed here. A supplied iCalSourceUrl triggers an external calendar import.
4986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4987pub struct CalendarUpdate {
4988    /// Campus associated with this calendar, or null for no campus. A campus represents a ChurchTools location/site, not a calendar permission group.
4989    ///
4990    /// `None` leaves the field out, `Some(None)` sends `null`.
4991    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4992    pub campus_id: Option<Option<i64>>,
4993    /// Display color, normally a CSS hex color such as #336699.
4994    ///
4995    /// `None` leaves the field out, `Some(None)` sends `null`.
4996    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
4997    pub color: Option<Option<String>>,
4998    /// Event type ID used by the Evangelische Termine integration, or null. This is an external event classification, not a ChurchTools calendar type.
4999    ///
5000    /// `None` leaves the field out, `Some(None)` sends `null`.
5001    #[serde(rename = "evTermineEventTypeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5002    pub ev_termine_event_type_id: Option<Option<i64>>,
5003    /// Configured service-planning event template ID for this calendar, or null. This differs from an appointment template.
5004    ///
5005    /// `None` leaves the field out, `Some(None)` sends `null`.
5006    #[serde(rename = "eventTemplateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5007    pub event_template_id: Option<Option<i64>>,
5008    /// External iCalendar feed to import. webcal:// and ical:// are normalized to https://; addresses without a scheme receive https://.
5009    ///
5010    /// `None` leaves the field out, `Some(None)` sends `null`.
5011    #[serde(rename = "iCalSourceUrl", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5012    pub i_cal_source_url: Option<Option<String>>,
5013    /// Calendar display name.
5014    #[serde(deserialize_with = "crate::lenient::string")]
5015    pub name: String,
5016    /// Display order. The calendar list is sorted by this value in ascending order.
5017    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
5018    pub sort_key: i64,
5019    /// Whether the Evangelische Termine integration should synchronize this calendar. This is separate from importing an iCalendar feed.
5020    #[serde(rename = "syncToEvTermine", default, skip_serializing_if = "Option::is_none")]
5021    pub sync_to_ev_termine: Option<bool>,
5022    /// Fields not described by the spec, e.g. instance-specific DB fields.
5023    #[serde(flatten)]
5024    pub extra: serde_json::Map<String, serde_json::Value>,
5025}
5026
5027/// A campus represents one location or congregation within a ChurchTools installation. Persons, groups, calendars and other resources can reference its numeric ID. This is the compact campus master-data representation; the detailed campus profile is a separate API representation.
5028#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5029pub struct Campus {
5030    /// Address associated with the campus profile, or null when none is assigned. Campus create/update requests do not set this field.
5031    #[serde(default, skip_serializing_if = "Option::is_none")]
5032    pub address: Option<CampusAddress>,
5033    /// Persistent profile GUID generated by ChurchTools. Use the numeric id for campusId references.
5034    #[serde(deserialize_with = "crate::lenient::string")]
5035    pub guid: String,
5036    /// Numeric campus ID used by campusId fields in other API resources.
5037    #[serde(deserialize_with = "crate::lenient::number")]
5038    pub id: i64,
5039    pub meta: MetaDataEntityId,
5040    /// Stored campus name.
5041    #[serde(deserialize_with = "crate::lenient::string")]
5042    pub name: String,
5043    /// Localized display name, translated from the stored name when a translation exists.
5044    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
5045    pub name_translated: String,
5046    /// Optional short profile name. Distinct from shorty and not editable through the campus create/update endpoints.
5047    #[serde(rename = "shortName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5048    pub short_name: Option<String>,
5049    /// Campus abbreviation, or null for records without one. New campuses created through this API require an abbreviation.
5050    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5051    pub shorty: Option<String>,
5052    /// Display-order value. GET /campuses does not guarantee this order; sort by this field in the client when needed.
5053    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
5054    pub sort_key: i64,
5055    /// Fields not described by the spec, e.g. instance-specific DB fields.
5056    #[serde(flatten)]
5057    pub extra: serde_json::Map<String, serde_json::Value>,
5058}
5059
5060/// Stored address associated with a campus profile.
5061#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5062pub struct CampusAddress {
5063    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5064    pub addition: Option<String>,
5065    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5066    pub city: Option<String>,
5067    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`, `default`, `parent`.
5068    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
5069    pub color: serde_json::Value,
5070    /// A country's ISO-code
5071    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5072    pub country: Option<String>,
5073    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5074    pub district: Option<String>,
5075    /// The identifier of the domain object. This field is set automatically from the path parameter and should not be included in the request body.
5076    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
5077    pub domain_identifier: String,
5078    /// The domain type of the address. This field is set automatically from the path parameter and should not be included in the request body.
5079    /// Allowed values: `appointment`, `campus`, `church`, `group`.
5080    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
5081    pub domain_type: String,
5082    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5083    pub icon: Option<String>,
5084    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5085    pub latitude: Option<String>,
5086    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5087    pub longitude: Option<String>,
5088    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5089    pub name: Option<String>,
5090    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5091    pub street: Option<String>,
5092    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5093    pub zip: Option<String>,
5094    #[serde(deserialize_with = "crate::lenient::number")]
5095    pub id: i64,
5096    #[serde(rename = "@deprecated")]
5097    pub deprecated: StoredAddressDeprecated,
5098    /// Use `latitude` instead
5099    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5100    #[deprecated = "Use `latitude` instead"]
5101    pub geo_lat: Option<String>,
5102    /// Use `longitude` instead
5103    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5104    #[deprecated = "Use `longitude` instead"]
5105    pub geo_lng: Option<String>,
5106    /// Use `latitude` instead
5107    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5108    #[deprecated = "Use `latitude` instead"]
5109    pub latitude_loose: Option<String>,
5110    /// Use `longitude` instead
5111    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5112    #[deprecated = "Use `longitude` instead"]
5113    pub longitude_loose: Option<String>,
5114    /// Allowed values: `default`, `parent`, `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
5115    #[serde(rename = "markerColor", default, skip_serializing_if = "serde_json::Value::is_null")]
5116    #[deprecated = "deprecated in the ChurchTools API"]
5117    pub marker_color: serde_json::Value,
5118    /// Use `icon` instead
5119    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5120    #[deprecated = "Use `icon` instead"]
5121    pub marker_icon: Option<String>,
5122    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5123    #[deprecated = "deprecated in the ChurchTools API"]
5124    pub marker_url: Option<String>,
5125    /// Use `name` instead
5126    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5127    #[deprecated = "Use `name` instead"]
5128    pub meeting_at: Option<String>,
5129    /// Use `zip` instead
5130    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5131    #[deprecated = "Use `zip` instead"]
5132    pub postalcode: Option<String>,
5133    /// Fields not described by the spec, e.g. instance-specific DB fields.
5134    #[serde(flatten)]
5135    pub extra: serde_json::Map<String, serde_json::Value>,
5136}
5137
5138/// Creates a campus (a location or congregation within the same ChurchTools installation). Name and abbreviation are required. Other profile details are managed separately.
5139#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5140pub struct CampusCreate {
5141    /// Campus name. Whitespace is trimmed; at least one character must remain.
5142    #[serde(deserialize_with = "crate::lenient::string")]
5143    pub name: String,
5144    /// Abbreviation used in compact displays. Whitespace is trimmed. This endpoint requires an explicit value; it does not generate one from the name.
5145    #[serde(deserialize_with = "crate::lenient::string")]
5146    pub shorty: String,
5147    /// Display-order value for clients that sort campuses. Negative values are accepted. Omitted defaults to zero.
5148    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5149    pub sort_key: Option<i64>,
5150    /// Fields not described by the spec, e.g. instance-specific DB fields.
5151    #[serde(flatten)]
5152    pub extra: serde_json::Map<String, serde_json::Value>,
5153}
5154
5155/// Partial campus update despite the PUT method. Every field is optional. Omitted or null values retain their existing values; an empty object leaves the campus unchanged. The ID comes from the URL.
5156#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5157pub struct CampusUpdate {
5158    /// New name. Omitted or null retains the current value.
5159    ///
5160    /// `None` leaves the field out, `Some(None)` sends `null`.
5161    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5162    pub name: Option<Option<String>>,
5163    /// New abbreviation. Omitted or null retains the current value.
5164    ///
5165    /// `None` leaves the field out, `Some(None)` sends `null`.
5166    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5167    pub shorty: Option<Option<String>>,
5168    /// New display-order value. Omitted or null retains the current value.
5169    ///
5170    /// `None` leaves the field out, `Some(None)` sends `null`.
5171    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5172    pub sort_key: Option<Option<i64>>,
5173    /// Fields not described by the spec, e.g. instance-specific DB fields.
5174    #[serde(flatten)]
5175    pub extra: serde_json::Map<String, serde_json::Value>,
5176}
5177
5178/// A cash discount defines a percentage for early-payment discounts and the ledger account to which the discount is posted. Its accounting period is determined by that account.
5179#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5180pub struct CashDiscount {
5181    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
5182    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
5183    pub account_id: i64,
5184    #[serde(deserialize_with = "crate::lenient::number")]
5185    pub id: i64,
5186    pub meta: MetaDataEntityId,
5187    /// Trimmed description. Supply a nonblank value because the stored model requires a string.
5188    #[serde(deserialize_with = "crate::lenient::string")]
5189    pub note: String,
5190    /// Percentage points: 2 means 2%. Stored values are floating-point numbers, although this API currently accepts only integer input.
5191    #[serde(deserialize_with = "crate::lenient::number")]
5192    pub rate: f64,
5193    /// Fields not described by the spec, e.g. instance-specific DB fields.
5194    #[serde(flatten)]
5195    pub extra: serde_json::Map<String, serde_json::Value>,
5196}
5197
5198/// A cash discount defines a percentage for early-payment discounts and the ledger account to which the discount is posted. Its accounting period is determined by that account.
5199#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5200pub struct CashDiscountCreate {
5201    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
5202    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
5203    pub account_id: i64,
5204    /// Trimmed description. Supply a nonblank value because the stored model requires a string.
5205    #[serde(deserialize_with = "crate::lenient::string")]
5206    pub note: String,
5207    /// Whole percentage points: 2 means 2%. This endpoint currently accepts only integers and does not validate a percentage range.
5208    #[serde(deserialize_with = "crate::lenient::number")]
5209    pub rate: i64,
5210    /// Fields not described by the spec, e.g. instance-specific DB fields.
5211    #[serde(flatten)]
5212    pub extra: serde_json::Map<String, serde_json::Value>,
5213}
5214
5215/// Replacement values for this cash discount.
5216#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5217pub struct CashDiscountUpdate {
5218    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
5219    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
5220    pub account_id: i64,
5221    /// Trimmed description. Supply a nonblank value because the stored model requires a string.
5222    #[serde(deserialize_with = "crate::lenient::string")]
5223    pub note: String,
5224    /// Whole percentage points: 2 means 2%. This endpoint currently accepts only integers and does not validate a percentage range.
5225    #[serde(deserialize_with = "crate::lenient::number")]
5226    pub rate: i64,
5227    /// Fields not described by the spec, e.g. instance-specific DB fields.
5228    #[serde(flatten)]
5229    pub extra: serde_json::Map<String, serde_json::Value>,
5230}
5231
5232/// Group or event chat room synchronized with Matrix.
5233#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5234pub struct Chat {
5235    /// Person ID recorded as the room creator. `0` represents a system user.
5236    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5237    pub creator: Option<i64>,
5238    /// ID of the group (`ctg`) or service-planning event (`cte`) associated with the room.
5239    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
5240    pub domain_id: i64,
5241    /// Stable ChurchTools chat identifier, not a Matrix room ID.
5242    #[serde(deserialize_with = "crate::lenient::string")]
5243    pub guid: String,
5244    /// `ctg` identifies a group and `cte` identifies a service-planning event.
5245    /// Allowed values: `cte`, `ctg`.
5246    #[serde(deserialize_with = "crate::lenient::string")]
5247    pub prefix: String,
5248    /// Display name of the room.
5249    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5250    pub roomname: Option<String>,
5251    /// Room lifecycle status. `STARTING` awaits confirmation from the central chat service.
5252    /// Allowed values: `NOT_STARTED`, `STARTED`, `STARTING`, `STOPPED`.
5253    #[serde(deserialize_with = "crate::lenient::string")]
5254    pub status: String,
5255    /// Fields not described by the spec, e.g. instance-specific DB fields.
5256    #[serde(flatten)]
5257    pub extra: serde_json::Map<String, serde_json::Value>,
5258}
5259
5260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5261pub struct ChatCreate {
5262    /// ID of the group (`ctg`) or service-planning event (`cte`) associated with the room.
5263    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
5264    pub domain_id: i64,
5265    /// Stable ChurchTools chat identifier, not a Matrix room ID.
5266    #[serde(deserialize_with = "crate::lenient::string")]
5267    pub guid: String,
5268    /// `ctg` identifies a group and `cte` identifies a service-planning event.
5269    /// Allowed values: `cte`, `ctg`.
5270    #[serde(deserialize_with = "crate::lenient::string")]
5271    pub prefix: String,
5272    /// Display name of the room.
5273    #[serde(deserialize_with = "crate::lenient::string")]
5274    pub roomname: String,
5275    /// Fields not described by the spec, e.g. instance-specific DB fields.
5276    #[serde(flatten)]
5277    pub extra: serde_json::Map<String, serde_json::Value>,
5278}
5279
5280/// Fields used to update chat metadata or change its lifecycle status. When `status` is set, the request performs a lifecycle transition.
5281#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5282pub struct ChatUpdate {
5283    /// Person ID recorded as the room creator.
5284    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5285    pub creator: Option<i64>,
5286    /// ID of the group (`ctg`) or service-planning event (`cte`) associated with the room.
5287    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5288    pub domain_id: Option<i64>,
5289    /// Synchronization token for central chat service callbacks.
5290    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5291    pub nonce: Option<String>,
5292    /// `ctg` identifies a group and `cte` identifies a service-planning event.
5293    /// Allowed values: `cte`, `ctg`.
5294    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5295    pub prefix: Option<String>,
5296    /// Display name of the room.
5297    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5298    pub roomname: Option<String>,
5299    /// Requested lifecycle status.
5300    /// Allowed values: `STARTED`, `STOPPED`.
5301    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5302    pub status: Option<String>,
5303    /// Fields not described by the spec, e.g. instance-specific DB fields.
5304    #[serde(flatten)]
5305    pub extra: serde_json::Map<String, serde_json::Value>,
5306}
5307
5308/// Attendance confirmation for an existing person. The embedded meeting contains refreshed attendance statistics.
5309#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5310pub struct Checkin {
5311    pub group: DomainObjectGroup,
5312    /// One dated occurrence of a group meeting, used to record attendance, guest counts and feedback. It is separate from the group itself and its memberships. No independent end time is stored. Cancellation and completion are separate flags; completion locks check-in changes.
5313    #[serde(rename = "groupMeeting")]
5314    pub group_meeting: GroupMeeting,
5315    /// Person as Domain Object
5316    pub person: DomainObjectPerson,
5317    /// Number of participants currently checked in at this meeting.
5318    #[serde(rename = "totalCheckedIn", deserialize_with = "crate::lenient::number")]
5319    pub total_checked_in: i64,
5320    /// Fields not described by the spec, e.g. instance-specific DB fields.
5321    #[serde(flatten)]
5322    pub extra: serde_json::Map<String, serde_json::Value>,
5323}
5324
5325/// Records attendance for one existing person at one group meeting. Supply exactly one non-null date or groupMeetingId; the other may be omitted or null.
5326#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5327pub struct CheckinCreate {
5328    /// Exact start timestamp of a meeting in this group. An existing meeting at that timestamp is reused; otherwise a meeting is created.
5329    ///
5330    /// `None` leaves the field out, `Some(None)` sends `null`.
5331    #[serde(deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
5332    pub date: Option<Option<chrono::DateTime<chrono::Utc>>>,
5333    /// ID of an existing meeting belonging to the path group.
5334    ///
5335    /// `None` leaves the field out, `Some(None)` sends `null`.
5336    #[serde(rename = "groupMeetingId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5337    pub group_meeting_id: Option<Option<i64>>,
5338    /// optional printer ID, if a name tag should be printed out
5339    #[serde(rename = "printerId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5340    pub printer_id: Option<i64>,
5341    /// Optional ticket token for this person and group. The ticket is marked used before attendance is recorded; later failures can leave it used.
5342    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5343    pub token: Option<String>,
5344    /// Fields not described by the spec, e.g. instance-specific DB fields.
5345    #[serde(flatten)]
5346    pub extra: serde_json::Map<String, serde_json::Value>,
5347}
5348
5349/// Membership to create before a separate attendance check-in. The group’s default role and normal active membership status are used; the origin is check-in. No meeting attendance or label printing is performed here.
5350#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5351pub struct CheckinMembershipCreate {
5352    /// Group-member custom field values keyed by field ID. Definitions and allowed options belong to the selected group. Omitted fields use membership defaults. POST and PUT currently differ in validation, so clients should submit correctly typed values for the field definition.
5353    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
5354    pub fields: Option<std::collections::BTreeMap<String, serde_json::Value>>,
5355    /// Target group ID. Supply an integer even though the enclosing validator does not validate this nested key explicitly.
5356    #[serde(deserialize_with = "crate::lenient::number")]
5357    pub id: i64,
5358    /// Allows admission even when the group is full; no additional override permission is checked here.
5359    #[serde(rename = "ignoreGroupSize", default, skip_serializing_if = "Option::is_none")]
5360    pub ignore_group_size: Option<bool>,
5361    /// Person fields to update after membership creation, keyed by API field name. Only names configured as person fields for this group are applied; other names are ignored. Send an empty object when no changes are needed.
5362    #[serde(rename = "personFields", deserialize_with = "crate::lenient::map")]
5363    pub person_fields: std::collections::BTreeMap<String, serde_json::Value>,
5364    /// Fields not described by the spec, e.g. instance-specific DB fields.
5365    #[serde(flatten)]
5366    pub extra: serde_json::Map<String, serde_json::Value>,
5367}
5368
5369/// Legacy person-model response used only by check-in admission. It differs from the regular, permission-filtered Person API resource: coordinates are strings, emails currently serialize as an object, and security-level properties are absent. Additional implementation properties may be present; clients should consume only the fields needed for admission and use the regular person endpoint for subsequent reads.
5370#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5371pub struct CheckinPerson {
5372    #[serde(rename = "departmentIds")]
5373    pub department_ids: Vec<i64>,
5374    /// The internal email collection currently serializes as an object rather than the normal Person email array.
5375    #[serde(deserialize_with = "crate::lenient::map")]
5376    pub emails: std::collections::BTreeMap<String, serde_json::Value>,
5377    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5378    pub first_name: Option<String>,
5379    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5380    pub guid: Option<String>,
5381    #[serde(deserialize_with = "crate::lenient::number")]
5382    pub id: i64,
5383    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
5384    pub last_name: String,
5385    /// Stored coordinate as a string; can be empty.
5386    #[serde(deserialize_with = "crate::lenient::string")]
5387    pub latitude: String,
5388    /// Stored coordinate as a string; can be empty.
5389    #[serde(deserialize_with = "crate::lenient::string")]
5390    pub longitude: String,
5391    /// Fields not described by the spec, e.g. instance-specific DB fields.
5392    #[serde(flatten)]
5393    pub extra: serde_json::Map<String, serde_json::Value>,
5394}
5395
5396/// Creates a new person, adds a check-in creation note, optionally tags the person and creates a group membership.
5397#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5398pub struct CheckinPersonCreate {
5399    /// Membership to create before a separate attendance check-in. The group’s default role and normal active membership status are used; the origin is check-in. No meeting attendance or label printing is performed here.
5400    pub group: CheckinMembershipCreate,
5401    /// Person fields for creation during check-in admission. Uses the normal new-person field validation, including installation-specific masterdata and custom fields. Unlike ordinary creation, this flow forces duplicate creation and ignores visibility. Optional fields depend on configured field security and new-person settings.
5402    pub person: CheckinPersonDataCreate,
5403    /// Optional person-tag ID. Omitted/null behaves as 0 and normally adds no tag. Nonexistent IDs are silently ignored; use a tag belonging to the person domain.
5404    ///
5405    /// `None` leaves the field out, `Some(None)` sends `null`.
5406    #[serde(rename = "tagId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5407    pub tag_id: Option<Option<i64>>,
5408    /// Fields not described by the spec, e.g. instance-specific DB fields.
5409    #[serde(flatten)]
5410    pub extra: serde_json::Map<String, serde_json::Value>,
5411}
5412
5413/// Person fields for creation during check-in admission. Uses the normal new-person field validation, including installation-specific masterdata and custom fields. Unlike ordinary creation, this flow forces duplicate creation and ignores visibility. Optional fields depend on configured field security and new-person settings.
5414#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5415pub struct CheckinPersonDataCreate {
5416    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5417    pub address_addition: Option<String>,
5418    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5419    pub baptised_by: Option<String>,
5420    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5421    pub birth_name: Option<String>,
5422    /// `None` leaves the field out, `Some(None)` sends `null`.
5423    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5424    pub birthday: Option<Option<chrono::NaiveDate>>,
5425    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5426    pub birthplace: Option<String>,
5427    /// ID of a campus returned by `GET /person/masterdata`.
5428    #[serde(rename = "campusId", deserialize_with = "crate::lenient::number")]
5429    pub campus_id: i64,
5430    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5431    pub city: Option<String>,
5432    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5433    pub cms_user_id: Option<String>,
5434    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5435    pub country: Option<String>,
5436    /// `None` leaves the field out, `Some(None)` sends `null`.
5437    #[serde(rename = "dateOfBaptism", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5438    pub date_of_baptism: Option<Option<chrono::NaiveDate>>,
5439    /// `None` leaves the field out, `Some(None)` sends `null`.
5440    #[serde(rename = "dateOfBelonging", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5441    pub date_of_belonging: Option<Option<chrono::NaiveDate>>,
5442    /// `None` leaves the field out, `Some(None)` sends `null`.
5443    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5444    pub date_of_death: Option<Option<chrono::NaiveDate>>,
5445    /// `None` leaves the field out, `Some(None)` sends `null`.
5446    #[serde(rename = "dateOfEntry", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
5447    pub date_of_entry: Option<Option<chrono::DateTime<chrono::Utc>>>,
5448    /// `None` leaves the field out, `Some(None)` sends `null`.
5449    #[serde(rename = "dateOfResign", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
5450    pub date_of_resign: Option<Option<chrono::DateTime<chrono::Utc>>>,
5451    /// Department IDs returned by `GET /person/masterdata`. At least one department must be set.
5452    #[serde(rename = "departmentIds")]
5453    pub department_ids: Vec<i64>,
5454    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5455    pub email: Option<String>,
5456    /// Save many eMail addresses for person. If `emails` is present in request `email` is ignored.
5457    #[serde(default, skip_serializing_if = "Option::is_none")]
5458    pub emails: Option<Vec<PersonEmail>>,
5459    /// `None` leaves the field out, `Some(None)` sends `null`.
5460    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5461    pub family_status_id: Option<Option<i64>>,
5462    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5463    pub fax: Option<String>,
5464    /// `None` leaves the field out, `Some(None)` sends `null`.
5465    #[serde(rename = "firstContact", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
5466    pub first_contact: Option<Option<chrono::DateTime<chrono::Utc>>>,
5467    /// Required field; surrounding whitespace is removed, blank text becomes null.
5468    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5469    pub first_name: Option<String>,
5470    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5471    pub grow_path_id: Option<i64>,
5472    /// Optional unique person GUID. Generated when omitted.
5473    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5474    pub guid: Option<String>,
5475    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5476    pub job: Option<String>,
5477    /// Required nonblank surname, trimmed before use.
5478    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
5479    pub last_name: String,
5480    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5481    pub mobile: Option<String>,
5482    /// `None` leaves the field out, `Some(None)` sends `null`.
5483    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5484    pub nationality_id: Option<Option<i64>>,
5485    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5486    pub nickname: Option<String>,
5487    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5488    pub optigem_id: Option<String>,
5489    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5490    pub phone_private: Option<String>,
5491    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5492    pub phone_work: Option<String>,
5493    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5494    pub place_of_baptism: Option<String>,
5495    /// Legacy representation of the privacy agreement. Use the three flat `privacyPolicyAgreement*` fields instead. When this object is used, all three values must be provided if privacy agreement fields are mandatory.
5496    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
5497    #[deprecated = "Use the three flat `privacyPolicyAgreement*` fields instead."]
5498    pub privacy_policy_agreement: Option<CheckinPersonDataCreatePrivacyPolicyAgreement>,
5499    /// Date of the privacy policy agreement. Required together with agreement type and person when `privacy_policy_fields_mandatory` is enabled.
5500    #[serde(rename = "privacyPolicyAgreementDate", default, skip_serializing_if = "Option::is_none")]
5501    pub privacy_policy_agreement_date: Option<chrono::NaiveDate>,
5502    /// ID of the configured agreement type describing how the agreement was obtained. This is independent from who gave the agreement. Required together with agreement date and person when `privacy_policy_fields_mandatory` is enabled.
5503    #[serde(rename = "privacyPolicyAgreementTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5504    pub privacy_policy_agreement_type_id: Option<i64>,
5505    /// ID of the configured agreement source describing who gave the agreement. This is independent from how the agreement was obtained. Required together with agreement date and type when `privacy_policy_fields_mandatory` is enabled.
5506    #[serde(rename = "privacyPolicyAgreementWhoId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5507    pub privacy_policy_agreement_who_id: Option<i64>,
5508    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5509    pub referred_by: Option<String>,
5510    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5511    pub referred_to: Option<String>,
5512    /// `None` leaves the field out, `Some(None)` sends `null`.
5513    #[serde(rename = "sexId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5514    pub sex_id: Option<Option<i64>>,
5515    /// ID of a person status returned by `GET /person/masterdata`.
5516    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
5517    pub status_id: i64,
5518    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5519    pub street: Option<String>,
5520    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5521    pub title: Option<String>,
5522    /// `None` leaves the field out, `Some(None)` sends `null`.
5523    #[serde(rename = "weddingDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5524    pub wedding_date: Option<Option<chrono::NaiveDate>>,
5525    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5526    pub zip: Option<String>,
5527    /// Fields not described by the spec, e.g. instance-specific DB fields.
5528    #[serde(flatten)]
5529    pub extra: serde_json::Map<String, serde_json::Value>,
5530}
5531
5532/// Legacy representation of the privacy agreement. Use the three flat `privacyPolicyAgreement*` fields instead. When this object is used, all three values must be provided if privacy agreement fields are mandatory.
5533#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5534pub struct CheckinPersonDataCreatePrivacyPolicyAgreement {
5535    /// `None` leaves the field out, `Some(None)` sends `null`.
5536    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5537    pub date: Option<Option<chrono::NaiveDate>>,
5538    /// How the agreement was obtained: 1 group registration, 2 self-confirmation, 3 outside ChurchTools, 4 check-in.
5539    ///
5540    /// `None` leaves the field out, `Some(None)` sends `null`.
5541    #[serde(rename = "typeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5542    pub type_id: Option<Option<i64>>,
5543    /// Who gave the agreement: 1 the person themself, 2 a parent, 10000 the person responsible for a group signup.
5544    ///
5545    /// `None` leaves the field out, `Some(None)` sends `null`.
5546    #[serde(rename = "whoId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5547    pub who_id: Option<Option<i64>>,
5548    /// Fields not described by the spec, e.g. instance-specific DB fields.
5549    #[serde(flatten)]
5550    pub extra: serde_json::Map<String, serde_json::Value>,
5551}
5552
5553/// Admits an existing person to a group and updates the group’s configured person fields. This is not a general person update or an attendance check-in.
5554#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5555pub struct CheckinPersonUpdate {
5556    /// Membership to create before a separate attendance check-in. The group’s default role and normal active membership status are used; the origin is check-in. No meeting attendance or label printing is performed here.
5557    pub group: CheckinMembershipCreate,
5558    /// Existing person to admit to the group. A current membership causes a conflict instead of being updated.
5559    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
5560    pub person_id: i64,
5561    /// Optional person-tag ID. Omitted/null behaves as 0 and normally adds no tag. Nonexistent IDs are silently ignored; use a tag belonging to the person domain.
5562    ///
5563    /// `None` leaves the field out, `Some(None)` sends `null`.
5564    #[serde(rename = "tagId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5565    pub tag_id: Option<Option<i64>>,
5566    /// Fields not described by the spec, e.g. instance-specific DB fields.
5567    #[serde(flatten)]
5568    pub extra: serde_json::Map<String, serde_json::Value>,
5569}
5570
5571/// A finance client is the organizational entity whose books are kept separately, for example a congregation or a charitable organization. Each client owns accounting periods, and those periods own its accounts and cost centers. It is unrelated to an OAuth application client.
5572#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5573pub struct Client {
5574    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5575    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5576    pub city: Option<String>,
5577    /// Stored DATEV identifier as a string or null.
5578    #[serde(rename = "datevClientNumber", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5579    pub datev_client_number: Option<String>,
5580    /// Stored DATEV identifier as a string or null.
5581    #[serde(rename = "datevConsultantNumber", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5582    pub datev_consultant_number: Option<String>,
5583    /// Optional valid email address. Use null or omit to clear it; an empty string is not accepted.
5584    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5585    pub email: Option<String>,
5586    /// Employer name used for electronically supported employer audits (euBP). Omitted or null clears it.
5587    #[serde(rename = "eubpBusinessName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5588    pub eubp_business_name: Option<String>,
5589    /// German employer business number for euBP: eight digits with a valid checksum. The first three digits must not be 000 or 100–110. Omitted or null clears it; empty string is rejected.
5590    #[serde(rename = "eubpBusinessNumber", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5591    pub eubp_business_number: Option<String>,
5592    #[serde(deserialize_with = "crate::lenient::number")]
5593    pub id: i64,
5594    pub meta: MetaDataEntityId,
5595    /// Trimmed client name, unique across finance clients.
5596    #[serde(deserialize_with = "crate::lenient::string")]
5597    pub name: String,
5598    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5599    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5600    pub phone: Option<String>,
5601    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5602    #[serde(rename = "postalCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5603    pub postal_code: Option<String>,
5604    /// Ascending display order. Required for creation and update.
5605    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
5606    pub sort_key: i64,
5607    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5608    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5609    pub street: Option<String>,
5610    /// Treasurer person as a domain object, or null when none is assigned.
5611    #[serde(default, skip_serializing_if = "Option::is_none")]
5612    pub treasurer: Option<DomainObjectPerson>,
5613    /// Optional person ID of the treasurer. Omitted or null clears the assignment.
5614    #[serde(rename = "treasurerId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5615    pub treasurer_id: Option<i64>,
5616    /// Fields not described by the spec, e.g. instance-specific DB fields.
5617    #[serde(flatten)]
5618    pub extra: serde_json::Map<String, serde_json::Value>,
5619}
5620
5621/// A finance client is the organizational entity whose books are kept separately, for example a congregation or a charitable organization. Each client owns accounting periods, and those periods own its accounts and cost centers. It is unrelated to an OAuth application client.
5622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5623pub struct ClientCreate {
5624    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5625    ///
5626    /// `None` leaves the field out, `Some(None)` sends `null`.
5627    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5628    pub city: Option<Option<String>>,
5629    /// Optional numeric DATEV client identifier. Numeric strings or numbers are accepted and stored as strings. Empty string is also accepted; omission or null clears it.
5630    #[serde(rename = "datevClientNumber", default, skip_serializing_if = "serde_json::Value::is_null")]
5631    pub datev_client_number: serde_json::Value,
5632    /// Optional numeric DATEV consultant identifier. Numeric strings or numbers are accepted and stored as strings. Empty string is also accepted; omission or null clears it.
5633    #[serde(rename = "datevConsultantNumber", default, skip_serializing_if = "serde_json::Value::is_null")]
5634    pub datev_consultant_number: serde_json::Value,
5635    /// Optional valid email address. Use null or omit to clear it; an empty string is not accepted.
5636    ///
5637    /// `None` leaves the field out, `Some(None)` sends `null`.
5638    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5639    pub email: Option<Option<String>>,
5640    /// Employer name used for electronically supported employer audits (euBP). Omitted or null clears it.
5641    ///
5642    /// `None` leaves the field out, `Some(None)` sends `null`.
5643    #[serde(rename = "eubpBusinessName", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5644    pub eubp_business_name: Option<Option<String>>,
5645    /// German employer business number for euBP: eight digits with a valid checksum. The first three digits must not be 000 or 100–110. Omitted or null clears it; empty string is rejected.
5646    ///
5647    /// `None` leaves the field out, `Some(None)` sends `null`.
5648    #[serde(rename = "eubpBusinessNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5649    pub eubp_business_number: Option<Option<String>>,
5650    /// Trimmed client name, unique across finance clients.
5651    #[serde(deserialize_with = "crate::lenient::string")]
5652    pub name: String,
5653    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5654    ///
5655    /// `None` leaves the field out, `Some(None)` sends `null`.
5656    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5657    pub phone: Option<Option<String>>,
5658    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5659    ///
5660    /// `None` leaves the field out, `Some(None)` sends `null`.
5661    #[serde(rename = "postalCode", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5662    pub postal_code: Option<Option<String>>,
5663    /// Ascending display order. Required for creation and update.
5664    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
5665    pub sort_key: i64,
5666    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5667    ///
5668    /// `None` leaves the field out, `Some(None)` sends `null`.
5669    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5670    pub street: Option<Option<String>>,
5671    /// Optional person ID of the treasurer. Omitted or null clears the assignment.
5672    ///
5673    /// `None` leaves the field out, `Some(None)` sends `null`.
5674    #[serde(rename = "treasurerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5675    pub treasurer_id: Option<Option<i64>>,
5676    /// Fields not described by the spec, e.g. instance-specific DB fields.
5677    #[serde(flatten)]
5678    pub extra: serde_json::Map<String, serde_json::Value>,
5679}
5680
5681/// Replacement finance-client data. name and sortKey are required; omitted optional fields are cleared, including contact, DATEV and euBP fields.
5682#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5683pub struct ClientUpdate {
5684    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5685    ///
5686    /// `None` leaves the field out, `Some(None)` sends `null`.
5687    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5688    pub city: Option<Option<String>>,
5689    /// Optional numeric DATEV client identifier. Numeric strings or numbers are accepted and stored as strings. Empty string is also accepted; omission or null clears it.
5690    #[serde(rename = "datevClientNumber", default, skip_serializing_if = "serde_json::Value::is_null")]
5691    pub datev_client_number: serde_json::Value,
5692    /// Optional numeric DATEV consultant identifier. Numeric strings or numbers are accepted and stored as strings. Empty string is also accepted; omission or null clears it.
5693    #[serde(rename = "datevConsultantNumber", default, skip_serializing_if = "serde_json::Value::is_null")]
5694    pub datev_consultant_number: serde_json::Value,
5695    /// Optional valid email address. Use null or omit to clear it; an empty string is not accepted.
5696    ///
5697    /// `None` leaves the field out, `Some(None)` sends `null`.
5698    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5699    pub email: Option<Option<String>>,
5700    /// Employer name used for electronically supported employer audits (euBP). Omitted or null clears it.
5701    ///
5702    /// `None` leaves the field out, `Some(None)` sends `null`.
5703    #[serde(rename = "eubpBusinessName", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5704    pub eubp_business_name: Option<Option<String>>,
5705    /// German employer business number for euBP: eight digits with a valid checksum. The first three digits must not be 000 or 100–110. Omitted or null clears it; empty string is rejected.
5706    ///
5707    /// `None` leaves the field out, `Some(None)` sends `null`.
5708    #[serde(rename = "eubpBusinessNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5709    pub eubp_business_number: Option<Option<String>>,
5710    /// Trimmed client name, unique across finance clients.
5711    #[serde(deserialize_with = "crate::lenient::string")]
5712    pub name: String,
5713    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5714    ///
5715    /// `None` leaves the field out, `Some(None)` sends `null`.
5716    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5717    pub phone: Option<Option<String>>,
5718    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5719    ///
5720    /// `None` leaves the field out, `Some(None)` sends `null`.
5721    #[serde(rename = "postalCode", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5722    pub postal_code: Option<Option<String>>,
5723    /// Ascending display order. Required for creation and update.
5724    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
5725    pub sort_key: i64,
5726    /// Optional contact information. Omitted or null clears it, including on update. These values are not trimmed by the controller.
5727    ///
5728    /// `None` leaves the field out, `Some(None)` sends `null`.
5729    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5730    pub street: Option<Option<String>>,
5731    /// Optional person ID of the treasurer. Omitted or null clears the assignment.
5732    ///
5733    /// `None` leaves the field out, `Some(None)` sends `null`.
5734    #[serde(rename = "treasurerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
5735    pub treasurer_id: Option<Option<i64>>,
5736    /// Fields not described by the spec, e.g. instance-specific DB fields.
5737    #[serde(flatten)]
5738    pub extra: serde_json::Map<String, serde_json::Value>,
5739}
5740
5741/// Value for Tailwind color
5742#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5743pub struct Color {
5744    /// A color in ChurchTools
5745    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
5746    #[serde(deserialize_with = "crate::lenient::string")]
5747    pub key: String,
5748    /// Allowed values: `100`, `200`, `300`, `400`, `50`, `500`, `600`, `700`, `800`, `900`.
5749    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5750    pub shade: Option<i64>,
5751    /// Fields not described by the spec, e.g. instance-specific DB fields.
5752    #[serde(flatten)]
5753    pub extra: serde_json::Map<String, serde_json::Value>,
5754}
5755
5756#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5757pub struct CombinedDonationReceipts {
5758    /// Separate attachment PDF in twofiles mode. Omitted in onefile mode when receipts exist; null when no matching receipts exist.
5759    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5760    pub attachments: Option<String>,
5761    /// Combined cover-letter PDF, or the complete combined PDF in onefile mode. Null if no matching receipts exist.
5762    #[serde(rename = "coverLetters", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5763    pub cover_letters: Option<String>,
5764    /// Fields not described by the spec, e.g. instance-specific DB fields.
5765    #[serde(flatten)]
5766    pub extra: serde_json::Map<String, serde_json::Value>,
5767}
5768
5769/// Visibility category for person comments and person-linked notes. This is a master-data label referenced by commentViewerId, not a ChurchTools group or a list of people. Access is assigned through the view comments permission for this ID.
5770#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5771pub struct CommentViewer {
5772    /// Category ID used as commentViewerId and as a selection of churchdb view comments.
5773    #[serde(deserialize_with = "crate::lenient::number")]
5774    pub id: i64,
5775    /// Stored category name or translation key.
5776    #[serde(deserialize_with = "crate::lenient::string")]
5777    pub name: String,
5778    /// Name translated for the current language, falling back to the stored name.
5779    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
5780    pub name_translated: String,
5781    /// Display sort key. Lists are sorted by sortKey, then stored name, both ascending.
5782    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
5783    pub sort_key: i64,
5784    /// Fields not described by the spec, e.g. instance-specific DB fields.
5785    #[serde(flatten)]
5786    pub extra: serde_json::Map<String, serde_json::Value>,
5787}
5788
5789/// Create a visibility category for person comments/notes. Creating the category does not grant anyone permission to read its content.
5790#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5791pub struct CommentViewerCreate {
5792    /// Trimmed display name or translation key, 1–50 characters. No uniqueness constraint is applied.
5793    #[serde(deserialize_with = "crate::lenient::string")]
5794    pub name: String,
5795    /// Nonnegative display sort key; defaults to 0.
5796    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5797    pub sort_key: Option<i64>,
5798    /// Fields not described by the spec, e.g. instance-specific DB fields.
5799    #[serde(flatten)]
5800    pub extra: serde_json::Map<String, serde_json::Value>,
5801}
5802
5803/// Updates a visibility category. The category ID comes from the URL. name is required; sortKey is optional and preserves its value when omitted.
5804#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5805pub struct CommentViewerUpdate {
5806    /// Trimmed display name or translation key, 1–50 characters. No uniqueness constraint is applied.
5807    #[serde(deserialize_with = "crate::lenient::string")]
5808    pub name: String,
5809    /// Optional nonnegative sort key. Omission preserves the existing value. Explicit null passes the validator but fails the integer setter; use omission to retain the value.
5810    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5811    pub sort_key: Option<i64>,
5812    /// Fields not described by the spec, e.g. instance-specific DB fields.
5813    #[serde(flatten)]
5814    pub extra: serde_json::Map<String, serde_json::Value>,
5815}
5816
5817#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5818pub struct Config {
5819    #[serde(rename = "_current_config_file", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5820    pub current_config_file: Option<String>,
5821    #[serde(default, skip_serializing_if = "Option::is_none")]
5822    pub accept_datasecurity: Option<bool>,
5823    #[serde(default, skip_serializing_if = "Option::is_none")]
5824    pub access_control_allow_credentials: Option<bool>,
5825    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5826    pub access_control_allow_origins: Option<String>,
5827    #[serde(default, skip_serializing_if = "Option::is_none")]
5828    pub admin_ids: Option<Vec<String>>,
5829    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5830    pub admin_mail: Option<String>,
5831    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5832    pub admin_message: Option<String>,
5833    #[serde(rename = "aiAssistantAvailable", default, skip_serializing_if = "Option::is_none")]
5834    pub ai_assistant_available: Option<bool>,
5835    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5836    pub ai_description_available_generation_count: Option<f64>,
5837    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5838    pub ai_description_available_generation_tests: Option<f64>,
5839    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5840    pub ai_description_generation_count: Option<f64>,
5841    #[serde(default, skip_serializing_if = "Option::is_none")]
5842    pub ai_description_generation_enabled: Option<bool>,
5843    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5844    pub ai_description_total_generation_count: Option<f64>,
5845    #[serde(default, skip_serializing_if = "Option::is_none")]
5846    pub allowaiassistant: Option<bool>,
5847    /// This is a string that can only be true or false.
5848    /// Allowed values: `0`, `1`.
5849    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5850    pub allowcheckin: Option<String>,
5851    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5852    pub allowedcals: Option<String>,
5853    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5854    pub allowedclients: Option<String>,
5855    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5856    pub allowedcwbusers: Option<String>,
5857    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5858    pub allowedresources: Option<String>,
5859    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5860    pub allowedservices: Option<String>,
5861    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5862    pub allowedstations: Option<String>,
5863    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5864    pub allowedsyncconnections: Option<String>,
5865    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5866    pub allowedsyncjobs: Option<String>,
5867    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5868    pub allowedtextgenerations: Option<String>,
5869    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5870    pub alloweduser: Option<String>,
5871    /// This is a string that can only be true or false.
5872    /// Allowed values: `0`, `1`.
5873    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5874    pub allowfinance: Option<String>,
5875    /// This is a string that can only be true or false.
5876    /// Allowed values: `0`, `1`.
5877    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5878    pub allowldap: Option<String>,
5879    /// This is a string that can only be true or false.
5880    /// Allowed values: `0`, `1`.
5881    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5882    pub allowoptigemsync: Option<String>,
5883    /// This is a string that can only be true or false.
5884    /// Allowed values: `0`, `1`.
5885    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5886    pub allowsync: Option<String>,
5887    #[serde(default, skip_serializing_if = "Option::is_none")]
5888    pub app_security_request: Option<bool>,
5889    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
5890    pub auth_cache_time: serde_json::Value,
5891    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5892    pub authorized_persons: Option<String>,
5893    /// Allowed values: `ChurchTools`, `VereinTools`.
5894    #[serde(deserialize_with = "crate::lenient::string")]
5895    pub brand: String,
5896    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5897    pub build: Option<String>,
5898    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5899    pub ccli_access_token: Option<String>,
5900    #[serde(default, skip_serializing_if = "Option::is_none")]
5901    pub ccli_auto_reporting_enabled: Option<bool>,
5902    #[serde(default, skip_serializing_if = "Option::is_none")]
5903    pub ccli_enabled: Option<bool>,
5904    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5905    pub ccli_last_token_refresh: Option<String>,
5906    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5907    pub ccli_refresh_token: Option<String>,
5908    #[serde(rename = "chatServer", deserialize_with = "crate::lenient::string")]
5909    pub chat_server: String,
5910    /// This is a string that can only be true or false.
5911    /// Allowed values: `0`, `1`.
5912    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5913    pub chrome_active: Option<String>,
5914    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5915    pub chrome_binary: Option<String>,
5916    #[serde(default, skip_serializing_if = "Option::is_none")]
5917    pub churchcal_active: Option<bool>,
5918    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5919    pub churchcal_css: Option<String>,
5920    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5921    pub churchcal_entries_last_days: Option<i64>,
5922    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5923    pub churchcal_firstdayinweek: Option<i64>,
5924    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5925    pub churchcal_maincalname: Option<String>,
5926    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5927    pub churchcal_name: Option<String>,
5928    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5929    pub churchcal_name_default: Option<String>,
5930    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5931    pub churchcal_sortcode: Option<i64>,
5932    #[serde(default, skip_serializing_if = "Option::is_none")]
5933    pub churchchat_allow_event_chat: Option<bool>,
5934    #[serde(default, skip_serializing_if = "Option::is_none")]
5935    pub churchchat_allow_group_chat: Option<bool>,
5936    #[serde(default, skip_serializing_if = "Option::is_none")]
5937    pub churchchat_allow_person_chat: Option<bool>,
5938    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5939    pub churchchat_delete_event_chat_after_x_days: Option<i64>,
5940    #[serde(default, skip_serializing_if = "Option::is_none")]
5941    pub churchchat_invite_ct_event_chat: Option<bool>,
5942    #[serde(default, skip_serializing_if = "Option::is_none")]
5943    pub churchchat_invite_ct_group_chat: Option<bool>,
5944    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5945    pub churchchat_name: Option<String>,
5946    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5947    pub churchchat_name_default: Option<String>,
5948    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5949    pub churchchat_sortcode: Option<i64>,
5950    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5951    pub churchchat_start_event_chat_before_x_days: Option<i64>,
5952    /// A stringified array of calendar ids
5953    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5954    pub churchchat_start_event_chat_for_calendars: Option<String>,
5955    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5956    pub churchchat_sync_user_id: Option<i64>,
5957    #[serde(default, skip_serializing_if = "Option::is_none")]
5958    pub churchcheckin_active: Option<bool>,
5959    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5960    pub churchcheckin_label_child: Option<String>,
5961    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5962    pub churchcheckin_label_parent: Option<String>,
5963    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5964    pub churchcheckin_label_standard: Option<String>,
5965    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5966    pub churchcheckin_name: Option<String>,
5967    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5968    pub churchcheckin_name_default: Option<String>,
5969    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
5970    pub churchcheckin_sortcode: Option<i64>,
5971    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5972    pub churchcheckin_tags: Option<String>,
5973    /// This is a string that can only be true or false.
5974    /// Allowed values: `0`, `1`.
5975    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5976    pub churchcustommodule_active: Option<String>,
5977    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5978    pub churchcustommodule_name: Option<String>,
5979    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5980    pub churchcustommodule_name_default: Option<String>,
5981    #[serde(default, skip_serializing_if = "Option::is_none")]
5982    pub churchdb_active: Option<bool>,
5983    #[serde(default, skip_serializing_if = "Option::is_none")]
5984    pub churchdb_archivedeletehistory: Option<bool>,
5985    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5986    pub churchdb_birthdaylist_station: Option<String>,
5987    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5988    pub churchdb_birthdaylist_status: Option<String>,
5989    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5990    pub churchdb_cleverreach_access_token: Option<String>,
5991    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5992    pub churchdb_cleverreach_client_id: Option<String>,
5993    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5994    pub churchdb_cleverreach_client_secret: Option<String>,
5995    /// Allowed values: `false`, `true`.
5996    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5997    pub churchdb_cleverreach_connected: Option<String>,
5998    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
5999    pub churchdb_cleverreach_refresh_token: Option<String>,
6000    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6001    pub churchdb_cleverreach_scopes: Option<String>,
6002    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6003    pub churchdb_cleverreach_token_expiry: Option<String>,
6004    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6005    pub churchdb_emailseparator: Option<String>,
6006    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6007    pub churchdb_home_lat: Option<String>,
6008    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6009    pub churchdb_home_lng: Option<String>,
6010    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6011    pub churchdb_mailchimp_apikey: Option<String>,
6012    #[serde(default, skip_serializing_if = "Option::is_none")]
6013    pub churchdb_mailchimp_connected: Option<bool>,
6014    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6015    pub churchdb_mailjet_apikey: Option<String>,
6016    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6017    pub churchdb_mailjet_apisecret: Option<String>,
6018    #[serde(default, skip_serializing_if = "Option::is_none")]
6019    pub churchdb_mailjet_connected: Option<bool>,
6020    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6021    pub churchdb_memberlist_station: Option<String>,
6022    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6023    pub churchdb_memberlist_status: Option<String>,
6024    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6025    pub churchdb_name: Option<String>,
6026    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6027    pub churchdb_name_default: Option<String>,
6028    #[serde(default, skip_serializing_if = "Option::is_none")]
6029    pub churchdb_sendgroupmails: Option<bool>,
6030    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6031    pub churchdb_smscmtelecom_apikey: Option<String>,
6032    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6033    pub churchdb_smspromote_apikey: Option<String>,
6034    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6035    pub churchdb_sortcode: Option<i64>,
6036    #[serde(default, skip_serializing_if = "Option::is_none")]
6037    pub churchfinance_active: Option<bool>,
6038    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6039    pub churchfinance_name: Option<String>,
6040    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6041    pub churchfinance_name_default: Option<String>,
6042    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6043    pub churchfinance_sortcode: Option<i64>,
6044    #[serde(default, skip_serializing_if = "Option::is_none")]
6045    pub churchgroup_active: Option<bool>,
6046    #[serde(default, skip_serializing_if = "Option::is_none")]
6047    pub churchgroup_inmenu: Option<bool>,
6048    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6049    pub churchgroup_name: Option<String>,
6050    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6051    pub churchgroup_name_default: Option<String>,
6052    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6053    pub churchgroup_sortcode: Option<i64>,
6054    #[serde(default, skip_serializing_if = "Option::is_none")]
6055    pub churchreport_active: Option<bool>,
6056    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6057    pub churchreport_name: Option<String>,
6058    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6059    pub churchreport_name_default: Option<String>,
6060    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6061    pub churchreport_sortcode: Option<i64>,
6062    #[serde(default, skip_serializing_if = "Option::is_none")]
6063    pub churchresource_active: Option<bool>,
6064    #[serde(default, skip_serializing_if = "Option::is_none")]
6065    pub churchresource_anonymize_for_public_user: Option<bool>,
6066    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6067    pub churchresource_entries_last_days: Option<i64>,
6068    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6069    pub churchresource_name: Option<String>,
6070    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6071    pub churchresource_name_default: Option<String>,
6072    #[serde(default, skip_serializing_if = "Option::is_none")]
6073    pub churchresource_send_emails: Option<bool>,
6074    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6075    pub churchresource_sortcode: Option<i64>,
6076    #[serde(default, skip_serializing_if = "Option::is_none")]
6077    pub churchservice_active: Option<bool>,
6078    #[serde(default, skip_serializing_if = "Option::is_none")]
6079    pub churchservice_agendashowenumeration: Option<bool>,
6080    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6081    pub churchservice_ccli_token: Option<String>,
6082    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6083    pub churchservice_ccli_token_secret: Option<String>,
6084    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6085    pub churchservice_entries_last_days: Option<i64>,
6086    #[serde(default, skip_serializing_if = "Option::is_none")]
6087    pub churchservice_invite_persons: Option<bool>,
6088    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6089    pub churchservice_name: Option<String>,
6090    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6091    pub churchservice_name_default: Option<String>,
6092    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6093    pub churchservice_openservice_rememberdays: Option<i64>,
6094    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6095    pub churchservice_reminderhours: Option<i64>,
6096    #[serde(default, skip_serializing_if = "Option::is_none")]
6097    pub churchservice_songwithcategoryasdir: Option<bool>,
6098    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6099    pub churchservice_sortcode: Option<i64>,
6100    #[serde(default, skip_serializing_if = "Option::is_none")]
6101    pub churchsync_active: Option<bool>,
6102    #[serde(default, skip_serializing_if = "Option::is_none")]
6103    pub churchsync_inmenu: Option<bool>,
6104    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6105    pub churchsync_name: Option<String>,
6106    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6107    pub churchsync_name_default: Option<String>,
6108    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6109    pub churchsync_sortcode: Option<i64>,
6110    #[serde(default, skip_serializing_if = "Option::is_none")]
6111    pub churchwiki_active: Option<bool>,
6112    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6113    pub churchwiki_name: Option<String>,
6114    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6115    pub churchwiki_name_default: Option<String>,
6116    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6117    pub churchwiki_sortcode: Option<i64>,
6118    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
6119    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
6120    pub cron_daily: Option<chrono::DateTime<chrono::Utc>>,
6121    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
6122    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
6123    pub cron_hour_8: Option<chrono::DateTime<chrono::Utc>>,
6124    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6125    pub cron_last_execution: Option<String>,
6126    /// This is a string that can only be true or false.
6127    /// Allowed values: `0`, `1`.
6128    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6129    pub cronjob_dbdump: Option<String>,
6130    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6131    pub cronjob_delay: Option<i64>,
6132    /// This is a string that can only be true or false.
6133    /// Allowed values: `0`, `1`.
6134    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6135    pub currently_mail_sending: Option<String>,
6136    #[serde(rename = "datasecurityPrivacyDeclarationWikiLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6137    pub datasecurity_privacy_declaration_wiki_link: Option<String>,
6138    #[serde(default, skip_serializing_if = "Option::is_none")]
6139    pub datasecurity_banner_enabled: Option<bool>,
6140    /// Only in extended config
6141    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6142    pub datasecurity_privacy_agreement_hint: Option<String>,
6143    /// Only in extended config
6144    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6145    pub datasecurity_privacy_agreement_text: Option<String>,
6146    /// Only in extended config
6147    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6148    pub datasecurity_privacy_agreement_text_for_children: Option<String>,
6149    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6150    pub db_name: Option<String>,
6151    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6152    pub db_password: Option<String>,
6153    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6154    pub db_server: Option<String>,
6155    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6156    pub db_user: Option<String>,
6157    #[serde(default, skip_serializing_if = "Option::is_none")]
6158    pub deactivate_default_login: Option<bool>,
6159    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6160    pub default_phone_area_code: Option<String>,
6161    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6162    pub deprecation_usage_mail_last_execution: Option<String>,
6163    /// Allowed values: `churchtools`, `own`.
6164    #[serde(rename = "emailServer", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6165    pub email_server: Option<String>,
6166    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6167    pub encryptionkey: Option<String>,
6168    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6169    pub env: Option<String>,
6170    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6171    pub evangelische_termine_api_key: Option<String>,
6172    #[serde(default, skip_serializing_if = "Option::is_none")]
6173    pub evangelische_termine_enabled: Option<bool>,
6174    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6175    pub evangelische_termine_name: Option<String>,
6176    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6177    pub evangelische_termine_url: Option<String>,
6178    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6179    pub evangelische_termine_vid: Option<String>,
6180    #[serde(default, skip_serializing_if = "Option::is_none")]
6181    pub feature_appointment_search: Option<bool>,
6182    /// This is a string that can only be true or false.
6183    /// Allowed values: `0`, `1`.
6184    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6185    pub feature_automation: Option<String>,
6186    /// This is a string that can only be true or false.
6187    /// Allowed values: `0`, `1`.
6188    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6189    pub feature_custommodule: Option<String>,
6190    /// This is a string that can only be true or false.
6191    /// Allowed values: `0`, `1`.
6192    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6193    pub feature_darkmode: Option<String>,
6194    /// This is a string that can only be true or false.
6195    /// Allowed values: `0`, `1`.
6196    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6197    pub feature_dynamic_groups: Option<String>,
6198    #[serde(default, skip_serializing_if = "Option::is_none")]
6199    pub feature_eubp: Option<bool>,
6200    #[serde(default, skip_serializing_if = "Option::is_none")]
6201    pub feature_event_fact_widget: Option<bool>,
6202    #[serde(default, skip_serializing_if = "Option::is_none")]
6203    pub feature_finance_donators_datatable: Option<bool>,
6204    #[serde(default, skip_serializing_if = "Option::is_none")]
6205    pub feature_flags_ui: Option<bool>,
6206    /// This is a string that can only be true or false.
6207    /// Allowed values: `0`, `1`.
6208    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6209    pub feature_group: Option<String>,
6210    /// Deprecated compatibility flag that is always true.
6211    #[serde(default, skip_serializing_if = "Option::is_none")]
6212    #[deprecated = "deprecated in the ChurchTools API"]
6213    pub feature_markdown_group: Option<bool>,
6214    /// This is a string that can only be true or false.
6215    /// Allowed values: `0`, `1`.
6216    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6217    pub feature_mobile_groups: Option<String>,
6218    /// Deprecated compatibility flag that is always true.
6219    #[serde(default, skip_serializing_if = "Option::is_none")]
6220    #[deprecated = "deprecated in the ChurchTools API"]
6221    pub feature_newsfeed_comment_reactions: Option<bool>,
6222    #[serde(default, skip_serializing_if = "Option::is_none")]
6223    pub feature_old_group_module: Option<bool>,
6224    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6225    pub feature_org_chart_groups: Option<String>,
6226    #[serde(default, skip_serializing_if = "Option::is_none")]
6227    pub feature_permission_new: Option<bool>,
6228    #[serde(default, skip_serializing_if = "Option::is_none")]
6229    pub feature_person_probe_filter: Option<bool>,
6230    /// This is a string that can only be true or false.
6231    /// Allowed values: `0`, `1`.
6232    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6233    pub feature_posts: Option<String>,
6234    /// This is a string that can only be true or false.
6235    /// Allowed values: `0`, `1`.
6236    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6237    pub feature_resources_app: Option<String>,
6238    #[serde(default, skip_serializing_if = "Option::is_none")]
6239    pub feature_sessionless_login: Option<bool>,
6240    /// This is a string that can only be true or false.
6241    /// Allowed values: `0`, `1`.
6242    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6243    pub feature_sync: Option<String>,
6244    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6245    pub feature_usechurchquery: Option<String>,
6246    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6247    pub file_meta_cron_last_file_size_id: Option<String>,
6248    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6249    pub file_meta_cron_last_image_metadata_id: Option<String>,
6250    #[serde(default, skip_serializing_if = "Option::is_none")]
6251    pub finance_active: Option<bool>,
6252    /// This is a string that can only be true or false.
6253    /// Allowed values: `0`, `1`.
6254    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6255    pub finance_inmenu: Option<String>,
6256    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6257    pub finance_name: Option<String>,
6258    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6259    pub finance_name_default: Option<String>,
6260    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6261    pub finance_sortcode: Option<String>,
6262    #[serde(rename = "finderUrl", deserialize_with = "crate::lenient::string")]
6263    pub finder_url: String,
6264    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
6265    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
6266    pub first_sync_job: Option<chrono::DateTime<chrono::Utc>>,
6267    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
6268    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
6269    pub first_transaction: Option<chrono::DateTime<chrono::Utc>>,
6270    #[serde(rename = "hideBetaStates", default, skip_serializing_if = "Option::is_none")]
6271    pub hide_beta_states: Option<bool>,
6272    #[serde(default, skip_serializing_if = "Option::is_none")]
6273    pub hide_all_hints: Option<bool>,
6274    /// This is a string that can only be true or false.
6275    /// Allowed values: `0`, `1`.
6276    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6277    pub hostingservice: Option<String>,
6278    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6279    pub https_only: Option<String>,
6280    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6281    pub ical_invitation_hmac_secret: Option<String>,
6282    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6283    pub image_extension: Option<String>,
6284    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6285    pub impressum_external: Option<String>,
6286    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6287    pub impressum_external_link: Option<String>,
6288    /// This is a string that can only be true or false.
6289    /// Allowed values: `0`, `1`.
6290    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6291    pub impressum_internal: Option<String>,
6292    #[serde(rename = "imprintWikiLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6293    pub imprint_wiki_link: Option<String>,
6294    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6295    pub installation_verification_code: Option<String>,
6296    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6297    pub invite_email_text: Option<String>,
6298    /// Whether the current user is configured as an authorized person.
6299    #[serde(rename = "isCurrentUserAuthorizedPerson")]
6300    pub is_current_user_authorized_person: bool,
6301    #[serde(rename = "isPostsActive")]
6302    pub is_posts_active: bool,
6303    #[serde(rename = "isSamlActive", default, skip_serializing_if = "Option::is_none")]
6304    pub is_saml_active: Option<bool>,
6305    #[serde(default, skip_serializing_if = "Option::is_none")]
6306    pub is_churchtools_blog_widget_active: Option<bool>,
6307    #[serde(default, skip_serializing_if = "Option::is_none")]
6308    pub is_churchtools_onboarding_widget_active: Option<bool>,
6309    #[serde(default, skip_serializing_if = "Option::is_none")]
6310    pub is_pr_widget_active: Option<bool>,
6311    #[serde(default, skip_serializing_if = "Option::is_none")]
6312    pub is_rss_widget_active: Option<bool>,
6313    /// The language code is a two-letter code that represents the language. For example, "en" for English, "de" for German, and "fr" for French.
6314    /// Allowed values: `cn`, `de`, `en`, `es`, `fa`, `fi`, `fr`, `it`, `nl`, `pl`, `pt`, `ru`, `sv`, `tw`.
6315    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6316    pub language: Option<String>,
6317    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6318    pub last_cron: Option<String>,
6319    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6320    pub last_cron_finished: Option<String>,
6321    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6322    pub last_db_dump: Option<String>,
6323    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6324    pub last_import_clear: Option<String>,
6325    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6326    pub last_translation_update: Option<String>,
6327    #[serde(default, skip_serializing_if = "Option::is_none")]
6328    pub ldap_otp_enabled: Option<bool>,
6329    #[serde(rename = "licenseSettings", default, skip_serializing_if = "Option::is_none")]
6330    pub license_settings: Option<GetConfigResponseLicenseSettings>,
6331    /// This is a string that can only be true or false.
6332    /// Allowed values: `0`, `1`.
6333    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6334    pub log_debug: Option<String>,
6335    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6336    pub login_message: Option<String>,
6337    #[serde(default, skip_serializing_if = "Option::is_none")]
6338    pub mail_enabled: Option<bool>,
6339    /// This is a string that can only be true or false.
6340    /// Allowed values: `0`, `1`.
6341    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6342    pub mail_sending_in_background: Option<String>,
6343    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6344    pub mail_sending_starttime: Option<String>,
6345    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6346    pub mail_smtp_args_host: Option<String>,
6347    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6348    pub mail_smtp_args_password: Option<String>,
6349    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6350    pub mail_smtp_args_port: Option<String>,
6351    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6352    pub mail_smtp_args_smtpsecure: Option<String>,
6353    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6354    pub mail_smtp_args_username: Option<String>,
6355    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6356    pub matomo_uri: Option<String>,
6357    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6358    pub max_uploadfile_size_kb: Option<i64>,
6359    /// This is a string that can only be true or false.
6360    /// Allowed values: `0`, `1`.
6361    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6362    pub memberlist_birthday_full: Option<String>,
6363    /// This is a string that can only be true or false.
6364    /// Allowed values: `0`, `1`.
6365    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6366    pub memberlist_email: Option<String>,
6367    /// This is a string that can only be true or false.
6368    /// Allowed values: `0`, `1`.
6369    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6370    pub memberlist_fax: Option<String>,
6371    /// This is a string that can only be true or false.
6372    /// Allowed values: `0`, `1`.
6373    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6374    pub memberlist_group_couples: Option<String>,
6375    /// This is a string that can only be true or false.
6376    /// Allowed values: `0`, `1`.
6377    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6378    pub memberlist_picture: Option<String>,
6379    /// This is a string that can only be true or false.
6380    /// Allowed values: `0`, `1`.
6381    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6382    pub memberlist_salutation: Option<String>,
6383    /// This is a string that can only be true or false.
6384    /// Allowed values: `0`, `1`.
6385    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6386    pub memberlist_telefongeschaeftlich: Option<String>,
6387    /// This is a string that can only be true or false.
6388    /// Allowed values: `0`, `1`.
6389    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6390    pub memberlist_telefonhandy: Option<String>,
6391    /// This is a string that can only be true or false.
6392    /// Allowed values: `0`, `1`.
6393    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6394    pub memberlist_telefonprivat: Option<String>,
6395    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
6396    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
6397    pub onboarding_start: Option<chrono::DateTime<chrono::Utc>>,
6398    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6399    pub openai_api_key: Option<String>,
6400    #[serde(default, skip_serializing_if = "Option::is_none")]
6401    pub openstreetmaps_enabled: Option<bool>,
6402    /// Allowed values: `Auftrag`, `Bedenkzeit`, `Entscheidung`, `Finder`, `FinderCombo`, `Mitarbeiter`, `Testphase`, `Unbekannt`, `Vorlage/Schulung/Test`, `WebsiteCombo`, `zu löschen`.
6403    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6404    pub orderstatus: Option<String>,
6405    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
6406    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
6407    pub orderstatus_since_date: Option<chrono::DateTime<chrono::Utc>>,
6408    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6409    pub package: Option<String>,
6410    #[serde(default, skip_serializing_if = "Option::is_none")]
6411    pub post_active: Option<bool>,
6412    #[serde(default, skip_serializing_if = "Option::is_none")]
6413    pub post_edit_time_limited: Option<bool>,
6414    #[serde(default, skip_serializing_if = "Option::is_none")]
6415    pub post_email_summary_default_enabled: Option<bool>,
6416    /// Allowed values: `all`, `featured_groups`, `my_groups`.
6417    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6418    pub post_email_summary_default_filter: Option<String>,
6419    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6420    pub post_email_summary_default_weekdays: Option<String>,
6421    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6422    pub post_featured_groups: Option<String>,
6423    #[serde(default, skip_serializing_if = "Option::is_none")]
6424    pub post_inmenu: Option<bool>,
6425    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6426    pub post_name: Option<String>,
6427    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6428    pub post_sortcode: Option<i64>,
6429    #[serde(default, skip_serializing_if = "Option::is_none")]
6430    pub post_wizard_completed: Option<bool>,
6431    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6432    pub post_wizard_groups: Option<String>,
6433    /// Allowed values: `0`, `1`.
6434    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6435    pub prevent_change_security_settings: Option<String>,
6436    #[serde(default, skip_serializing_if = "Option::is_none")]
6437    pub prevent_export: Option<bool>,
6438    #[serde(default, skip_serializing_if = "Option::is_none")]
6439    pub prevent_manual_finance_account_creation: Option<bool>,
6440    #[serde(default, skip_serializing_if = "Option::is_none")]
6441    pub privacy_policy_external: Option<bool>,
6442    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6443    pub privacy_policy_external_link: Option<String>,
6444    #[serde(default, skip_serializing_if = "Option::is_none")]
6445    pub privacy_policy_fields_mandatory: Option<bool>,
6446    #[serde(default, skip_serializing_if = "Option::is_none")]
6447    pub privacy_policy_fields_mandatory_api: Option<bool>,
6448    #[serde(default, skip_serializing_if = "Option::is_none")]
6449    pub privacy_policy_internal: Option<bool>,
6450    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6451    pub privacy_policy_relationships: Option<String>,
6452    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6453    pub profile: Option<String>,
6454    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6455    pub public_channel_registry: Option<String>,
6456    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6457    pub public_channel_registry_url: Option<String>,
6458    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6459    pub rabbitmq_config_host: Option<String>,
6460    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6461    pub rabbitmq_config_password: Option<String>,
6462    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6463    pub rabbitmq_config_port: Option<String>,
6464    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6465    pub rabbitmq_config_user: Option<String>,
6466    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6467    pub redis_server: Option<String>,
6468    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6469    pub rss_widget_link: Option<String>,
6470    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6471    pub safe_mode_enable_authorized_persons: Option<String>,
6472    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6473    pub safe_mode_enable_chat_sync: Option<String>,
6474    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6475    pub safe_mode_enable_consolidation: Option<String>,
6476    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6477    pub safe_mode_enable_guid_sync: Option<String>,
6478    /// This is a string that can only be true or false.
6479    /// Allowed values: `0`, `1`.
6480    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6481    pub safe_mode_enable_job_queueing: Option<String>,
6482    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6483    pub safe_mode_enable_mail: Option<String>,
6484    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6485    pub safe_mode_enable_newsletter: Option<String>,
6486    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6487    pub safe_mode_enable_notification: Option<String>,
6488    #[serde(default, skip_serializing_if = "Option::is_none")]
6489    pub send_data_security_mails: Option<bool>,
6490    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6491    pub session_handler: Option<String>,
6492    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6493    pub short_name: Option<String>,
6494    #[serde(rename = "showAIAssistant", default, skip_serializing_if = "Option::is_none")]
6495    pub show_ai_assistant: Option<bool>,
6496    #[serde(default, skip_serializing_if = "Option::is_none")]
6497    pub show_remember_me: Option<bool>,
6498    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6499    pub site_language: Option<String>,
6500    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6501    pub site_licensekey: Option<String>,
6502    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6503    pub site_logo: Option<String>,
6504    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6505    pub site_mail: Option<String>,
6506    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6507    pub site_name: Option<String>,
6508    #[serde(default, skip_serializing_if = "Option::is_none")]
6509    pub site_offline: Option<bool>,
6510    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6511    pub site_region: Option<String>,
6512    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6513    pub site_startpage: Option<String>,
6514    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6515    pub site_url: Option<String>,
6516    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
6517    #[serde(rename = "support-user-active-since", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
6518    pub support_user_active_since: Option<chrono::DateTime<chrono::Utc>>,
6519    /// Whether this installation is configured as a test system.
6520    #[serde(default, skip_serializing_if = "Option::is_none")]
6521    pub test: Option<bool>,
6522    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6523    pub timezone: Option<String>,
6524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6525    pub url_metadata_url: Option<String>,
6526    /// Allowed values: `failed`, `in_progress`, `not_verified`, `verified`.
6527    #[serde(rename = "verificationStatus", deserialize_with = "crate::lenient::string")]
6528    pub verification_status: String,
6529    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6530    pub version: Option<String>,
6531    #[serde(rename = "webchatLink", deserialize_with = "crate::lenient::string")]
6532    pub webchat_link: String,
6533    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6534    pub website_order_status: Option<String>,
6535    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6536    pub website_sync_user_id: Option<String>,
6537    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6538    pub website_testphase_date: Option<String>,
6539    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6540    pub website_trial_user_id: Option<i64>,
6541    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6542    pub website_url: Option<String>,
6543    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6544    pub welcome: Option<String>,
6545    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6546    pub welcome_subtext: Option<String>,
6547    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6548    pub wget_path: Option<String>,
6549    /// Fields not described by the spec, e.g. instance-specific DB fields.
6550    #[serde(flatten)]
6551    pub extra: serde_json::Map<String, serde_json::Value>,
6552}
6553
6554/// Shared label for person email addresses. Renaming a label changes its display wherever that label is used.
6555#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6556pub struct ContactLabel {
6557    /// Whether this label is preferred for new email addresses. Setting `true` unsets an existing default label.
6558    #[serde(rename = "isDefault")]
6559    pub is_default: bool,
6560    /// Unique contact-label name.
6561    #[serde(deserialize_with = "crate::lenient::string")]
6562    pub name: String,
6563    /// Display-order value.
6564    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
6565    pub sort_key: i64,
6566    /// Contact-label ID referenced by a person’s email address.
6567    #[serde(deserialize_with = "crate::lenient::number")]
6568    pub id: i64,
6569    /// Translated Name of Label
6570    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
6571    pub name_translated: String,
6572    /// Fields not described by the spec, e.g. instance-specific DB fields.
6573    #[serde(flatten)]
6574    pub extra: serde_json::Map<String, serde_json::Value>,
6575}
6576
6577/// Label used to distinguish a person’s email addresses, for example private and work. Names must be unique.
6578#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6579pub struct ContactLabelCreate {
6580    /// Whether this label is preferred for new email addresses. Setting `true` unsets an existing default label.
6581    #[serde(rename = "isDefault")]
6582    pub is_default: bool,
6583    /// Unique contact-label name.
6584    #[serde(deserialize_with = "crate::lenient::string")]
6585    pub name: String,
6586    /// Display-order value.
6587    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
6588    pub sort_key: i64,
6589    /// Fields not described by the spec, e.g. instance-specific DB fields.
6590    #[serde(flatten)]
6591    pub extra: serde_json::Map<String, serde_json::Value>,
6592}
6593
6594/// Replacement values for an existing contact label.
6595#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6596pub struct ContactLabelUpdate {
6597    /// Whether this label is preferred for new email addresses. Setting `true` unsets an existing default label.
6598    #[serde(rename = "isDefault")]
6599    pub is_default: bool,
6600    /// Unique contact-label name.
6601    #[serde(deserialize_with = "crate::lenient::string")]
6602    pub name: String,
6603    /// Display-order value.
6604    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
6605    pub sort_key: i64,
6606    /// Fields not described by the spec, e.g. instance-specific DB fields.
6607    #[serde(flatten)]
6608    pub extra: serde_json::Map<String, serde_json::Value>,
6609}
6610
6611/// A cost center assigns income and expenses to a purpose, project or group within one accounting period. Budgets and balances use integer minor currency units (for example cents). Linking a group also enables access through group-internal finance permissions. Includes the linked group, or null when there is none.
6612#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6613pub struct CostCenter {
6614    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
6615    pub accounting_period_id: i64,
6616    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6617    pub annotation: Option<String>,
6618    /// Budget is in cent.
6619    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6620    pub budget: Option<i64>,
6621    /// Budget plus cash-account income minus cash-account expenses, in minor currency units. Null without a budget or before calculation.
6622    #[serde(rename = "budgetBalance", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6623    pub budget_balance: Option<i64>,
6624    /// Remaining budget of the matching cost center in the previous period, in minor currency units. Null when unavailable or not calculated; an unmatched center can have 0.
6625    #[serde(rename = "budgetBalanceLastPeriod", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6626    pub budget_balance_last_period: Option<i64>,
6627    /// Budget of the cost center with the same number in the previous period of this client, in minor currency units. Null when unavailable or not calculated.
6628    #[serde(rename = "budgetLastPeriod", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6629    pub budget_last_period: Option<i64>,
6630    /// Cash-account expenses minus cash-account income, in minor currency units. Can be negative. Null if not calculated, for example immediately after creation.
6631    #[serde(rename = "budgetSpent", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6632    pub budget_spent: Option<i64>,
6633    #[serde(deserialize_with = "crate::lenient::number")]
6634    pub id: i64,
6635    pub meta: MetaDataEntityId,
6636    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6637    pub name: Option<String>,
6638    #[serde(deserialize_with = "crate::lenient::string")]
6639    pub number: String,
6640    /// Linked group as a domain object, or null. The response does not include a separate groupId.
6641    #[serde(default, skip_serializing_if = "Option::is_none")]
6642    pub group: Option<DomainObjectGroup>,
6643    /// Fields not described by the spec, e.g. instance-specific DB fields.
6644    #[serde(flatten)]
6645    pub extra: serde_json::Map<String, serde_json::Value>,
6646}
6647
6648/// Cost centers to create. Each item may select its own accounting period and group.
6649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6650pub struct CostCenterBulkCreate {
6651    #[serde(rename = "costCenters")]
6652    pub cost_centers: Vec<CostCenterCreate>,
6653    /// Fields not described by the spec, e.g. instance-specific DB fields.
6654    #[serde(flatten)]
6655    pub extra: serde_json::Map<String, serde_json::Value>,
6656}
6657
6658/// A cost center assigns income and expenses to a purpose, project or group within one accounting period. Budgets and balances use integer minor currency units (for example cents). Linking a group also enables access through group-internal finance permissions.
6659#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6660pub struct CostCenterCreate {
6661    /// Existing, open accounting period owning this cost center.
6662    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
6663    pub accounting_period_id: i64,
6664    /// Optional trimmed note. Omitted, null or blank clears it.
6665    ///
6666    /// `None` leaves the field out, `Some(None)` sends `null`.
6667    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6668    pub annotation: Option<Option<String>>,
6669    /// Optional budget in minor currency units, for example 3200 for EUR 32.00. Omitted or null removes the budget.
6670    ///
6671    /// `None` leaves the field out, `Some(None)` sends `null`.
6672    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6673    pub budget: Option<Option<i64>>,
6674    /// Optional linked group. Omitted or null removes the link, including on update.
6675    ///
6676    /// `None` leaves the field out, `Some(None)` sends `null`.
6677    #[serde(rename = "groupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6678    pub group_id: Option<Option<i64>>,
6679    /// Trimmed name, unique within the accounting period. Supply a nonblank name when creating.
6680    #[serde(deserialize_with = "crate::lenient::string")]
6681    pub name: String,
6682    /// Trimmed identifier, unique within the accounting period. Leading zeros are preserved; letters are accepted, although list ordering compares the integer value.
6683    #[serde(deserialize_with = "crate::lenient::string")]
6684    pub number: String,
6685    /// Fields not described by the spec, e.g. instance-specific DB fields.
6686    #[serde(flatten)]
6687    pub extra: serde_json::Map<String, serde_json::Value>,
6688}
6689
6690/// Optional account-report options. A missing body selects the entire accounting period as a PDF.
6691#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6692pub struct CostCenterStatementReportCreate {
6693    /// Last document date to include. Omission or null defaults to the corresponding accounting-period boundary. The final endDate must be on or after startDate.
6694    ///
6695    /// `None` leaves the field out, `Some(None)` sends `null`.
6696    #[serde(rename = "endDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6697    pub end_date: Option<Option<chrono::NaiveDate>>,
6698    /// PDF creates a file and returns its URL with HTTP 201. CSV/XLSX return the file directly with HTTP 200. Accept: text/html overrides this selection.
6699    /// Allowed values: `csv`, `pdf`, `xlsx`.
6700    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6701    pub format: Option<String>,
6702    /// First document date to include. Omission or null defaults to the corresponding accounting-period boundary. The final endDate must be on or after startDate.
6703    ///
6704    /// `None` leaves the field out, `Some(None)` sends `null`.
6705    #[serde(rename = "startDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6706    pub start_date: Option<Option<chrono::NaiveDate>>,
6707    /// Include transactions classified as internal rebookings in the cost-center report.
6708    #[serde(rename = "includeRebookings", default, skip_serializing_if = "Option::is_none")]
6709    pub include_rebookings: Option<bool>,
6710    /// Legacy alias for format.
6711    /// Allowed values: `csv`, `pdf`, `xlsx`.
6712    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6713    #[deprecated = "deprecated in the ChurchTools API"]
6714    pub r#type: Option<String>,
6715    /// Fields not described by the spec, e.g. instance-specific DB fields.
6716    #[serde(flatten)]
6717    pub extra: serde_json::Map<String, serde_json::Value>,
6718}
6719
6720/// A cost center assigns income and expenses to a purpose, project or group within one accounting period. Budgets and balances use integer minor currency units (for example cents). Linking a group also enables access through group-internal finance permissions. Serialized entity without the expanded group.
6721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6722pub struct CostCenterStored {
6723    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
6724    pub accounting_period_id: i64,
6725    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6726    pub annotation: Option<String>,
6727    /// Budget is in cent.
6728    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6729    pub budget: Option<i64>,
6730    /// Budget plus cash-account income minus cash-account expenses, in minor currency units. Null without a budget or before calculation.
6731    #[serde(rename = "budgetBalance", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6732    pub budget_balance: Option<i64>,
6733    /// Remaining budget of the matching cost center in the previous period, in minor currency units. Null when unavailable or not calculated; an unmatched center can have 0.
6734    #[serde(rename = "budgetBalanceLastPeriod", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6735    pub budget_balance_last_period: Option<i64>,
6736    /// Budget of the cost center with the same number in the previous period of this client, in minor currency units. Null when unavailable or not calculated.
6737    #[serde(rename = "budgetLastPeriod", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6738    pub budget_last_period: Option<i64>,
6739    /// Cash-account expenses minus cash-account income, in minor currency units. Can be negative. Null if not calculated, for example immediately after creation.
6740    #[serde(rename = "budgetSpent", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6741    pub budget_spent: Option<i64>,
6742    #[serde(deserialize_with = "crate::lenient::number")]
6743    pub id: i64,
6744    pub meta: MetaDataEntityId,
6745    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6746    pub name: Option<String>,
6747    #[serde(deserialize_with = "crate::lenient::string")]
6748    pub number: String,
6749    /// Fields not described by the spec, e.g. instance-specific DB fields.
6750    #[serde(flatten)]
6751    pub extra: serde_json::Map<String, serde_json::Value>,
6752}
6753
6754/// Replacement values for a cost center. number and accountingPeriodId are required; omitted name, annotation, budget and groupId are cleared. The target accounting period must be open. Both name and number must remain unique in that period.
6755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6756pub struct CostCenterUpdate {
6757    /// Existing, open accounting period owning this cost center.
6758    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
6759    pub accounting_period_id: i64,
6760    /// Optional trimmed note. Omitted, null or blank clears it.
6761    ///
6762    /// `None` leaves the field out, `Some(None)` sends `null`.
6763    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6764    pub annotation: Option<Option<String>>,
6765    /// Optional budget in minor currency units, for example 3200 for EUR 32.00. Omitted or null removes the budget.
6766    ///
6767    /// `None` leaves the field out, `Some(None)` sends `null`.
6768    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6769    pub budget: Option<Option<i64>>,
6770    /// Optional linked group. Omitted or null removes the link, including on update.
6771    ///
6772    /// `None` leaves the field out, `Some(None)` sends `null`.
6773    #[serde(rename = "groupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6774    pub group_id: Option<Option<i64>>,
6775    /// Trimmed name. Unlike creation, updating accepts omitted, null or blank names and stores null.
6776    ///
6777    /// `None` leaves the field out, `Some(None)` sends `null`.
6778    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
6779    pub name: Option<Option<String>>,
6780    /// Trimmed identifier, unique within the accounting period. Leading zeros are preserved; letters are accepted, although list ordering compares the integer value.
6781    #[serde(deserialize_with = "crate::lenient::string")]
6782    pub number: String,
6783    /// Fields not described by the spec, e.g. instance-specific DB fields.
6784    #[serde(flatten)]
6785    pub extra: serde_json::Map<String, serde_json::Value>,
6786}
6787
6788/// Metadata for a stored file or URL attachment. `domainType` and `domainId` identify the owning attachment context.
6789#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6790pub struct CtFile {
6791    /// Domain-specific extra data. Empty for most files (serialized as an empty array), but some domains add a key-value object (e.g. statement uploads return `{ "statementId": 1 }`).
6792    #[serde(rename = "additionalInfos", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
6793    pub additional_infos: Option<std::collections::BTreeMap<String, serde_json::Value>>,
6794    /// Whether the image was generated by artificial intelligence.
6795    #[serde(rename = "aiGenerated")]
6796    pub ai_generated: bool,
6797    /// Image credit or attribution.
6798    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6799    pub annotation: Option<String>,
6800    /// Attribution link.
6801    #[serde(rename = "annotationLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6802    pub annotation_link: Option<String>,
6803    /// File or image description.
6804    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6805    pub description: Option<String>,
6806    /// Attachment-context identifier; its meaning depends on `domainType`.
6807    #[serde(rename = "domainId", deserialize_with = "crate::lenient::string")]
6808    pub domain_id: String,
6809    /// Stored attachment category. Internal categories may not be accepted by the domain-based file routes.
6810    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
6811    pub domain_type: String,
6812    /// Absolute download URL or external link URL.
6813    #[serde(rename = "fileUrl", deserialize_with = "crate::lenient::string")]
6814    pub file_url: String,
6815    /// Storage filename/hash for a binary file, or the target URL for a link. name is the user-facing display name.
6816    #[serde(deserialize_with = "crate::lenient::string")]
6817    pub filename: String,
6818    /// Image dimensions calculated from the file.
6819    #[serde(rename = "imageMetadata", default, skip_serializing_if = "Option::is_none")]
6820    pub image_metadata: Option<CtFileImageMetadata>,
6821    #[serde(rename = "imageOption", default, skip_serializing_if = "Option::is_none")]
6822    pub image_option: Option<CtFileImageOption>,
6823    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6824    pub image_url: Option<String>,
6825    pub meta: FileMetaData,
6826    #[serde(deserialize_with = "crate::lenient::string")]
6827    pub name: String,
6828    /// Legacy relative download URL, or an absolute external URL for a link.
6829    #[serde(rename = "relativeUrl", deserialize_with = "crate::lenient::string")]
6830    pub relative_url: String,
6831    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6832    pub security_level_id: Option<i64>,
6833    /// Whether domain lists show the file only to users who may edit its owning object.
6834    #[serde(rename = "showOnlyWhenEditable")]
6835    pub show_only_when_editable: bool,
6836    /// The file size in byte
6837    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6838    pub size: Option<i64>,
6839    /// file for a stored file, link for a filename beginning with http.
6840    /// Allowed values: `file`, `link`.
6841    #[serde(deserialize_with = "crate::lenient::string")]
6842    pub r#type: String,
6843    /// Persisted file record ID.
6844    #[serde(deserialize_with = "crate::lenient::number")]
6845    pub id: i64,
6846    /// Fields not described by the spec, e.g. instance-specific DB fields.
6847    #[serde(flatten)]
6848    pub extra: serde_json::Map<String, serde_json::Value>,
6849}
6850
6851/// Image dimensions calculated from the file.
6852#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6853pub struct CtFileImageMetadata {
6854    #[serde(rename = "aspectRatio", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6855    pub aspect_ratio: Option<f64>,
6856    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6857    pub height: Option<i64>,
6858    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6859    pub width: Option<i64>,
6860    /// Fields not described by the spec, e.g. instance-specific DB fields.
6861    #[serde(flatten)]
6862    pub extra: serde_json::Map<String, serde_json::Value>,
6863}
6864
6865#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6866pub struct CtFileImageOption {
6867    pub crop: CtFileImageOptionCrop,
6868    pub focus: CtFileImageOptionFocus,
6869    /// Fields not described by the spec, e.g. instance-specific DB fields.
6870    #[serde(flatten)]
6871    pub extra: serde_json::Map<String, serde_json::Value>,
6872}
6873
6874#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6875pub struct CtFileImageOptionCrop {
6876    #[serde(deserialize_with = "crate::lenient::number")]
6877    pub bottom: f64,
6878    #[serde(deserialize_with = "crate::lenient::number")]
6879    pub left: f64,
6880    #[serde(deserialize_with = "crate::lenient::number")]
6881    pub right: f64,
6882    #[serde(deserialize_with = "crate::lenient::number")]
6883    pub top: f64,
6884    /// Fields not described by the spec, e.g. instance-specific DB fields.
6885    #[serde(flatten)]
6886    pub extra: serde_json::Map<String, serde_json::Value>,
6887}
6888
6889#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6890pub struct CtFileImageOptionFocus {
6891    #[serde(deserialize_with = "crate::lenient::number")]
6892    pub x: f64,
6893    #[serde(deserialize_with = "crate::lenient::number")]
6894    pub y: f64,
6895    /// Fields not described by the spec, e.g. instance-specific DB fields.
6896    #[serde(flatten)]
6897    pub extra: serde_json::Map<String, serde_json::Value>,
6898}
6899
6900/// Database-field definition. key is the API property name used when reading or writing a person/group value; column is its underlying database column. fieldCategory and fieldType describe ownership and value behavior. Installation-created fields have createdByChurch=true; built-in fields expose fewer editable settings.
6901#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6902pub struct DbField {
6903    /// Whether a person field’s value is cleared on archiving. Cannot be true for a non-nullable field.
6904    #[serde(rename = "deleteOnArchive")]
6905    pub delete_on_archive: bool,
6906    /// Whether the field is enabled for normal use.
6907    #[serde(rename = "isActive")]
6908    pub is_active: bool,
6909    /// Whether routines may use this field.
6910    #[serde(rename = "isAvailableInRoutines")]
6911    pub is_available_in_routines: bool,
6912    /// Whether the field is available on new-person forms; primarily relevant to person categories.
6913    #[serde(rename = "isNewPersonField")]
6914    pub is_new_person_field: bool,
6915    /// Configured field length.
6916    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
6917    pub length: Option<i64>,
6918    /// Legacy display-layout setting, retained for compatibility.
6919    #[serde(rename = "lineEnding", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6920    #[deprecated = "deprecated in the ChurchTools API"]
6921    pub line_ending: Option<String>,
6922    /// Stored display name or translation key. nameTranslated is its localized display text.
6923    #[serde(deserialize_with = "crate::lenient::string")]
6924    pub name: String,
6925    /// Security-level ID governing access to this field, resolved from installation masterdata.
6926    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
6927    pub security_level: i64,
6928    /// Abbreviated label.
6929    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6930    pub shorty: Option<String>,
6931    /// Display-order value within its category.
6932    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
6933    pub sort_key: i64,
6934    /// Whether the field may be used as a placeholder.
6935    #[serde(rename = "useAsPlaceholder")]
6936    pub use_as_placeholder: bool,
6937    /// Compatibility mappings emitted by the backend.
6938    #[serde(rename = "@deprecated")]
6939    pub deprecated: DbFieldDeprecated,
6940    /// Underlying database column; prefer key for API requests.
6941    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
6942    #[deprecated = "deprecated in the ChurchTools API"]
6943    pub column: Option<String>,
6944    /// True for a custom field created by this ChurchTools installation.
6945    #[serde(rename = "createdByChurch")]
6946    pub created_by_church: bool,
6947    /// Stored field category and its underlying entity table. Use internCode when creating a field.
6948    #[serde(rename = "fieldCategory")]
6949    pub field_category: DbFieldCategory,
6950    /// Database-field type definition. internCode selects the input/validation behavior; the numeric ID is referenced by field definitions. The name can be a translation key.
6951    #[serde(rename = "fieldType")]
6952    pub field_type: DbFieldType,
6953    /// Stored flag controlling frontend visibility; current updates reset it to false.
6954    #[serde(rename = "hideInFrontend")]
6955    pub hide_in_frontend: bool,
6956    /// Field-definition ID used in /dbfields paths.
6957    #[serde(deserialize_with = "crate::lenient::number")]
6958    pub id: i64,
6959    /// Whether the field is marked as basic information; current updates reset it to false.
6960    #[serde(rename = "isBasicInfo")]
6961    pub is_basic_info: bool,
6962    /// Whether the field is marked as non-configurable; current updates reset it to false.
6963    #[serde(rename = "isNotConfigurable")]
6964    pub is_not_configurable: bool,
6965    /// Whether stored field values may be null. Custom checkbox fields are non-nullable.
6966    #[serde(rename = "isNullable")]
6967    pub is_nullable: bool,
6968    /// API property name. Built-in columns are mapped to API names; custom fields normally retain their generated column name.
6969    #[serde(deserialize_with = "crate::lenient::string")]
6970    pub key: String,
6971    /// Localized display name for the current language.
6972    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
6973    pub name_translated: String,
6974    /// Deprecated alias of isNotConfigurable.
6975    #[serde(rename = "notConfigurable", default, skip_serializing_if = "Option::is_none")]
6976    #[deprecated = "deprecated in the ChurchTools API"]
6977    pub not_configurable: Option<bool>,
6978    /// Deprecated alias of isNullable.
6979    #[serde(default, skip_serializing_if = "Option::is_none")]
6980    #[deprecated = "deprecated in the ChurchTools API"]
6981    pub nullable: Option<bool>,
6982    /// Optional choices, included by an unfiltered list with include\[\]=options. The row shape depends on the field. Campus and group-visibility fields use specialized representations in this expansion.
6983    #[serde(default, skip_serializing_if = "Option::is_none")]
6984    pub options: Option<Vec<DbFieldOption>>,
6985    /// Fields not described by the spec, e.g. instance-specific DB fields.
6986    #[serde(flatten)]
6987    pub extra: serde_json::Map<String, serde_json::Value>,
6988}
6989
6990/// Stored field category and its underlying entity table. Use internCode when creating a field.
6991#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6992pub struct DbFieldCategory {
6993    #[serde(deserialize_with = "crate::lenient::number")]
6994    pub id: i64,
6995    /// Field category: f_address (person address/contact), f_church (person church information), f_category (person categories), f_group (group data), f_dep (departments), f_growpath (person growth-path data), or f_datasecurity (person privacy information). These are category codes, not entity IDs.
6996    /// Allowed values: `f_address`, `f_category`, `f_church`, `f_datasecurity`, `f_dep`, `f_group`, `f_growpath`.
6997    #[serde(rename = "internCode", deserialize_with = "crate::lenient::string")]
6998    pub intern_code: String,
6999    #[serde(deserialize_with = "crate::lenient::string")]
7000    pub name: String,
7001    #[serde(deserialize_with = "crate::lenient::string")]
7002    pub table: String,
7003    /// Fields not described by the spec, e.g. instance-specific DB fields.
7004    #[serde(flatten)]
7005    pub extra: serde_json::Map<String, serde_json::Value>,
7006}
7007
7008/// Creates a custom database column and field definition, plus an option table for selection types. Checkbox fields require `deleteOnArchive=false`. Column names are generated from the label and may receive a numeric suffix.
7009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7010pub struct DbFieldCreate {
7011    /// Whether a person field’s value is cleared on archiving. Cannot be true for a non-nullable field.
7012    #[serde(rename = "deleteOnArchive")]
7013    pub delete_on_archive: bool,
7014    /// Whether the field is enabled for normal use.
7015    #[serde(rename = "isActive")]
7016    pub is_active: bool,
7017    /// Whether routines may use this field.
7018    #[serde(rename = "isAvailableInRoutines", default, skip_serializing_if = "Option::is_none")]
7019    pub is_available_in_routines: Option<bool>,
7020    /// Whether the field is available on new-person forms; primarily relevant to person categories.
7021    #[serde(rename = "isNewPersonField")]
7022    pub is_new_person_field: bool,
7023    /// Configured maximum length for text and textarea fields.
7024    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
7025    pub length: Option<i64>,
7026    /// Legacy display-layout setting retained for compatibility.
7027    ///
7028    /// `None` leaves the field out, `Some(None)` sends `null`.
7029    #[serde(rename = "lineEnding", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
7030    #[deprecated = "deprecated in the ChurchTools API"]
7031    pub line_ending: Option<Option<String>>,
7032    /// Stored display name or translation key. nameTranslated is its localized display text.
7033    #[serde(deserialize_with = "crate::lenient::string")]
7034    pub name: String,
7035    /// Security-level ID governing access to this field, resolved from installation masterdata.
7036    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
7037    pub security_level: i64,
7038    /// Abbreviated display label.
7039    ///
7040    /// `None` leaves the field out, `Some(None)` sends `null`.
7041    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
7042    pub shorty: Option<Option<String>>,
7043    /// Display-order value within its category.
7044    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
7045    pub sort_key: i64,
7046    /// Whether the field may be used as a placeholder.
7047    #[serde(rename = "useAsPlaceholder")]
7048    pub use_as_placeholder: bool,
7049    /// Field category: f_address (person address/contact), f_church (person church information), f_category (person categories), f_group (group data), f_dep (departments), f_growpath (person growth-path data), or f_datasecurity (person privacy information). These are category codes, not entity IDs.
7050    /// Allowed values: `f_address`, `f_category`, `f_church`, `f_datasecurity`, `f_dep`, `f_group`, `f_growpath`.
7051    #[serde(rename = "fieldCategoryInternCode", deserialize_with = "crate::lenient::string")]
7052    pub field_category_intern_code: String,
7053    /// Fields not described by the spec, e.g. instance-specific DB fields.
7054    #[serde(flatten)]
7055    pub extra: serde_json::Map<String, serde_json::Value>,
7056}
7057
7058/// Compatibility mappings emitted by the backend.
7059#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7060pub struct DbFieldDeprecated {
7061    /// Allowed values: `isNotConfigurable`.
7062    #[serde(rename = "notConfigurable", deserialize_with = "crate::lenient::string")]
7063    pub not_configurable: String,
7064    /// Allowed values: `isNullable`.
7065    #[serde(deserialize_with = "crate::lenient::string")]
7066    pub nullable: String,
7067    /// Fields not described by the spec, e.g. instance-specific DB fields.
7068    #[serde(flatten)]
7069    pub extra: serde_json::Map<String, serde_json::Value>,
7070}
7071
7072/// Option row. Keys and value types depend on the selected masterdata table. Integer SQL columns are returned as JSON integers (including null values coerced to 0); other columns retain their database-returned value. name and sortKey are common aliases, not universal fields.
7073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7074pub struct DbFieldOption {
7075    /// Option identifier; group-visibility expansions use string IDs.
7076    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7077    pub id: serde_json::Value,
7078    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7079    pub name: Option<String>,
7080    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
7081    pub sort_key: Option<i64>,
7082    /// Fields not described by the spec, e.g. instance-specific DB fields.
7083    #[serde(flatten)]
7084    pub extra: serde_json::Map<String, serde_json::Value>,
7085}
7086
7087/// One writable option-table column. Names are API keys; `bezeichnung`, `sortkey`, `kuerzel` and `securitylevel_id` are mapped to `name`, `sortKey`, `shorty` and `securityLevel`. Audit columns are omitted.
7088#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7089pub struct DbFieldOptionColumn {
7090    /// Generated by the database; omit this column from create/update payloads.
7091    #[serde(rename = "isAutoIncrement")]
7092    pub is_auto_increment: bool,
7093    /// Whether the underlying database column permits SQL NULL.
7094    #[serde(rename = "isNullable")]
7095    pub is_nullable: bool,
7096    /// Parsed SQL width. For `int(11)`, 11 is a display width rather than a numerical bound.
7097    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
7098    pub length: Option<i64>,
7099    /// API property name to use in option payloads.
7100    #[serde(deserialize_with = "crate::lenient::string")]
7101    pub name: String,
7102    /// Localized label for the API property name.
7103    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
7104    pub name_translated: String,
7105    /// SQL type reported by table introspection, such as int, varchar or tinyint. This is not FieldTypeCode and has no fixed API enum.
7106    #[serde(deserialize_with = "crate::lenient::string")]
7107    pub r#type: String,
7108    /// Fields not described by the spec, e.g. instance-specific DB fields.
7109    #[serde(flatten)]
7110    pub extra: serde_json::Map<String, serde_json::Value>,
7111}
7112
7113/// Option row for the selected field’s underlying masterdata table. Read `/dbfields/{fieldId}/options/metadata` first: provide every column whose `isAutoIncrement` is `false`, using its API name. There is no universal set of writable keys across all fields. For custom selection tables, `name` and `sortKey` are both required.
7114#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7115pub struct DbFieldOptionCreate {
7116    /// Common option label. Custom selection-table labels contain 1–30 characters.
7117    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7118    pub name: Option<String>,
7119    /// Display order, required for custom selection tables and any metadata exposing a non-auto-increment `sortKey` column.
7120    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
7121    pub sort_key: Option<i64>,
7122    /// Fields not described by the spec, e.g. instance-specific DB fields.
7123    #[serde(flatten)]
7124    pub extra: serde_json::Map<String, serde_json::Value>,
7125}
7126
7127/// Full option-row update based on the selected field’s metadata. All non-auto-increment columns are required, even if only one value changes. The option ID comes from the path.
7128#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7129pub struct DbFieldOptionUpdate {
7130    /// Common option label. Custom selection-table labels contain 1–30 characters.
7131    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7132    pub name: Option<String>,
7133    /// Display order, required for custom selection tables and any metadata exposing a non-auto-increment `sortKey` column.
7134    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
7135    pub sort_key: Option<i64>,
7136    /// Fields not described by the spec, e.g. instance-specific DB fields.
7137    #[serde(flatten)]
7138    pub extra: serde_json::Map<String, serde_json::Value>,
7139}
7140
7141/// Database-field type definition. internCode selects the input/validation behavior; the numeric ID is referenced by field definitions. The name can be a translation key.
7142#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7143pub struct DbFieldType {
7144    #[serde(deserialize_with = "crate::lenient::number")]
7145    pub id: i64,
7146    /// Input/storage type. select and radioselect use one option, multiselect uses multiple options. text and textarea require a configured length when created. api identifies an application-specific field type.
7147    /// Allowed values: `api`, `checkbox`, `date`, `datetime`, `multiselect`, `number`, `radioselect`, `select`, `text`, `textarea`.
7148    #[serde(rename = "internCode", deserialize_with = "crate::lenient::string")]
7149    pub intern_code: String,
7150    #[serde(deserialize_with = "crate::lenient::string")]
7151    pub name: String,
7152    /// Display-order value.
7153    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
7154    pub sort_key: i64,
7155    /// Fields not described by the spec, e.g. instance-specific DB fields.
7156    #[serde(flatten)]
7157    pub extra: serde_json::Map<String, serde_json::Value>,
7158}
7159
7160/// Updates an existing field. Only installation-created fields can change their name, active state, line ending and configured length. Type, nullability and column/key cannot be changed.
7161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7162pub struct DbFieldUpdate {
7163    /// Whether a person field’s value is cleared on archiving. Cannot be true for a non-nullable field.
7164    #[serde(rename = "deleteOnArchive")]
7165    pub delete_on_archive: bool,
7166    /// Whether the field is enabled for normal use.
7167    #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")]
7168    pub is_active: Option<bool>,
7169    /// Whether routines may use this field.
7170    #[serde(rename = "isAvailableInRoutines", default, skip_serializing_if = "Option::is_none")]
7171    pub is_available_in_routines: Option<bool>,
7172    /// Whether the field is available on new-person forms; primarily relevant to person categories.
7173    #[serde(rename = "isNewPersonField")]
7174    pub is_new_person_field: bool,
7175    /// Configured maximum length for text and textarea fields.
7176    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
7177    pub length: Option<i64>,
7178    /// Legacy display-layout setting retained for compatibility.
7179    ///
7180    /// `None` leaves the field out, `Some(None)` sends `null`.
7181    #[serde(rename = "lineEnding", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
7182    #[deprecated = "deprecated in the ChurchTools API"]
7183    pub line_ending: Option<Option<String>>,
7184    /// Stored display name or translation key. nameTranslated is its localized display text.
7185    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7186    pub name: Option<String>,
7187    /// Security-level ID governing access to this field, resolved from installation masterdata.
7188    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
7189    pub security_level: i64,
7190    /// Abbreviated display label.
7191    ///
7192    /// `None` leaves the field out, `Some(None)` sends `null`.
7193    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
7194    pub shorty: Option<Option<String>>,
7195    /// Display-order value within its category.
7196    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
7197    pub sort_key: i64,
7198    /// Whether the field may be used as a placeholder.
7199    #[serde(rename = "useAsPlaceholder")]
7200    pub use_as_placeholder: bool,
7201    /// Installation-created person fields can move between `f_address`, `f_church`, `f_category` and `f_datasecurity`. Built-in fields and fields in other categories can only keep their existing category.
7202    /// Allowed values: `f_address`, `f_category`, `f_church`, `f_datasecurity`, `f_dep`, `f_group`, `f_growpath`.
7203    #[serde(rename = "fieldCategoryInternCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7204    pub field_category_intern_code: Option<String>,
7205    /// Fields not described by the spec, e.g. instance-specific DB fields.
7206    #[serde(flatten)]
7207    pub extra: serde_json::Map<String, serde_json::Value>,
7208}
7209
7210#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7211pub struct DeleteGroupsGroupIdMeetingsMeetingIdMembersMemberIdBody {
7212    /// Attendance state after revoking the check-in.
7213    /// Allowed values: `absent`, `unsure`.
7214    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7215    pub status: Option<String>,
7216    /// Fields not described by the spec, e.g. instance-specific DB fields.
7217    #[serde(flatten)]
7218    pub extra: serde_json::Map<String, serde_json::Value>,
7219}
7220
7221#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7222pub struct DeleteSimulateData {
7223    #[serde(deserialize_with = "crate::lenient::string")]
7224    pub redirect: String,
7225    /// Fields not described by the spec, e.g. instance-specific DB fields.
7226    #[serde(flatten)]
7227    pub extra: serde_json::Map<String, serde_json::Value>,
7228}
7229
7230/// Denomination of a church
7231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7232pub struct Denomination {
7233    /// Technical enum case name used by ChurchTools.
7234    /// Allowed values: `CATHOLIC`, `ECUMENICAL`, `FREE_EVANGELICAL`, `NONE`, `ORTHODOX`, `PROTESTANT`.
7235    #[serde(deserialize_with = "crate::lenient::string")]
7236    pub key: String,
7237    /// Translation key of the denomination.
7238    /// Allowed values: `denomination.catholic`, `denomination.ecumenical`, `denomination.free.evangelical`, `denomination.none`, `denomination.orthodox`, `denomination.protestant`.
7239    #[serde(deserialize_with = "crate::lenient::string")]
7240    pub name: String,
7241    /// Localized denomination name.
7242    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
7243    pub name_translated: String,
7244    /// Fields not described by the spec, e.g. instance-specific DB fields.
7245    #[serde(flatten)]
7246    pub extra: serde_json::Map<String, serde_json::Value>,
7247}
7248
7249/// Person-related department used to organize the directory and its access rules. It is distinct from campuses, groups and service groups.
7250#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7251pub struct Department {
7252    #[serde(rename = "@deprecated")]
7253    pub deprecated: DepartmentDeprecated,
7254    #[serde(deserialize_with = "crate::lenient::number")]
7255    pub id: i64,
7256    #[serde(deserialize_with = "crate::lenient::string")]
7257    pub name: String,
7258    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
7259    pub name_translated: String,
7260    /// Use `shorty` instead
7261    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7262    #[deprecated = "Use `shorty` instead"]
7263    pub short: Option<String>,
7264    #[serde(deserialize_with = "crate::lenient::string")]
7265    pub shorty: String,
7266    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
7267    pub sort_key: i64,
7268    /// Fields not described by the spec, e.g. instance-specific DB fields.
7269    #[serde(flatten)]
7270    pub extra: serde_json::Map<String, serde_json::Value>,
7271}
7272
7273#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7274pub struct DepartmentDeprecated {
7275    /// Allowed values: `shorty`.
7276    #[serde(deserialize_with = "crate::lenient::string")]
7277    pub short: String,
7278    /// Fields not described by the spec, e.g. instance-specific DB fields.
7279    #[serde(flatten)]
7280    pub extra: serde_json::Map<String, serde_json::Value>,
7281}
7282
7283/// Compatibility metadata describing legacy date fields.
7284#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7285pub struct Deprecated {
7286    #[serde(rename = "dateFrom", deserialize_with = "crate::lenient::string")]
7287    pub date_from: String,
7288    #[serde(rename = "dateTo", deserialize_with = "crate::lenient::string")]
7289    pub date_to: String,
7290    #[serde(rename = "endDate", deserialize_with = "crate::lenient::string")]
7291    pub end_date: String,
7292    /// Fields not described by the spec, e.g. instance-specific DB fields.
7293    #[serde(flatten)]
7294    pub extra: serde_json::Map<String, serde_json::Value>,
7295}
7296
7297/// One app-device registration belonging to a person. deviceId identifies the registration; pushId is the delivery token. Reading devices does not extend their lifetime.
7298#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7299pub struct Device {
7300    /// Compatibility mapping for legacy fields; id actually contains pushId.
7301    #[serde(rename = "@deprecated")]
7302    pub deprecated: DeviceDeprecated,
7303    /// Used App Version
7304    #[serde(rename = "appVersion", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7305    pub app_version: Option<String>,
7306    /// Use `meta.createdDate` instead
7307    #[serde(rename = "createdAt", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
7308    #[deprecated = "Use `meta."]
7309    pub created_at: Option<chrono::DateTime<chrono::Utc>>,
7310    /// Client-generated registration identifier, scoped to the person. Not necessarily a UUID and not the legacy id field.
7311    #[serde(rename = "deviceId", deserialize_with = "crate::lenient::string")]
7312    pub device_id: String,
7313    /// Registration expiry, refreshed by PUT to three months from now, or one day during simulation. Reads and push selection do not themselves enforce this timestamp.
7314    #[serde(rename = "expirationDate", serialize_with = "crate::datetime::serialize_utc")]
7315    pub expiration_date: chrono::DateTime<chrono::Utc>,
7316    /// Legacy value equal to pushId, despite the compatibility marker naming deviceId as its replacement.
7317    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7318    #[deprecated = "deprecated in the ChurchTools API"]
7319    pub id: Option<String>,
7320    pub meta: MetaDataEntityId,
7321    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
7322    pub person_id: i64,
7323    /// Push-provider token, or null. Do not use it as the registration identifier.
7324    #[serde(rename = "pushId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7325    pub push_id: Option<String>,
7326    /// Use `expirationDate` instead
7327    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
7328    #[deprecated = "Use `expirationDate` instead"]
7329    pub ttl: Option<chrono::DateTime<chrono::Utc>>,
7330    /// Push platform: APN for Apple Push Notification service; FCM for Firebase Cloud Messaging.
7331    /// Allowed values: `APN`, `FCM`.
7332    #[serde(deserialize_with = "crate::lenient::string")]
7333    pub r#type: String,
7334    /// Use `meta.modifiedDate` instead
7335    #[serde(rename = "updatedAt", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
7336    #[deprecated = "Use `meta."]
7337    pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
7338    /// Legacy alias of appVersion.
7339    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7340    #[deprecated = "deprecated in the ChurchTools API"]
7341    pub version: Option<String>,
7342    /// Fields not described by the spec, e.g. instance-specific DB fields.
7343    #[serde(flatten)]
7344    pub extra: serde_json::Map<String, serde_json::Value>,
7345}
7346
7347/// Compatibility mapping for legacy fields; id actually contains pushId.
7348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7349pub struct DeviceDeprecated {
7350    #[serde(rename = "createdAt", deserialize_with = "crate::lenient::string")]
7351    pub created_at: String,
7352    #[serde(deserialize_with = "crate::lenient::string")]
7353    pub id: String,
7354    #[serde(deserialize_with = "crate::lenient::string")]
7355    pub ttl: String,
7356    #[serde(rename = "updatedAt", deserialize_with = "crate::lenient::string")]
7357    pub updated_at: String,
7358    #[serde(deserialize_with = "crate::lenient::string")]
7359    pub version: String,
7360    /// Fields not described by the spec, e.g. instance-specific DB fields.
7361    #[serde(flatten)]
7362    pub extra: serde_json::Map<String, serde_json::Value>,
7363}
7364
7365/// Creates or refreshes a device registration. personId and deviceId come from the URL. Omitted values do not uniformly preserve the previous registration.
7366#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7367pub struct DeviceUpdate {
7368    /// App version accepted by the version validator, such as 1.2.3. Omission or null clears the stored version.
7369    ///
7370    /// `None` leaves the field out, `Some(None)` sends `null`.
7371    #[serde(rename = "appVersion", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
7372    pub app_version: Option<Option<String>>,
7373    /// Trimmed push token. Omission replaces the token with deviceId; null clears it; an empty or whitespace-only string preserves the previous token (null on a new device).
7374    ///
7375    /// `None` leaves the field out, `Some(None)` sends `null`.
7376    #[serde(rename = "pushId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
7377    pub push_id: Option<Option<String>>,
7378    /// Push platform: APN for Apple Push Notification service; FCM for Firebase Cloud Messaging.
7379    /// Allowed values: `APN`, `FCM`.
7380    #[serde(deserialize_with = "crate::lenient::string")]
7381    pub r#type: String,
7382    /// Legacy alias of appVersion; use appVersion. The canonical field takes precedence if both are present.
7383    ///
7384    /// `None` leaves the field out, `Some(None)` sends `null`.
7385    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
7386    #[deprecated = "deprecated in the ChurchTools API"]
7387    pub version: Option<Option<String>>,
7388    /// Fields not described by the spec, e.g. instance-specific DB fields.
7389    #[serde(flatten)]
7390    pub extra: serde_json::Map<String, serde_json::Value>,
7391}
7392
7393/// Action as Domain Object
7394#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7395pub struct DomainObjectAction {
7396    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7397    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7398    pub api_url: Option<String>,
7399    /// Optional display color.
7400    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7401    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7402    pub color: serde_json::Value,
7403    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7404    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7405    pub domain_identifier: String,
7406    /// Optional image URL.
7407    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7408    pub image_url: Option<String>,
7409    /// Additional localized display lines; not structured resource fields.
7410    #[serde(default, skip_serializing_if = "Option::is_none")]
7411    pub infos: Option<Vec<String>>,
7412    /// Optional initials for an avatar fallback.
7413    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7414    pub initials: Option<String>,
7415    /// Display title of the referenced object.
7416    #[serde(deserialize_with = "crate::lenient::string")]
7417    pub title: String,
7418    #[serde(rename = "domainAttributes")]
7419    pub domain_attributes: DomainObjectActionDomainAttributes,
7420    /// Allowed values: `action`.
7421    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7422    pub domain_type: String,
7423    #[serde(rename = "frontendUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7424    pub frontend_url: serde_json::Value,
7425    #[serde(deserialize_with = "crate::lenient::string")]
7426    pub icon: String,
7427    /// Fields not described by the spec, e.g. instance-specific DB fields.
7428    #[serde(flatten)]
7429    pub extra: serde_json::Map<String, serde_json::Value>,
7430}
7431
7432#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7433pub struct DomainObjectActionDomainAttributes {
7434    #[serde(rename = "createDomainType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7435    pub create_domain_type: Option<String>,
7436    /// Fields not described by the spec, e.g. instance-specific DB fields.
7437    #[serde(flatten)]
7438    pub extra: serde_json::Map<String, serde_json::Value>,
7439}
7440
7441/// Appointment as Domain Object
7442#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7443pub struct DomainObjectAppointment {
7444    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7445    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7446    pub api_url: Option<String>,
7447    /// Optional display color.
7448    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7449    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7450    pub color: serde_json::Value,
7451    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7452    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7453    pub domain_identifier: String,
7454    /// Optional image URL.
7455    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7456    pub image_url: Option<String>,
7457    /// Additional localized display lines; not structured resource fields.
7458    #[serde(default, skip_serializing_if = "Option::is_none")]
7459    pub infos: Option<Vec<String>>,
7460    /// Optional initials for an avatar fallback.
7461    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7462    pub initials: Option<String>,
7463    /// Display title of the referenced object.
7464    #[serde(deserialize_with = "crate::lenient::string")]
7465    pub title: String,
7466    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
7467    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
7468    /// Allowed values: `appointment`.
7469    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7470    pub domain_type: String,
7471    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
7472    pub frontend_url: String,
7473    /// Allowed values: `calendar`.
7474    #[serde(deserialize_with = "crate::lenient::string")]
7475    pub icon: String,
7476    /// Fields not described by the spec, e.g. instance-specific DB fields.
7477    #[serde(flatten)]
7478    pub extra: serde_json::Map<String, serde_json::Value>,
7479}
7480
7481/// One dated occurrence of an appointment series, identified by appointment ID and occurrence date.
7482#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7483pub struct DomainObjectAppointmentOccurrence {
7484    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7485    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7486    pub api_url: Option<String>,
7487    /// Optional display color.
7488    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7489    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7490    pub color: serde_json::Value,
7491    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7492    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7493    pub domain_identifier: String,
7494    /// Optional image URL.
7495    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7496    pub image_url: Option<String>,
7497    /// Additional localized display lines; not structured resource fields.
7498    #[serde(default, skip_serializing_if = "Option::is_none")]
7499    pub infos: Option<Vec<String>>,
7500    /// Optional initials for an avatar fallback.
7501    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7502    pub initials: Option<String>,
7503    /// Display title of the referenced object.
7504    #[serde(deserialize_with = "crate::lenient::string")]
7505    pub title: String,
7506    #[serde(rename = "domainAttributes")]
7507    pub domain_attributes: DomainObjectAppointmentOccurrenceDomainAttributes,
7508    /// Allowed values: `appointment_occurrence`.
7509    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7510    pub domain_type: String,
7511    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
7512    pub frontend_url: String,
7513    /// Allowed values: `calendar-day`.
7514    #[serde(deserialize_with = "crate::lenient::string")]
7515    pub icon: String,
7516    /// Fields not described by the spec, e.g. instance-specific DB fields.
7517    #[serde(flatten)]
7518    pub extra: serde_json::Map<String, serde_json::Value>,
7519}
7520
7521#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7522pub struct DomainObjectAppointmentOccurrenceDomainAttributes {
7523    /// Occurrence date used in the compound identifier.
7524    #[serde(rename = "startDate")]
7525    pub start_date: chrono::NaiveDate,
7526    /// Fields not described by the spec, e.g. instance-specific DB fields.
7527    #[serde(flatten)]
7528    pub extra: serde_json::Map<String, serde_json::Value>,
7529}
7530
7531/// Calendar as Domain Object
7532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7533pub struct DomainObjectCalendar {
7534    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7535    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7536    pub api_url: Option<String>,
7537    /// Optional display color.
7538    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7539    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7540    pub color: serde_json::Value,
7541    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7542    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7543    pub domain_identifier: String,
7544    /// Optional image URL.
7545    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7546    pub image_url: Option<String>,
7547    /// Additional localized display lines; not structured resource fields.
7548    #[serde(default, skip_serializing_if = "Option::is_none")]
7549    pub infos: Option<Vec<String>>,
7550    /// Optional initials for an avatar fallback.
7551    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7552    pub initials: Option<String>,
7553    /// Display title of the referenced object.
7554    #[serde(deserialize_with = "crate::lenient::string")]
7555    pub title: String,
7556    #[serde(rename = "domainAttributes")]
7557    pub domain_attributes: DomainObjectCalendarDomainAttributes,
7558    /// Allowed values: `calendar`.
7559    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7560    pub domain_type: String,
7561    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
7562    pub frontend_url: String,
7563    /// Allowed values: `calendar`.
7564    #[serde(deserialize_with = "crate::lenient::string")]
7565    pub icon: String,
7566    /// Fields not described by the spec, e.g. instance-specific DB fields.
7567    #[serde(flatten)]
7568    pub extra: serde_json::Map<String, serde_json::Value>,
7569}
7570
7571#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7572pub struct DomainObjectCalendarDomainAttributes {
7573    #[serde(rename = "campusName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7574    pub campus_name: Option<String>,
7575    /// Fields not described by the spec, e.g. instance-specific DB fields.
7576    #[serde(flatten)]
7577    pub extra: serde_json::Map<String, serde_json::Value>,
7578}
7579
7580/// Event as Domain Object
7581#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7582pub struct DomainObjectEvent {
7583    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7584    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7585    pub api_url: Option<String>,
7586    /// Optional display color.
7587    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7588    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7589    pub color: serde_json::Value,
7590    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7591    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7592    pub domain_identifier: String,
7593    /// Optional image URL.
7594    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7595    pub image_url: Option<String>,
7596    /// Additional localized display lines; not structured resource fields.
7597    #[serde(default, skip_serializing_if = "Option::is_none")]
7598    pub infos: Option<Vec<String>>,
7599    /// Optional initials for an avatar fallback.
7600    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7601    pub initials: Option<String>,
7602    /// Display title of the referenced object.
7603    #[serde(deserialize_with = "crate::lenient::string")]
7604    pub title: String,
7605    #[serde(rename = "domainAttributes")]
7606    pub domain_attributes: DomainObjectEventDomainAttributes,
7607    /// Allowed values: `event`.
7608    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7609    pub domain_type: String,
7610    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
7611    pub frontend_url: String,
7612    /// Allowed values: `calendar-day`.
7613    #[serde(deserialize_with = "crate::lenient::string")]
7614    pub icon: String,
7615    /// Fields not described by the spec, e.g. instance-specific DB fields.
7616    #[serde(flatten)]
7617    pub extra: serde_json::Map<String, serde_json::Value>,
7618}
7619
7620#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7621pub struct DomainObjectEventDomainAttributes {
7622    /// Start of this service-planning event.
7623    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
7624    pub start_date: chrono::DateTime<chrono::Utc>,
7625    /// Fields not described by the spec, e.g. instance-specific DB fields.
7626    #[serde(flatten)]
7627    pub extra: serde_json::Map<String, serde_json::Value>,
7628}
7629
7630/// External person as Domain Object
7631#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7632pub struct DomainObjectExternalPerson {
7633    #[serde(rename = "apiUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7634    pub api_url: serde_json::Value,
7635    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7636    pub color: serde_json::Value,
7637    #[serde(rename = "domainAttributes")]
7638    pub domain_attributes: DomainObjectExternalPersonDomainAttributes,
7639    #[serde(rename = "domainIdentifier", default, skip_serializing_if = "serde_json::Value::is_null")]
7640    pub domain_identifier: serde_json::Value,
7641    /// Allowed values: `externalPerson`.
7642    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7643    pub domain_type: String,
7644    #[serde(rename = "frontendUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7645    pub frontend_url: serde_json::Value,
7646    /// Allowed values: `user`.
7647    #[serde(deserialize_with = "crate::lenient::string")]
7648    pub icon: String,
7649    #[serde(rename = "imageUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7650    pub image_url: serde_json::Value,
7651    pub infos: Vec<String>,
7652    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7653    pub initials: Option<String>,
7654    #[serde(deserialize_with = "crate::lenient::string")]
7655    pub title: String,
7656    /// Fields not described by the spec, e.g. instance-specific DB fields.
7657    #[serde(flatten)]
7658    pub extra: serde_json::Map<String, serde_json::Value>,
7659}
7660
7661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7662pub struct DomainObjectExternalPersonDomainAttributes {
7663    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7664    pub email: Option<String>,
7665    /// Fields not described by the spec, e.g. instance-specific DB fields.
7666    #[serde(flatten)]
7667    pub extra: serde_json::Map<String, serde_json::Value>,
7668}
7669
7670/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
7671#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7672pub struct DomainObjectFile {
7673    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7674    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7675    pub api_url: Option<String>,
7676    /// Optional display color.
7677    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7678    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7679    pub color: serde_json::Value,
7680    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7681    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7682    pub domain_identifier: String,
7683    /// Optional image URL.
7684    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7685    pub image_url: Option<String>,
7686    /// Additional localized display lines; not structured resource fields.
7687    #[serde(default, skip_serializing_if = "Option::is_none")]
7688    pub infos: Option<Vec<String>>,
7689    /// Optional initials for an avatar fallback.
7690    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7691    pub initials: Option<String>,
7692    /// Display title of the referenced object.
7693    #[serde(deserialize_with = "crate::lenient::string")]
7694    pub title: String,
7695    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
7696    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
7697    /// Allowed values: `file`.
7698    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7699    pub domain_type: String,
7700    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
7701    pub frontend_url: String,
7702    /// Allowed values: `file`.
7703    #[serde(deserialize_with = "crate::lenient::string")]
7704    pub icon: String,
7705    /// Fields not described by the spec, e.g. instance-specific DB fields.
7706    #[serde(flatten)]
7707    pub extra: serde_json::Map<String, serde_json::Value>,
7708}
7709
7710/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
7711#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7712pub struct DomainObjectFurtherLink {
7713    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7714    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7715    pub api_url: Option<String>,
7716    /// Optional display color.
7717    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7718    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7719    pub color: serde_json::Value,
7720    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7721    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7722    pub domain_identifier: String,
7723    /// Optional image URL.
7724    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7725    pub image_url: Option<String>,
7726    /// Additional localized display lines; not structured resource fields.
7727    #[serde(default, skip_serializing_if = "Option::is_none")]
7728    pub infos: Option<Vec<String>>,
7729    /// Optional initials for an avatar fallback.
7730    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7731    pub initials: Option<String>,
7732    /// Display title of the referenced object.
7733    #[serde(deserialize_with = "crate::lenient::string")]
7734    pub title: String,
7735    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
7736    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
7737    /// Allowed values: `further_link`.
7738    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7739    pub domain_type: String,
7740    #[serde(rename = "frontendUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7741    pub frontend_url: serde_json::Value,
7742    /// Allowed values: `link`.
7743    #[serde(deserialize_with = "crate::lenient::string")]
7744    pub icon: String,
7745    /// Fields not described by the spec, e.g. instance-specific DB fields.
7746    #[serde(flatten)]
7747    pub extra: serde_json::Map<String, serde_json::Value>,
7748}
7749
7750/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
7751#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7752pub struct DomainObjectGroup {
7753    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
7754    pub api_url: String,
7755    /// Optional display color.
7756    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7757    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7758    pub color: serde_json::Value,
7759    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7760    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7761    pub domain_identifier: String,
7762    /// Optional image URL.
7763    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7764    pub image_url: Option<String>,
7765    /// Additional localized display lines; not structured resource fields.
7766    #[serde(default, skip_serializing_if = "Option::is_none")]
7767    pub infos: Option<Vec<String>>,
7768    /// Optional initials for an avatar fallback.
7769    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7770    pub initials: Option<String>,
7771    /// Display title of the referenced object.
7772    #[serde(deserialize_with = "crate::lenient::string")]
7773    pub title: String,
7774    #[serde(rename = "domainAttributes")]
7775    pub domain_attributes: DomainObjectGroupDomainAttributes,
7776    /// Allowed values: `group`.
7777    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7778    pub domain_type: String,
7779    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
7780    pub frontend_url: String,
7781    /// Allowed values: `users`.
7782    #[serde(deserialize_with = "crate::lenient::string")]
7783    pub icon: String,
7784    /// Fields not described by the spec, e.g. instance-specific DB fields.
7785    #[serde(flatten)]
7786    pub extra: serde_json::Map<String, serde_json::Value>,
7787}
7788
7789#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7790pub struct DomainObjectGroupDomainAttributes {
7791    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
7792    pub campus_id: Option<f64>,
7793    #[serde(rename = "groupStatusId", deserialize_with = "crate::lenient::number")]
7794    pub group_status_id: f64,
7795    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
7796    pub group_type_id: f64,
7797    #[serde(deserialize_with = "crate::lenient::string")]
7798    pub guid: String,
7799    #[serde(deserialize_with = "crate::lenient::string")]
7800    pub note: String,
7801    /// The visibility of a group.
7802    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
7803    #[serde(deserialize_with = "crate::lenient::string")]
7804    pub visibility: String,
7805    /// Fields not described by the spec, e.g. instance-specific DB fields.
7806    #[serde(flatten)]
7807    pub extra: serde_json::Map<String, serde_json::Value>,
7808}
7809
7810/// A person’s membership in a group. Its `domainIdentifier` is the membership row ID; `domainAttributes` contains the group, person, and role IDs.
7811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7812pub struct DomainObjectGroupMembership {
7813    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
7814    pub api_url: String,
7815    /// Optional display color.
7816    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7817    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7818    pub color: serde_json::Value,
7819    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7820    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7821    pub domain_identifier: String,
7822    /// Optional image URL.
7823    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7824    pub image_url: Option<String>,
7825    pub infos: Vec<String>,
7826    /// Optional initials for an avatar fallback.
7827    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7828    pub initials: Option<String>,
7829    /// Display title of the referenced object.
7830    #[serde(deserialize_with = "crate::lenient::string")]
7831    pub title: String,
7832    #[serde(rename = "domainAttributes")]
7833    pub domain_attributes: DomainObjectGroupMembershipDomainAttributes,
7834    /// Allowed values: `group_membership`.
7835    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7836    pub domain_type: String,
7837    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
7838    pub frontend_url: String,
7839    /// Allowed values: `user`.
7840    #[serde(deserialize_with = "crate::lenient::string")]
7841    pub icon: String,
7842    /// Fields not described by the spec, e.g. instance-specific DB fields.
7843    #[serde(flatten)]
7844    pub extra: serde_json::Map<String, serde_json::Value>,
7845}
7846
7847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7848pub struct DomainObjectGroupMembershipDomainAttributes {
7849    /// A simple date in ISO format, e.g. '2022-10-19'
7850    #[serde(rename = "dateOfDeath", default, skip_serializing_if = "Option::is_none")]
7851    pub date_of_death: Option<chrono::NaiveDate>,
7852    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
7853    pub first_name: String,
7854    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
7855    pub group_id: i64,
7856    /// Globally Unique Identifier
7857    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7858    pub guid: Option<String>,
7859    #[serde(rename = "isArchived")]
7860    pub is_archived: bool,
7861    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
7862    pub last_name: String,
7863    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
7864    pub person_id: i64,
7865    #[serde(rename = "roleId", deserialize_with = "crate::lenient::number")]
7866    pub role_id: i64,
7867    /// Fields not described by the spec, e.g. instance-specific DB fields.
7868    #[serde(flatten)]
7869    pub extra: serde_json::Map<String, serde_json::Value>,
7870}
7871
7872/// Public directory entry for an enabled group homepage. domainIdentifier is the numeric homepage record ID as a string, while apiUrl/frontendUrl contain its random URL hash. childGroupIds are hierarchy descendants, not necessarily the groups actually displayed by the page.
7873#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7874pub struct DomainObjectGrouphomepage {
7875    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7876    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7877    pub api_url: Option<String>,
7878    /// Optional display color.
7879    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7880    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7881    pub color: serde_json::Value,
7882    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7883    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7884    pub domain_identifier: String,
7885    /// Optional image URL.
7886    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7887    pub image_url: Option<String>,
7888    /// Additional localized display lines; not structured resource fields.
7889    #[serde(default, skip_serializing_if = "Option::is_none")]
7890    pub infos: Option<Vec<String>>,
7891    /// Optional initials for an avatar fallback.
7892    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7893    pub initials: Option<String>,
7894    /// Display title of the referenced object.
7895    #[serde(deserialize_with = "crate::lenient::string")]
7896    pub title: String,
7897    #[serde(rename = "domainAttributes")]
7898    pub domain_attributes: DomainObjectGrouphomepageDomainAttributes,
7899    /// Allowed values: `grouphomepage`.
7900    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7901    pub domain_type: String,
7902    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7903    pub frontend_url: Option<String>,
7904    /// Allowed values: `globe`.
7905    #[serde(deserialize_with = "crate::lenient::string")]
7906    pub icon: String,
7907    /// Fields not described by the spec, e.g. instance-specific DB fields.
7908    #[serde(flatten)]
7909    pub extra: serde_json::Map<String, serde_json::Value>,
7910}
7911
7912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7913pub struct DomainObjectGrouphomepageDomainAttributes {
7914    /// All reachable active, non-hidden descendants, across every hierarchy depth. This may include internal groups, repeated IDs along multiple hierarchy paths, and groups omitted by the public-page feature filter.
7915    #[serde(rename = "childGroupIds")]
7916    pub child_group_ids: Vec<i64>,
7917    /// ID of the group that owns this homepage; that group itself is not part of the descendant list.
7918    #[serde(rename = "parentGroupId", deserialize_with = "crate::lenient::number")]
7919    pub parent_group_id: i64,
7920    /// Fields not described by the spec, e.g. instance-specific DB fields.
7921    #[serde(flatten)]
7922    pub extra: serde_json::Map<String, serde_json::Value>,
7923}
7924
7925/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
7926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7927pub struct DomainObjectLogo {
7928    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
7929    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7930    pub api_url: Option<String>,
7931    /// Optional display color.
7932    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7933    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7934    pub color: serde_json::Value,
7935    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7936    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7937    pub domain_identifier: String,
7938    /// Optional image URL.
7939    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7940    pub image_url: Option<String>,
7941    /// Additional localized display lines; not structured resource fields.
7942    #[serde(default, skip_serializing_if = "Option::is_none")]
7943    pub infos: Option<Vec<String>>,
7944    /// Optional initials for an avatar fallback.
7945    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7946    pub initials: Option<String>,
7947    /// Display title of the referenced object.
7948    #[serde(deserialize_with = "crate::lenient::string")]
7949    pub title: String,
7950    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
7951    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
7952    /// Allowed values: `logo`.
7953    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7954    pub domain_type: String,
7955    #[serde(rename = "frontendUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7956    pub frontend_url: serde_json::Value,
7957    #[serde(deserialize_with = "crate::lenient::string")]
7958    pub icon: String,
7959    /// Fields not described by the spec, e.g. instance-specific DB fields.
7960    #[serde(flatten)]
7961    pub extra: serde_json::Map<String, serde_json::Value>,
7962}
7963
7964/// OSM Address as Domain Object
7965#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7966pub struct DomainObjectOsmAddress {
7967    #[serde(rename = "apiUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7968    pub api_url: serde_json::Value,
7969    /// Optional display color.
7970    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
7971    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
7972    pub color: serde_json::Value,
7973    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
7974    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
7975    pub domain_identifier: String,
7976    /// Optional image URL.
7977    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7978    pub image_url: Option<String>,
7979    pub infos: Vec<String>,
7980    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
7981    pub initials: Option<String>,
7982    /// Display title of the referenced object.
7983    #[serde(deserialize_with = "crate::lenient::string")]
7984    pub title: String,
7985    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
7986    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
7987    /// Allowed values: `osm-address`.
7988    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
7989    pub domain_type: String,
7990    #[serde(rename = "frontendUrl", default, skip_serializing_if = "serde_json::Value::is_null")]
7991    pub frontend_url: serde_json::Value,
7992    #[serde(deserialize_with = "crate::lenient::string")]
7993    pub icon: String,
7994    /// Fields not described by the spec, e.g. instance-specific DB fields.
7995    #[serde(flatten)]
7996    pub extra: serde_json::Map<String, serde_json::Value>,
7997}
7998
7999/// Pairs domain types and identifiers by array index. The arrays must have equal lengths. Empty arrays are allowed.
8000#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8001pub struct DomainObjectPayload {
8002    /// 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`.
8003    pub domain_identifiers: Vec<String>,
8004    /// Object types corresponding to the identifiers at the same indexes.
8005    /// Allowed values: `appointment`, `appointment_occurrence`, `event`, `group`, `group_membership`, `person`, `song`, `wiki_page`.
8006    pub domain_types: Vec<String>,
8007    /// Fields not described by the spec, e.g. instance-specific DB fields.
8008    #[serde(flatten)]
8009    pub extra: serde_json::Map<String, serde_json::Value>,
8010}
8011
8012/// Person as Domain Object
8013#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8014pub struct DomainObjectPerson {
8015    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
8016    pub api_url: String,
8017    /// Optional display color.
8018    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
8019    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8020    pub color: serde_json::Value,
8021    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
8022    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
8023    pub domain_identifier: String,
8024    /// Optional image URL.
8025    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8026    pub image_url: Option<String>,
8027    pub infos: Vec<String>,
8028    /// Optional initials for an avatar fallback.
8029    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8030    pub initials: Option<String>,
8031    /// Display title of the referenced object.
8032    #[serde(deserialize_with = "crate::lenient::string")]
8033    pub title: String,
8034    #[serde(rename = "domainAttributes")]
8035    pub domain_attributes: DomainObjectPersonDomainAttributes,
8036    /// Allowed values: `person`.
8037    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
8038    pub domain_type: String,
8039    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
8040    pub frontend_url: String,
8041    /// user for an ordinary person; user-shield for a censored person placeholder.
8042    /// Allowed values: `user`, `user-shield`.
8043    #[serde(deserialize_with = "crate::lenient::string")]
8044    pub icon: String,
8045    /// Fields not described by the spec, e.g. instance-specific DB fields.
8046    #[serde(flatten)]
8047    pub extra: serde_json::Map<String, serde_json::Value>,
8048}
8049
8050#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8051pub struct DomainObjectPersonDomainAttributes {
8052    /// A simple date in ISO format, e.g. '2022-10-19'
8053    #[serde(rename = "dateOfDeath", default, skip_serializing_if = "Option::is_none")]
8054    pub date_of_death: Option<chrono::NaiveDate>,
8055    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
8056    pub first_name: String,
8057    /// Globally Unique Identifier
8058    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8059    pub guid: Option<String>,
8060    #[serde(rename = "isArchived")]
8061    pub is_archived: bool,
8062    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
8063    pub last_name: String,
8064    /// Fields not described by the spec, e.g. instance-specific DB fields.
8065    #[serde(flatten)]
8066    pub extra: serde_json::Map<String, serde_json::Value>,
8067}
8068
8069/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
8070#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8071pub struct DomainObjectPost {
8072    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
8073    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8074    pub api_url: Option<String>,
8075    /// Optional display color.
8076    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
8077    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8078    pub color: serde_json::Value,
8079    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
8080    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
8081    pub domain_identifier: String,
8082    /// Optional image URL.
8083    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8084    pub image_url: Option<String>,
8085    pub infos: Vec<String>,
8086    /// Optional initials for an avatar fallback.
8087    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8088    pub initials: Option<String>,
8089    /// Display title of the referenced object.
8090    #[serde(deserialize_with = "crate::lenient::string")]
8091    pub title: String,
8092    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
8093    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
8094    /// Allowed values: `post`.
8095    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
8096    pub domain_type: String,
8097    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
8098    pub frontend_url: String,
8099    /// Allowed values: `newspaper`.
8100    #[serde(deserialize_with = "crate::lenient::string")]
8101    pub icon: String,
8102    /// Fields not described by the spec, e.g. instance-specific DB fields.
8103    #[serde(flatten)]
8104    pub extra: serde_json::Map<String, serde_json::Value>,
8105}
8106
8107/// Compact display reference returned for responseFormat=domainObject. domainIdentifier is the role ID as a string, title is the stored role name, and infos contains the translated group-type name. apiUrl, imageUrl, color and initials are null.
8108#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8109pub struct DomainObjectRole {
8110    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
8111    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8112    pub api_url: Option<String>,
8113    /// Optional display color.
8114    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
8115    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8116    pub color: serde_json::Value,
8117    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
8118    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
8119    pub domain_identifier: String,
8120    /// Optional image URL.
8121    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8122    pub image_url: Option<String>,
8123    /// Additional localized display lines; not structured resource fields.
8124    pub infos: Vec<String>,
8125    /// Optional initials for an avatar fallback.
8126    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8127    pub initials: Option<String>,
8128    /// Display title of the referenced object.
8129    #[serde(deserialize_with = "crate::lenient::string")]
8130    pub title: String,
8131    /// Empty object; roles do not expose additional domain attributes.
8132    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
8133    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
8134    /// Allowed values: `role`.
8135    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
8136    pub domain_type: String,
8137    /// Absolute link to this role in the group-type settings.
8138    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
8139    pub frontend_url: String,
8140    /// Icon identifying a leader or participant role.
8141    /// Allowed values: `id-badge`, `user`.
8142    #[serde(deserialize_with = "crate::lenient::string")]
8143    pub icon: String,
8144    /// Fields not described by the spec, e.g. instance-specific DB fields.
8145    #[serde(flatten)]
8146    pub extra: serde_json::Map<String, serde_json::Value>,
8147}
8148
8149/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
8150#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8151pub struct DomainObjectSong {
8152    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
8153    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8154    pub api_url: Option<String>,
8155    /// Optional display color.
8156    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
8157    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8158    pub color: serde_json::Value,
8159    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
8160    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
8161    pub domain_identifier: String,
8162    /// Optional image URL.
8163    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8164    pub image_url: Option<String>,
8165    /// Additional localized display lines; not structured resource fields.
8166    #[serde(default, skip_serializing_if = "Option::is_none")]
8167    pub infos: Option<Vec<String>>,
8168    /// Optional initials for an avatar fallback.
8169    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8170    pub initials: Option<String>,
8171    /// Display title of the referenced object.
8172    #[serde(deserialize_with = "crate::lenient::string")]
8173    pub title: String,
8174    #[serde(rename = "domainAttributes", deserialize_with = "crate::lenient::map")]
8175    pub domain_attributes: std::collections::BTreeMap<String, serde_json::Value>,
8176    /// Allowed values: `song`.
8177    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
8178    pub domain_type: String,
8179    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
8180    pub frontend_url: String,
8181    /// Allowed values: `music`.
8182    #[serde(deserialize_with = "crate::lenient::string")]
8183    pub icon: String,
8184    /// Fields not described by the spec, e.g. instance-specific DB fields.
8185    #[serde(flatten)]
8186    pub extra: serde_json::Map<String, serde_json::Value>,
8187}
8188
8189/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
8190#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8191pub struct DomainObjectWikiPage {
8192    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
8193    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8194    pub api_url: Option<String>,
8195    /// Optional display color.
8196    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
8197    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8198    pub color: serde_json::Value,
8199    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
8200    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
8201    pub domain_identifier: String,
8202    /// Optional image URL.
8203    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8204    pub image_url: Option<String>,
8205    /// Additional localized display lines; not structured resource fields.
8206    #[serde(default, skip_serializing_if = "Option::is_none")]
8207    pub infos: Option<Vec<String>>,
8208    /// Optional initials for an avatar fallback.
8209    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8210    pub initials: Option<String>,
8211    /// Display title of the referenced object.
8212    #[serde(deserialize_with = "crate::lenient::string")]
8213    pub title: String,
8214    #[serde(rename = "domainAttributes")]
8215    pub domain_attributes: DomainObjectWikiPageDomainAttributes,
8216    /// Allowed values: `wiki_page`.
8217    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
8218    pub domain_type: String,
8219    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
8220    pub frontend_url: String,
8221    /// Allowed values: `file`.
8222    #[serde(deserialize_with = "crate::lenient::string")]
8223    pub icon: String,
8224    /// Fields not described by the spec, e.g. instance-specific DB fields.
8225    #[serde(flatten)]
8226    pub extra: serde_json::Map<String, serde_json::Value>,
8227}
8228
8229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8230pub struct DomainObjectWikiPageDomainAttributes {
8231    #[serde(rename = "wikiCategoryId", deserialize_with = "crate::lenient::number")]
8232    pub wiki_category_id: i64,
8233    /// Fields not described by the spec, e.g. instance-specific DB fields.
8234    #[serde(flatten)]
8235    pub extra: serde_json::Map<String, serde_json::Value>,
8236}
8237
8238/// Download URLs for an individual donation receipt: cover letter and attachment. This representation has no receipt ID, sum or metadata.
8239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8240pub struct DonationReceipt {
8241    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
8242    pub accounting_period_id: i64,
8243    /// Download URL of the attachment PDF, possibly a temporary watermarked copy.
8244    #[serde(deserialize_with = "crate::lenient::string")]
8245    pub attachment: String,
8246    /// Download URL of the cover letter PDF, possibly a temporary watermarked copy.
8247    #[serde(rename = "coverLetter", deserialize_with = "crate::lenient::string")]
8248    pub cover_letter: String,
8249    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::number")]
8250    pub donator_id: i64,
8251    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8252    pub donator_spouse_id: Option<i64>,
8253    /// Stored or newly generated receipt type. Requested watermarking does not change the stored type in this response.
8254    /// Allowed values: `DRAFT`, `DUPLICATE`, `ORIGINAL`.
8255    #[serde(deserialize_with = "crate::lenient::string")]
8256    pub r#type: String,
8257    /// Fields not described by the spec, e.g. instance-specific DB fields.
8258    #[serde(flatten)]
8259    pub extra: serde_json::Map<String, serde_json::Value>,
8260}
8261
8262#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8263pub struct DonationReceiptCreate {
8264    /// Accounting period for the requested donor or pair.
8265    #[serde(deserialize_with = "crate::lenient::number")]
8266    pub accounting_period_id: i64,
8267    /// DRAFT creates temporary PDFs, ORIGINAL creates persistent files, and DUPLICATE marks a copy. On reads this parameter chooses watermarking, not which stored record is selected.
8268    /// Allowed values: `DRAFT`, `DUPLICATE`, `ORIGINAL`.
8269    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8270    pub r#type: Option<String>,
8271    /// Fields not described by the spec, e.g. instance-specific DB fields.
8272    #[serde(flatten)]
8273    pub extra: serde_json::Map<String, serde_json::Value>,
8274}
8275
8276/// Background generation job information. With total=0 both jobGroup and statusUrl are null.
8277#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8278pub struct DonationReceiptJobResult {
8279    #[serde(rename = "jobGroup", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8280    pub job_group: Option<String>,
8281    /// URL for polling generation progress, or null when no jobs were created.
8282    #[serde(rename = "statusUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8283    pub status_url: Option<String>,
8284    /// Number of donor households queued for receipt generation.
8285    #[serde(deserialize_with = "crate::lenient::number")]
8286    pub total: i64,
8287    /// Fields not described by the spec, e.g. instance-specific DB fields.
8288    #[serde(flatten)]
8289    pub extra: serde_json::Map<String, serde_json::Value>,
8290}
8291
8292#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8293pub struct DonationReceiptsCreate {
8294    #[serde(deserialize_with = "crate::lenient::number")]
8295    pub accounting_period_id: i64,
8296    /// Identifier of an existing attachment template.
8297    #[serde(deserialize_with = "crate::lenient::string")]
8298    pub donation_receipt_attachment_template_id: String,
8299    /// Identifier of an existing cover-letter template.
8300    #[serde(deserialize_with = "crate::lenient::string")]
8301    pub donation_receipt_letter_template_id: String,
8302    /// Fields not described by the spec, e.g. instance-specific DB fields.
8303    #[serde(flatten)]
8304    pub extra: serde_json::Map<String, serde_json::Value>,
8305}
8306
8307/// Donation summary for one person or one donor/spouse pair in an accounting period. A single person and that person’s couple form separate aggregates. Canceled transactions and cancellation entries are excluded.
8308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8309pub struct Donator {
8310    /// Serialized migration hint for the deprecated field.
8311    #[serde(rename = "@deprecated")]
8312    pub deprecated: DonatorDeprecated,
8313    /// Total number of donations in the specified accounting period.
8314    #[serde(deserialize_with = "crate::lenient::number")]
8315    pub count: i64,
8316    /// Creation timestamp of the selected stored receipt, or null if no receipt exists.
8317    #[serde(rename = "donationReceiptCreatedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
8318    pub donation_receipt_created_date: Option<chrono::DateTime<chrono::Utc>>,
8319    /// Indicator if all necessary data for a donation receipt is available.
8320    #[serde(rename = "hasAllDonatorData")]
8321    pub has_all_donator_data: bool,
8322    /// Indicator if a donation receipt is available.
8323    #[serde(rename = "hasDonationReceipt")]
8324    pub has_donation_receipt: bool,
8325    /// Presence of first name, last name, street, postcode and city for the single donor or, for a pair, the person with the smaller ID. These are presence flags, not validated addresses.
8326    #[serde(rename = "hasDonatorData")]
8327    pub has_donator_data: DonatorHasDonatorData,
8328    /// True if the stored receipt predates the tracked last modification or has a different net sum. False when no receipt exists.
8329    #[serde(rename = "isDonationReceiptOutdated")]
8330    pub is_donation_receipt_outdated: bool,
8331    /// Amount for the selected latest donation in minor currency units; a payback fallback is negative. Equal document dates have no transaction-ID tie-breaker.
8332    #[serde(rename = "lastDonationAmount", deserialize_with = "crate::lenient::number")]
8333    pub last_donation_amount: i64,
8334    /// Latest donation document date, falling back to the latest payback date if no donation exists.
8335    #[serde(rename = "lastDonationDate", serialize_with = "crate::datetime::serialize_utc")]
8336    pub last_donation_date: chrono::DateTime<chrono::Utc>,
8337    /// Deprecated alias of lastModifiedDate.
8338    #[serde(rename = "lastModified", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
8339    #[deprecated = "deprecated in the ChurchTools API"]
8340    pub last_modified: Option<chrono::DateTime<chrono::Utc>>,
8341    /// Latest modification timestamp considered for the household’s donation records and cancellation tracking.
8342    #[serde(rename = "lastModifiedDate", serialize_with = "crate::datetime::serialize_utc")]
8343    pub last_modified_date: chrono::DateTime<chrono::Utc>,
8344    /// Total number of donation paybacks in the specified accounting period.
8345    #[serde(rename = "paybackCount", deserialize_with = "crate::lenient::number")]
8346    pub payback_count: i64,
8347    /// Resolved persons for the donor or donor/spouse pair. Pair grouping normalizes the person IDs regardless of their order in the original transaction.
8348    pub persons: Vec<DomainObjectPerson>,
8349    /// Net donation amount after paybacks, in minor currency units. May be zero or negative.
8350    #[serde(deserialize_with = "crate::lenient::number")]
8351    pub sum: i64,
8352    /// Fields not described by the spec, e.g. instance-specific DB fields.
8353    #[serde(flatten)]
8354    pub extra: serde_json::Map<String, serde_json::Value>,
8355}
8356
8357/// Serialized migration hint for the deprecated field.
8358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8359pub struct DonatorDeprecated {
8360    /// Allowed values: `lastModifiedDate`.
8361    #[serde(rename = "lastModified", deserialize_with = "crate::lenient::string")]
8362    pub last_modified: String,
8363    /// Fields not described by the spec, e.g. instance-specific DB fields.
8364    #[serde(flatten)]
8365    pub extra: serde_json::Map<String, serde_json::Value>,
8366}
8367
8368/// Presence of first name, last name, street, postcode and city for the single donor or, for a pair, the person with the smaller ID. These are presence flags, not validated addresses.
8369#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8370pub struct DonatorHasDonatorData {
8371    pub city: bool,
8372    #[serde(rename = "firstName")]
8373    pub first_name: bool,
8374    #[serde(rename = "lastName")]
8375    pub last_name: bool,
8376    pub street: bool,
8377    pub zip: bool,
8378    /// Fields not described by the spec, e.g. instance-specific DB fields.
8379    #[serde(flatten)]
8380    pub extra: serde_json::Map<String, serde_json::Value>,
8381}
8382
8383/// Action definition for a source membership state. An empty object requests no action.
8384#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8385pub struct DynamicGroupProcess {
8386    /// Leaving out a value or setting it to null is handled identically: When creating a membership the default value is used, when updating a membership the value is left unchanged. Target groupMemberStatus none requests deletion of an existing membership. For queryResultOnly, use an actual membership state to create a membership.
8387    #[serde(rename = "handleMembership", default, skip_serializing_if = "Option::is_none")]
8388    pub handle_membership: Option<DynamicGroupProcessHandleMembership>,
8389    /// Fields not described by the spec, e.g. instance-specific DB fields.
8390    #[serde(flatten)]
8391    pub extra: serde_json::Map<String, serde_json::Value>,
8392}
8393
8394/// Leaving out a value or setting it to null is handled identically: When creating a membership the default value is used, when updating a membership the value is left unchanged. Target groupMemberStatus none requests deletion of an existing membership. For queryResultOnly, use an actual membership state to create a membership.
8395#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8396pub struct DynamicGroupProcessHandleMembership {
8397    /// Omit or use null for context-dependent fallback (default on creation, unchanged on update). {unchanged: true} preserves a value; {default: true} requests the process default. Use a scalar or {value: ...} for an explicit value. An empty object passes request schema validation but fails when the rules execute. Explicit null cannot reliably clear every membership field in the current processor.
8398    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8399    pub comment: serde_json::Value,
8400    /// Membership-field values keyed by numeric field ID or reference name. The request schema only accepts lowercase letters, digits and hyphens as keys; field existence and value semantics are resolved during refresh.
8401    #[serde(rename = "groupMemberFields", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
8402    pub group_member_fields: Option<std::collections::BTreeMap<String, serde_json::Value>>,
8403    /// Allowed values: `active`, `none`, `requested`, `to_delete`, `waiting`.
8404    #[serde(rename = "groupMemberStatus", default, skip_serializing_if = "serde_json::Value::is_null")]
8405    pub group_member_status: serde_json::Value,
8406    /// Group-type role ID, or a value-control object. It must be valid for this group when executed; the request schema does not resolve it.
8407    #[serde(rename = "groupTypeRoleId", default, skip_serializing_if = "serde_json::Value::is_null")]
8408    pub group_type_role_id: serde_json::Value,
8409    /// Omit or use null for context-dependent fallback (default on creation, unchanged on update). {unchanged: true} preserves a value; {default: true} requests the process default. Use a scalar or {value: ...} for an explicit value. An empty object passes request schema validation but fails when the rules execute. Explicit null cannot reliably clear every membership field in the current processor.
8410    #[serde(rename = "memberEndDate", default, skip_serializing_if = "serde_json::Value::is_null")]
8411    pub member_end_date: serde_json::Value,
8412    /// Omit or use null for context-dependent fallback (default on creation, unchanged on update). {unchanged: true} preserves a value; {default: true} requests the process default. Use a scalar or {value: ...} for an explicit value. An empty object passes request schema validation but fails when the rules execute. Explicit null cannot reliably clear every membership field in the current processor.
8413    #[serde(rename = "memberStartDate", default, skip_serializing_if = "serde_json::Value::is_null")]
8414    pub member_start_date: serde_json::Value,
8415    /// Fields not described by the spec, e.g. instance-specific DB fields.
8416    #[serde(flatten)]
8417    pub extra: serde_json::Map<String, serde_json::Value>,
8418}
8419
8420#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8421pub struct DynamicGroupProcessHandleMembershipCommentVariant5 {
8422    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8423    pub value: Option<String>,
8424    /// Fields not described by the spec, e.g. instance-specific DB fields.
8425    #[serde(flatten)]
8426    pub extra: serde_json::Map<String, serde_json::Value>,
8427}
8428
8429#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8430pub struct DynamicGroupProcessHandleMembershipGroupMemberStatusVariant5 {
8431    /// Allowed values: `active`, `none`, `requested`, `to_delete`, `waiting`.
8432    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8433    pub value: Option<String>,
8434    /// Fields not described by the spec, e.g. instance-specific DB fields.
8435    #[serde(flatten)]
8436    pub extra: serde_json::Map<String, serde_json::Value>,
8437}
8438
8439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8440pub struct DynamicGroupProcessHandleMembershipGroupTypeRoleIdVariant5 {
8441    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8442    pub value: Option<i64>,
8443    /// Fields not described by the spec, e.g. instance-specific DB fields.
8444    #[serde(flatten)]
8445    pub extra: serde_json::Map<String, serde_json::Value>,
8446}
8447
8448#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8449pub struct DynamicGroupProcessHandleMembershipMemberStartDateVariant5 {
8450    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8451    pub value: Option<String>,
8452    /// Fields not described by the spec, e.g. instance-specific DB fields.
8453    #[serde(flatten)]
8454    pub extra: serde_json::Map<String, serde_json::Value>,
8455}
8456
8457/// Defines how a person is placed in the dynamic group.
8458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8459pub struct DynamicGroupProcessSets {
8460    /// People who are both current members and part of this rule’s result.
8461    #[serde(rename = "groupAndQueryResult")]
8462    pub group_and_query_result: DynamicGroupProcessSetsGroupAndQueryResult,
8463    /// People who already belong to the group but are absent from this rule’s result.
8464    #[serde(rename = "groupOnly")]
8465    pub group_only: DynamicGroupProcessSetsGroupOnly,
8466    /// People in the query result who are not current members; only the none source-state key is valid.
8467    #[serde(rename = "queryResultOnly")]
8468    pub query_result_only: DynamicGroupProcessSetsQueryResultOnly,
8469    /// Fields not described by the spec, e.g. instance-specific DB fields.
8470    #[serde(flatten)]
8471    pub extra: serde_json::Map<String, serde_json::Value>,
8472}
8473
8474/// People who are both current members and part of this rule’s result.
8475#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8476pub struct DynamicGroupProcessSetsGroupAndQueryResult {
8477    /// Action definition for a source membership state. An empty object requests no action.
8478    #[serde(default, skip_serializing_if = "Option::is_none")]
8479    pub active: Option<DynamicGroupProcess>,
8480    /// Action definition for a source membership state. An empty object requests no action.
8481    #[serde(default, skip_serializing_if = "Option::is_none")]
8482    pub none: Option<DynamicGroupProcess>,
8483    /// Action definition for a source membership state. An empty object requests no action.
8484    #[serde(default, skip_serializing_if = "Option::is_none")]
8485    pub requested: Option<DynamicGroupProcess>,
8486    /// Action definition for a source membership state. An empty object requests no action.
8487    #[serde(default, skip_serializing_if = "Option::is_none")]
8488    pub to_delete: Option<DynamicGroupProcess>,
8489    /// Action definition for a source membership state. An empty object requests no action.
8490    #[serde(default, skip_serializing_if = "Option::is_none")]
8491    pub waiting: Option<DynamicGroupProcess>,
8492    /// Fields not described by the spec, e.g. instance-specific DB fields.
8493    #[serde(flatten)]
8494    pub extra: serde_json::Map<String, serde_json::Value>,
8495}
8496
8497/// People who already belong to the group but are absent from this rule’s result.
8498#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8499pub struct DynamicGroupProcessSetsGroupOnly {
8500    /// Action definition for a source membership state. An empty object requests no action.
8501    #[serde(default, skip_serializing_if = "Option::is_none")]
8502    pub active: Option<DynamicGroupProcess>,
8503    /// Action definition for a source membership state. An empty object requests no action.
8504    #[serde(default, skip_serializing_if = "Option::is_none")]
8505    pub none: Option<DynamicGroupProcess>,
8506    /// Action definition for a source membership state. An empty object requests no action.
8507    #[serde(default, skip_serializing_if = "Option::is_none")]
8508    pub requested: Option<DynamicGroupProcess>,
8509    /// Action definition for a source membership state. An empty object requests no action.
8510    #[serde(default, skip_serializing_if = "Option::is_none")]
8511    pub to_delete: Option<DynamicGroupProcess>,
8512    /// Action definition for a source membership state. An empty object requests no action.
8513    #[serde(default, skip_serializing_if = "Option::is_none")]
8514    pub waiting: Option<DynamicGroupProcess>,
8515    /// Fields not described by the spec, e.g. instance-specific DB fields.
8516    #[serde(flatten)]
8517    pub extra: serde_json::Map<String, serde_json::Value>,
8518}
8519
8520/// People in the query result who are not current members; only the none source-state key is valid.
8521#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8522pub struct DynamicGroupProcessSetsQueryResultOnly {
8523    /// Action definition for a source membership state. An empty object requests no action.
8524    #[serde(default, skip_serializing_if = "Option::is_none")]
8525    pub none: Option<DynamicGroupProcess>,
8526    /// Fields not described by the spec, e.g. instance-specific DB fields.
8527    #[serde(flatten)]
8528    pub extra: serde_json::Map<String, serde_json::Value>,
8529}
8530
8531/// ChurchQuery definition evaluated by the dynamic-group engine. params.responseFields must include the field named by personIdFieldName.
8532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8533pub struct DynamicGroupQuery {
8534    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8535    pub description: Option<String>,
8536    /// Allowed values: `ChurchQuery`.
8537    #[serde(deserialize_with = "crate::lenient::string")]
8538    pub method: String,
8539    pub params: DynamicGroupQueryParams,
8540    /// Fields not described by the spec, e.g. instance-specific DB fields.
8541    #[serde(flatten)]
8542    pub extra: serde_json::Map<String, serde_json::Value>,
8543}
8544
8545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8546pub struct DynamicGroupQueryParams {
8547    #[serde(rename = "computedFields", default, skip_serializing_if = "Option::is_none")]
8548    pub computed_fields: Option<Vec<DynamicGroupQueryParamsComputedFieldsItem>>,
8549    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8550    pub description: Option<String>,
8551    /// JSON expression evaluated as the query filter.
8552    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8553    pub filter: serde_json::Value,
8554    #[serde(rename = "groupBy", default, skip_serializing_if = "Option::is_none")]
8555    pub group_by: Option<Vec<String>>,
8556    #[serde(rename = "orderBy", default, skip_serializing_if = "Option::is_none")]
8557    pub order_by: Option<Vec<String>>,
8558    #[serde(rename = "outfileNamePart", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8559    pub outfile_name_part: Option<String>,
8560    #[serde(rename = "primaryEntityAlias", deserialize_with = "crate::lenient::string")]
8561    pub primary_entity_alias: String,
8562    #[serde(rename = "responseFields")]
8563    pub response_fields: Vec<String>,
8564    /// Only if the query is used in a unit test
8565    #[serde(default, skip_serializing_if = "Option::is_none")]
8566    pub test: Option<DynamicGroupQueryParamsTest>,
8567    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8568    pub title: Option<String>,
8569    /// Fields not described by the spec, e.g. instance-specific DB fields.
8570    #[serde(flatten)]
8571    pub extra: serde_json::Map<String, serde_json::Value>,
8572}
8573
8574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8575pub struct DynamicGroupQueryParamsComputedFieldsItem {
8576    #[serde(deserialize_with = "crate::lenient::string")]
8577    pub name: String,
8578    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8579    pub value: serde_json::Value,
8580    /// Fields not described by the spec, e.g. instance-specific DB fields.
8581    #[serde(flatten)]
8582    pub extra: serde_json::Map<String, serde_json::Value>,
8583}
8584
8585/// Only if the query is used in a unit test
8586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8587pub struct DynamicGroupQueryParamsTest {
8588    #[serde(deserialize_with = "crate::lenient::number")]
8589    pub count: i64,
8590    /// Fields not described by the spec, e.g. instance-specific DB fields.
8591    #[serde(flatten)]
8592    pub extra: serde_json::Map<String, serde_json::Value>,
8593}
8594
8595/// Failure entry returned by refresh-all. It has no structured groupId; the human-readable error includes group context.
8596#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8597pub struct DynamicGroupRefreshError {
8598    /// Legacy failure marker; not the number of changes rolled back.
8599    #[serde(deserialize_with = "crate::lenient::number")]
8600    pub count: i64,
8601    /// Localized error message with group context and underlying exception message.
8602    #[serde(deserialize_with = "crate::lenient::string")]
8603    pub error: String,
8604    /// Fields not described by the spec, e.g. instance-specific DB fields.
8605    #[serde(flatten)]
8606    pub extra: serde_json::Map<String, serde_json::Value>,
8607}
8608
8609/// Statistics for one synchronous group refresh. At most 500 actual membership changes are applied per execution; repeat refreshes may be needed.
8610#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8611pub struct DynamicGroupRefreshResult {
8612    /// Memberships created in this run.
8613    #[serde(deserialize_with = "crate::lenient::number")]
8614    pub created: i64,
8615    /// Memberships removed in this run.
8616    #[serde(deserialize_with = "crate::lenient::number")]
8617    pub deleted: i64,
8618    /// Group whose rules were evaluated.
8619    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
8620    pub group_id: i64,
8621    /// Estimated additional runs based on the remaining-action counter; not an automatically queued job count.
8622    #[serde(rename = "runsNeeded", deserialize_with = "crate::lenient::number")]
8623    pub runs_needed: i64,
8624    /// Reported remaining actions at the change limit. This can overcount when earlier actions did not require a write.
8625    #[serde(deserialize_with = "crate::lenient::number")]
8626    pub unprocessed: i64,
8627    /// Existing memberships changed in this run.
8628    #[serde(deserialize_with = "crate::lenient::number")]
8629    pub updated: i64,
8630    /// Fields not described by the spec, e.g. instance-specific DB fields.
8631    #[serde(flatten)]
8632    pub extra: serde_json::Map<String, serde_json::Value>,
8633}
8634
8635/// One automatic-membership rule. Queries and processing modes are evaluated against the membership snapshot at the start of a refresh. Rules are ordered by increasing importance; any requested deletion takes precedence over updates, regardless of importance.
8636#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8637pub struct DynamicGroupRule {
8638    /// Human-readable explanation of what this rule does.
8639    #[serde(deserialize_with = "crate::lenient::string")]
8640    pub description: String,
8641    /// Determines the order of the rule sets. The higher the number, the later the rule set is processed. As it may override previous results, a higher number implies higher priority.
8642    #[serde(deserialize_with = "crate::lenient::number")]
8643    pub importance: i64,
8644    /// The name of the field that contains the person id. This is used to identify the person to be placed in the dynamic group.
8645    #[serde(rename = "personIdFieldName", deserialize_with = "crate::lenient::string")]
8646    pub person_id_field_name: String,
8647    /// Defines how a person is placed in the dynamic group.
8648    pub process: DynamicGroupProcessSets,
8649    /// ChurchQuery definition evaluated by the dynamic-group engine. params.responseFields must include the field named by personIdFieldName.
8650    pub query: DynamicGroupQuery,
8651    /// Short rule identifier used in diagnostics.
8652    #[serde(deserialize_with = "crate::lenient::string")]
8653    pub shorty: String,
8654    /// Fields not described by the spec, e.g. instance-specific DB fields.
8655    #[serde(flatten)]
8656    pub extra: serde_json::Map<String, serde_json::Value>,
8657}
8658
8659/// Replaces all stored rules. It does not activate the group or run a refresh. An empty array clears the stored rule set and reads back as null, while preserving the refresh status.
8660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8661pub struct DynamicGroupRuleSetUpdate {
8662    #[serde(rename = "dynamicGroupRuleSet")]
8663    pub dynamic_group_rule_set: Vec<DynamicGroupRule>,
8664    /// Fields not described by the spec, e.g. instance-specific DB fields.
8665    #[serde(flatten)]
8666    pub extra: serde_json::Map<String, serde_json::Value>,
8667}
8668
8669/// Set the refresh mode independently of the stored rule set. This does not evaluate or execute rules.
8670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8671pub struct DynamicGroupStatusUpdate {
8672    /// Controls automatic membership refresh: active participates in scheduled and manual refreshes; manual allows explicit refresh only; inactive blocks both; none disables dynamic-group behavior without deleting stored rules or existing memberships.
8673    /// Allowed values: `active`, `inactive`, `manual`, `none`.
8674    #[serde(rename = "dynamicGroupStatus", deserialize_with = "crate::lenient::string")]
8675    pub dynamic_group_status: String,
8676    /// Fields not described by the spec, e.g. instance-specific DB fields.
8677    #[serde(flatten)]
8678    pub extra: serde_json::Map<String, serde_json::Value>,
8679}
8680
8681#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8682pub struct DynamicGroupValueDefault {
8683    pub default: bool,
8684    /// Fields not described by the spec, e.g. instance-specific DB fields.
8685    #[serde(flatten)]
8686    pub extra: serde_json::Map<String, serde_json::Value>,
8687}
8688
8689#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8690pub struct DynamicGroupValueUnchanged {
8691    pub unchanged: bool,
8692    /// Fields not described by the spec, e.g. instance-specific DB fields.
8693    #[serde(flatten)]
8694    pub extra: serde_json::Map<String, serde_json::Value>,
8695}
8696
8697/// Placeholder lookups made while rendering one visible person’s content. Conditional branches affect which placeholders are evaluated.
8698#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8699pub struct EmailPlaceholderStatistics {
8700    /// Unique evaluated placeholder names in first-lookup order, excluding internal .all/.person names.
8701    pub order: Vec<String>,
8702    /// Recipient represented by this entry.
8703    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
8704    pub person_id: i64,
8705    /// Map of evaluated placeholder names to availability codes. An empty map can serialize as \[\]. Internal names ending in .all or .person are omitted.
8706    /// Allowed values: `0`, `1`, `2`.
8707    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
8708    pub stats: serde_json::Value,
8709    /// Fields not described by the spec, e.g. instance-specific DB fields.
8710    #[serde(flatten)]
8711    pub extra: serde_json::Map<String, serde_json::Value>,
8712}
8713
8714/// Read-only request for per-person placeholder availability. Only persons visible to the current user are considered.
8715#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8716pub struct EmailPlaceholderStatisticsCreate {
8717    /// HTML/text fragments concatenated in order without inserting whitespace. Empty array produces an empty body before optional template wrapping.
8718    pub content: Vec<String>,
8719    /// Optional HTML template. All literal {{body}} tokens are replaced with the concatenated content before placeholders are resolved. If the template has no HTML file, content is used directly.
8720    #[serde(rename = "emailTemplateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8721    pub email_template_id: Option<i64>,
8722    /// Optional visible group providing group and membership placeholders. Template access can also be granted through permission to view this group’s automatic emails.
8723    #[serde(rename = "groupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8724    pub group_id: Option<i64>,
8725    /// Accepted legacy parameter. Currently validated but not used in rendering, authorization or statistics.
8726    #[serde(rename = "automaticEmailId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8727    pub automatic_email_id: Option<i64>,
8728    /// IDs of the persons for which statistics are calculated
8729    #[serde(rename = "personIds")]
8730    pub person_ids: Vec<i64>,
8731    /// Fields not described by the spec, e.g. instance-specific DB fields.
8732    #[serde(flatten)]
8733    pub extra: serde_json::Map<String, serde_json::Value>,
8734}
8735
8736/// Flat rendering result; no data wrapper. The subject property is present only when the request included subject.
8737#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8738pub struct EmailPreview {
8739    /// Rendered email preview HTML
8740    #[serde(deserialize_with = "crate::lenient::string")]
8741    pub html: String,
8742    /// Rendered subject, only present when a subject was provided
8743    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8744    pub subject: Option<String>,
8745    /// Fields not described by the spec, e.g. instance-specific DB fields.
8746    #[serde(flatten)]
8747    pub extra: serde_json::Map<String, serde_json::Value>,
8748}
8749
8750/// Render one visible person’s email content for preview. This does not create a draft or send an email.
8751#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8752pub struct EmailPreviewCreate {
8753    /// HTML/text fragments concatenated in order without inserting whitespace. Empty array produces an empty body before optional template wrapping.
8754    pub content: Vec<String>,
8755    /// Optional HTML template. All literal {{body}} tokens are replaced with the concatenated content before placeholders are resolved. If the template has no HTML file, content is used directly.
8756    #[serde(rename = "emailTemplateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8757    pub email_template_id: Option<i64>,
8758    /// Optional visible group providing group and membership placeholders. Template access can also be granted through permission to view this group’s automatic emails.
8759    #[serde(rename = "groupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8760    pub group_id: Option<i64>,
8761    /// ID of the person used to render person placeholders
8762    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
8763    pub person_id: i64,
8764    /// Optional email subject to render with placeholders
8765    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8766    pub subject: Option<String>,
8767    /// Optional acting-user context used by placeholder decorators; omit to use the current context. This is distinct from the recipient personId. Context handling currently differs between placeholder types.
8768    #[serde(rename = "userId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8769    pub user_id: Option<i64>,
8770    /// Fields not described by the spec, e.g. instance-specific DB fields.
8771    #[serde(flatten)]
8772    pub extra: serde_json::Map<String, serde_json::Value>,
8773}
8774
8775/// euBP service health information
8776#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8777pub struct EubpHealthInfo {
8778    /// Configured service environment, normally test, production or mock. The configuration is returned verbatim.
8779    #[serde(deserialize_with = "crate::lenient::string")]
8780    pub environment: String,
8781    /// Whether the eXTra service is available
8782    #[serde(rename = "extraServiceAvailable")]
8783    pub extra_service_available: bool,
8784    /// Configured eXTra integration-service URL.
8785    #[serde(rename = "extraServiceUrl", deserialize_with = "crate::lenient::string")]
8786    pub extra_service_url: String,
8787    /// Fields not described by the spec, e.g. instance-specific DB fields.
8788    #[serde(flatten)]
8789    pub extra: serde_json::Map<String, serde_json::Value>,
8790}
8791
8792#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8793pub struct EubpPeriodAccountsUpdate {
8794    /// Complete additional-account selection for this submission-period row. Duplicates are deduplicated; unknown IDs are ignored. \[\] removes additional selections.
8795    #[serde(rename = "accountIds")]
8796    pub account_ids: Vec<i64>,
8797    /// Fields not described by the spec, e.g. instance-specific DB fields.
8798    #[serde(flatten)]
8799    pub extra: serde_json::Map<String, serde_json::Value>,
8800}
8801
8802/// Submission of finance data for an electronically supported audit (euBP), transmitted through the eXTra service to Deutsche Rentenversicherung (DRV). One submission groups a main finance client and optionally related clients across calendar years. Period rows link these years to CT accounting periods; they are not accounting periods themselves.
8803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8804pub struct EubpSubmission {
8805    /// ID of the finance client
8806    #[serde(rename = "clientId", deserialize_with = "crate::lenient::number")]
8807    pub client_id: i64,
8808    /// Client request ID from eXTra service
8809    #[serde(rename = "clientRequestId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8810    pub client_request_id: Option<String>,
8811    /// Company name snapshot used for transmission
8812    #[serde(rename = "companyName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8813    pub company_name: Option<String>,
8814    /// Company number snapshot used for transmission
8815    #[serde(rename = "companyNumber", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8816    pub company_number: Option<String>,
8817    /// Delivery deadline for the audit data Serialized as an ISO timestamp including timezone, even though creation accepts a calendar date. Serialized as an ISO timestamp including timezone, even though creation accepts a calendar date.
8818    #[serde(rename = "deliveryDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
8819    pub delivery_date: Option<chrono::DateTime<chrono::Utc>>,
8820    /// URL to download the generated export ZIP file
8821    #[serde(rename = "downloadUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8822    pub download_url: Option<String>,
8823    /// Status code from DRV
8824    #[serde(rename = "drvStatusCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8825    pub drv_status_code: Option<String>,
8826    /// Status message from DRV
8827    #[serde(rename = "drvStatusMessage", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8828    pub drv_status_message: Option<String>,
8829    /// Most recent eXTra transport/status code.
8830    #[serde(rename = "extraStatusCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8831    pub extra_status_code: Option<String>,
8832    /// Most recent eXTra status message.
8833    #[serde(rename = "extraStatusMessage", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8834    pub extra_status_message: Option<String>,
8835    /// ID of the generated export file in cc_file
8836    #[serde(rename = "fileId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8837    pub file_id: Option<i64>,
8838    /// Submission ID
8839    #[serde(deserialize_with = "crate::lenient::number")]
8840    pub id: i64,
8841    pub meta: MetaDataEntityId,
8842    /// One row per affected client and requested year, including rows without a matching accounting period.
8843    pub periods: Vec<EubpSubmissionPeriod>,
8844    /// Reference date for the audit (Stichtag der Prüfung) Serialized as an ISO timestamp including timezone, even though creation accepts a calendar date. Serialized as an ISO timestamp including timezone, even though creation accepts a calendar date.
8845    #[serde(rename = "referenceDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
8846    pub reference_date: Option<chrono::DateTime<chrono::Utc>>,
8847    /// Timestamp when submission was sent
8848    #[serde(rename = "sentDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
8849    pub sent_date: Option<chrono::DateTime<chrono::Utc>>,
8850    /// Server message ID from eXTra service
8851    #[serde(rename = "serverMessageId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8852    pub server_message_id: Option<String>,
8853    /// Local workflow state. Accounts are editable in draft, rejected and response. pending means queued/in progress, not accepted by DRV.
8854    /// Allowed values: `accepted`, `cancelled`, `draft`, `finished`, `pending`, `rejected`, `response`, `sent`.
8855    #[serde(deserialize_with = "crate::lenient::string")]
8856    pub status: String,
8857    /// Title of the submission
8858    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8859    pub title: Option<String>,
8860    /// Reason for transmission (1=audit, 2=software change, 3=provider change)
8861    /// Allowed values: `1`, `2`, `3`.
8862    #[serde(rename = "transmissionReason", deserialize_with = "crate::lenient::number")]
8863    pub transmission_reason: i64,
8864    /// Start year of the delivery period
8865    #[serde(rename = "yearFrom", deserialize_with = "crate::lenient::number")]
8866    pub year_from: i64,
8867    /// End year of the delivery period
8868    #[serde(rename = "yearTo", deserialize_with = "crate::lenient::number")]
8869    pub year_to: i64,
8870    /// Fields not described by the spec, e.g. instance-specific DB fields.
8871    #[serde(flatten)]
8872    pub extra: serde_json::Map<String, serde_json::Value>,
8873}
8874
8875/// An additional account linked to a submission period
8876#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8877pub struct EubpSubmissionAccount {
8878    /// ID of the account
8879    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
8880    pub account_id: i64,
8881    /// Name of the account
8882    #[serde(rename = "accountName", deserialize_with = "crate::lenient::string")]
8883    pub account_name: String,
8884    /// Account number
8885    #[serde(rename = "accountNumber", deserialize_with = "crate::lenient::string")]
8886    pub account_number: String,
8887    /// Submission account ID
8888    #[serde(deserialize_with = "crate::lenient::number")]
8889    pub id: i64,
8890    /// ID of the parent submission period
8891    #[serde(rename = "submissionPeriodId", deserialize_with = "crate::lenient::number")]
8892    pub submission_period_id: i64,
8893    /// Fields not described by the spec, e.g. instance-specific DB fields.
8894    #[serde(flatten)]
8895    pub extra: serde_json::Map<String, serde_json::Value>,
8896}
8897
8898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8899pub struct EubpSubmissionAccountsUpdate {
8900    /// Complete selection by exact keys from the unified account list. \[\] clears optional selections; mandatory/transmitted accounts remain effectively selected.
8901    #[serde(rename = "accountKeys")]
8902    pub account_keys: Vec<String>,
8903    /// Restrict the update to one affected client; omitted/null applies to all clients. A non-participating client results in no changes.
8904    ///
8905    /// `None` leaves the field out, `Some(None)` sends `null`.
8906    #[serde(rename = "clientId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
8907    pub client_id: Option<Option<i64>>,
8908    /// Fields not described by the spec, e.g. instance-specific DB fields.
8909    #[serde(flatten)]
8910    pub extra: serde_json::Map<String, serde_json::Value>,
8911}
8912
8913/// Creates a draft audit submission. The main client needs a treasurer and a business number. An overlapping submission involving any selected client is rejected unless its status is cancelled or rejected. yearFrom must not exceed yearTo.
8914#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8915pub struct EubpSubmissionCreate {
8916    /// Year-to-account-ID mapping for the main client only. Currently non-empty ID lists are rejected by a misplaced Unique validator; use the separate account-selection endpoints after creating the draft.
8917    ///
8918    /// `None` leaves the field out, `Some(None)` sends `null`.
8919    #[serde(rename = "additionalAccountsPerYear", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
8920    pub additional_accounts_per_year: Option<Option<std::collections::BTreeMap<String, Vec<i64>>>>,
8921    /// IDs of finance clients that belong to the audited company and should get their own submission periods. The main clientId is always added automatically. Clients without an accounting period overlapping the requested years are omitted. Included clients must exist and have either no business number or the same number as the main client.
8922    ///
8923    /// `None` leaves the field out, `Some(None)` sends `null`.
8924    #[serde(rename = "affectedClientIds", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
8925    pub affected_client_ids: Option<Option<Vec<i64>>>,
8926    /// ID of the finance client
8927    #[serde(rename = "clientId", deserialize_with = "crate::lenient::number")]
8928    pub client_id: i64,
8929    /// Delivery deadline for the audit data Only retained for transmissionReason=1; cleared for software/provider changes. Only retained for transmissionReason=1; cleared for software/provider changes.
8930    ///
8931    /// `None` leaves the field out, `Some(None)` sends `null`.
8932    #[serde(rename = "deliveryDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
8933    pub delivery_date: Option<Option<chrono::NaiveDate>>,
8934    /// Reference date for the audit (Stichtag der Prüfung) Only retained for transmissionReason=1; cleared for software/provider changes. Only retained for transmissionReason=1; cleared for software/provider changes.
8935    ///
8936    /// `None` leaves the field out, `Some(None)` sends `null`.
8937    #[serde(rename = "referenceDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
8938    pub reference_date: Option<Option<chrono::NaiveDate>>,
8939    /// Title of the submission
8940    ///
8941    /// `None` leaves the field out, `Some(None)` sends `null`.
8942    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
8943    pub title: Option<Option<String>>,
8944    /// Reason for transmission (1=audit, 2=software change, 3=provider change)
8945    /// Allowed values: `1`, `2`, `3`.
8946    #[serde(rename = "transmissionReason", deserialize_with = "crate::lenient::number")]
8947    pub transmission_reason: i64,
8948    /// Start year of the delivery period
8949    #[serde(rename = "yearFrom", deserialize_with = "crate::lenient::number")]
8950    pub year_from: i64,
8951    /// End year of the delivery period
8952    #[serde(rename = "yearTo", deserialize_with = "crate::lenient::number")]
8953    pub year_to: i64,
8954    /// Fields not described by the spec, e.g. instance-specific DB fields.
8955    #[serde(flatten)]
8956    pub extra: serde_json::Map<String, serde_json::Value>,
8957}
8958
8959/// A period (year) within an euBP submission
8960#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8961pub struct EubpSubmissionPeriod {
8962    /// ID of the linked accounting period
8963    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
8964    pub accounting_period_id: Option<i64>,
8965    /// Additional accounts for this period
8966    #[serde(rename = "additionalAccounts")]
8967    pub additional_accounts: Vec<EubpSubmissionAccount>,
8968    /// ID of the finance client this period belongs to
8969    #[serde(rename = "clientId", deserialize_with = "crate::lenient::number")]
8970    pub client_id: i64,
8971    /// File number assigned during export
8972    #[serde(rename = "fileNumber", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
8973    pub file_number: Option<String>,
8974    /// True when an accounting period is linked; this does not imply that any transactions exist.
8975    #[serde(rename = "hasData")]
8976    pub has_data: bool,
8977    /// Submission-period row ID; distinct from accountingPeriodId.
8978    #[serde(deserialize_with = "crate::lenient::number")]
8979    pub id: i64,
8980    /// Marks the final client/year row of the submission, including when that row has no accounting data.
8981    #[serde(rename = "isLast")]
8982    pub is_last: bool,
8983    /// ID of the parent submission
8984    #[serde(rename = "submissionId", deserialize_with = "crate::lenient::number")]
8985    pub submission_id: i64,
8986    /// Account IDs that were transmitted during submission (mandatory + additional accounts)
8987    #[serde(rename = "transmittedAccountIds", default, skip_serializing_if = "Option::is_none")]
8988    pub transmitted_account_ids: Option<Vec<i64>>,
8989    /// Year of this period
8990    #[serde(deserialize_with = "crate::lenient::number")]
8991    pub year: i64,
8992    /// Fields not described by the spec, e.g. instance-specific DB fields.
8993    #[serde(flatten)]
8994    pub extra: serde_json::Map<String, serde_json::Value>,
8995}
8996
8997/// Structural client/year preview and missing-period warnings. This is not a validation of the complete generated transmission file.
8998#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8999pub struct EubpSubmissionPreview {
9000    /// Preview data per period
9001    pub periods: Vec<EubpSubmissionPreviewPeriodsItem>,
9002    /// Validation warnings
9003    pub warnings: Vec<EubpSubmissionPreviewWarningsItem>,
9004    /// Fields not described by the spec, e.g. instance-specific DB fields.
9005    #[serde(flatten)]
9006    pub extra: serde_json::Map<String, serde_json::Value>,
9007}
9008
9009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9010pub struct EubpSubmissionPreviewPeriodsItem {
9011    #[serde(rename = "dateRange")]
9012    pub date_range: EubpSubmissionPreviewPeriodsItemDateRange,
9013    /// Whether an accounting period is linked. Without one, dateRange covers the complete calendar year.
9014    #[serde(rename = "hasData")]
9015    pub has_data: bool,
9016    #[serde(rename = "isLast")]
9017    pub is_last: bool,
9018    #[serde(deserialize_with = "crate::lenient::number")]
9019    pub year: i64,
9020    /// Fields not described by the spec, e.g. instance-specific DB fields.
9021    #[serde(flatten)]
9022    pub extra: serde_json::Map<String, serde_json::Value>,
9023}
9024
9025#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9026pub struct EubpSubmissionPreviewPeriodsItemDateRange {
9027    pub from: chrono::NaiveDate,
9028    pub to: chrono::NaiveDate,
9029    /// Fields not described by the spec, e.g. instance-specific DB fields.
9030    #[serde(flatten)]
9031    pub extra: serde_json::Map<String, serde_json::Value>,
9032}
9033
9034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9035pub struct EubpSubmissionPreviewWarningsItem {
9036    /// Localized warning text.
9037    #[serde(deserialize_with = "crate::lenient::string")]
9038    pub message: String,
9039    /// Allowed values: `info`.
9040    #[serde(deserialize_with = "crate::lenient::string")]
9041    pub severity: String,
9042    /// Allowed values: `missing_accounting_period`.
9043    #[serde(deserialize_with = "crate::lenient::string")]
9044    pub r#type: String,
9045    /// Years without a linked accounting period. A year can occur more than once for different clients.
9046    pub years: Vec<i64>,
9047    /// Fields not described by the spec, e.g. instance-specific DB fields.
9048    #[serde(flatten)]
9049    pub extra: serde_json::Map<String, serde_json::Value>,
9050}
9051
9052/// Accounts merged across selected client/year rows by exact number|name. Only accounts with bookings are listed; fields that differ by year/client are combined.
9053#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9054pub struct EubpUnifiedAccount {
9055    /// Account-group name of the first encountered merged account; other years/clients can have different groups.
9056    #[serde(rename = "accountGroupName", deserialize_with = "crate::lenient::string")]
9057    pub account_group_name: String,
9058    /// Whether this is a donation account True when true for at least one merged account. True when true for at least one merged account.
9059    #[serde(rename = "isDonationAccount")]
9060    pub is_donation_account: bool,
9061    /// Opaque selection key composed of account number, a vertical bar and account name. Reuse the returned key exactly.
9062    #[serde(deserialize_with = "crate::lenient::string")]
9063    pub key: String,
9064    /// Whether this account is mandatory for euBP True when true for at least one merged account. True when true for at least one merged account.
9065    pub mandatory: bool,
9066    /// Account name
9067    #[serde(deserialize_with = "crate::lenient::string")]
9068    pub name: String,
9069    /// Account number
9070    #[serde(deserialize_with = "crate::lenient::string")]
9071    pub number: String,
9072    /// True if at least one merged account is mandatory, already transmitted or additionally selected.
9073    pub selected: bool,
9074    /// Whether this account was already transmitted True when true for at least one merged account. True when true for at least one merged account.
9075    pub transmitted: bool,
9076    /// Years in which this account has bookings
9077    pub years: Vec<i64>,
9078    /// Fields not described by the spec, e.g. instance-specific DB fields.
9079    #[serde(flatten)]
9080    pub extra: serde_json::Map<String, serde_json::Value>,
9081}
9082
9083/// Event classification returned by the configured Evangelische Termine server. Keys and labels are supplied by that server and are not a fixed ChurchTools enum.
9084#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9085pub struct EvangelischeTermineEventType {
9086    /// External event-type identifier to use in integration settings.
9087    #[serde(deserialize_with = "crate::lenient::string")]
9088    pub key: String,
9089    /// Display label supplied by Evangelische Termine.
9090    #[serde(deserialize_with = "crate::lenient::string")]
9091    pub value: String,
9092    /// Fields not described by the spec, e.g. instance-specific DB fields.
9093    #[serde(flatten)]
9094    pub extra: serde_json::Map<String, serde_json::Value>,
9095}
9096
9097/// Connection settings to test against Evangelische Termine. Testing these values does not save settings or enable synchronization.
9098#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9099pub struct EvangelischeTermineSettingsValidateCreate {
9100    /// SOAP API key for the organizer. The literal value ***** reuses the API key already stored in ChurchTools. The supplied URL and organizer ID are still used for this check.
9101    #[serde(rename = "apiKey", deserialize_with = "crate::lenient::string")]
9102    pub api_key: String,
9103    /// Base URL of the Evangelische Termine installation, without /soap or /soap?WSDL. Leading/trailing whitespace and a trailing slash are normalized; a hostname without a scheme uses HTTPS. The client validates the target URL before connecting.
9104    #[serde(deserialize_with = "crate::lenient::string")]
9105    pub url: String,
9106    /// External organizer identifier (Veranstalter-ID). Send it as a string, even when it contains only digits.
9107    #[serde(deserialize_with = "crate::lenient::string")]
9108    pub vid: String,
9109    /// Fields not described by the spec, e.g. instance-specific DB fields.
9110    #[serde(flatten)]
9111    pub extra: serde_json::Map<String, serde_json::Value>,
9112}
9113
9114/// An occurrence in service planning linked to a calendar appointment. id identifies the planning event, appointmentId the underlying appointment (possibly a recurring series). This enriched read representation differs from the response to PUT /events/{eventId}.
9115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9116pub struct Event {
9117    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::string")]
9118    pub deprecated: String,
9119    #[serde(rename = "adminIds")]
9120    pub admin_ids: Vec<i64>,
9121    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::number")]
9122    pub appointment_id: i64,
9123    /// Calendar as Domain Object
9124    pub calendar: DomainObjectCalendar,
9125    /// Room lifecycle status. `STARTING` awaits confirmation from the central chat service.
9126    /// Allowed values: `NOT_STARTED`, `STARTED`, `STARTING`, `STOPPED`.
9127    #[serde(rename = "chatStatus", deserialize_with = "crate::lenient::string")]
9128    pub chat_status: String,
9129    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9130    pub description: Option<String>,
9131    /// End derived by adding the underlying appointment duration to this event occurrence’s start.
9132    #[serde(rename = "endDate", serialize_with = "crate::datetime::serialize_utc")]
9133    pub end_date: chrono::DateTime<chrono::Utc>,
9134    #[serde(rename = "eventAdminIds", default, skip_serializing_if = "Option::is_none")]
9135    #[deprecated = "deprecated in the ChurchTools API"]
9136    pub event_admin_ids: Option<Vec<i64>>,
9137    #[serde(rename = "eventFiles")]
9138    pub event_files: Vec<DomainObjectFile>,
9139    /// Assignments included by include=eventServices (legacy spelling). Always included by single-event and person-event reads.
9140    #[serde(rename = "eventServices", default, skip_serializing_if = "Option::is_none")]
9141    pub event_services_2: Option<Vec<ServiceRequest>>,
9142    /// Assignments included by include=event_services. The property spelling follows the requested include.
9143    #[serde(default, skip_serializing_if = "Option::is_none")]
9144    pub event_services: Option<Vec<ServiceRequest>>,
9145    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9146    pub guid: Option<String>,
9147    #[serde(deserialize_with = "crate::lenient::number")]
9148    pub id: i64,
9149    #[serde(rename = "isCanceled")]
9150    pub is_canceled: bool,
9151    #[serde(deserialize_with = "crate::lenient::string")]
9152    pub name: String,
9153    /// Deprecated alias for description.
9154    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9155    #[deprecated = "deprecated in the ChurchTools API"]
9156    pub note: Option<String>,
9157    /// Computed UI permissions. startChat does not include all installation-level chat prerequisites; the chat action performs its own authorization checks.
9158    pub permissions: EventPermissions,
9159    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
9160    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
9161    pub start_date: chrono::DateTime<chrono::Utc>,
9162    /// Fields not described by the spec, e.g. instance-specific DB fields.
9163    #[serde(flatten)]
9164    pub extra: serde_json::Map<String, serde_json::Value>,
9165}
9166
9167/// Change chat activation for an event, optionally sending invitation emails.
9168#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9169pub struct EventChatUpdate {
9170    /// `true` starts or reactivates the event chat; `false` stops an existing chat.
9171    pub enabled: bool,
9172    /// Send invitations to eligible event participants who cannot chat yet. This is independent of enabled: `true` can also send invitations when stopping the chat. Repeated requests can send invitations again.
9173    #[serde(rename = "triggerChatInviteMail", default, skip_serializing_if = "Option::is_none")]
9174    pub trigger_chat_invite_mail: Option<bool>,
9175    /// Fields not described by the spec, e.g. instance-specific DB fields.
9176    #[serde(flatten)]
9177    pub extra: serde_json::Map<String, serde_json::Value>,
9178}
9179
9180/// Update the event description, administrators and cancellation state. Event dates, the calendar appointment and service assignments are managed through their respective endpoints.
9181#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9182pub struct EventDetailsUpdate {
9183    /// Replace the administrator list. A change to the set of IDs additionally requires the "edit masterdata" permission for the service planning domain.
9184    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
9185    pub admin_ids: Option<Vec<i64>>,
9186    /// Event description.
9187    ///
9188    /// `None` leaves the field out, `Some(None)` sends `null`.
9189    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
9190    pub description: Option<Option<String>>,
9191    /// Legacy input alias for `adminIds`.
9192    #[serde(rename = "eventAdminIds", default, skip_serializing_if = "Option::is_none")]
9193    #[deprecated = "deprecated in the ChurchTools API"]
9194    pub event_admin_ids: Option<Vec<i64>>,
9195    /// Whether the service-planning event is cancelled.
9196    #[serde(rename = "isCanceled", default, skip_serializing_if = "Option::is_none")]
9197    pub is_canceled: Option<bool>,
9198    /// Deprecated alias for `description`.
9199    ///
9200    /// `None` leaves the field out, `Some(None)` sends `null`.
9201    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
9202    #[deprecated = "deprecated in the ChurchTools API"]
9203    pub note: Option<Option<String>>,
9204    /// Fields not described by the spec, e.g. instance-specific DB fields.
9205    #[serde(flatten)]
9206    pub extra: serde_json::Map<String, serde_json::Value>,
9207}
9208
9209/// Result of updating event details. This differs from the enriched event read response: it contains the stored appointment, description, administrators and cancellation flag, without services, event startDate or meta.
9210#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9211pub struct EventDetailsUpdateResult {
9212    /// Stored administrator IDs.
9213    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
9214    pub admin_ids: Option<Vec<serde_json::Value>>,
9215    /// Stored calendar appointment, including its recurrence definition. This is not an occurrence-specific appointment projection.
9216    pub appointment: EventDetailsUpdateResultAppointment,
9217    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9218    pub description: Option<String>,
9219    /// Event GUID, or `null` for a legacy record without one.
9220    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9221    pub guid: Option<String>,
9222    #[serde(deserialize_with = "crate::lenient::number")]
9223    pub id: i64,
9224    #[serde(rename = "isCanceled")]
9225    pub is_canceled: bool,
9226    /// Deprecated alias for `description`.
9227    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9228    #[deprecated = "deprecated in the ChurchTools API"]
9229    pub note: Option<String>,
9230    /// Fields not described by the spec, e.g. instance-specific DB fields.
9231    #[serde(flatten)]
9232    pub extra: serde_json::Map<String, serde_json::Value>,
9233}
9234
9235/// Stored calendar appointment, including its recurrence definition. This is not an occurrence-specific appointment projection.
9236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9237pub struct EventDetailsUpdateResultAppointment {
9238    pub additionals: Vec<AppointmentAdditionals>,
9239    /// Use 'additionals' instead
9240    #[serde(default, skip_serializing_if = "Option::is_none")]
9241    #[deprecated = "Use 'additionals' instead"]
9242    pub additions: Option<Vec<AppointmentAdditionals>>,
9243    #[serde(default, skip_serializing_if = "Option::is_none")]
9244    pub address: Option<Address>,
9245    /// True when the appointment is all-day. The serialized endDate is inclusive.
9246    #[serde(rename = "allDay")]
9247    pub all_day: bool,
9248    /// Calendar containing the appointment.
9249    pub calendar: AppointmentBaseCalendar,
9250    /// Use 'title' instead
9251    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9252    #[deprecated = "Use 'title' instead"]
9253    pub caption: Option<String>,
9254    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9255    pub description: Option<String>,
9256    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
9257    #[serde(rename = "endDate")]
9258    pub end_date: crate::DateOrDateTime,
9259    pub exceptions: Vec<AppointmentExeptions>,
9260    /// ID of the stored appointment or series.
9261    #[serde(deserialize_with = "crate::lenient::number")]
9262    pub id: i64,
9263    #[serde(default, skip_serializing_if = "Option::is_none")]
9264    pub image: Option<Image>,
9265    /// Use 'description' instead
9266    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9267    #[deprecated = "Use 'description' instead"]
9268    pub information: Option<String>,
9269    #[serde(rename = "isInternal")]
9270    pub is_internal: bool,
9271    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9272    pub link: Option<String>,
9273    pub meta: MetaDataEntityId,
9274    /// Use 'subtitle' instead
9275    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9276    #[deprecated = "Use 'subtitle' instead"]
9277    pub note: Option<String>,
9278    /// Person on whose behalf the appointment was entered, or null.
9279    #[serde(rename = "onBehalfOfPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9280    pub on_behalf_of_pid: Option<i64>,
9281    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
9282    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9283    pub repeat_frequency: Option<i64>,
9284    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
9285    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
9286    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
9287    pub repeat_id: i64,
9288    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
9289    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9290    pub repeat_option: Option<i64>,
9291    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
9292    #[serde(rename = "repeatUntil", default, skip_serializing_if = "Option::is_none")]
9293    pub repeat_until: Option<chrono::NaiveDate>,
9294    /// Registration-group configuration, or null if the appointment has none.
9295    #[serde(default, skip_serializing_if = "Option::is_none")]
9296    pub signup: Option<AppointmentSignup>,
9297    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
9298    #[serde(rename = "startDate")]
9299    pub start_date: crate::DateOrDateTime,
9300    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9301    pub subtitle: Option<String>,
9302    #[serde(deserialize_with = "crate::lenient::string")]
9303    pub title: String,
9304    /// Revision counter increased by updates; not an input precondition or a per-occurrence ID.
9305    #[serde(deserialize_with = "crate::lenient::number")]
9306    pub version: i64,
9307    /// Fields not described by the spec, e.g. instance-specific DB fields.
9308    #[serde(flatten)]
9309    pub extra: serde_json::Map<String, serde_json::Value>,
9310}
9311
9312/// A fact definition describes a metric or selection (for example attendance or service type). An event fact stores one value for that definition on a service-planning event. `eventId` identifies the event, not its calendar appointment; `factId` identifies the reusable definition from /facts. Values are returned as numbers for numeric facts and strings for select facts. Definitions and events are referenced by ID, not embedded.
9313#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9314pub struct EventFact {
9315    /// Legacy response marker identifying the metadata replacements.
9316    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::string")]
9317    pub deprecated: String,
9318    /// Service-planning event ID. This is not the calendar appointment ID.
9319    #[serde(rename = "eventId", deserialize_with = "crate::lenient::number")]
9320    pub event_id: i64,
9321    /// ID of the fact definition from /facts; the same `factId` can have different values on different events.
9322    #[serde(rename = "factId", deserialize_with = "crate::lenient::number")]
9323    pub fact_id: i64,
9324    pub meta: MetaDataEntityId,
9325    /// Last modification timestamp.
9326    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
9327    #[deprecated = "deprecated in the ChurchTools API"]
9328    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
9329    /// ID of the person who last modified the value.
9330    #[serde(rename = "modifiedPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9331    #[deprecated = "deprecated in the ChurchTools API"]
9332    pub modified_pid: Option<i64>,
9333    /// Numeric facts are serialized as JSON numbers, select facts as their stored option text. A legacy empty stored value is returned as `null`; new values cannot be `null`.
9334    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
9335    pub value: serde_json::Value,
9336    /// Fields not described by the spec, e.g. instance-specific DB fields.
9337    #[serde(flatten)]
9338    pub extra: serde_json::Map<String, serde_json::Value>,
9339}
9340
9341/// Calendar selection and optional event-start date range for a facts export. For a complete calendar month, use its first day as from and the first day of the next month as to.
9342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9343pub struct EventFactExportCreate {
9344    /// Calendars containing the appointments linked to the service-planning events. Only events visible to the current user are exported.
9345    pub calendar_ids: Vec<i64>,
9346    /// Inclusive lower bound for the event start date in the installation’s timezone.
9347    #[serde(default, skip_serializing_if = "Option::is_none")]
9348    pub from: Option<chrono::NaiveDate>,
9349    /// Exclusive upper bound for the event start date in the installation’s timezone. Must be later than from when both are supplied.
9350    #[serde(default, skip_serializing_if = "Option::is_none")]
9351    pub to: Option<chrono::NaiveDate>,
9352    /// Fields not described by the spec, e.g. instance-specific DB fields.
9353    #[serde(flatten)]
9354    pub extra: serde_json::Map<String, serde_json::Value>,
9355}
9356
9357/// Replaces the value of an event fact, or creates it if none is stored yet. The same validation applies to creation and replacement.
9358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9359pub struct EventFactUpdate {
9360    /// For numeric facts, prefer a JSON number. For select facts, send the configured option text from /facts/{id}.
9361    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
9362    pub value: serde_json::Value,
9363    /// Fields not described by the spec, e.g. instance-specific DB fields.
9364    #[serde(flatten)]
9365    pub extra: serde_json::Map<String, serde_json::Value>,
9366}
9367
9368/// Message and selected recipients for an event email. This creates a send operation, not a stored event or agenda.
9369#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9370pub struct EventMailCreate {
9371    /// HTML email body. ChurchTools appends buttons for all supplied events and any requested, available agenda and file links.
9372    #[serde(deserialize_with = "crate::lenient::string")]
9373    pub body: String,
9374    /// Events used to resolve participating recipients and message links. Every supplied event must exist. Events are not required to share an agenda.
9375    #[serde(rename = "eventIds")]
9376    pub event_ids: Vec<i64>,
9377    /// Selected person IDs. Only selected participants in visible service groups of the loaded events, or selected people the sender may otherwise view, receive the message. The response reports other IDs as rejected. Participants are not added automatically.
9378    pub recipients: Vec<i64>,
9379    /// Also include the currently logged-in person as a recipient, even if their ID is absent from recipients.
9380    #[serde(rename = "sendCopyToMe", default, skip_serializing_if = "Option::is_none")]
9381    pub send_copy_to_me: Option<bool>,
9382    /// Email subject.
9383    #[serde(deserialize_with = "crate::lenient::string")]
9384    pub subject: String,
9385    /// Append links for supplied events that have an agenda and for whose calendar the sender has "view agenda" permission.
9386    #[serde(rename = "appendAgendaButton")]
9387    pub append_agenda_button: bool,
9388    /// File IDs to list as links in the message body. Only files associated with one of the supplied events are used. These are links, not binary email attachments.
9389    pub files: Vec<i64>,
9390    /// Fields not described by the spec, e.g. instance-specific DB fields.
9391    #[serde(flatten)]
9392    pub extra: serde_json::Map<String, serde_json::Value>,
9393}
9394
9395/// Effective scope of an event email queue operation.
9396#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9397pub struct EventMailSendResult {
9398    /// Supplied event IDs for which an agenda button was included. An empty array means no requested agenda button could be included.
9399    #[serde(rename = "agendaEventIds")]
9400    pub agenda_event_ids: Vec<i64>,
9401    /// Requested file IDs included as links in the message.
9402    #[serde(rename = "includedFileIds")]
9403    pub included_file_ids: Vec<i64>,
9404    /// Requested person IDs rejected by visibility rules.
9405    #[serde(rename = "rejectedRecipientIds")]
9406    pub rejected_recipient_ids: Vec<i64>,
9407    /// Person IDs whose messages were accepted by the mail queue, including the sender when `sendCopyToMe` added them. Queue acceptance does not confirm delivery.
9408    #[serde(rename = "sentRecipientIds")]
9409    pub sent_recipient_ids: Vec<i64>,
9410    /// Fields not described by the spec, e.g. instance-specific DB fields.
9411    #[serde(flatten)]
9412    pub extra: serde_json::Map<String, serde_json::Value>,
9413}
9414
9415/// Reference records used by the Event module. IDs in assignments, event facts and song arrangements refer to these configurable records. Their names and IDs are installation-specific, not enums.
9416#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9417pub struct EventMasterData {
9418    /// Configured reasons for absences, such as holidays or illness. Referenced by absence records.
9419    #[serde(rename = "absenceReasons")]
9420    pub absence_reasons: Vec<AbsenceReason>,
9421    /// Definitions of event facts, such as attendance or collection totals. These are field definitions, not the values recorded for an event.
9422    pub facts: Vec<serde_json::Value>,
9423    /// Service groups organize related roles, such as music or technical teams. A service refers to its group through `serviceGroupId`.
9424    #[serde(rename = "serviceGroups")]
9425    pub service_groups: Vec<ServiceGroup>,
9426    /// Service-role definitions, such as worship leader or sound operator. A role is distinct from a person's assignment to that role at an event.
9427    pub services: Vec<Service>,
9428    /// Categories used to organize songs. Song records refer to these categories.
9429    #[serde(rename = "songCategories")]
9430    pub song_categories: Vec<SongCategory>,
9431    /// Sources used by song arrangements, such as hymnals or song collections.
9432    #[serde(rename = "songSources")]
9433    pub song_sources: Vec<SongSource>,
9434    /// Fields not described by the spec, e.g. instance-specific DB fields.
9435    #[serde(flatten)]
9436    pub extra: serde_json::Map<String, serde_json::Value>,
9437}
9438
9439/// Computed UI permissions. startChat does not include all installation-level chat prerequisites; the chat action performs its own authorization checks.
9440#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9441pub struct EventPermissions {
9442    #[serde(rename = "startChat")]
9443    pub start_chat: bool,
9444    #[serde(rename = "useChat")]
9445    pub use_chat: bool,
9446    /// Fields not described by the spec, e.g. instance-specific DB fields.
9447    #[serde(flatten)]
9448    pub extra: serde_json::Map<String, serde_json::Value>,
9449}
9450
9451/// Enriched event with the eventServices include always present, possibly as an empty list.
9452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9453pub struct EventReadWithServices {
9454    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::string")]
9455    pub deprecated: String,
9456    #[serde(rename = "adminIds")]
9457    pub admin_ids: Vec<i64>,
9458    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::number")]
9459    pub appointment_id: i64,
9460    /// Calendar as Domain Object
9461    pub calendar: DomainObjectCalendar,
9462    /// Room lifecycle status. `STARTING` awaits confirmation from the central chat service.
9463    /// Allowed values: `NOT_STARTED`, `STARTED`, `STARTING`, `STOPPED`.
9464    #[serde(rename = "chatStatus", deserialize_with = "crate::lenient::string")]
9465    pub chat_status: String,
9466    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9467    pub description: Option<String>,
9468    /// End derived by adding the underlying appointment duration to this event occurrence’s start.
9469    #[serde(rename = "endDate", serialize_with = "crate::datetime::serialize_utc")]
9470    pub end_date: chrono::DateTime<chrono::Utc>,
9471    #[serde(rename = "eventAdminIds", default, skip_serializing_if = "Option::is_none")]
9472    #[deprecated = "deprecated in the ChurchTools API"]
9473    pub event_admin_ids: Option<Vec<i64>>,
9474    #[serde(rename = "eventFiles")]
9475    pub event_files: Vec<DomainObjectFile>,
9476    /// Assignments included by include=eventServices (legacy spelling). Always included by single-event and person-event reads.
9477    #[serde(rename = "eventServices", default, skip_serializing_if = "Option::is_none")]
9478    pub event_services_2: Option<Vec<ServiceRequest>>,
9479    /// Assignments included by include=event_services. The property spelling follows the requested include.
9480    #[serde(default, skip_serializing_if = "Option::is_none")]
9481    pub event_services: Option<Vec<ServiceRequest>>,
9482    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9483    pub guid: Option<String>,
9484    #[serde(deserialize_with = "crate::lenient::number")]
9485    pub id: i64,
9486    #[serde(rename = "isCanceled")]
9487    pub is_canceled: bool,
9488    #[serde(deserialize_with = "crate::lenient::string")]
9489    pub name: String,
9490    /// Deprecated alias for description.
9491    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9492    #[deprecated = "deprecated in the ChurchTools API"]
9493    pub note: Option<String>,
9494    /// Computed UI permissions. startChat does not include all installation-level chat prerequisites; the chat action performs its own authorization checks.
9495    pub permissions: EventPermissions,
9496    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
9497    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
9498    pub start_date: chrono::DateTime<chrono::Utc>,
9499    /// Fields not described by the spec, e.g. instance-specific DB fields.
9500    #[serde(flatten)]
9501    pub extra: serde_json::Map<String, serde_json::Value>,
9502}
9503
9504#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9505pub struct EventService {
9506    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
9507    pub deprecated: Option<std::collections::BTreeMap<String, String>>,
9508    /// Use `isAccepted` instead
9509    #[serde(default, skip_serializing_if = "Option::is_none")]
9510    #[deprecated = "Use `isAccepted` instead"]
9511    pub agreed: Option<bool>,
9512    #[serde(rename = "allowChat", default, skip_serializing_if = "Option::is_none")]
9513    pub allow_chat: Option<bool>,
9514    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9515    pub comment: Option<String>,
9516    /// Use `index` instead
9517    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9518    #[deprecated = "Use `index` instead"]
9519    pub counter: Option<i64>,
9520    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
9521    pub event: serde_json::Value,
9522    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9523    pub id: Option<i64>,
9524    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9525    pub index: Option<i64>,
9526    #[serde(rename = "isAccepted", default, skip_serializing_if = "Option::is_none")]
9527    pub is_accepted: Option<bool>,
9528    #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")]
9529    pub is_valid: Option<bool>,
9530    #[serde(default, skip_serializing_if = "Option::is_none")]
9531    pub meta: Option<MetaDataEntityId>,
9532    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9533    pub name: Option<String>,
9534    #[serde(default, skip_serializing_if = "Option::is_none")]
9535    pub permissions: Option<EventServicePermissions>,
9536    #[serde(default, skip_serializing_if = "Option::is_none")]
9537    pub person: Option<DomainObjectPerson>,
9538    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9539    #[deprecated = "deprecated in the ChurchTools API"]
9540    pub person_id: Option<i64>,
9541    /// Deprecated alias for `meta.modifiedDate`.
9542    #[serde(rename = "requestedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
9543    #[deprecated = "deprecated in the ChurchTools API"]
9544    pub requested_date: Option<chrono::DateTime<chrono::Utc>>,
9545    #[serde(rename = "requesterPerson", default, skip_serializing_if = "Option::is_none")]
9546    pub requester_person: Option<DomainObjectPerson>,
9547    #[serde(rename = "requesterPersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9548    #[deprecated = "deprecated in the ChurchTools API"]
9549    pub requester_person_id: Option<i64>,
9550    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9551    pub service_id: Option<i64>,
9552    #[serde(rename = "serviceName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9553    pub service_name: Option<String>,
9554    /// Fields not described by the spec, e.g. instance-specific DB fields.
9555    #[serde(flatten)]
9556    pub extra: serde_json::Map<String, serde_json::Value>,
9557}
9558
9559#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9560pub struct EventServiceCountUpdate {
9561    /// Desired total number of active slots for this service, including occupied slots. Use 0 to remove all slots, which succeeds only when all are unassigned.
9562    #[serde(deserialize_with = "crate::lenient::number")]
9563    pub count: i64,
9564    /// ID of the reusable service role from /services.
9565    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
9566    pub service_id: i64,
9567    /// Fields not described by the spec, e.g. instance-specific DB fields.
9568    #[serde(flatten)]
9569    pub extra: serde_json::Map<String, serde_json::Value>,
9570}
9571
9572#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9573pub struct EventServiceEventVariant2 {
9574    #[serde(deserialize_with = "crate::lenient::number")]
9575    pub id: i64,
9576    #[serde(deserialize_with = "crate::lenient::string")]
9577    pub name: String,
9578    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
9579    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
9580    pub start_date: chrono::DateTime<chrono::Utc>,
9581    /// Fields not described by the spec, e.g. instance-specific DB fields.
9582    #[serde(flatten)]
9583    pub extra: serde_json::Map<String, serde_json::Value>,
9584}
9585
9586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9587pub struct EventServicePermissions {
9588    #[serde(rename = "enterSelfIfFree", default, skip_serializing_if = "Option::is_none")]
9589    pub enter_self_if_free: Option<bool>,
9590    /// Fields not described by the spec, e.g. instance-specific DB fields.
9591    #[serde(flatten)]
9592    pub extra: serde_json::Map<String, serde_json::Value>,
9593}
9594
9595/// Change the number of service slots in one event.
9596#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9597pub struct EventServicesUpdate {
9598    /// Desired counts for the listed services only. An empty array makes no changes. Supply each `serviceId` once: entries are processed against the initial slot snapshot, so repeated IDs do not represent successive updates.
9599    pub services: Vec<EventServiceCountUpdate>,
9600    /// Fields not described by the spec, e.g. instance-specific DB fields.
9601    #[serde(flatten)]
9602    pub extra: serde_json::Map<String, serde_json::Value>,
9603}
9604
9605/// This is separate from a calendar appointment template. When creating an event for an appointment with eventTemplateId, the current event-creation service copies description, `adminIds`, service slot counts and facts. The appointment and supplied startDate determine the new event’s appointment and time; the remaining scheduling fields are template metadata for clients.
9606#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9607pub struct EventTemplate {
9608    /// Database storage can return numeric IDs as strings. `null` means no stored administrator list.
9609    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
9610    pub admin_ids: Option<Vec<serde_json::Value>>,
9611    /// Default calendar ID; `null` when no default is stored.
9612    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9613    pub calendar_id: Option<i64>,
9614    /// Empty text is converted to `null` when the event is created from this template.
9615    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9616    pub description: Option<String>,
9617    /// Default duration in seconds, not minutes.
9618    #[serde(rename = "durationInSeconds", deserialize_with = "crate::lenient::number")]
9619    pub duration_in_seconds: i64,
9620    /// Proposed event name; `null` when no default is stored.
9621    #[serde(rename = "eventName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9622    pub event_name: Option<String>,
9623    /// Default recorded values keyed by fact definition ID from /facts.
9624    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
9625    pub facts: serde_json::Value,
9626    /// Default local start hour; `null` when no default is stored.
9627    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9628    pub hour: Option<i64>,
9629    /// ID to use as eventTemplateId when creating an event for a calendar appointment.
9630    #[serde(deserialize_with = "crate::lenient::number")]
9631    pub id: i64,
9632    /// Default local start minute; `null` when no default is stored.
9633    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9634    pub minute: Option<i64>,
9635    /// Deprecated alias for description.
9636    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9637    #[deprecated = "deprecated in the ChurchTools API"]
9638    pub note: Option<String>,
9639    /// Service roles and their requested slot counts; an empty list is allowed.
9640    pub services: Vec<EventTemplateService>,
9641    /// Template display order. This endpoint sorts by `sortKey` ascending.
9642    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
9643    pub sort_key: i64,
9644    /// Name of the reusable template, distinct from the proposed event name.
9645    #[serde(rename = "templateName", deserialize_with = "crate::lenient::string")]
9646    pub template_name: String,
9647    /// Fields not described by the spec, e.g. instance-specific DB fields.
9648    #[serde(flatten)]
9649    pub extra: serde_json::Map<String, serde_json::Value>,
9650}
9651
9652#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9653pub struct EventTemplateService {
9654    /// Number of unassigned slots to create for this service role when applying the template.
9655    #[serde(deserialize_with = "crate::lenient::number")]
9656    pub count: i64,
9657    /// ID of the reusable service role from /services.
9658    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
9659    pub service_id: i64,
9660    /// Fields not described by the spec, e.g. instance-specific DB fields.
9661    #[serde(flatten)]
9662    pub extra: serde_json::Map<String, serde_json::Value>,
9663}
9664
9665/// Sanitized provider configuration returned to settings administrators. OAuth/OIDC client secrets and SAML SP private keys are not included.
9666#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9667pub struct ExternalLogin {
9668    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
9669    pub config: serde_json::Value,
9670    /// Whether the login flow may create a ChurchTools person when no local identity mapping exists. The matching mode controls whether this happens automatically or requires an explicit choice.
9671    #[serde(rename = "createNewPerson")]
9672    pub create_new_person: bool,
9673    /// Whether the external provider offers a registration flow; support depends on the protocol handler.
9674    #[serde(rename = "hasRegistration")]
9675    pub has_registration: bool,
9676    /// Whether this provider is listed among available SSO login choices. Hiding it is not the same as deleting its configuration or mappings.
9677    #[serde(rename = "isVisible")]
9678    pub is_visible: bool,
9679    /// Determines how an authenticated external identity without an existing person mapping is handled. Auto-match mode uses automatic name-and-email matching and optional person creation. Verified mode asks the user to either prove ownership of a local account or, when `createNewPerson` is enabled, explicitly create a person. Pre-provisioned mode rejects identities without a mapping.
9680    /// Allowed values: `auto_match`, `preprovisioned_only`, `verified_user_linking`.
9681    #[serde(rename = "matchingMode", deserialize_with = "crate::lenient::string")]
9682    pub matching_mode: String,
9683    /// Display name shown for this provider.
9684    #[serde(deserialize_with = "crate::lenient::string")]
9685    pub name: String,
9686    /// Default campus ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
9687    #[serde(rename = "newPersonCampusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9688    pub new_person_campus_id: Option<i64>,
9689    /// Default department ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
9690    #[serde(rename = "newPersonDepartmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9691    pub new_person_department_id: Option<i64>,
9692    /// Default person status ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
9693    #[serde(rename = "newPersonStatusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9694    pub new_person_status_id: Option<i64>,
9695    /// Marks the preferred external login. At most one provider may have this flag; choosing a second primary provider is rejected rather than automatically demoting the first.
9696    #[serde(rename = "primaryLogin")]
9697    pub primary_login: bool,
9698    /// Secondary text on the login choice.
9699    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9700    pub subtitle: Option<String>,
9701    /// Configured login protocol.
9702    /// Allowed values: `oauth`, `oidc`, `saml`.
9703    #[serde(deserialize_with = "crate::lenient::string")]
9704    pub r#type: String,
9705    /// Whether existing person data is updated from provider data after successful matching.
9706    #[serde(rename = "updateDataOnLogin")]
9707    pub update_data_on_login: bool,
9708    /// Provider configuration ID used in management and protocol URLs.
9709    #[serde(deserialize_with = "crate::lenient::number")]
9710    pub id: i64,
9711    /// Resolved provider logo URL, or null if unavailable.
9712    #[serde(rename = "logoUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9713    pub logo_url: Option<String>,
9714    /// Fields not described by the spec, e.g. instance-specific DB fields.
9715    #[serde(flatten)]
9716    pub extra: serde_json::Map<String, serde_json::Value>,
9717}
9718
9719/// Browser-session-bound authorization request. Retain the session cookie, open url in that browser session and let the provider redirect to the callback.
9720#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9721pub struct ExternalLoginAuthorizationStart {
9722    /// Pending authorization expiry as Unix epoch seconds; normally 600 seconds after creation.
9723    #[serde(rename = "expiresAt", deserialize_with = "crate::lenient::number")]
9724    pub expires_at: i64,
9725    /// Opaque, single-use authorization state. Do not reuse it or substitute another browser session.
9726    #[serde(deserialize_with = "crate::lenient::string")]
9727    pub state: String,
9728    /// Provider authorization URL including state, nonce and the PKCE challenge.
9729    #[serde(deserialize_with = "crate::lenient::string")]
9730    pub url: String,
9731    /// Fields not described by the spec, e.g. instance-specific DB fields.
9732    #[serde(flatten)]
9733    pub extra: serde_json::Map<String, serde_json::Value>,
9734}
9735
9736/// Creates an external login provider. SAML configuration requires the SAML settings feature flag.
9737#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9738pub struct ExternalLoginCreate {
9739    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
9740    pub config: serde_json::Value,
9741    /// Whether the login flow may create a ChurchTools person when no local identity mapping exists. The matching mode controls whether this happens automatically or requires an explicit choice.
9742    #[serde(rename = "createNewPerson")]
9743    pub create_new_person: bool,
9744    /// Whether the external provider offers a registration flow; support depends on the protocol handler.
9745    #[serde(rename = "hasRegistration")]
9746    pub has_registration: bool,
9747    #[serde(rename = "isVisible", default, skip_serializing_if = "Option::is_none")]
9748    pub is_visible: Option<bool>,
9749    /// Determines how an authenticated external identity without an existing person mapping is handled. Auto-match mode uses automatic name-and-email matching and optional person creation. Verified mode asks the user to either prove ownership of a local account or, when `createNewPerson` is enabled, explicitly create a person. Pre-provisioned mode rejects identities without a mapping.
9750    /// Allowed values: `auto_match`, `preprovisioned_only`, `verified_user_linking`.
9751    #[serde(rename = "matchingMode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9752    pub matching_mode: Option<String>,
9753    /// Display name shown for this provider.
9754    #[serde(deserialize_with = "crate::lenient::string")]
9755    pub name: String,
9756    /// Default campus ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
9757    #[serde(rename = "newPersonCampusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9758    pub new_person_campus_id: Option<i64>,
9759    /// Default department ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
9760    #[serde(rename = "newPersonDepartmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9761    pub new_person_department_id: Option<i64>,
9762    /// Default person status ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
9763    #[serde(rename = "newPersonStatusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9764    pub new_person_status_id: Option<i64>,
9765    #[serde(rename = "primaryLogin", default, skip_serializing_if = "Option::is_none")]
9766    pub primary_login: Option<bool>,
9767    /// Secondary text on the login choice.
9768    ///
9769    /// `None` leaves the field out, `Some(None)` sends `null`.
9770    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
9771    pub subtitle: Option<Option<String>>,
9772    /// Configured login protocol.
9773    /// Allowed values: `oauth`, `oidc`, `saml`.
9774    #[serde(deserialize_with = "crate::lenient::string")]
9775    pub r#type: String,
9776    /// Whether existing person data is updated from provider data after successful matching.
9777    #[serde(rename = "updateDataOnLogin")]
9778    pub update_data_on_login: bool,
9779    /// Fields not described by the spec, e.g. instance-specific DB fields.
9780    #[serde(flatten)]
9781    pub extra: serde_json::Map<String, serde_json::Value>,
9782}
9783
9784/// Credentials used to prove ownership of a local account for a pending external identity. The token must originate from the preceding external login in the same browser session.
9785#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9786pub struct ExternalLoginLinkCreate {
9787    /// Opaque, session-bound linking token from the account-linking redirect. Expires 600 seconds after creation.
9788    #[serde(rename = "linkToken", deserialize_with = "crate::lenient::string")]
9789    pub link_token: String,
9790    /// Password for that account; does not replace the second-factor step.
9791    #[serde(deserialize_with = "crate::lenient::string")]
9792    pub password: String,
9793    /// Username or email address verified by the configured ChurchTools credential authentication, including legacy LDAP when configured.
9794    #[serde(deserialize_with = "crate::lenient::string")]
9795    pub username: String,
9796    /// Fields not described by the spec, e.g. instance-specific DB fields.
9797    #[serde(flatten)]
9798    pub extra: serde_json::Map<String, serde_json::Value>,
9799}
9800
9801#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9802pub struct ExternalLoginLinkResult {
9803    /// Absolute ChurchTools URL to navigate to. It can request two-factor verification; HTTP 200 alone does not mean login is complete.
9804    #[serde(deserialize_with = "crate::lenient::string")]
9805    pub location: String,
9806    /// Fields not described by the spec, e.g. instance-specific DB fields.
9807    #[serde(flatten)]
9808    pub extra: serde_json::Map<String, serde_json::Value>,
9809}
9810
9811/// OAuth provider configuration.
9812#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9813pub struct ExternalLoginOAuthConfig {
9814    #[serde(rename = "accessTokenUrl", deserialize_with = "crate::lenient::string")]
9815    pub access_token_url: String,
9816    #[serde(rename = "authorizeUrl", deserialize_with = "crate::lenient::string")]
9817    pub authorize_url: String,
9818    /// Version 2 uses the stable /oauthclients/login/callback URL. Existing providers without this value retain their provider-specific callback URL. New OAuth providers default to version 2.
9819    /// Allowed values: `2`.
9820    #[serde(rename = "callbackUrlVersion", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9821    pub callback_url_version: Option<i64>,
9822    #[serde(rename = "clientId", deserialize_with = "crate::lenient::string")]
9823    pub client_id: String,
9824    /// OAuth client secret.
9825    #[serde(rename = "clientSecret", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9826    pub client_secret: Option<String>,
9827    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9828    pub scope: Option<String>,
9829    #[serde(rename = "urlResourceOwnerDetails", deserialize_with = "crate::lenient::string")]
9830    pub url_resource_owner_details: String,
9831    /// Fields not described by the spec, e.g. instance-specific DB fields.
9832    #[serde(flatten)]
9833    pub extra: serde_json::Map<String, serde_json::Value>,
9834}
9835
9836/// OpenID Connect provider configuration.
9837#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9838pub struct ExternalLoginOidcConfig {
9839    /// Optional allowlist for the `ct_connection` claim. When configured, an ID token without an allowed connection is rejected.
9840    #[serde(rename = "allowedConnections", default, skip_serializing_if = "Option::is_none")]
9841    pub allowed_connections: Option<Vec<String>>,
9842    /// Retained for stored-data and API compatibility. Callback routing no longer depends on this value.
9843    /// Allowed values: `2`.
9844    #[serde(rename = "callbackUrlVersion", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9845    #[deprecated = "deprecated in the ChurchTools API"]
9846    pub callback_url_version: Option<i64>,
9847    #[serde(rename = "clientId", deserialize_with = "crate::lenient::string")]
9848    pub client_id: String,
9849    /// OpenID Connect client secret.
9850    #[serde(rename = "clientSecret", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9851    pub client_secret: Option<String>,
9852    /// Optional installation identifier that must be present in the `ct_entitlements` claim.
9853    #[serde(rename = "installationId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9854    pub installation_id: Option<String>,
9855    /// Exact HTTPS issuer used for discovery and token validation. User info, query strings and fragments are rejected; a path and explicit port are allowed.
9856    #[serde(deserialize_with = "crate::lenient::string")]
9857    pub issuer: String,
9858    /// Optional minimum `acr`. Numeric values are ordered numerically; non-numeric values require an exact match.
9859    #[serde(rename = "minAcr", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9860    pub min_acr: Option<String>,
9861    /// Space-separated scopes. Missing, null or empty values use `openid profile email`. The `openid` scope is always included. Claim policies do not automatically add scopes.
9862    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9863    pub scope: Option<String>,
9864    /// Fields not described by the spec, e.g. instance-specific DB fields.
9865    #[serde(flatten)]
9866    pub extra: serde_json::Map<String, serde_json::Value>,
9867}
9868
9869/// An OIDC authorization test could not be started or completed.
9870#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9871pub struct ExternalLoginOidcTestError {
9872    /// Sorted unique claim names from the validated ID token on success. Claim values and tokens are never returned.
9873    #[serde(rename = "claimNames", default, skip_serializing_if = "Option::is_none")]
9874    pub claim_names: Option<Vec<String>>,
9875    /// Sanitized, actionable failure category without provider response details.
9876    /// Allowed values: `acr_insufficient`, `client_id_mismatch`, `configuration_error`, `connection_not_allowed`, `discovery_issuer_mismatch`, `discovery_private_network`, `discovery_unavailable`, `entitlement_missing`, `id_token_invalid`, `issuer_invalid`, `nonce_invalid`, `provider_error`, `signature_invalid`, `signing_algorithm_unsupported`, `signing_key_unavailable`, `subject_missing`, `token_exchange_failed`, `token_time_invalid`, `validation_failed`.
9877    #[serde(rename = "errorCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9878    pub error_code: Option<String>,
9879    #[serde(deserialize_with = "crate::lenient::string")]
9880    pub status: String,
9881    /// Fields not described by the spec, e.g. instance-specific DB fields.
9882    #[serde(flatten)]
9883    pub extra: serde_json::Map<String, serde_json::Value>,
9884}
9885
9886/// Session-bound OIDC test status. pending means the provider callback is outstanding; success means token and claim-policy validation succeeded; error contains a sanitized category; expired also covers unknown states or another administrator/session.
9887#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9888pub struct ExternalLoginOidcTestResult {
9889    /// Sorted unique claim names from the validated ID token on success. Claim values and tokens are never returned.
9890    #[serde(rename = "claimNames", default, skip_serializing_if = "Option::is_none")]
9891    pub claim_names: Option<Vec<String>>,
9892    /// Sanitized, actionable failure category without provider response details.
9893    /// Allowed values: `acr_insufficient`, `client_id_mismatch`, `configuration_error`, `connection_not_allowed`, `discovery_issuer_mismatch`, `discovery_private_network`, `discovery_unavailable`, `entitlement_missing`, `id_token_invalid`, `issuer_invalid`, `nonce_invalid`, `provider_error`, `signature_invalid`, `signing_algorithm_unsupported`, `signing_key_unavailable`, `subject_missing`, `token_exchange_failed`, `token_time_invalid`, `validation_failed`.
9894    #[serde(rename = "errorCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9895    pub error_code: Option<String>,
9896    /// Allowed values: `error`, `expired`, `pending`, `success`.
9897    #[serde(deserialize_with = "crate::lenient::string")]
9898    pub status: String,
9899    /// Fields not described by the spec, e.g. instance-specific DB fields.
9900    #[serde(flatten)]
9901    pub extra: serde_json::Map<String, serde_json::Value>,
9902}
9903
9904/// OIDC test authorization. The callback records diagnostics instead of creating a person, linking an identity or completing a ChurchTools login.
9905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9906pub struct ExternalLoginOidcTestStart {
9907    /// Pending authorization expiry as Unix epoch seconds; normally 600 seconds after creation.
9908    #[serde(rename = "expiresAt", deserialize_with = "crate::lenient::number")]
9909    pub expires_at: i64,
9910    /// Opaque, single-use authorization state. Do not reuse it or substitute another browser session.
9911    #[serde(deserialize_with = "crate::lenient::string")]
9912    pub state: String,
9913    /// Provider authorization URL including state, nonce and the PKCE challenge.
9914    #[serde(deserialize_with = "crate::lenient::string")]
9915    pub url: String,
9916    /// Fields not described by the spec, e.g. instance-specific DB fields.
9917    #[serde(flatten)]
9918    pub extra: serde_json::Map<String, serde_json::Value>,
9919}
9920
9921/// Request to create a ChurchTools person from the identity already verified by the external provider and stored in this browser session. No person attributes are accepted from the client.
9922#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9923pub struct ExternalLoginPersonCreate {
9924    /// Opaque, session-bound linking token from the account-linking redirect. Expires 600 seconds after creation.
9925    #[serde(rename = "linkToken", deserialize_with = "crate::lenient::string")]
9926    pub link_token: String,
9927    /// Fields not described by the spec, e.g. instance-specific DB fields.
9928    #[serde(flatten)]
9929    pub extra: serde_json::Map<String, serde_json::Value>,
9930}
9931
9932/// Public summary of one external identity-provider link for a person. Provider configuration, secrets and the external identity identifier are not included.
9933#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9934pub struct ExternalLoginPersonMapping {
9935    /// ID of the linked external-login provider; used to unlink this mapping.
9936    #[serde(rename = "externalLoginId", deserialize_with = "crate::lenient::number")]
9937    pub external_login_id: i64,
9938    /// Configured provider display name.
9939    #[serde(rename = "externalLoginName", deserialize_with = "crate::lenient::string")]
9940    pub external_login_name: String,
9941    /// Authentication protocol used by the provider.
9942    /// Allowed values: `ldap`, `oauth`, `oidc`, `saml`.
9943    #[serde(rename = "externalLoginType", deserialize_with = "crate::lenient::string")]
9944    pub external_login_type: String,
9945    /// Fields not described by the spec, e.g. instance-specific DB fields.
9946    #[serde(flatten)]
9947    pub extra: serde_json::Map<String, serde_json::Value>,
9948}
9949
9950#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9951pub struct ExternalLoginSamlCertificateMetadata {
9952    #[serde(rename = "fingerprintSha256", deserialize_with = "crate::lenient::string")]
9953    pub fingerprint_sha256: String,
9954    /// Allowed values: `expired`, `expiring`, `not-yet-valid`, `valid`.
9955    #[serde(deserialize_with = "crate::lenient::string")]
9956    pub status: String,
9957    /// Allowed values: `signing`.
9958    #[serde(deserialize_with = "crate::lenient::string")]
9959    pub r#use: String,
9960    #[serde(rename = "validFrom", serialize_with = "crate::datetime::serialize_utc")]
9961    pub valid_from: chrono::DateTime<chrono::Utc>,
9962    #[serde(rename = "validTo", serialize_with = "crate::datetime::serialize_utc")]
9963    pub valid_to: chrono::DateTime<chrono::Utc>,
9964    /// Fields not described by the spec, e.g. instance-specific DB fields.
9965    #[serde(flatten)]
9966    pub extra: serde_json::Map<String, serde_json::Value>,
9967}
9968
9969/// SAML identity-provider settings. SP keys and certificates are managed by ChurchTools.
9970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9971pub struct ExternalLoginSamlConfig {
9972    /// Retained for stored-data and API compatibility. Callback routing no longer depends on this value.
9973    /// Allowed values: `2`.
9974    #[serde(rename = "callbackUrlVersion", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
9975    #[deprecated = "deprecated in the ChurchTools API"]
9976    pub callback_url_version: Option<i64>,
9977    #[serde(rename = "emailAttribute", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9978    pub email_attribute: Option<String>,
9979    #[serde(rename = "firstNameAttribute", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9980    pub first_name_attribute: Option<String>,
9981    #[serde(rename = "idAttribute", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9982    pub id_attribute: Option<String>,
9983    /// Legacy signing certificate fingerprint. Ignored when multiple signing certificates are configured.
9984    #[serde(rename = "idpCertFingerprint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9985    pub idp_cert_fingerprint: Option<String>,
9986    #[serde(rename = "idpCertificateMetadata", default, skip_serializing_if = "Option::is_none")]
9987    pub idp_certificate_metadata: Option<Vec<ExternalLoginSamlCertificateMetadata>>,
9988    /// SAML IdP entity identifier. Required when the provider will be visible.
9989    #[serde(rename = "idpEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9990    pub idp_entity_id: Option<String>,
9991    #[serde(rename = "idpSingleLogoutService", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9992    pub idp_single_logout_service: Option<String>,
9993    /// Allowed values: `urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`.
9994    #[serde(rename = "idpSingleLogoutServiceBinding", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9995    pub idp_single_logout_service_binding: Option<String>,
9996    /// IdP SSO URL. Required when the provider will be visible.
9997    #[serde(rename = "idpSingleSignOnService", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
9998    pub idp_single_sign_on_service: Option<String>,
9999    /// Allowed values: `urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`.
10000    #[serde(rename = "idpSingleSignOnServiceBinding", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10001    pub idp_single_sign_on_service_binding: Option<String>,
10002    /// Legacy field for a single IdP signing certificate in PEM format.
10003    #[serde(rename = "idpX509cert", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10004    pub idp_x509cert: Option<String>,
10005    #[serde(rename = "idpX509certMulti", default, skip_serializing_if = "Option::is_none")]
10006    pub idp_x509cert_multi: Option<ExternalLoginSamlConfigIdpX509certMulti>,
10007    #[serde(rename = "lastNameAttribute", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10008    pub last_name_attribute: Option<String>,
10009    /// Identifies providers imported from the legacy SAML configuration.
10010    #[serde(rename = "migratedLegacySamlProvider", default, skip_serializing_if = "Option::is_none")]
10011    pub migrated_legacy_saml_provider: Option<bool>,
10012    #[serde(rename = "signRequests", default, skip_serializing_if = "Option::is_none")]
10013    pub sign_requests: Option<bool>,
10014    /// Signature algorithm URI. The API validates URL syntax but not a closed algorithm catalog.
10015    #[serde(rename = "signatureAlgorithm", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10016    pub signature_algorithm: Option<String>,
10017    /// Required signatures on inbound SAML authentication responses. `response` requires the outer SAML Response, `assertion` requires its Assertion, and `both` requires both. SP metadata exposes the Assertion requirement as `WantAssertionsSigned`; SAML metadata has no standard attribute for requiring the outer Response signature.
10018    /// Allowed values: `assertion`, `both`, `response`.
10019    #[serde(rename = "signatureRequirement", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10020    pub signature_requirement: Option<String>,
10021    #[serde(rename = "siteName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10022    pub site_name: Option<String>,
10023    #[serde(rename = "spX509cert", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10024    pub sp_x509cert: Option<String>,
10025    #[serde(rename = "usernameAttribute", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10026    pub username_attribute: Option<String>,
10027    /// Fields not described by the spec, e.g. instance-specific DB fields.
10028    #[serde(flatten)]
10029    pub extra: serde_json::Map<String, serde_json::Value>,
10030}
10031
10032#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10033pub struct ExternalLoginSamlConfigIdpX509certMulti {
10034    /// One or more IdP signing certificates in PEM format. Multiple certificates support signing key rollover; encryption certificates are not configured here.
10035    pub signing: Vec<String>,
10036    /// Fields not described by the spec, e.g. instance-specific DB fields.
10037    #[serde(flatten)]
10038    pub extra: serde_json::Map<String, serde_json::Value>,
10039}
10040
10041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10042pub struct ExternalLoginSamlTestMapping {
10043    /// Configured attribute name, or the SAML default for this ChurchTools field.
10044    #[serde(rename = "claimName", deserialize_with = "crate::lenient::string")]
10045    pub claim_name: String,
10046    /// ChurchTools identity field whose provider attribute mapping is inspected.
10047    /// Allowed values: `email`, `firstName`, `id`, `lastName`, `username`.
10048    #[serde(deserialize_with = "crate::lenient::string")]
10049    pub field: String,
10050    /// Whether the attribute name exists in the response. Empty attribute values still count as present.
10051    pub present: bool,
10052    /// Fields not described by the spec, e.g. instance-specific DB fields.
10053    #[serde(flatten)]
10054    pub extra: serde_json::Map<String, serde_json::Value>,
10055}
10056
10057/// SAML protocol-test diagnostics. success means an authenticated SAML response was received; it does not imply that local person matching or required attribute values are valid. error carries no detailed error category. pending and expired contain only status.
10058#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10059pub struct ExternalLoginSamlTestResult {
10060    /// Sorted unique SAML attribute names on success; attribute values and the SAML assertion are not returned.
10061    #[serde(rename = "claimNames", default, skip_serializing_if = "Option::is_none")]
10062    pub claim_names: Option<Vec<String>>,
10063    /// Five configured/default mappings in order: id, email, username, firstName, lastName. Presence checks only the attribute name, not whether its value is nonempty or usable.
10064    #[serde(default, skip_serializing_if = "Option::is_none")]
10065    pub mappings: Option<Vec<ExternalLoginSamlTestMapping>>,
10066    /// Allowed values: `error`, `expired`, `pending`, `success`.
10067    #[serde(deserialize_with = "crate::lenient::string")]
10068    pub status: String,
10069    /// Fields not described by the spec, e.g. instance-specific DB fields.
10070    #[serde(flatten)]
10071    pub extra: serde_json::Map<String, serde_json::Value>,
10072}
10073
10074/// A SAML test bound to the current browser session, administrator and provider. Keep the session cookie when opening url and polling state.
10075#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10076pub struct ExternalLoginSamlTestStart {
10077    /// Unix timestamp in seconds, 600 seconds after creation; applies to pending and completed results.
10078    #[serde(rename = "expiresAt", deserialize_with = "crate::lenient::number")]
10079    pub expires_at: i64,
10080    /// Opaque RelayState used to correlate the callback and poll this test.
10081    #[serde(deserialize_with = "crate::lenient::string")]
10082    pub state: String,
10083    /// Identity-provider SSO URL containing the SAML request and RelayState. Open it in the same browser session.
10084    #[serde(deserialize_with = "crate::lenient::string")]
10085    pub url: String,
10086    /// Fields not described by the spec, e.g. instance-specific DB fields.
10087    #[serde(flatten)]
10088    pub extra: serde_json::Map<String, serde_json::Value>,
10089}
10090
10091/// Updates provider settings. The protocol in `type` must match the existing provider.
10092#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10093pub struct ExternalLoginUpdate {
10094    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
10095    pub config: serde_json::Value,
10096    /// Whether the login flow may create a ChurchTools person when no local identity mapping exists. The matching mode controls whether this happens automatically or requires an explicit choice.
10097    #[serde(rename = "createNewPerson")]
10098    pub create_new_person: bool,
10099    /// Whether the external provider offers a registration flow; support depends on the protocol handler.
10100    #[serde(rename = "hasRegistration")]
10101    pub has_registration: bool,
10102    /// Whether this provider is listed among available SSO login choices. Hiding it is not the same as deleting its configuration or mappings.
10103    #[serde(rename = "isVisible", default, skip_serializing_if = "Option::is_none")]
10104    pub is_visible: Option<bool>,
10105    /// Determines how an authenticated external identity without an existing person mapping is handled. Auto-match mode uses automatic name-and-email matching and optional person creation. Verified mode asks the user to either prove ownership of a local account or, when `createNewPerson` is enabled, explicitly create a person. Pre-provisioned mode rejects identities without a mapping.
10106    /// Allowed values: `auto_match`, `preprovisioned_only`, `verified_user_linking`.
10107    #[serde(rename = "matchingMode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10108    pub matching_mode: Option<String>,
10109    /// Display name shown for this provider.
10110    #[serde(deserialize_with = "crate::lenient::string")]
10111    pub name: String,
10112    /// Default campus ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
10113    #[serde(rename = "newPersonCampusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10114    pub new_person_campus_id: Option<i64>,
10115    /// Default department ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
10116    #[serde(rename = "newPersonDepartmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10117    pub new_person_department_id: Option<i64>,
10118    /// Default person status ID for newly created people. A numeric ID is required when createNewPerson is true; explicit null is required otherwise.
10119    #[serde(rename = "newPersonStatusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10120    pub new_person_status_id: Option<i64>,
10121    /// Marks the preferred external login. At most one provider may have this flag; choosing a second primary provider is rejected rather than automatically demoting the first.
10122    #[serde(rename = "primaryLogin", default, skip_serializing_if = "Option::is_none")]
10123    pub primary_login: Option<bool>,
10124    /// Secondary text on the login choice.
10125    ///
10126    /// `None` leaves the field out, `Some(None)` sends `null`.
10127    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10128    pub subtitle: Option<Option<String>>,
10129    /// Configured login protocol.
10130    /// Allowed values: `oauth`, `oidc`, `saml`.
10131    #[serde(deserialize_with = "crate::lenient::string")]
10132    pub r#type: String,
10133    /// Whether existing person data is updated from provider data after successful matching.
10134    #[serde(rename = "updateDataOnLogin")]
10135    pub update_data_on_login: bool,
10136    /// Fields not described by the spec, e.g. instance-specific DB fields.
10137    #[serde(flatten)]
10138    pub extra: serde_json::Map<String, serde_json::Value>,
10139}
10140
10141/// Configured external connection with masked access credentials.
10142#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10143pub struct ExternalSystem {
10144    /// Adapter-specific HTTP header values used to access the external system.
10145    #[serde(rename = "accessHeaderValues", default, skip_serializing_if = "serde_json::Value::is_null")]
10146    pub access_header_values: serde_json::Value,
10147    /// Name of a registered adapter from `/sync/adapters`. Custom adapter names are supported.
10148    #[serde(deserialize_with = "crate::lenient::string")]
10149    pub adapter: String,
10150    /// Display name of the external connection.
10151    #[serde(deserialize_with = "crate::lenient::string")]
10152    pub name: String,
10153    /// External system ID
10154    #[serde(deserialize_with = "crate::lenient::number")]
10155    pub id: i64,
10156    /// Number of configured sync jobs.
10157    #[serde(rename = "jobConfigsCount", deserialize_with = "crate::lenient::number")]
10158    pub job_configs_count: i64,
10159    /// Fields not described by the spec, e.g. instance-specific DB fields.
10160    #[serde(flatten)]
10161    pub extra: serde_json::Map<String, serde_json::Value>,
10162}
10163
10164/// Connection to a specific external system through a registered adapter.
10165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10166pub struct ExternalSystemCreate {
10167    /// Adapter-specific HTTP header values used to access the external system.
10168    #[serde(rename = "accessHeaderValues", default, skip_serializing_if = "serde_json::Value::is_null")]
10169    pub access_header_values: serde_json::Value,
10170    /// Name of a registered adapter from `/sync/adapters`. Custom adapter names are supported.
10171    #[serde(deserialize_with = "crate::lenient::string")]
10172    pub adapter: String,
10173    /// Display name of the external connection.
10174    #[serde(deserialize_with = "crate::lenient::string")]
10175    pub name: String,
10176    /// Fields not described by the spec, e.g. instance-specific DB fields.
10177    #[serde(flatten)]
10178    pub extra: serde_json::Map<String, serde_json::Value>,
10179}
10180
10181/// Updates the external connection. Supplied header keys are merged into existing headers.
10182#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10183pub struct ExternalSystemUpdate {
10184    /// Adapter-specific HTTP header values used to access the external system.
10185    #[serde(rename = "accessHeaderValues", default, skip_serializing_if = "serde_json::Value::is_null")]
10186    pub access_header_values: serde_json::Value,
10187    /// Name of a registered adapter from `/sync/adapters`. Custom adapter names are supported.
10188    #[serde(deserialize_with = "crate::lenient::string")]
10189    pub adapter: String,
10190    /// Display name of the external connection.
10191    #[serde(deserialize_with = "crate::lenient::string")]
10192    pub name: String,
10193    /// Existing external system ID.
10194    #[serde(deserialize_with = "crate::lenient::number")]
10195    pub id: i64,
10196    /// Fields not described by the spec, e.g. instance-specific DB fields.
10197    #[serde(flatten)]
10198    pub extra: serde_json::Map<String, serde_json::Value>,
10199}
10200
10201/// Stored numeric metric definition. `unit` can be `null` in existing data.
10202#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10203pub struct FactNumber {
10204    /// Deprecated response field that points clients from fieldType to type.
10205    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::string")]
10206    pub deprecated: String,
10207    /// Legacy alias for type.
10208    /// Allowed values: `number`, `select`.
10209    #[serde(rename = "fieldType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10210    #[deprecated = "deprecated in the ChurchTools API"]
10211    pub field_type: Option<String>,
10212    /// ID of the fact master data entry.
10213    #[serde(deserialize_with = "crate::lenient::number")]
10214    pub id: i64,
10215    /// Stored label of the metric or selection.
10216    #[serde(deserialize_with = "crate::lenient::string")]
10217    pub name: String,
10218    /// Label translated for the current language, falling back to name.
10219    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
10220    pub name_translated: String,
10221    /// Sort key for ordering facts.
10222    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
10223    pub sort_key: i64,
10224    /// Allowed values: `number`.
10225    #[serde(deserialize_with = "crate::lenient::string")]
10226    pub r#type: String,
10227    /// Unit for numeric values.
10228    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10229    pub unit: Option<String>,
10230    /// Fields not described by the spec, e.g. instance-specific DB fields.
10231    #[serde(flatten)]
10232    pub extra: serde_json::Map<String, serde_json::Value>,
10233}
10234
10235/// Definition of a numeric metric, such as attendance. Recorded event values are returned as JSON numbers.
10236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10237pub struct FactNumberCreate {
10238    /// Label of the metric or selection, trimmed before storage.
10239    #[serde(deserialize_with = "crate::lenient::string")]
10240    pub name: String,
10241    /// Display order.
10242    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10243    pub sort_key: Option<i64>,
10244    #[serde(deserialize_with = "crate::lenient::string")]
10245    pub r#type: String,
10246    /// Unit displayed with numeric values.
10247    #[serde(deserialize_with = "crate::lenient::string")]
10248    pub unit: String,
10249    /// Fields not described by the spec, e.g. instance-specific DB fields.
10250    #[serde(flatten)]
10251    pub extra: serde_json::Map<String, serde_json::Value>,
10252}
10253
10254/// Stored selection definition. options contains the literal labels accepted when writing event values; legacy definitions can have an empty list.
10255#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10256pub struct FactSelect {
10257    /// Deprecated response field that points clients from fieldType to type.
10258    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::string")]
10259    pub deprecated: String,
10260    /// Legacy alias for type.
10261    /// Allowed values: `number`, `select`.
10262    #[serde(rename = "fieldType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10263    #[deprecated = "deprecated in the ChurchTools API"]
10264    pub field_type: Option<String>,
10265    /// ID of the fact master data entry.
10266    #[serde(deserialize_with = "crate::lenient::number")]
10267    pub id: i64,
10268    /// Stored label of the metric or selection.
10269    #[serde(deserialize_with = "crate::lenient::string")]
10270    pub name: String,
10271    /// Label translated for the current language, falling back to name.
10272    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
10273    pub name_translated: String,
10274    /// Sort key for ordering facts.
10275    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
10276    pub sort_key: i64,
10277    /// Allowed values for select facts.
10278    pub options: Vec<String>,
10279    /// Allowed values: `select`.
10280    #[serde(deserialize_with = "crate::lenient::string")]
10281    pub r#type: String,
10282    /// Fields not described by the spec, e.g. instance-specific DB fields.
10283    #[serde(flatten)]
10284    pub extra: serde_json::Map<String, serde_json::Value>,
10285}
10286
10287/// Definition of a selection field, such as service type. Supply the complete list of non-empty option labels; event values use the label itself, not an option ID.
10288#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10289pub struct FactSelectCreate {
10290    /// Label of the metric or selection, trimmed before storage.
10291    #[serde(deserialize_with = "crate::lenient::string")]
10292    pub name: String,
10293    /// Display order.
10294    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10295    pub sort_key: Option<i64>,
10296    /// Complete list of allowed option labels. Supply at least one option.
10297    pub options: Vec<String>,
10298    #[serde(deserialize_with = "crate::lenient::string")]
10299    pub r#type: String,
10300    /// Fields not described by the spec, e.g. instance-specific DB fields.
10301    #[serde(flatten)]
10302    pub extra: serde_json::Map<String, serde_json::Value>,
10303}
10304
10305#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10306pub struct FeatureUsage {
10307    /// Value to decrement the metric by
10308    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10309    pub delta: Option<f64>,
10310    /// Feature, tour or event name.
10311    #[serde(deserialize_with = "crate::lenient::string")]
10312    pub name: String,
10313    /// Allowed values: `event`, `feature`, `tour`.
10314    #[serde(deserialize_with = "crate::lenient::string")]
10315    pub r#type: String,
10316    /// Fields not described by the spec, e.g. instance-specific DB fields.
10317    #[serde(flatten)]
10318    pub extra: serde_json::Map<String, serde_json::Value>,
10319}
10320
10321/// Field mapping for an external connection and domain. `GET` can return an unsaved mapping when none exists.
10322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10323pub struct FieldMapping {
10324    /// ChurchTools domain types accepted by entity and field mapping validation. Adapter support can be a smaller subset.
10325    /// 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`, ….
10326    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
10327    pub domain_type: String,
10328    pub entries: SyncFieldMappingEntries,
10329    /// Configured external connection with masked access credentials.
10330    #[serde(rename = "externalSystem")]
10331    pub external_system: ExternalSystem,
10332    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10333    pub id: Option<i64>,
10334    /// Fields not described by the spec, e.g. instance-specific DB fields.
10335    #[serde(flatten)]
10336    pub extra: serde_json::Map<String, serde_json::Value>,
10337}
10338
10339/// Stored directional field mapping. No separate entry ID is returned.
10340#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10341pub struct FieldMappingEntry {
10342    /// Source field name supported by the adapter.
10343    #[serde(deserialize_with = "crate::lenient::string")]
10344    pub from: String,
10345    /// Adapter-specific source-field qualifier.
10346    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
10347    pub from_filter: String,
10348    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
10349    pub others: serde_json::Value,
10350    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
10351    /// Allowed values: `es`, `master`.
10352    #[serde(deserialize_with = "crate::lenient::string")]
10353    pub system: String,
10354    /// Target field name supported by the adapter.
10355    #[serde(deserialize_with = "crate::lenient::string")]
10356    pub to: String,
10357    /// Adapter-specific target-field qualifier.
10358    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
10359    pub to_filter: String,
10360    #[serde(rename = "valueMapping", default, skip_serializing_if = "serde_json::Value::is_null")]
10361    pub value_mapping: serde_json::Value,
10362    /// Fields not described by the spec, e.g. instance-specific DB fields.
10363    #[serde(flatten)]
10364    pub extra: serde_json::Map<String, serde_json::Value>,
10365}
10366
10367/// Display-metadata update for every attachment of a domain object.
10368#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10369pub struct FileDomainUpdate {
10370    /// Display name assigned to every matching file.
10371    ///
10372    /// `None` leaves the field out, `Some(None)` sends `null`.
10373    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10374    pub name: Option<Option<String>>,
10375    /// Sort key assigned to every matching file.
10376    ///
10377    /// `None` leaves the field out, `Some(None)` sends `null`.
10378    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10379    pub sort_key: Option<Option<i64>>,
10380    /// Fields not described by the spec, e.g. instance-specific DB fields.
10381    #[serde(flatten)]
10382    pub extra: serde_json::Map<String, serde_json::Value>,
10383}
10384
10385/// Stores a URL as an attachment without downloading its target. The selected category’s file-save hooks still run.
10386#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10387pub struct FileLinkCreate {
10388    /// Display name. The URL is used when no name is supplied.
10389    ///
10390    /// `None` leaves the field out, `Some(None)` sends `null`.
10391    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10392    pub name: Option<Option<String>>,
10393    /// Attachment security level.
10394    ///
10395    /// `None` leaves the field out, `Some(None)` sends `null`.
10396    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10397    pub security_level_id: Option<Option<i64>>,
10398    /// Absolute URL to store.
10399    #[serde(deserialize_with = "crate::lenient::string")]
10400    pub url: String,
10401    /// Fields not described by the spec, e.g. instance-specific DB fields.
10402    #[serde(flatten)]
10403    pub extra: serde_json::Map<String, serde_json::Value>,
10404}
10405
10406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10407pub struct FileMetaData {
10408    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
10409    #[serde(rename = "createdDate", serialize_with = "crate::datetime::serialize_utc")]
10410    pub created_date: chrono::DateTime<chrono::Utc>,
10411    #[serde(rename = "createdPerson", default, skip_serializing_if = "serde_json::Value::is_null")]
10412    pub created_person: serde_json::Value,
10413    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
10414    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
10415    pub modified_date: chrono::DateTime<chrono::Utc>,
10416    #[serde(rename = "modifiedPerson", default, skip_serializing_if = "serde_json::Value::is_null")]
10417    pub modified_person: serde_json::Value,
10418    /// Fields not described by the spec, e.g. instance-specific DB fields.
10419    #[serde(flatten)]
10420    pub extra: serde_json::Map<String, serde_json::Value>,
10421}
10422
10423/// File or Link for a specific domain type. E.g. uploaded music file for songs or avatar of a person.
10424#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10425pub struct FileOrLink {
10426    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10427    pub domain_id: Option<String>,
10428    /// ChurchTools Domain Type. Where does this file belong to?
10429    #[serde(rename = "domainType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10430    pub domain_type: Option<String>,
10431    /// Link to external website or link to file in ChurchTools
10432    #[serde(rename = "fileUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10433    pub file_url: Option<String>,
10434    /// Filename of uploaded file or name of the link
10435    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10436    pub filename: Option<String>,
10437    #[serde(default, skip_serializing_if = "Option::is_none")]
10438    pub meta: Option<MetaDataEntityId>,
10439    /// Name of that file, when it's been uploaded
10440    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10441    pub name: Option<String>,
10442    /// Fields not described by the spec, e.g. instance-specific DB fields.
10443    #[serde(flatten)]
10444    pub extra: serde_json::Map<String, serde_json::Value>,
10445}
10446
10447/// Updates one file and optionally copies it to another attachment context.
10448#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10449pub struct FileUpdate {
10450    /// Display name assigned to every matching file.
10451    ///
10452    /// `None` leaves the field out, `Some(None)` sends `null`.
10453    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10454    pub name: Option<Option<String>>,
10455    /// Sort key assigned to every matching file.
10456    ///
10457    /// `None` leaves the field out, `Some(None)` sends `null`.
10458    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10459    pub sort_key: Option<Option<i64>>,
10460    /// Target attachment context to which the file is copied.
10461    #[serde(rename = "copyTo", default, skip_serializing_if = "Option::is_none")]
10462    pub copy_to: Option<FileUpdateCopyTo>,
10463    /// Fields not described by the spec, e.g. instance-specific DB fields.
10464    #[serde(flatten)]
10465    pub extra: serde_json::Map<String, serde_json::Value>,
10466}
10467
10468/// Target attachment context to which the file is copied.
10469#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10470pub struct FileUpdateCopyTo {
10471    /// Target identifier.
10472    #[serde(rename = "domainId", deserialize_with = "crate::lenient::string")]
10473    pub domain_id: String,
10474    /// Target attachment category.
10475    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
10476    pub domain_type: String,
10477    /// Fields not described by the spec, e.g. instance-specific DB fields.
10478    #[serde(flatten)]
10479    pub extra: serde_json::Map<String, serde_json::Value>,
10480}
10481
10482/// Metadata returned after upload. The `attachments` category does not create a database file record and returns `id: null`.
10483#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10484pub struct FileUploadResult {
10485    /// Domain-specific extra data. Empty for most files (serialized as an empty array), but some domains add a key-value object (e.g. statement uploads return `{ "statementId": 1 }`).
10486    #[serde(rename = "additionalInfos", deserialize_with = "crate::lenient::map")]
10487    pub additional_infos: std::collections::BTreeMap<String, serde_json::Value>,
10488    /// Whether the image was generated by artificial intelligence.
10489    #[serde(rename = "aiGenerated")]
10490    pub ai_generated: bool,
10491    /// Image credit or attribution.
10492    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10493    pub annotation: Option<String>,
10494    /// Attribution link.
10495    #[serde(rename = "annotationLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10496    pub annotation_link: Option<String>,
10497    /// File or image description.
10498    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10499    pub description: Option<String>,
10500    /// Attachment-context identifier; its meaning depends on `domainType`.
10501    #[serde(rename = "domainId", deserialize_with = "crate::lenient::string")]
10502    pub domain_id: String,
10503    /// Stored attachment category. Internal categories may not be accepted by the domain-based file routes.
10504    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
10505    pub domain_type: String,
10506    /// Absolute download URL or external link URL.
10507    #[serde(rename = "fileUrl", deserialize_with = "crate::lenient::string")]
10508    pub file_url: String,
10509    /// Storage filename/hash for a binary file, or the target URL for a link. name is the user-facing display name.
10510    #[serde(deserialize_with = "crate::lenient::string")]
10511    pub filename: String,
10512    /// Image dimensions calculated from the file.
10513    #[serde(rename = "imageMetadata", default, skip_serializing_if = "Option::is_none")]
10514    pub image_metadata: Option<CtFileImageMetadata>,
10515    #[serde(rename = "imageOption", default, skip_serializing_if = "Option::is_none")]
10516    pub image_option: Option<CtFileImageOption>,
10517    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10518    pub image_url: Option<String>,
10519    pub meta: FileMetaData,
10520    #[serde(deserialize_with = "crate::lenient::string")]
10521    pub name: String,
10522    /// Legacy relative download URL, or an absolute external URL for a link.
10523    #[serde(rename = "relativeUrl", deserialize_with = "crate::lenient::string")]
10524    pub relative_url: String,
10525    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10526    pub security_level_id: Option<i64>,
10527    /// Whether domain lists show the file only to users who may edit its owning object.
10528    #[serde(rename = "showOnlyWhenEditable")]
10529    pub show_only_when_editable: bool,
10530    /// The file size in byte
10531    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10532    pub size: Option<i64>,
10533    /// file for a stored file, link for a filename beginning with http.
10534    /// Allowed values: `file`, `link`.
10535    #[serde(deserialize_with = "crate::lenient::string")]
10536    pub r#type: String,
10537    /// Persisted file ID, or null for the special attachments category.
10538    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10539    pub id: Option<i64>,
10540    /// Fields not described by the spec, e.g. instance-specific DB fields.
10541    #[serde(flatten)]
10542    pub extra: serde_json::Map<String, serde_json::Value>,
10543}
10544
10545/// Finance definitions needed for one accounting period. Clients and periods include all entries visible to the caller; account types, classes, groups and tax types are installation-wide. Accounts, cost centers, tax rates, cash discounts and transaction purposes relate to the selected period.
10546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10547pub struct FinanceMasterData {
10548    #[serde(rename = "accountClasses")]
10549    pub account_classes: Vec<AccountClass>,
10550    #[serde(rename = "accountGroups")]
10551    pub account_groups: Vec<AccountGroup>,
10552    #[serde(rename = "accountTypes")]
10553    pub account_types: Vec<AccountType>,
10554    #[serde(rename = "accountingPeriods")]
10555    pub accounting_periods: Vec<AccountingPeriod>,
10556    /// Entries for the selected period filtered by the caller’s finance permissions.
10557    pub accounts: Vec<Account>,
10558    /// Entries linked to accounts of the selected period; this collection has no per-account visibility filter.
10559    #[serde(rename = "cashDiscounts")]
10560    pub cash_discounts: Vec<CashDiscount>,
10561    pub clients: Vec<Client>,
10562    /// Entries for the selected period filtered by the caller’s finance permissions.
10563    #[serde(rename = "costCenters")]
10564    pub cost_centers: Vec<CostCenter>,
10565    /// Entries linked to accounts of the selected period; this collection has no per-account visibility filter.
10566    #[serde(rename = "taxRates")]
10567    pub tax_rates: Vec<TaxRate>,
10568    #[serde(rename = "taxTypes")]
10569    pub tax_types: Vec<TaxType>,
10570    /// Entries for the selected period filtered by the caller’s finance permissions.
10571    #[serde(rename = "transactionPurposes")]
10572    pub transaction_purposes: Vec<TransactionPurpose>,
10573    /// Fields not described by the spec, e.g. instance-specific DB fields.
10574    #[serde(flatten)]
10575    pub extra: serde_json::Map<String, serde_json::Value>,
10576}
10577
10578/// Stored finance-template JSON file, with counts of the definitions it contains. These files describe a chart of accounts for reuse in another accounting period.
10579#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10580pub struct FinanceTemplate {
10581    pub counts: FinanceTemplateCounts,
10582    /// File-domain identifier, if assigned.
10583    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10584    pub domain_identifier: Option<String>,
10585    /// Allowed values: `finance_template`.
10586    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
10587    pub domain_type: String,
10588    #[serde(deserialize_with = "crate::lenient::string")]
10589    pub filename: String,
10590    #[serde(deserialize_with = "crate::lenient::number")]
10591    pub id: i64,
10592    #[serde(deserialize_with = "crate::lenient::string")]
10593    pub name: String,
10594    #[serde(rename = "relativeUrl", deserialize_with = "crate::lenient::string")]
10595    pub relative_url: String,
10596    /// Stored file security level, if assigned.
10597    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10598    pub security_level_id: Option<i64>,
10599    /// File size in bytes, or null when unavailable.
10600    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10601    pub size: Option<i64>,
10602    #[serde(deserialize_with = "crate::lenient::string")]
10603    pub url: String,
10604    /// Fields not described by the spec, e.g. instance-specific DB fields.
10605    #[serde(flatten)]
10606    pub extra: serde_json::Map<String, serde_json::Value>,
10607}
10608
10609/// Portable account definition in an exported finance template.
10610#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10611pub struct FinanceTemplateAccount {
10612    /// Parent account-group name.
10613    #[serde(rename = "accountGroup", deserialize_with = "crate::lenient::string")]
10614    pub account_group: String,
10615    /// Budget in minor currency units.
10616    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10617    pub budget: Option<i64>,
10618    #[serde(rename = "isDonationAccount")]
10619    pub is_donation_account: bool,
10620    #[serde(rename = "isMandatoryEubp")]
10621    pub is_mandatory_eubp: bool,
10622    #[serde(rename = "isOpeningBalanceAccount")]
10623    pub is_opening_balance_account: bool,
10624    #[serde(deserialize_with = "crate::lenient::string")]
10625    pub name: String,
10626    #[serde(deserialize_with = "crate::lenient::string")]
10627    pub number: String,
10628    /// Tax-type name and percentage separated by a slash, or null.
10629    #[serde(rename = "taxRate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10630    pub tax_rate: Option<String>,
10631    /// Fields not described by the spec, e.g. instance-specific DB fields.
10632    #[serde(flatten)]
10633    pub extra: serde_json::Map<String, serde_json::Value>,
10634}
10635
10636/// Portable account class definition in an exported finance template.
10637#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10638pub struct FinanceTemplateAccountClass {
10639    /// Parent account-type name instead of an installation-specific ID.
10640    #[serde(rename = "accountType", deserialize_with = "crate::lenient::string")]
10641    pub account_type: String,
10642    #[serde(rename = "includeProfitLoss")]
10643    pub include_profit_loss: bool,
10644    #[serde(deserialize_with = "crate::lenient::string")]
10645    pub name: String,
10646    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
10647    pub sort_key: i64,
10648    /// Fields not described by the spec, e.g. instance-specific DB fields.
10649    #[serde(flatten)]
10650    pub extra: serde_json::Map<String, serde_json::Value>,
10651}
10652
10653/// Portable account group definition in an exported finance template.
10654#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10655pub struct FinanceTemplateAccountGroup {
10656    /// Parent account-class name.
10657    #[serde(rename = "accountClass", deserialize_with = "crate::lenient::string")]
10658    pub account_class: String,
10659    #[serde(rename = "isCashAssetAccount")]
10660    pub is_cash_asset_account: bool,
10661    #[serde(deserialize_with = "crate::lenient::string")]
10662    pub name: String,
10663    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
10664    pub sort_key: i64,
10665    /// Fields not described by the spec, e.g. instance-specific DB fields.
10666    #[serde(flatten)]
10667    pub extra: serde_json::Map<String, serde_json::Value>,
10668}
10669
10670/// Portable account type definition in an exported finance template.
10671#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10672pub struct FinanceTemplateAccountType {
10673    /// Allowed values: `assets`, `liabilities`.
10674    #[serde(rename = "balanceType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10675    pub balance_type: Option<String>,
10676    #[serde(deserialize_with = "crate::lenient::string")]
10677    pub name: String,
10678    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
10679    pub sort_key: i64,
10680    /// Fields not described by the spec, e.g. instance-specific DB fields.
10681    #[serde(flatten)]
10682    pub extra: serde_json::Map<String, serde_json::Value>,
10683}
10684
10685/// Portable cash discount definition in an exported finance template.
10686#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10687pub struct FinanceTemplateCashDiscount {
10688    /// Receiving account name.
10689    #[serde(deserialize_with = "crate::lenient::string")]
10690    pub account: String,
10691    #[serde(deserialize_with = "crate::lenient::string")]
10692    pub note: String,
10693    #[serde(deserialize_with = "crate::lenient::number")]
10694    pub rate: f64,
10695    /// Fields not described by the spec, e.g. instance-specific DB fields.
10696    #[serde(flatten)]
10697    pub extra: serde_json::Map<String, serde_json::Value>,
10698}
10699
10700/// Portable cost center definition in an exported finance template.
10701#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10702pub struct FinanceTemplateCostCenter {
10703    /// Budget in minor currency units.
10704    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10705    pub budget: Option<i64>,
10706    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10707    pub name: Option<String>,
10708    #[serde(deserialize_with = "crate::lenient::string")]
10709    pub number: String,
10710    /// Fields not described by the spec, e.g. instance-specific DB fields.
10711    #[serde(flatten)]
10712    pub extra: serde_json::Map<String, serde_json::Value>,
10713}
10714
10715#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10716pub struct FinanceTemplateCounts {
10717    #[serde(rename = "accountClasses", deserialize_with = "crate::lenient::number")]
10718    pub account_classes: i64,
10719    #[serde(rename = "accountGroups", deserialize_with = "crate::lenient::number")]
10720    pub account_groups: i64,
10721    #[serde(rename = "accountTypes", deserialize_with = "crate::lenient::number")]
10722    pub account_types: i64,
10723    #[serde(deserialize_with = "crate::lenient::number")]
10724    pub accounts: i64,
10725    #[serde(rename = "costCenters", deserialize_with = "crate::lenient::number")]
10726    pub cost_centers: i64,
10727    #[serde(rename = "taxRates", deserialize_with = "crate::lenient::number")]
10728    pub tax_rates: i64,
10729    #[serde(rename = "taxTypes", deserialize_with = "crate::lenient::number")]
10730    pub tax_types: i64,
10731    /// Fields not described by the spec, e.g. instance-specific DB fields.
10732    #[serde(flatten)]
10733    pub extra: serde_json::Map<String, serde_json::Value>,
10734}
10735
10736/// Portable chart-of-accounts definitions. Relationships use names or account numbers instead of database IDs. No transactions, client objects or accounting-period objects are included. This export is not a full-fidelity backup.
10737#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10738pub struct FinanceTemplateExport {
10739    #[serde(rename = "accountClasses")]
10740    pub account_classes: Vec<FinanceTemplateAccountClass>,
10741    #[serde(rename = "accountGroups")]
10742    pub account_groups: Vec<FinanceTemplateAccountGroup>,
10743    #[serde(rename = "accountTypes")]
10744    pub account_types: Vec<FinanceTemplateAccountType>,
10745    pub accounts: Vec<FinanceTemplateAccount>,
10746    #[serde(rename = "cashDiscounts")]
10747    pub cash_discounts: Vec<FinanceTemplateCashDiscount>,
10748    #[serde(rename = "costCenters")]
10749    pub cost_centers: Vec<FinanceTemplateCostCenter>,
10750    #[serde(rename = "taxRates")]
10751    pub tax_rates: Vec<FinanceTemplateTaxRate>,
10752    #[serde(rename = "taxTypes")]
10753    pub tax_types: Vec<FinanceTemplateTaxType>,
10754    /// Fields not described by the spec, e.g. instance-specific DB fields.
10755    #[serde(flatten)]
10756    pub extra: serde_json::Map<String, serde_json::Value>,
10757}
10758
10759/// Portable tax rate definition in an exported finance template.
10760#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10761pub struct FinanceTemplateTaxRate {
10762    /// Receiving account name.
10763    #[serde(deserialize_with = "crate::lenient::string")]
10764    pub account: String,
10765    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10766    pub note: Option<String>,
10767    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10768    pub rate: Option<f64>,
10769    #[serde(rename = "taxType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10770    pub tax_type: Option<String>,
10771    /// Fields not described by the spec, e.g. instance-specific DB fields.
10772    #[serde(flatten)]
10773    pub extra: serde_json::Map<String, serde_json::Value>,
10774}
10775
10776/// Portable tax type definition in an exported finance template.
10777#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10778pub struct FinanceTemplateTaxType {
10779    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10780    pub name: Option<String>,
10781    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
10782    pub sort_key: i64,
10783    /// Fields not described by the spec, e.g. instance-specific DB fields.
10784    #[serde(flatten)]
10785    pub extra: serde_json::Map<String, serde_json::Value>,
10786}
10787
10788/// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
10789#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10790pub struct FinanceYearValueComparison {
10791    #[serde(rename = "lastYear", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10792    pub last_year: Option<i64>,
10793    #[serde(rename = "thisYear", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10794    pub this_year: Option<i64>,
10795    /// Fields not described by the spec, e.g. instance-specific DB fields.
10796    #[serde(flatten)]
10797    pub extra: serde_json::Map<String, serde_json::Value>,
10798}
10799
10800/// A planned follow-up for a person, optionally associated with a group membership. dueDate is the original plan; effectiveDueDate is the currently scheduled date. doneDate marks both completed and dismissed follow-ups, which are distinguished in history rather than a separate response status. FollowUp is the older master-data type; this resource is FollowUp2 for compatibility.
10801#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10802pub struct FollowUp2 {
10803    /// A color in ChurchTools
10804    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
10805    #[serde(deserialize_with = "crate::lenient::string")]
10806    pub color: String,
10807    /// Trimmed description; missing, null or blank becomes null.
10808    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10809    pub description: Option<String>,
10810    /// Original planned date. May be absent/null; direct creation/update allows past dates. Omission on update clears it.
10811    #[serde(rename = "dueDate", default, skip_serializing_if = "Option::is_none")]
10812    pub due_date: Option<chrono::NaiveDate>,
10813    /// A simple date in ISO format, e.g. '2022-10-19'
10814    #[serde(rename = "effectiveDueDate", default, skip_serializing_if = "Option::is_none")]
10815    pub effective_due_date: Option<chrono::NaiveDate>,
10816    /// Configured icon, or handshake when none is configured.
10817    #[serde(deserialize_with = "crate::lenient::string")]
10818    pub icon: String,
10819    /// Person responsible for the follow-up, or null when it is handled by eligible group staff.
10820    #[serde(rename = "ownerId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10821    pub owner_id: Option<i64>,
10822    /// Optional fixed destination group for completion. Completion still requires the client to submit its selected successGroupId; it is not added automatically.
10823    #[serde(rename = "successGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10824    pub success_group_id: Option<i64>,
10825    /// Membership status assigned in the selected success group; null uses the default active status.
10826    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
10827    #[serde(rename = "successGroupMemberStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
10828    pub success_group_member_status: Option<String>,
10829    /// Optional group-type restriction for selecting a destination group on completion.
10830    #[serde(rename = "successGroupOfGroupTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10831    pub success_group_of_group_type_id: Option<i64>,
10832    /// Role assigned in the selected success group; null uses the membership service default.
10833    #[serde(rename = "successRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10834    pub success_role_id: Option<i64>,
10835    #[serde(deserialize_with = "crate::lenient::string")]
10836    pub title: String,
10837    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
10838    #[serde(rename = "doneDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
10839    pub done_date: Option<chrono::DateTime<chrono::Utc>>,
10840    /// Group context for a membership follow-up; null for a personal follow-up.
10841    #[serde(rename = "groupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10842    pub group_id: Option<i64>,
10843    #[serde(deserialize_with = "crate::lenient::number")]
10844    pub id: i64,
10845    /// Group-membership row ID, distinct from personId; null for personal follow-ups.
10846    #[serde(rename = "membershipId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
10847    pub membership_id: Option<i64>,
10848    pub meta: MetaDataEntityId,
10849    /// Allowed values: `bulk-job`, `default`, `migration`, `routine`.
10850    #[serde(deserialize_with = "crate::lenient::string")]
10851    pub origin: String,
10852    /// Person the follow-up concerns.
10853    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
10854    pub person_id: i64,
10855    /// Fields not described by the spec, e.g. instance-specific DB fields.
10856    #[serde(flatten)]
10857    pub extra: serde_json::Map<String, serde_json::Value>,
10858}
10859
10860/// Completion action payload. A configured fixed group is not selected automatically; `0` also completes without a membership action.
10861#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10862pub struct FollowUpCompletionCreate {
10863    /// Selected destination group. Must match a configured fixed group and/or group-type restriction. Completion can create or overwrite this person’s membership using the configured role/status defaults.
10864    ///
10865    /// `None` leaves the field out, `Some(None)` sends `null`.
10866    #[serde(rename = "successGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10867    pub success_group_id: Option<Option<i64>>,
10868    /// Fields not described by the spec, e.g. instance-specific DB fields.
10869    #[serde(flatten)]
10870    pub extra: serde_json::Map<String, serde_json::Value>,
10871}
10872
10873/// Input for a follow-up concerning a person, optionally within an existing group membership. The person is the subject; ownerId is the person responsible for handling it. Date fields are calendar dates, not timestamps. Only title must be nonempty; omitted/blank description is normalized to null. duration is not read by these direct CRUD endpoints.
10874#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10875pub struct FollowUpCreate {
10876    /// Optional color. Missing/null uses the yellow display fallback.
10877    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
10878    ///
10879    /// `None` leaves the field out, `Some(None)` sends `null`.
10880    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10881    pub color: Option<Option<String>>,
10882    /// Trimmed description; missing, null or blank becomes null.
10883    ///
10884    /// `None` leaves the field out, `Some(None)` sends `null`.
10885    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10886    pub description: Option<Option<String>>,
10887    /// Original planned date. May be absent/null; direct creation/update allows past dates. Omission on update clears it.
10888    ///
10889    /// `None` leaves the field out, `Some(None)` sends `null`.
10890    #[serde(rename = "dueDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10891    pub due_date: Option<Option<chrono::NaiveDate>>,
10892    /// Current working due date. Defaults to dueDate when omitted/null; postponement changes this independently of the original dueDate.
10893    ///
10894    /// `None` leaves the field out, `Some(None)` sends `null`.
10895    #[serde(rename = "effectiveDueDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10896    pub effective_due_date: Option<Option<chrono::NaiveDate>>,
10897    /// Optional icon name. Missing/null/blank is stored as null; responses display the handshake fallback.
10898    ///
10899    /// `None` leaves the field out, `Some(None)` sends `null`.
10900    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10901    pub icon: Option<Option<String>>,
10902    /// Responsible person ID. Personal creation defaults to the current user; group-member creation can remain unassigned. Omitted/null on update preserves the current owner.
10903    ///
10904    /// `None` leaves the field out, `Some(None)` sends `null`.
10905    #[serde(rename = "ownerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10906    pub owner_id: Option<Option<i64>>,
10907    /// Optional fixed destination group for completion. Completion still requires the client to submit its selected successGroupId; it is not added automatically.
10908    ///
10909    /// `None` leaves the field out, `Some(None)` sends `null`.
10910    #[serde(rename = "successGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10911    pub success_group_id: Option<Option<i64>>,
10912    /// Membership status assigned in the selected success group; null uses the default active status.
10913    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
10914    ///
10915    /// `None` leaves the field out, `Some(None)` sends `null`.
10916    #[serde(rename = "successGroupMemberStatus", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10917    pub success_group_member_status: Option<Option<String>>,
10918    /// Optional group-type restriction for selecting a destination group on completion.
10919    ///
10920    /// `None` leaves the field out, `Some(None)` sends `null`.
10921    #[serde(rename = "successGroupOfGroupTypeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10922    pub success_group_of_group_type_id: Option<Option<i64>>,
10923    /// Role assigned in the selected success group; null uses the membership service default.
10924    ///
10925    /// `None` leaves the field out, `Some(None)` sends `null`.
10926    #[serde(rename = "successRoleId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10927    pub success_role_id: Option<Option<i64>>,
10928    #[serde(deserialize_with = "crate::lenient::string")]
10929    pub title: String,
10930    /// Fields not described by the spec, e.g. instance-specific DB fields.
10931    #[serde(flatten)]
10932    pub extra: serde_json::Map<String, serde_json::Value>,
10933}
10934
10935#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10936pub struct FollowUpNoteCreate {
10937    /// Note text.
10938    #[serde(deserialize_with = "crate::lenient::string")]
10939    pub comment: String,
10940    /// Visibility category applied only to an additional person link when `also_apply_to_person=true`. Ignored for the follow-up link itself.
10941    ///
10942    /// `None` leaves the field out, `Some(None)` sends `null`.
10943    #[serde(rename = "commentViewerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10944    pub comment_viewer_id: Option<Option<i64>>,
10945    /// Fields not described by the spec, e.g. instance-specific DB fields.
10946    #[serde(flatten)]
10947    pub extra: serde_json::Map<String, serde_json::Value>,
10948}
10949
10950#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10951pub struct FollowUpPostponeCreate {
10952    /// New effective date, strictly after today in server date handling. The original `dueDate` is retained.
10953    #[serde(rename = "dueDate")]
10954    pub due_date: chrono::NaiveDate,
10955    /// Fields not described by the spec, e.g. instance-specific DB fields.
10956    #[serde(flatten)]
10957    pub extra: serde_json::Map<String, serde_json::Value>,
10958}
10959
10960#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10961pub struct FollowUpResetCreate {
10962    /// A future date overrides `effectiveDueDate`; otherwise it is restored from the original `dueDate`, which may be past or null.
10963    ///
10964    /// `None` leaves the field out, `Some(None)` sends `null`.
10965    #[serde(rename = "dueDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10966    pub due_date: Option<Option<chrono::NaiveDate>>,
10967    /// Fields not described by the spec, e.g. instance-specific DB fields.
10968    #[serde(flatten)]
10969    pub extra: serde_json::Map<String, serde_json::Value>,
10970}
10971
10972/// Mutable fields of a follow-up backed by a shared specification. The specification owns `title`, `description`, `icon`, `color` and success settings, so those fields cannot be changed through the follow-up endpoint.
10973#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10974pub struct FollowUpSharedUpdate {
10975    /// Original planned date. Omission or null clears it.
10976    ///
10977    /// `None` leaves the field out, `Some(None)` sends `null`.
10978    #[serde(rename = "dueDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10979    pub due_date: Option<Option<chrono::NaiveDate>>,
10980    /// Current working due date. Defaults to dueDate when omitted/null.
10981    ///
10982    /// `None` leaves the field out, `Some(None)` sends `null`.
10983    #[serde(rename = "effectiveDueDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10984    pub effective_due_date: Option<Option<chrono::NaiveDate>>,
10985    /// Responsible person ID. Omitted/null preserves the current owner.
10986    ///
10987    /// `None` leaves the field out, `Some(None)` sends `null`.
10988    #[serde(rename = "ownerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
10989    pub owner_id: Option<Option<i64>>,
10990    /// Fields not described by the spec, e.g. instance-specific DB fields.
10991    #[serde(flatten)]
10992    pub extra: serde_json::Map<String, serde_json::Value>,
10993}
10994
10995/// Counts within the current user’s follow-up scope, excluding archived subject persons. Pending categories use the effective due date after postponements and the server’s current date. Completed and dismissed items both count as done. All counters are present, including zero.
10996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
10997pub struct FollowUpStatistics {
10998    /// Number of completed or dismissed follow-ups (doneDate is set).
10999    #[serde(rename = "countDone", deserialize_with = "crate::lenient::number")]
11000    pub count_done: i64,
11001    /// Number of pending follow-ups due after today
11002    #[serde(rename = "countDueAfterToday", deserialize_with = "crate::lenient::number")]
11003    pub count_due_after_today: i64,
11004    /// Number of pending follow-ups due before today (aka 'overdue')
11005    #[serde(rename = "countDueBeforeToday", deserialize_with = "crate::lenient::number")]
11006    pub count_due_before_today: i64,
11007    /// Number of pending follow-ups due today
11008    #[serde(rename = "countDueToday", deserialize_with = "crate::lenient::number")]
11009    pub count_due_today: i64,
11010    /// Number of pending follow-ups without due date
11011    #[serde(rename = "countDueUnspecified", deserialize_with = "crate::lenient::number")]
11012    pub count_due_unspecified: i64,
11013    /// Fields not described by the spec, e.g. instance-specific DB fields.
11014    #[serde(flatten)]
11015    pub extra: serde_json::Map<String, serde_json::Value>,
11016}
11017
11018/// Update of a follow-up backed by an unshared specification. Updating a shared specification uses `FollowUpSharedUpdate` instead. The owner cannot be unassigned through this endpoint.
11019#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11020pub struct FollowUpUpdate {
11021    /// Optional color. Missing/null uses the yellow display fallback.
11022    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
11023    ///
11024    /// `None` leaves the field out, `Some(None)` sends `null`.
11025    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11026    pub color: Option<Option<String>>,
11027    /// Trimmed description; missing, null or blank becomes null.
11028    ///
11029    /// `None` leaves the field out, `Some(None)` sends `null`.
11030    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11031    pub description: Option<Option<String>>,
11032    /// Original planned date. May be absent/null; direct creation/update allows past dates. Omission on update clears it.
11033    ///
11034    /// `None` leaves the field out, `Some(None)` sends `null`.
11035    #[serde(rename = "dueDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11036    pub due_date: Option<Option<chrono::NaiveDate>>,
11037    /// Current working due date. Defaults to dueDate when omitted/null; postponement changes this independently of the original dueDate.
11038    ///
11039    /// `None` leaves the field out, `Some(None)` sends `null`.
11040    #[serde(rename = "effectiveDueDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11041    pub effective_due_date: Option<Option<chrono::NaiveDate>>,
11042    /// Optional icon name. Missing/null/blank is stored as null; responses display the handshake fallback.
11043    ///
11044    /// `None` leaves the field out, `Some(None)` sends `null`.
11045    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11046    pub icon: Option<Option<String>>,
11047    /// Responsible person ID. Personal creation defaults to the current user; group-member creation can remain unassigned. Omitted/null on update preserves the current owner.
11048    ///
11049    /// `None` leaves the field out, `Some(None)` sends `null`.
11050    #[serde(rename = "ownerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11051    pub owner_id: Option<Option<i64>>,
11052    /// Optional fixed destination group for completion. Completion still requires the client to submit its selected successGroupId; it is not added automatically.
11053    ///
11054    /// `None` leaves the field out, `Some(None)` sends `null`.
11055    #[serde(rename = "successGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11056    pub success_group_id: Option<Option<i64>>,
11057    /// Membership status assigned in the selected success group; null uses the default active status.
11058    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
11059    ///
11060    /// `None` leaves the field out, `Some(None)` sends `null`.
11061    #[serde(rename = "successGroupMemberStatus", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11062    pub success_group_member_status: Option<Option<String>>,
11063    /// Optional group-type restriction for selecting a destination group on completion.
11064    ///
11065    /// `None` leaves the field out, `Some(None)` sends `null`.
11066    #[serde(rename = "successGroupOfGroupTypeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11067    pub success_group_of_group_type_id: Option<Option<i64>>,
11068    /// Role assigned in the selected success group; null uses the membership service default.
11069    ///
11070    /// `None` leaves the field out, `Some(None)` sends `null`.
11071    #[serde(rename = "successRoleId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
11072    pub success_role_id: Option<Option<i64>>,
11073    #[serde(deserialize_with = "crate::lenient::string")]
11074    pub title: String,
11075    /// Fields not described by the spec, e.g. instance-specific DB fields.
11076    #[serde(flatten)]
11077    pub extra: serde_json::Map<String, serde_json::Value>,
11078}
11079
11080#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11081pub struct FurtherLink {
11082    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11083    pub description: Option<String>,
11084    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11085    pub image_url: Option<String>,
11086    #[serde(deserialize_with = "crate::lenient::string")]
11087    pub name: String,
11088    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
11089    pub sort_key: f64,
11090    #[serde(deserialize_with = "crate::lenient::string")]
11091    pub url: String,
11092    #[serde(deserialize_with = "crate::lenient::number")]
11093    pub id: i64,
11094    /// Fields not described by the spec, e.g. instance-specific DB fields.
11095    #[serde(flatten)]
11096    pub extra: serde_json::Map<String, serde_json::Value>,
11097}
11098
11099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11100pub struct FurtherLinkCreate {
11101    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11102    pub description: Option<String>,
11103    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11104    pub image_url: Option<String>,
11105    #[serde(deserialize_with = "crate::lenient::string")]
11106    pub name: String,
11107    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
11108    pub sort_key: f64,
11109    #[serde(deserialize_with = "crate::lenient::string")]
11110    pub url: String,
11111    /// Fields not described by the spec, e.g. instance-specific DB fields.
11112    #[serde(flatten)]
11113    pub extra: serde_json::Map<String, serde_json::Value>,
11114}
11115
11116#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11117pub struct GetCaptchaResponse {
11118    pub parameters: GetCaptchaResponseParameters,
11119    #[serde(deserialize_with = "crate::lenient::string")]
11120    pub signature: String,
11121    /// Fields not described by the spec, e.g. instance-specific DB fields.
11122    #[serde(flatten)]
11123    pub extra: serde_json::Map<String, serde_json::Value>,
11124}
11125
11126#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11127pub struct GetCaptchaResponseParameters {
11128    #[serde(deserialize_with = "crate::lenient::string")]
11129    pub algorithm: String,
11130    #[serde(deserialize_with = "crate::lenient::number")]
11131    pub cost: i64,
11132    #[serde(rename = "expiresAt", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11133    pub expires_at: Option<i64>,
11134    #[serde(rename = "keyLength", deserialize_with = "crate::lenient::number")]
11135    pub key_length: i64,
11136    #[serde(rename = "keyPrefix", deserialize_with = "crate::lenient::string")]
11137    pub key_prefix: String,
11138    #[serde(rename = "keySignature", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11139    pub key_signature: Option<String>,
11140    #[serde(deserialize_with = "crate::lenient::string")]
11141    pub nonce: String,
11142    #[serde(deserialize_with = "crate::lenient::string")]
11143    pub salt: String,
11144    /// Fields not described by the spec, e.g. instance-specific DB fields.
11145    #[serde(flatten)]
11146    pub extra: serde_json::Map<String, serde_json::Value>,
11147}
11148
11149#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11150pub struct GetConfigResponse {
11151    #[serde(rename = "_current_config_file", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11152    pub current_config_file: Option<String>,
11153    #[serde(default, skip_serializing_if = "Option::is_none")]
11154    pub accept_datasecurity: Option<bool>,
11155    #[serde(default, skip_serializing_if = "Option::is_none")]
11156    pub access_control_allow_credentials: Option<bool>,
11157    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11158    pub access_control_allow_origins: Option<String>,
11159    #[serde(default, skip_serializing_if = "Option::is_none")]
11160    pub admin_ids: Option<Vec<String>>,
11161    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11162    pub admin_mail: Option<String>,
11163    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11164    pub admin_message: Option<String>,
11165    #[serde(rename = "aiAssistantAvailable", default, skip_serializing_if = "Option::is_none")]
11166    pub ai_assistant_available: Option<bool>,
11167    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11168    pub ai_description_available_generation_count: Option<f64>,
11169    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11170    pub ai_description_available_generation_tests: Option<f64>,
11171    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11172    pub ai_description_generation_count: Option<f64>,
11173    #[serde(default, skip_serializing_if = "Option::is_none")]
11174    pub ai_description_generation_enabled: Option<bool>,
11175    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11176    pub ai_description_total_generation_count: Option<f64>,
11177    #[serde(default, skip_serializing_if = "Option::is_none")]
11178    pub allowaiassistant: Option<bool>,
11179    /// This is a string that can only be true or false.
11180    /// Allowed values: `0`, `1`.
11181    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11182    pub allowcheckin: Option<String>,
11183    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11184    pub allowedcals: Option<String>,
11185    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11186    pub allowedclients: Option<String>,
11187    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11188    pub allowedcwbusers: Option<String>,
11189    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11190    pub allowedresources: Option<String>,
11191    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11192    pub allowedservices: Option<String>,
11193    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11194    pub allowedstations: Option<String>,
11195    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11196    pub allowedsyncconnections: Option<String>,
11197    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11198    pub allowedsyncjobs: Option<String>,
11199    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11200    pub allowedtextgenerations: Option<String>,
11201    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11202    pub alloweduser: Option<String>,
11203    /// This is a string that can only be true or false.
11204    /// Allowed values: `0`, `1`.
11205    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11206    pub allowfinance: Option<String>,
11207    /// This is a string that can only be true or false.
11208    /// Allowed values: `0`, `1`.
11209    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11210    pub allowldap: Option<String>,
11211    /// This is a string that can only be true or false.
11212    /// Allowed values: `0`, `1`.
11213    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11214    pub allowoptigemsync: Option<String>,
11215    /// This is a string that can only be true or false.
11216    /// Allowed values: `0`, `1`.
11217    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11218    pub allowsync: Option<String>,
11219    #[serde(default, skip_serializing_if = "Option::is_none")]
11220    pub app_security_request: Option<bool>,
11221    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
11222    pub auth_cache_time: serde_json::Value,
11223    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11224    pub authorized_persons: Option<String>,
11225    /// Allowed values: `ChurchTools`, `VereinTools`.
11226    #[serde(deserialize_with = "crate::lenient::string")]
11227    pub brand: String,
11228    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11229    pub build: Option<String>,
11230    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11231    pub ccli_access_token: Option<String>,
11232    #[serde(default, skip_serializing_if = "Option::is_none")]
11233    pub ccli_auto_reporting_enabled: Option<bool>,
11234    #[serde(default, skip_serializing_if = "Option::is_none")]
11235    pub ccli_enabled: Option<bool>,
11236    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11237    pub ccli_last_token_refresh: Option<String>,
11238    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11239    pub ccli_refresh_token: Option<String>,
11240    #[serde(rename = "chatServer", deserialize_with = "crate::lenient::string")]
11241    pub chat_server: String,
11242    /// This is a string that can only be true or false.
11243    /// Allowed values: `0`, `1`.
11244    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11245    pub chrome_active: Option<String>,
11246    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11247    pub chrome_binary: Option<String>,
11248    #[serde(default, skip_serializing_if = "Option::is_none")]
11249    pub churchcal_active: Option<bool>,
11250    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11251    pub churchcal_css: Option<String>,
11252    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11253    pub churchcal_entries_last_days: Option<i64>,
11254    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11255    pub churchcal_firstdayinweek: Option<i64>,
11256    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11257    pub churchcal_maincalname: Option<String>,
11258    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11259    pub churchcal_name: Option<String>,
11260    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11261    pub churchcal_name_default: Option<String>,
11262    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11263    pub churchcal_sortcode: Option<i64>,
11264    #[serde(default, skip_serializing_if = "Option::is_none")]
11265    pub churchchat_allow_event_chat: Option<bool>,
11266    #[serde(default, skip_serializing_if = "Option::is_none")]
11267    pub churchchat_allow_group_chat: Option<bool>,
11268    #[serde(default, skip_serializing_if = "Option::is_none")]
11269    pub churchchat_allow_person_chat: Option<bool>,
11270    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11271    pub churchchat_delete_event_chat_after_x_days: Option<i64>,
11272    #[serde(default, skip_serializing_if = "Option::is_none")]
11273    pub churchchat_invite_ct_event_chat: Option<bool>,
11274    #[serde(default, skip_serializing_if = "Option::is_none")]
11275    pub churchchat_invite_ct_group_chat: Option<bool>,
11276    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11277    pub churchchat_name: Option<String>,
11278    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11279    pub churchchat_name_default: Option<String>,
11280    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11281    pub churchchat_sortcode: Option<i64>,
11282    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11283    pub churchchat_start_event_chat_before_x_days: Option<i64>,
11284    /// A stringified array of calendar ids
11285    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11286    pub churchchat_start_event_chat_for_calendars: Option<String>,
11287    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11288    pub churchchat_sync_user_id: Option<i64>,
11289    #[serde(default, skip_serializing_if = "Option::is_none")]
11290    pub churchcheckin_active: Option<bool>,
11291    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11292    pub churchcheckin_label_child: Option<String>,
11293    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11294    pub churchcheckin_label_parent: Option<String>,
11295    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11296    pub churchcheckin_label_standard: Option<String>,
11297    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11298    pub churchcheckin_name: Option<String>,
11299    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11300    pub churchcheckin_name_default: Option<String>,
11301    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11302    pub churchcheckin_sortcode: Option<i64>,
11303    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11304    pub churchcheckin_tags: Option<String>,
11305    /// This is a string that can only be true or false.
11306    /// Allowed values: `0`, `1`.
11307    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11308    pub churchcustommodule_active: Option<String>,
11309    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11310    pub churchcustommodule_name: Option<String>,
11311    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11312    pub churchcustommodule_name_default: Option<String>,
11313    #[serde(default, skip_serializing_if = "Option::is_none")]
11314    pub churchdb_active: Option<bool>,
11315    #[serde(default, skip_serializing_if = "Option::is_none")]
11316    pub churchdb_archivedeletehistory: Option<bool>,
11317    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11318    pub churchdb_birthdaylist_station: Option<String>,
11319    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11320    pub churchdb_birthdaylist_status: Option<String>,
11321    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11322    pub churchdb_cleverreach_access_token: Option<String>,
11323    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11324    pub churchdb_cleverreach_client_id: Option<String>,
11325    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11326    pub churchdb_cleverreach_client_secret: Option<String>,
11327    /// Allowed values: `false`, `true`.
11328    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11329    pub churchdb_cleverreach_connected: Option<String>,
11330    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11331    pub churchdb_cleverreach_refresh_token: Option<String>,
11332    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11333    pub churchdb_cleverreach_scopes: Option<String>,
11334    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11335    pub churchdb_cleverreach_token_expiry: Option<String>,
11336    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11337    pub churchdb_emailseparator: Option<String>,
11338    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11339    pub churchdb_home_lat: Option<String>,
11340    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11341    pub churchdb_home_lng: Option<String>,
11342    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11343    pub churchdb_mailchimp_apikey: Option<String>,
11344    #[serde(default, skip_serializing_if = "Option::is_none")]
11345    pub churchdb_mailchimp_connected: Option<bool>,
11346    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11347    pub churchdb_mailjet_apikey: Option<String>,
11348    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11349    pub churchdb_mailjet_apisecret: Option<String>,
11350    #[serde(default, skip_serializing_if = "Option::is_none")]
11351    pub churchdb_mailjet_connected: Option<bool>,
11352    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11353    pub churchdb_memberlist_station: Option<String>,
11354    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11355    pub churchdb_memberlist_status: Option<String>,
11356    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11357    pub churchdb_name: Option<String>,
11358    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11359    pub churchdb_name_default: Option<String>,
11360    #[serde(default, skip_serializing_if = "Option::is_none")]
11361    pub churchdb_sendgroupmails: Option<bool>,
11362    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11363    pub churchdb_smscmtelecom_apikey: Option<String>,
11364    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11365    pub churchdb_smspromote_apikey: Option<String>,
11366    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11367    pub churchdb_sortcode: Option<i64>,
11368    #[serde(default, skip_serializing_if = "Option::is_none")]
11369    pub churchfinance_active: Option<bool>,
11370    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11371    pub churchfinance_name: Option<String>,
11372    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11373    pub churchfinance_name_default: Option<String>,
11374    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11375    pub churchfinance_sortcode: Option<i64>,
11376    #[serde(default, skip_serializing_if = "Option::is_none")]
11377    pub churchgroup_active: Option<bool>,
11378    #[serde(default, skip_serializing_if = "Option::is_none")]
11379    pub churchgroup_inmenu: Option<bool>,
11380    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11381    pub churchgroup_name: Option<String>,
11382    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11383    pub churchgroup_name_default: Option<String>,
11384    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11385    pub churchgroup_sortcode: Option<i64>,
11386    #[serde(default, skip_serializing_if = "Option::is_none")]
11387    pub churchreport_active: Option<bool>,
11388    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11389    pub churchreport_name: Option<String>,
11390    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11391    pub churchreport_name_default: Option<String>,
11392    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11393    pub churchreport_sortcode: Option<i64>,
11394    #[serde(default, skip_serializing_if = "Option::is_none")]
11395    pub churchresource_active: Option<bool>,
11396    #[serde(default, skip_serializing_if = "Option::is_none")]
11397    pub churchresource_anonymize_for_public_user: Option<bool>,
11398    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11399    pub churchresource_entries_last_days: Option<i64>,
11400    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11401    pub churchresource_name: Option<String>,
11402    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11403    pub churchresource_name_default: Option<String>,
11404    #[serde(default, skip_serializing_if = "Option::is_none")]
11405    pub churchresource_send_emails: Option<bool>,
11406    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11407    pub churchresource_sortcode: Option<i64>,
11408    #[serde(default, skip_serializing_if = "Option::is_none")]
11409    pub churchservice_active: Option<bool>,
11410    #[serde(default, skip_serializing_if = "Option::is_none")]
11411    pub churchservice_agendashowenumeration: Option<bool>,
11412    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11413    pub churchservice_ccli_token: Option<String>,
11414    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11415    pub churchservice_ccli_token_secret: Option<String>,
11416    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11417    pub churchservice_entries_last_days: Option<i64>,
11418    #[serde(default, skip_serializing_if = "Option::is_none")]
11419    pub churchservice_invite_persons: Option<bool>,
11420    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11421    pub churchservice_name: Option<String>,
11422    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11423    pub churchservice_name_default: Option<String>,
11424    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11425    pub churchservice_openservice_rememberdays: Option<i64>,
11426    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11427    pub churchservice_reminderhours: Option<i64>,
11428    #[serde(default, skip_serializing_if = "Option::is_none")]
11429    pub churchservice_songwithcategoryasdir: Option<bool>,
11430    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11431    pub churchservice_sortcode: Option<i64>,
11432    #[serde(default, skip_serializing_if = "Option::is_none")]
11433    pub churchsync_active: Option<bool>,
11434    #[serde(default, skip_serializing_if = "Option::is_none")]
11435    pub churchsync_inmenu: Option<bool>,
11436    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11437    pub churchsync_name: Option<String>,
11438    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11439    pub churchsync_name_default: Option<String>,
11440    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11441    pub churchsync_sortcode: Option<i64>,
11442    #[serde(default, skip_serializing_if = "Option::is_none")]
11443    pub churchwiki_active: Option<bool>,
11444    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11445    pub churchwiki_name: Option<String>,
11446    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11447    pub churchwiki_name_default: Option<String>,
11448    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11449    pub churchwiki_sortcode: Option<i64>,
11450    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11451    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
11452    pub cron_daily: Option<chrono::DateTime<chrono::Utc>>,
11453    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11454    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
11455    pub cron_hour_8: Option<chrono::DateTime<chrono::Utc>>,
11456    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11457    pub cron_last_execution: Option<String>,
11458    /// This is a string that can only be true or false.
11459    /// Allowed values: `0`, `1`.
11460    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11461    pub cronjob_dbdump: Option<String>,
11462    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11463    pub cronjob_delay: Option<i64>,
11464    /// This is a string that can only be true or false.
11465    /// Allowed values: `0`, `1`.
11466    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11467    pub currently_mail_sending: Option<String>,
11468    #[serde(rename = "datasecurityPrivacyDeclarationWikiLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11469    pub datasecurity_privacy_declaration_wiki_link: Option<String>,
11470    #[serde(default, skip_serializing_if = "Option::is_none")]
11471    pub datasecurity_banner_enabled: Option<bool>,
11472    /// Only in extended config
11473    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11474    pub datasecurity_privacy_agreement_hint: Option<String>,
11475    /// Only in extended config
11476    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11477    pub datasecurity_privacy_agreement_text: Option<String>,
11478    /// Only in extended config
11479    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11480    pub datasecurity_privacy_agreement_text_for_children: Option<String>,
11481    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11482    pub db_name: Option<String>,
11483    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11484    pub db_password: Option<String>,
11485    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11486    pub db_server: Option<String>,
11487    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11488    pub db_user: Option<String>,
11489    #[serde(default, skip_serializing_if = "Option::is_none")]
11490    pub deactivate_default_login: Option<bool>,
11491    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11492    pub default_phone_area_code: Option<String>,
11493    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11494    pub deprecation_usage_mail_last_execution: Option<String>,
11495    /// Allowed values: `churchtools`, `own`.
11496    #[serde(rename = "emailServer", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11497    pub email_server: Option<String>,
11498    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11499    pub encryptionkey: Option<String>,
11500    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11501    pub env: Option<String>,
11502    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11503    pub evangelische_termine_api_key: Option<String>,
11504    #[serde(default, skip_serializing_if = "Option::is_none")]
11505    pub evangelische_termine_enabled: Option<bool>,
11506    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11507    pub evangelische_termine_name: Option<String>,
11508    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11509    pub evangelische_termine_url: Option<String>,
11510    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11511    pub evangelische_termine_vid: Option<String>,
11512    #[serde(default, skip_serializing_if = "Option::is_none")]
11513    pub feature_appointment_search: Option<bool>,
11514    /// This is a string that can only be true or false.
11515    /// Allowed values: `0`, `1`.
11516    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11517    pub feature_automation: Option<String>,
11518    /// This is a string that can only be true or false.
11519    /// Allowed values: `0`, `1`.
11520    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11521    pub feature_custommodule: Option<String>,
11522    /// This is a string that can only be true or false.
11523    /// Allowed values: `0`, `1`.
11524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11525    pub feature_darkmode: Option<String>,
11526    /// This is a string that can only be true or false.
11527    /// Allowed values: `0`, `1`.
11528    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11529    pub feature_dynamic_groups: Option<String>,
11530    #[serde(default, skip_serializing_if = "Option::is_none")]
11531    pub feature_eubp: Option<bool>,
11532    #[serde(default, skip_serializing_if = "Option::is_none")]
11533    pub feature_event_fact_widget: Option<bool>,
11534    #[serde(default, skip_serializing_if = "Option::is_none")]
11535    pub feature_finance_donators_datatable: Option<bool>,
11536    #[serde(default, skip_serializing_if = "Option::is_none")]
11537    pub feature_flags_ui: Option<bool>,
11538    /// This is a string that can only be true or false.
11539    /// Allowed values: `0`, `1`.
11540    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11541    pub feature_group: Option<String>,
11542    /// Deprecated compatibility flag that is always true.
11543    #[serde(default, skip_serializing_if = "Option::is_none")]
11544    #[deprecated = "deprecated in the ChurchTools API"]
11545    pub feature_markdown_group: Option<bool>,
11546    /// This is a string that can only be true or false.
11547    /// Allowed values: `0`, `1`.
11548    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11549    pub feature_mobile_groups: Option<String>,
11550    /// Deprecated compatibility flag that is always true.
11551    #[serde(default, skip_serializing_if = "Option::is_none")]
11552    #[deprecated = "deprecated in the ChurchTools API"]
11553    pub feature_newsfeed_comment_reactions: Option<bool>,
11554    #[serde(default, skip_serializing_if = "Option::is_none")]
11555    pub feature_old_group_module: Option<bool>,
11556    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11557    pub feature_org_chart_groups: Option<String>,
11558    #[serde(default, skip_serializing_if = "Option::is_none")]
11559    pub feature_permission_new: Option<bool>,
11560    #[serde(default, skip_serializing_if = "Option::is_none")]
11561    pub feature_person_probe_filter: Option<bool>,
11562    /// This is a string that can only be true or false.
11563    /// Allowed values: `0`, `1`.
11564    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11565    pub feature_posts: Option<String>,
11566    /// This is a string that can only be true or false.
11567    /// Allowed values: `0`, `1`.
11568    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11569    pub feature_resources_app: Option<String>,
11570    #[serde(default, skip_serializing_if = "Option::is_none")]
11571    pub feature_sessionless_login: Option<bool>,
11572    /// This is a string that can only be true or false.
11573    /// Allowed values: `0`, `1`.
11574    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11575    pub feature_sync: Option<String>,
11576    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11577    pub feature_usechurchquery: Option<String>,
11578    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11579    pub file_meta_cron_last_file_size_id: Option<String>,
11580    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11581    pub file_meta_cron_last_image_metadata_id: Option<String>,
11582    #[serde(default, skip_serializing_if = "Option::is_none")]
11583    pub finance_active: Option<bool>,
11584    /// This is a string that can only be true or false.
11585    /// Allowed values: `0`, `1`.
11586    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11587    pub finance_inmenu: Option<String>,
11588    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11589    pub finance_name: Option<String>,
11590    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11591    pub finance_name_default: Option<String>,
11592    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11593    pub finance_sortcode: Option<String>,
11594    #[serde(rename = "finderUrl", deserialize_with = "crate::lenient::string")]
11595    pub finder_url: String,
11596    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11597    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
11598    pub first_sync_job: Option<chrono::DateTime<chrono::Utc>>,
11599    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11600    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
11601    pub first_transaction: Option<chrono::DateTime<chrono::Utc>>,
11602    #[serde(rename = "hideBetaStates", default, skip_serializing_if = "Option::is_none")]
11603    pub hide_beta_states: Option<bool>,
11604    #[serde(default, skip_serializing_if = "Option::is_none")]
11605    pub hide_all_hints: Option<bool>,
11606    /// This is a string that can only be true or false.
11607    /// Allowed values: `0`, `1`.
11608    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11609    pub hostingservice: Option<String>,
11610    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11611    pub https_only: Option<String>,
11612    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11613    pub ical_invitation_hmac_secret: Option<String>,
11614    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11615    pub image_extension: Option<String>,
11616    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11617    pub impressum_external: Option<String>,
11618    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11619    pub impressum_external_link: Option<String>,
11620    /// This is a string that can only be true or false.
11621    /// Allowed values: `0`, `1`.
11622    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11623    pub impressum_internal: Option<String>,
11624    #[serde(rename = "imprintWikiLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11625    pub imprint_wiki_link: Option<String>,
11626    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11627    pub installation_verification_code: Option<String>,
11628    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11629    pub invite_email_text: Option<String>,
11630    /// Whether the current user is configured as an authorized person.
11631    #[serde(rename = "isCurrentUserAuthorizedPerson")]
11632    pub is_current_user_authorized_person: bool,
11633    #[serde(rename = "isPostsActive")]
11634    pub is_posts_active: bool,
11635    #[serde(rename = "isSamlActive", default, skip_serializing_if = "Option::is_none")]
11636    pub is_saml_active: Option<bool>,
11637    #[serde(default, skip_serializing_if = "Option::is_none")]
11638    pub is_churchtools_blog_widget_active: Option<bool>,
11639    #[serde(default, skip_serializing_if = "Option::is_none")]
11640    pub is_churchtools_onboarding_widget_active: Option<bool>,
11641    #[serde(default, skip_serializing_if = "Option::is_none")]
11642    pub is_pr_widget_active: Option<bool>,
11643    #[serde(default, skip_serializing_if = "Option::is_none")]
11644    pub is_rss_widget_active: Option<bool>,
11645    /// The language code is a two-letter code that represents the language. For example, "en" for English, "de" for German, and "fr" for French.
11646    /// Allowed values: `cn`, `de`, `en`, `es`, `fa`, `fi`, `fr`, `it`, `nl`, `pl`, `pt`, `ru`, `sv`, `tw`.
11647    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11648    pub language: Option<String>,
11649    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11650    pub last_cron: Option<String>,
11651    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11652    pub last_cron_finished: Option<String>,
11653    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11654    pub last_db_dump: Option<String>,
11655    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11656    pub last_import_clear: Option<String>,
11657    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11658    pub last_translation_update: Option<String>,
11659    #[serde(default, skip_serializing_if = "Option::is_none")]
11660    pub ldap_otp_enabled: Option<bool>,
11661    #[serde(rename = "licenseSettings", default, skip_serializing_if = "Option::is_none")]
11662    pub license_settings: Option<GetConfigResponseLicenseSettings>,
11663    /// This is a string that can only be true or false.
11664    /// Allowed values: `0`, `1`.
11665    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11666    pub log_debug: Option<String>,
11667    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11668    pub login_message: Option<String>,
11669    #[serde(default, skip_serializing_if = "Option::is_none")]
11670    pub mail_enabled: Option<bool>,
11671    /// This is a string that can only be true or false.
11672    /// Allowed values: `0`, `1`.
11673    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11674    pub mail_sending_in_background: Option<String>,
11675    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11676    pub mail_sending_starttime: Option<String>,
11677    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11678    pub mail_smtp_args_host: Option<String>,
11679    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11680    pub mail_smtp_args_password: Option<String>,
11681    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11682    pub mail_smtp_args_port: Option<String>,
11683    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11684    pub mail_smtp_args_smtpsecure: Option<String>,
11685    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11686    pub mail_smtp_args_username: Option<String>,
11687    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11688    pub matomo_uri: Option<String>,
11689    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11690    pub max_uploadfile_size_kb: Option<i64>,
11691    /// This is a string that can only be true or false.
11692    /// Allowed values: `0`, `1`.
11693    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11694    pub memberlist_birthday_full: Option<String>,
11695    /// This is a string that can only be true or false.
11696    /// Allowed values: `0`, `1`.
11697    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11698    pub memberlist_email: Option<String>,
11699    /// This is a string that can only be true or false.
11700    /// Allowed values: `0`, `1`.
11701    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11702    pub memberlist_fax: Option<String>,
11703    /// This is a string that can only be true or false.
11704    /// Allowed values: `0`, `1`.
11705    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11706    pub memberlist_group_couples: Option<String>,
11707    /// This is a string that can only be true or false.
11708    /// Allowed values: `0`, `1`.
11709    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11710    pub memberlist_picture: Option<String>,
11711    /// This is a string that can only be true or false.
11712    /// Allowed values: `0`, `1`.
11713    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11714    pub memberlist_salutation: Option<String>,
11715    /// This is a string that can only be true or false.
11716    /// Allowed values: `0`, `1`.
11717    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11718    pub memberlist_telefongeschaeftlich: Option<String>,
11719    /// This is a string that can only be true or false.
11720    /// Allowed values: `0`, `1`.
11721    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11722    pub memberlist_telefonhandy: Option<String>,
11723    /// This is a string that can only be true or false.
11724    /// Allowed values: `0`, `1`.
11725    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11726    pub memberlist_telefonprivat: Option<String>,
11727    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11728    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
11729    pub onboarding_start: Option<chrono::DateTime<chrono::Utc>>,
11730    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11731    pub openai_api_key: Option<String>,
11732    #[serde(default, skip_serializing_if = "Option::is_none")]
11733    pub openstreetmaps_enabled: Option<bool>,
11734    /// Allowed values: `Auftrag`, `Bedenkzeit`, `Entscheidung`, `Finder`, `FinderCombo`, `Mitarbeiter`, `Testphase`, `Unbekannt`, `Vorlage/Schulung/Test`, `WebsiteCombo`, `zu löschen`.
11735    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11736    pub orderstatus: Option<String>,
11737    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11738    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
11739    pub orderstatus_since_date: Option<chrono::DateTime<chrono::Utc>>,
11740    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11741    pub package: Option<String>,
11742    #[serde(default, skip_serializing_if = "Option::is_none")]
11743    pub post_active: Option<bool>,
11744    #[serde(default, skip_serializing_if = "Option::is_none")]
11745    pub post_edit_time_limited: Option<bool>,
11746    #[serde(default, skip_serializing_if = "Option::is_none")]
11747    pub post_email_summary_default_enabled: Option<bool>,
11748    /// Allowed values: `all`, `featured_groups`, `my_groups`.
11749    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11750    pub post_email_summary_default_filter: Option<String>,
11751    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11752    pub post_email_summary_default_weekdays: Option<String>,
11753    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11754    pub post_featured_groups: Option<String>,
11755    #[serde(default, skip_serializing_if = "Option::is_none")]
11756    pub post_inmenu: Option<bool>,
11757    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11758    pub post_name: Option<String>,
11759    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11760    pub post_sortcode: Option<i64>,
11761    #[serde(default, skip_serializing_if = "Option::is_none")]
11762    pub post_wizard_completed: Option<bool>,
11763    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11764    pub post_wizard_groups: Option<String>,
11765    /// Allowed values: `0`, `1`.
11766    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11767    pub prevent_change_security_settings: Option<String>,
11768    #[serde(default, skip_serializing_if = "Option::is_none")]
11769    pub prevent_export: Option<bool>,
11770    #[serde(default, skip_serializing_if = "Option::is_none")]
11771    pub prevent_manual_finance_account_creation: Option<bool>,
11772    #[serde(default, skip_serializing_if = "Option::is_none")]
11773    pub privacy_policy_external: Option<bool>,
11774    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11775    pub privacy_policy_external_link: Option<String>,
11776    #[serde(default, skip_serializing_if = "Option::is_none")]
11777    pub privacy_policy_fields_mandatory: Option<bool>,
11778    #[serde(default, skip_serializing_if = "Option::is_none")]
11779    pub privacy_policy_fields_mandatory_api: Option<bool>,
11780    #[serde(default, skip_serializing_if = "Option::is_none")]
11781    pub privacy_policy_internal: Option<bool>,
11782    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11783    pub privacy_policy_relationships: Option<String>,
11784    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11785    pub profile: Option<String>,
11786    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11787    pub public_channel_registry: Option<String>,
11788    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11789    pub public_channel_registry_url: Option<String>,
11790    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11791    pub rabbitmq_config_host: Option<String>,
11792    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11793    pub rabbitmq_config_password: Option<String>,
11794    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11795    pub rabbitmq_config_port: Option<String>,
11796    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11797    pub rabbitmq_config_user: Option<String>,
11798    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11799    pub redis_server: Option<String>,
11800    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11801    pub rss_widget_link: Option<String>,
11802    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11803    pub safe_mode_enable_authorized_persons: Option<String>,
11804    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11805    pub safe_mode_enable_chat_sync: Option<String>,
11806    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11807    pub safe_mode_enable_consolidation: Option<String>,
11808    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11809    pub safe_mode_enable_guid_sync: Option<String>,
11810    /// This is a string that can only be true or false.
11811    /// Allowed values: `0`, `1`.
11812    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11813    pub safe_mode_enable_job_queueing: Option<String>,
11814    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11815    pub safe_mode_enable_mail: Option<String>,
11816    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11817    pub safe_mode_enable_newsletter: Option<String>,
11818    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11819    pub safe_mode_enable_notification: Option<String>,
11820    #[serde(default, skip_serializing_if = "Option::is_none")]
11821    pub send_data_security_mails: Option<bool>,
11822    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11823    pub session_handler: Option<String>,
11824    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11825    pub short_name: Option<String>,
11826    #[serde(rename = "showAIAssistant", default, skip_serializing_if = "Option::is_none")]
11827    pub show_ai_assistant: Option<bool>,
11828    #[serde(default, skip_serializing_if = "Option::is_none")]
11829    pub show_remember_me: Option<bool>,
11830    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11831    pub site_language: Option<String>,
11832    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11833    pub site_licensekey: Option<String>,
11834    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11835    pub site_logo: Option<String>,
11836    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11837    pub site_mail: Option<String>,
11838    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11839    pub site_name: Option<String>,
11840    #[serde(default, skip_serializing_if = "Option::is_none")]
11841    pub site_offline: Option<bool>,
11842    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11843    pub site_region: Option<String>,
11844    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11845    pub site_startpage: Option<String>,
11846    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11847    pub site_url: Option<String>,
11848    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11849    #[serde(rename = "support-user-active-since", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
11850    pub support_user_active_since: Option<chrono::DateTime<chrono::Utc>>,
11851    pub test: bool,
11852    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11853    pub timezone: Option<String>,
11854    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11855    pub url_metadata_url: Option<String>,
11856    /// Allowed values: `failed`, `in_progress`, `not_verified`, `verified`.
11857    #[serde(rename = "verificationStatus", deserialize_with = "crate::lenient::string")]
11858    pub verification_status: String,
11859    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11860    pub version: Option<String>,
11861    #[serde(rename = "webchatLink", deserialize_with = "crate::lenient::string")]
11862    pub webchat_link: String,
11863    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11864    pub website_order_status: Option<String>,
11865    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11866    pub website_sync_user_id: Option<String>,
11867    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11868    pub website_testphase_date: Option<String>,
11869    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
11870    pub website_trial_user_id: Option<i64>,
11871    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11872    pub website_url: Option<String>,
11873    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11874    pub welcome: Option<String>,
11875    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11876    pub welcome_subtext: Option<String>,
11877    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11878    pub wget_path: Option<String>,
11879    /// Fields not described by the spec, e.g. instance-specific DB fields.
11880    #[serde(flatten)]
11881    pub extra: serde_json::Map<String, serde_json::Value>,
11882}
11883
11884#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11885pub struct GetConfigResponseLicenseSettings {
11886    /// Allowed values: `0`, `1`.
11887    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11888    pub hide_licensetab: Option<String>,
11889    /// Fields not described by the spec, e.g. instance-specific DB fields.
11890    #[serde(flatten)]
11891    pub extra: serde_json::Map<String, serde_json::Value>,
11892}
11893
11894#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11895pub struct GetGroupMemberstatusResponseItem {
11896    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
11897    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
11898    #[serde(deserialize_with = "crate::lenient::string")]
11899    pub id: String,
11900    /// Translated name of the member status.
11901    #[serde(deserialize_with = "crate::lenient::string")]
11902    pub name: String,
11903    /// Fields not described by the spec, e.g. instance-specific DB fields.
11904    #[serde(flatten)]
11905    pub extra: serde_json::Map<String, serde_json::Value>,
11906}
11907
11908#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11909pub struct GetGroupsGroupIdMemberfieldsDataItemVariant1 {
11910    /// A global person field configured for this group’s membership/signup UI. id identifies the configuration row; dbField.id identifies the underlying person field used in the /memberfields/person/{fieldId} path.
11911    pub field: GroupMemberFieldPerson,
11912    /// Allowed values: `person`.
11913    #[serde(deserialize_with = "crate::lenient::string")]
11914    pub r#type: String,
11915    /// Fields not described by the spec, e.g. instance-specific DB fields.
11916    #[serde(flatten)]
11917    pub extra: serde_json::Map<String, serde_json::Value>,
11918}
11919
11920#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11921pub struct GetGroupsGroupIdMemberfieldsDataItemVariant2 {
11922    /// A group-specific membership field definition. Values belong to a person’s membership in this group, rather than to the person globally.
11923    pub field: GroupMemberFieldGroup,
11924    /// Allowed values: `group`.
11925    #[serde(deserialize_with = "crate::lenient::string")]
11926    pub r#type: String,
11927    /// Fields not described by the spec, e.g. instance-specific DB fields.
11928    #[serde(flatten)]
11929    pub extra: serde_json::Map<String, serde_json::Value>,
11930}
11931
11932#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11933pub struct GetGroupsIdQrcodecheckinPersonIdPdfData {
11934    /// Absolute URL of the generated PDF; contains the ticket credential in its filename.
11935    #[serde(deserialize_with = "crate::lenient::string")]
11936    pub url: String,
11937    /// Fields not described by the spec, e.g. instance-specific DB fields.
11938    #[serde(flatten)]
11939    pub extra: serde_json::Map<String, serde_json::Value>,
11940}
11941
11942#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11943pub struct GetInfoResponse {
11944    #[serde(default, skip_serializing_if = "Option::is_none")]
11945    pub address: Option<Address>,
11946    /// Database Build Version
11947    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11948    pub build: Option<String>,
11949    #[serde(rename = "shortName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11950    pub short_name: Option<String>,
11951    #[serde(rename = "siteName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11952    pub site_name: Option<String>,
11953    /// ChurchTools Version
11954    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11955    pub version: Option<String>,
11956    /// Fields not described by the spec, e.g. instance-specific DB fields.
11957    #[serde(flatten)]
11958    pub extra: serde_json::Map<String, serde_json::Value>,
11959}
11960
11961#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11962pub struct GetLogsStatisticsLoginDataItem {
11963    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
11964    #[serde(rename = "lastLogin", serialize_with = "crate::datetime::serialize_utc")]
11965    pub last_login: chrono::DateTime<chrono::Utc>,
11966    /// Person as Domain Object
11967    pub person: DomainObjectPerson,
11968    /// Count of how many times a user has loged in.
11969    #[serde(rename = "totalLogins", deserialize_with = "crate::lenient::number")]
11970    pub total_logins: i64,
11971    /// Fields not described by the spec, e.g. instance-specific DB fields.
11972    #[serde(flatten)]
11973    pub extra: serde_json::Map<String, serde_json::Value>,
11974}
11975
11976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
11977pub struct GetMenuResponse {
11978    #[serde(default, skip_serializing_if = "Option::is_none")]
11979    pub admin: Option<GetMenuResponseAdmin>,
11980    #[serde(rename = "currentStation", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11981    pub current_station: Option<String>,
11982    #[serde(default, skip_serializing_if = "Option::is_none")]
11983    pub family: Option<Vec<GetMenuResponseFamilyItem>>,
11984    #[serde(default, skip_serializing_if = "Option::is_none")]
11985    pub help: Option<GetMenuResponseHelp>,
11986    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11987    pub logo: Option<String>,
11988    #[serde(default, skip_serializing_if = "Option::is_none")]
11989    pub modules: Option<Vec<GetMenuResponseModulesItem>>,
11990    #[serde(default, skip_serializing_if = "Option::is_none")]
11991    pub personal: Option<GetMenuResponsePersonal>,
11992    #[serde(default, skip_serializing_if = "Option::is_none")]
11993    pub simulate: Option<bool>,
11994    #[serde(rename = "siteName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11995    pub site_name: Option<String>,
11996    #[serde(default, skip_serializing_if = "Option::is_none")]
11997    pub stations: Option<Vec<GetMenuResponseStationsItem>>,
11998    #[serde(rename = "stationsCount", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
11999    pub stations_count: Option<String>,
12000    #[serde(default, skip_serializing_if = "Option::is_none")]
12001    pub user: Option<GetMenuResponseUser>,
12002    /// Fields not described by the spec, e.g. instance-specific DB fields.
12003    #[serde(flatten)]
12004    pub extra: serde_json::Map<String, serde_json::Value>,
12005}
12006
12007#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12008pub struct GetMenuResponseAdmin {
12009    #[serde(default, skip_serializing_if = "Option::is_none")]
12010    pub actions: Option<Vec<GetMenuResponseAdminActionsItem>>,
12011    #[serde(default, skip_serializing_if = "Option::is_none")]
12012    pub primary: Option<Vec<GetMenuResponseAdminPrimaryItem>>,
12013    #[serde(default, skip_serializing_if = "Option::is_none")]
12014    pub secondary: Option<Vec<GetMenuResponseAdminPrimaryItem>>,
12015    /// Fields not described by the spec, e.g. instance-specific DB fields.
12016    #[serde(flatten)]
12017    pub extra: serde_json::Map<String, serde_json::Value>,
12018}
12019
12020#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12021pub struct GetMenuResponseAdminActionsItem {
12022    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12023    pub href: Option<String>,
12024    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12025    pub icon: Option<String>,
12026    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12027    pub key: Option<String>,
12028    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12029    pub label: Option<String>,
12030    /// Fields not described by the spec, e.g. instance-specific DB fields.
12031    #[serde(flatten)]
12032    pub extra: serde_json::Map<String, serde_json::Value>,
12033}
12034
12035#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12036pub struct GetMenuResponseAdminPrimaryItem {
12037    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12038    pub href: Option<String>,
12039    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12040    pub icon: Option<String>,
12041    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12042    pub label: Option<String>,
12043    /// Fields not described by the spec, e.g. instance-specific DB fields.
12044    #[serde(flatten)]
12045    pub extra: serde_json::Map<String, serde_json::Value>,
12046}
12047
12048#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12049pub struct GetMenuResponseFamilyItem {
12050    #[serde(deserialize_with = "crate::lenient::string")]
12051    pub href: String,
12052    #[serde(deserialize_with = "crate::lenient::string")]
12053    pub icon: String,
12054    #[serde(deserialize_with = "crate::lenient::string")]
12055    pub label: String,
12056    /// Fields not described by the spec, e.g. instance-specific DB fields.
12057    #[serde(flatten)]
12058    pub extra: serde_json::Map<String, serde_json::Value>,
12059}
12060
12061#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12062pub struct GetMenuResponseHelp {
12063    #[serde(default, skip_serializing_if = "Option::is_none")]
12064    pub actions: Option<Vec<GetMenuResponseHelpActionsItem>>,
12065    #[serde(default, skip_serializing_if = "Option::is_none")]
12066    pub primary: Option<Vec<GetMenuResponseHelpPrimaryItem>>,
12067    #[serde(default, skip_serializing_if = "Option::is_none")]
12068    pub secondary: Option<Vec<GetMenuResponseHelpSecondaryItem>>,
12069    #[serde(default, skip_serializing_if = "Option::is_none")]
12070    pub tertiary: Option<Vec<GetMenuResponseHelpSecondaryItem>>,
12071    /// Fields not described by the spec, e.g. instance-specific DB fields.
12072    #[serde(flatten)]
12073    pub extra: serde_json::Map<String, serde_json::Value>,
12074}
12075
12076#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12077pub struct GetMenuResponseHelpActionsItem {
12078    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12079    pub icon: Option<String>,
12080    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12081    pub key: Option<String>,
12082    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12083    pub label: Option<String>,
12084    /// Fields not described by the spec, e.g. instance-specific DB fields.
12085    #[serde(flatten)]
12086    pub extra: serde_json::Map<String, serde_json::Value>,
12087}
12088
12089#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12090pub struct GetMenuResponseHelpPrimaryItem {
12091    #[serde(default, skip_serializing_if = "Option::is_none")]
12092    pub external: Option<bool>,
12093    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12094    pub href: Option<String>,
12095    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12096    pub icon: Option<String>,
12097    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12098    pub key: Option<String>,
12099    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12100    pub label: Option<String>,
12101    /// Fields not described by the spec, e.g. instance-specific DB fields.
12102    #[serde(flatten)]
12103    pub extra: serde_json::Map<String, serde_json::Value>,
12104}
12105
12106#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12107pub struct GetMenuResponseHelpSecondaryItem {
12108    #[serde(default, skip_serializing_if = "Option::is_none")]
12109    pub external: Option<bool>,
12110    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12111    pub href: Option<String>,
12112    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12113    pub icon: Option<String>,
12114    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12115    pub label: Option<String>,
12116    /// Fields not described by the spec, e.g. instance-specific DB fields.
12117    #[serde(flatten)]
12118    pub extra: serde_json::Map<String, serde_json::Value>,
12119}
12120
12121#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12122pub struct GetMenuResponseModulesItem {
12123    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12124    pub href: Option<String>,
12125    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12126    pub label: Option<String>,
12127    /// Fields not described by the spec, e.g. instance-specific DB fields.
12128    #[serde(flatten)]
12129    pub extra: serde_json::Map<String, serde_json::Value>,
12130}
12131
12132#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12133pub struct GetMenuResponsePersonal {
12134    #[serde(default, skip_serializing_if = "Option::is_none")]
12135    pub actions: Option<Vec<GetMenuResponseAdminPrimaryItem>>,
12136    #[serde(default, skip_serializing_if = "Option::is_none")]
12137    pub primary: Option<Vec<GetMenuResponseAdminPrimaryItem>>,
12138    #[serde(default, skip_serializing_if = "Option::is_none")]
12139    pub secondary: Option<Vec<GetMenuResponseAdminPrimaryItem>>,
12140    /// Fields not described by the spec, e.g. instance-specific DB fields.
12141    #[serde(flatten)]
12142    pub extra: serde_json::Map<String, serde_json::Value>,
12143}
12144
12145#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12146pub struct GetMenuResponseStationsItem {
12147    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12148    pub address_id: Option<String>,
12149    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12150    pub association_id: Option<String>,
12151    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12152    pub bezeichnung: Option<String>,
12153    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12154    pub created_date: Option<String>,
12155    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12156    pub created_pid: Option<String>,
12157    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12158    pub denomination: Option<String>,
12159    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12160    pub description: Option<String>,
12161    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12162    pub email: Option<String>,
12163    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12164    pub guid: Option<String>,
12165    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12166    pub id: Option<String>,
12167    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12168    pub is_published: Option<String>,
12169    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12170    pub kuerzel: Option<String>,
12171    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12172    pub modified_date: Option<String>,
12173    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12174    pub modified_pid: Option<String>,
12175    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12176    pub phone: Option<String>,
12177    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12178    pub profile_type: Option<String>,
12179    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12180    pub short_name: Option<String>,
12181    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12182    pub sign_up_group_id: Option<f64>,
12183    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12184    pub slug: Option<String>,
12185    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12186    pub social_media: Option<String>,
12187    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12188    pub sortkey: Option<String>,
12189    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12190    pub tags: Option<String>,
12191    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12192    pub team_title: Option<String>,
12193    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12194    pub visitors: Option<String>,
12195    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12196    pub website: Option<String>,
12197    /// Fields not described by the spec, e.g. instance-specific DB fields.
12198    #[serde(flatten)]
12199    pub extra: serde_json::Map<String, serde_json::Value>,
12200}
12201
12202#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12203pub struct GetMenuResponseUser {
12204    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12205    pub firstname: Option<String>,
12206    #[serde(rename = "hasAdminRights", default, skip_serializing_if = "Option::is_none")]
12207    pub has_admin_rights: Option<bool>,
12208    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12209    pub id: Option<String>,
12210    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12211    pub image: Option<String>,
12212    #[serde(rename = "imageId", default, skip_serializing_if = "serde_json::Value::is_null")]
12213    pub image_id: serde_json::Value,
12214    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12215    pub image_url: Option<String>,
12216    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12217    pub lastname: Option<String>,
12218    #[serde(rename = "loggedIn", default, skip_serializing_if = "Option::is_none")]
12219    pub logged_in: Option<bool>,
12220    /// Fields not described by the spec, e.g. instance-specific DB fields.
12221    #[serde(flatten)]
12222    pub extra: serde_json::Map<String, serde_json::Value>,
12223}
12224
12225#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12226pub struct GetPermissionsDefinitionsData {
12227    pub modules: Vec<PermissionDefinitionModule>,
12228    /// Fields not described by the spec, e.g. instance-specific DB fields.
12229    #[serde(flatten)]
12230    pub extra: serde_json::Map<String, serde_json::Value>,
12231}
12232
12233#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12234pub struct GetPermissionsGlobalPersonSummaryData {
12235    pub permissions: Vec<PermissionPersonSummaryEntry>,
12236    /// Fields not described by the spec, e.g. instance-specific DB fields.
12237    #[serde(flatten)]
12238    pub extra: serde_json::Map<String, serde_json::Value>,
12239}
12240
12241#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12242pub struct GetPermissionsOriginsGlobalPersonsPersonIdData {
12243    pub permissions: Vec<PermissionWithOrigins>,
12244    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
12245    pub person_id: i64,
12246    /// Fields not described by the spec, e.g. instance-specific DB fields.
12247    #[serde(flatten)]
12248    pub extra: serde_json::Map<String, serde_json::Value>,
12249}
12250
12251#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12252pub struct GetPermissionsOriginsInternalPersonsPersonIdData {
12253    pub groups: Vec<GetPermissionsOriginsInternalPersonsPersonIdDataGroupsItem>,
12254    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
12255    pub person_id: i64,
12256    /// Fields not described by the spec, e.g. instance-specific DB fields.
12257    #[serde(flatten)]
12258    pub extra: serde_json::Map<String, serde_json::Value>,
12259}
12260
12261#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12262pub struct GetPermissionsOriginsInternalPersonsPersonIdDataGroupsItem {
12263    /// ID of the target group the permissions apply to
12264    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
12265    pub group_id: i64,
12266    pub permissions: Vec<PermissionWithOrigins>,
12267    /// Fields not described by the spec, e.g. instance-specific DB fields.
12268    #[serde(flatten)]
12269    pub extra: serde_json::Map<String, serde_json::Value>,
12270}
12271
12272#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12273pub struct GetPersonsBirthdaysDataItem {
12274    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12275    pub deprecated: Option<String>,
12276    /// Calculated age. (see note to that endpoint)
12277    #[serde(deserialize_with = "crate::lenient::number")]
12278    pub age: i64,
12279    /// A simple date in ISO format, e.g. '2022-10-19'
12280    #[serde(default, skip_serializing_if = "Option::is_none")]
12281    pub anniversary: Option<chrono::NaiveDate>,
12282    /// A simple date in ISO format, e.g. '2022-10-19'
12283    #[serde(rename = "anniversaryInitialDate", default, skip_serializing_if = "Option::is_none")]
12284    pub anniversary_initial_date: Option<chrono::NaiveDate>,
12285    /// Actually birthday
12286    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12287    #[deprecated = "deprecated in the ChurchTools API"]
12288    pub date: Option<String>,
12289    /// Person as Domain Object
12290    #[serde(default, skip_serializing_if = "Option::is_none")]
12291    pub person: Option<DomainObjectPerson>,
12292    /// Type of Date
12293    #[serde(deserialize_with = "crate::lenient::string")]
12294    pub r#type: String,
12295    /// Fields not described by the spec, e.g. instance-specific DB fields.
12296    #[serde(flatten)]
12297    pub extra: serde_json::Map<String, serde_json::Value>,
12298}
12299
12300#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12301pub struct GetPersonsDuplicatesDataItem {
12302    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12303    pub relationship_type_id: Option<i64>,
12304    pub relationships: Vec<PersonDuplicate>,
12305    /// Fields not described by the spec, e.g. instance-specific DB fields.
12306    #[serde(flatten)]
12307    pub extra: serde_json::Map<String, serde_json::Value>,
12308}
12309
12310#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12311pub struct GetPersonsIdLoginstringResponse {
12312    /// Secret one-time credential; consume through a login link.
12313    #[serde(rename = "loginString", deserialize_with = "crate::lenient::string")]
12314    pub login_string: String,
12315    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
12316    pub person_id: i64,
12317    /// Fields not described by the spec, e.g. instance-specific DB fields.
12318    #[serde(flatten)]
12319    pub extra: serde_json::Map<String, serde_json::Value>,
12320}
12321
12322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12323pub struct GetPersonsRelationshipsDataItem {
12324    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
12325    pub deprecated: Option<std::collections::BTreeMap<String, String>>,
12326    #[serde(rename = "degreeOfRelationship", default, skip_serializing_if = "serde_json::Value::is_null")]
12327    #[deprecated = "deprecated in the ChurchTools API"]
12328    pub degree_of_relationship: serde_json::Value,
12329    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12330    pub id: Option<i64>,
12331    #[serde(rename = "personAId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12332    pub person_a_id: Option<i64>,
12333    #[serde(rename = "personBId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12334    pub person_b_id: Option<i64>,
12335    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12336    #[deprecated = "deprecated in the ChurchTools API"]
12337    pub person_id: Option<i64>,
12338    #[serde(rename = "relationshipName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12339    #[deprecated = "deprecated in the ChurchTools API"]
12340    pub relationship_name: Option<String>,
12341    #[serde(rename = "relationshipType", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
12342    pub relationship_type: Option<std::collections::BTreeMap<String, serde_json::Value>>,
12343    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12344    #[deprecated = "deprecated in the ChurchTools API"]
12345    pub relationship_type_id: Option<i64>,
12346    #[serde(rename = "relativeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12347    #[deprecated = "deprecated in the ChurchTools API"]
12348    pub relative_id: Option<i64>,
12349    /// Fields not described by the spec, e.g. instance-specific DB fields.
12350    #[serde(flatten)]
12351    pub extra: serde_json::Map<String, serde_json::Value>,
12352}
12353
12354#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12355pub struct GetSearchDataItem {
12356    /// Allowed values: `action`, `domainObject`.
12357    #[serde(deserialize_with = "crate::lenient::string")]
12358    pub r#type: String,
12359    /// Fields not described by the spec, e.g. instance-specific DB fields.
12360    #[serde(flatten)]
12361    pub extra: serde_json::Map<String, serde_json::Value>,
12362}
12363
12364#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12365pub struct GetSyncExternalsystemsIdFieldmappingsDomaintypeNosuggestionsDataVariant1 {
12366    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
12367    pub es: Option<std::collections::BTreeMap<String, bool>>,
12368    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
12369    pub master: Option<std::collections::BTreeMap<String, bool>>,
12370    /// Fields not described by the spec, e.g. instance-specific DB fields.
12371    #[serde(flatten)]
12372    pub extra: serde_json::Map<String, serde_json::Value>,
12373}
12374
12375#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12376pub struct GetWidgetsBlogData {
12377    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12378    pub description: Option<String>,
12379    #[serde(default, skip_serializing_if = "Option::is_none")]
12380    pub items: Option<Vec<BlogItem>>,
12381    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12382    pub link: Option<String>,
12383    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12384    pub title: Option<String>,
12385    #[serde(rename = "totalCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12386    pub total_count: Option<i64>,
12387    /// Fields not described by the spec, e.g. instance-specific DB fields.
12388    #[serde(flatten)]
12389    pub extra: serde_json::Map<String, serde_json::Value>,
12390}
12391
12392/// Current user’s global permission values, keyed by active module and registered permission key. Missing grants are false for flags and \[\] for selections. Maximum-level permissions return a single-element array containing the maximum (99999 for unrestricted); multiple-selection permissions expand unrestricted grants into current IDs, losing the distinction from explicit grants to all current values. Compatibility aliases can be null when their source module is absent.
12393#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12394pub struct GlobalPermissions {
12395    #[serde(default, skip_serializing_if = "Option::is_none")]
12396    pub churchcal: Option<GlobalPermissionsChurchcal>,
12397    #[serde(default, skip_serializing_if = "Option::is_none")]
12398    pub churchcheckin: Option<GlobalPermissionsChurchcheckin>,
12399    #[serde(default, skip_serializing_if = "Option::is_none")]
12400    pub churchcore: Option<GlobalPermissionsChurchcore>,
12401    #[serde(default, skip_serializing_if = "Option::is_none")]
12402    pub churchdb: Option<GlobalPermissionsChurchdb>,
12403    #[serde(default, skip_serializing_if = "Option::is_none")]
12404    pub churchgroup: Option<GlobalPermissionsChurchgroup>,
12405    #[serde(default, skip_serializing_if = "Option::is_none")]
12406    pub churchreport: Option<GlobalPermissionsChurchreport>,
12407    #[serde(default, skip_serializing_if = "Option::is_none")]
12408    pub churchresource: Option<GlobalPermissionsChurchresource>,
12409    #[serde(default, skip_serializing_if = "Option::is_none")]
12410    pub churchservice: Option<GlobalPermissionsChurchservice>,
12411    #[serde(default, skip_serializing_if = "Option::is_none")]
12412    pub churchsync: Option<GlobalPermissionsChurchsync>,
12413    #[serde(default, skip_serializing_if = "Option::is_none")]
12414    pub churchwiki: Option<GlobalPermissionsChurchwiki>,
12415    #[serde(default, skip_serializing_if = "Option::is_none")]
12416    pub finance: Option<GlobalPermissionsFinance>,
12417    #[serde(default, skip_serializing_if = "Option::is_none")]
12418    pub post: Option<GlobalPermissionsPost>,
12419    /// Fields not described by the spec, e.g. instance-specific DB fields.
12420    #[serde(flatten)]
12421    pub extra: serde_json::Map<String, serde_json::Value>,
12422}
12423
12424#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12425pub struct GlobalPermissionsChurchcal {
12426    #[serde(rename = "admin appointment tags", default, skip_serializing_if = "Option::is_none")]
12427    pub admin_appointment_tags: Option<bool>,
12428    #[serde(rename = "admin church category")]
12429    pub admin_church_category: bool,
12430    #[serde(rename = "admin group category")]
12431    pub admin_group_category: bool,
12432    #[serde(rename = "admin personal category")]
12433    pub admin_personal_category: bool,
12434    #[serde(rename = "assistance mode")]
12435    pub assistance_mode: bool,
12436    #[serde(rename = "create group category")]
12437    pub create_group_category: bool,
12438    #[serde(rename = "create personal category")]
12439    pub create_personal_category: bool,
12440    #[serde(rename = "edit calendar entry template")]
12441    pub edit_calendar_entry_template: Vec<i64>,
12442    #[serde(rename = "edit category")]
12443    pub edit_category: Vec<i64>,
12444    pub view: bool,
12445    #[serde(rename = "view category")]
12446    pub view_category: Vec<i64>,
12447    /// Fields not described by the spec, e.g. instance-specific DB fields.
12448    #[serde(flatten)]
12449    pub extra: serde_json::Map<String, serde_json::Value>,
12450}
12451
12452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12453pub struct GlobalPermissionsChurchcheckin {
12454    #[serde(rename = "create person")]
12455    pub create_person: bool,
12456    #[serde(rename = "edit masterdata")]
12457    pub edit_masterdata: bool,
12458    pub view: bool,
12459    /// Fields not described by the spec, e.g. instance-specific DB fields.
12460    #[serde(flatten)]
12461    pub extra: serde_json::Map<String, serde_json::Value>,
12462}
12463
12464#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12465pub struct GlobalPermissionsChurchcore {
12466    #[serde(rename = "administer church html templates")]
12467    pub administer_church_html_templates: bool,
12468    #[serde(rename = "administer custom modules", default, skip_serializing_if = "Option::is_none")]
12469    pub administer_custom_modules: Option<bool>,
12470    #[serde(rename = "administer persons")]
12471    pub administer_persons: bool,
12472    #[serde(rename = "administer settings")]
12473    pub administer_settings: bool,
12474    #[serde(rename = "edit languages")]
12475    pub edit_languages: Vec<i64>,
12476    #[serde(rename = "edit public profiles")]
12477    pub edit_public_profiles: bool,
12478    #[serde(rename = "edit translations masterdata")]
12479    pub edit_translations_masterdata: bool,
12480    #[serde(rename = "edit website releases")]
12481    pub edit_website_releases: bool,
12482    #[serde(rename = "edit website staff")]
12483    pub edit_website_staff: bool,
12484    #[serde(rename = "invite persons")]
12485    pub invite_persons: bool,
12486    #[serde(rename = "login to external system")]
12487    pub login_to_external_system: Vec<i64>,
12488    #[serde(rename = "simulate persons")]
12489    pub simulate_persons: bool,
12490    #[serde(rename = "use church html templates")]
12491    pub use_church_html_templates: Vec<i64>,
12492    #[serde(rename = "use churchquery", default, skip_serializing_if = "Option::is_none")]
12493    pub use_churchquery: Option<bool>,
12494    #[serde(rename = "view links", default, skip_serializing_if = "Option::is_none")]
12495    pub view_links: Option<Vec<i64>>,
12496    #[serde(rename = "view logfile")]
12497    pub view_logfile: bool,
12498    #[serde(rename = "view website")]
12499    pub view_website: bool,
12500    /// Fields not described by the spec, e.g. instance-specific DB fields.
12501    #[serde(flatten)]
12502    pub extra: serde_json::Map<String, serde_json::Value>,
12503}
12504
12505#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12506pub struct GlobalPermissionsChurchdb {
12507    #[serde(rename = "administer global filters")]
12508    pub administer_global_filters: bool,
12509    /// Compatibility alias of churchgroup administer groups. Null when the corresponding module/permission is absent.
12510    #[serde(rename = "administer groups", default, skip_serializing_if = "Option::is_none")]
12511    #[deprecated = "deprecated in the ChurchTools API"]
12512    pub administer_groups: Option<bool>,
12513    #[serde(rename = "complex filter")]
12514    pub complex_filter: bool,
12515    /// Compatibility alias of churchgroup create groups of grouptype. Null when the corresponding module/permission is absent.
12516    #[serde(rename = "create groups of grouptype", default, skip_serializing_if = "Option::is_none")]
12517    #[deprecated = "deprecated in the ChurchTools API"]
12518    pub create_groups_of_grouptype: Option<Vec<i64>>,
12519    #[serde(rename = "create person")]
12520    pub create_person: bool,
12521    #[serde(rename = "create print labels")]
12522    pub create_print_labels: bool,
12523    /// Compatibility alias of churchgroup delete group. Null when the corresponding module/permission is absent.
12524    #[serde(rename = "delete group", default, skip_serializing_if = "Option::is_none")]
12525    #[deprecated = "deprecated in the ChurchTools API"]
12526    pub delete_group: Option<Vec<i64>>,
12527    /// Compatibility alias of churchgroup delete groups of grouptype. Null when the corresponding module/permission is absent.
12528    #[serde(rename = "delete groups of grouptype", default, skip_serializing_if = "Option::is_none")]
12529    #[deprecated = "deprecated in the ChurchTools API"]
12530    pub delete_groups_of_grouptype: Option<Vec<i64>>,
12531    #[serde(rename = "delete persons")]
12532    pub delete_persons: bool,
12533    #[serde(rename = "edit bulkletter")]
12534    pub edit_bulkletter: bool,
12535    /// Compatibility alias of churchgroup edit group. Null when the corresponding module/permission is absent.
12536    #[serde(rename = "edit group", default, skip_serializing_if = "Option::is_none")]
12537    #[deprecated = "deprecated in the ChurchTools API"]
12538    pub edit_group: Option<Vec<i64>>,
12539    #[serde(rename = "edit group memberships")]
12540    pub edit_group_memberships: bool,
12541    /// Compatibility alias of churchgroup edit group memberships of group. Null when the corresponding module/permission is absent.
12542    #[serde(rename = "edit group memberships of group", default, skip_serializing_if = "Option::is_none")]
12543    #[deprecated = "deprecated in the ChurchTools API"]
12544    pub edit_group_memberships_of_group: Option<Vec<i64>>,
12545    /// Compatibility alias of churchgroup edit group memberships of grouptype. Null when the corresponding module/permission is absent.
12546    #[serde(rename = "edit group memberships of grouptype", default, skip_serializing_if = "Option::is_none")]
12547    #[deprecated = "deprecated in the ChurchTools API"]
12548    pub edit_group_memberships_of_grouptype: Option<Vec<i64>>,
12549    /// Compatibility alias of churchgroup edit groups of grouptype. Null when the corresponding module/permission is absent.
12550    #[serde(rename = "edit groups of grouptype", default, skip_serializing_if = "Option::is_none")]
12551    #[deprecated = "deprecated in the ChurchTools API"]
12552    pub edit_groups_of_grouptype: Option<Vec<i64>>,
12553    #[serde(rename = "edit masterdata")]
12554    pub edit_masterdata: bool,
12555    #[serde(rename = "edit person visibility")]
12556    pub edit_person_visibility: bool,
12557    #[serde(rename = "edit relations")]
12558    pub edit_relations: bool,
12559    /// Omitted when export prevention is configured; otherwise a grant flag.
12560    #[serde(rename = "export data", default, skip_serializing_if = "Option::is_none")]
12561    pub export_data: Option<bool>,
12562    #[serde(rename = "push/pull archive")]
12563    pub push_pull_archive: bool,
12564    #[serde(rename = "security level edit own data")]
12565    pub security_level_edit_own_data: Vec<i64>,
12566    /// Compatibility alias of churchgroup security level group. Null when the corresponding module/permission is absent.
12567    #[serde(rename = "security level group", default, skip_serializing_if = "Option::is_none")]
12568    #[deprecated = "deprecated in the ChurchTools API"]
12569    pub security_level_group: Option<Vec<i64>>,
12570    #[serde(rename = "security level person")]
12571    pub security_level_person: Vec<i64>,
12572    #[serde(rename = "security level view own data")]
12573    pub security_level_view_own_data: Vec<i64>,
12574    #[serde(rename = "send sms")]
12575    pub send_sms: bool,
12576    pub view: bool,
12577    #[serde(rename = "view alldata")]
12578    pub view_alldata: Vec<i64>,
12579    #[serde(rename = "view archive")]
12580    pub view_archive: bool,
12581    #[serde(rename = "view birthdaylist", default, skip_serializing_if = "Option::is_none")]
12582    pub view_birthdaylist: Option<bool>,
12583    #[serde(rename = "view comments")]
12584    pub view_comments: Vec<i64>,
12585    /// Compatibility alias of churchgroup view group. Null when the corresponding module/permission is absent.
12586    #[serde(rename = "view group", default, skip_serializing_if = "Option::is_none")]
12587    #[deprecated = "deprecated in the ChurchTools API"]
12588    pub view_group: Option<Vec<i64>>,
12589    /// Compatibility alias of churchgroup view groups of grouptype. Null when the corresponding module/permission is absent.
12590    #[serde(rename = "view groups of grouptype", default, skip_serializing_if = "Option::is_none")]
12591    #[deprecated = "deprecated in the ChurchTools API"]
12592    pub view_groups_of_grouptype: Option<Vec<i64>>,
12593    #[serde(rename = "view hidden persons")]
12594    pub view_hidden_persons: bool,
12595    #[serde(rename = "view history", default, skip_serializing_if = "Option::is_none")]
12596    pub view_history: Option<bool>,
12597    #[serde(rename = "view memberliste")]
12598    pub view_memberliste: bool,
12599    #[serde(rename = "view person history")]
12600    pub view_person_history: bool,
12601    #[serde(rename = "view person tags")]
12602    pub view_person_tags: bool,
12603    /// Campus IDs whose persons are globally visible through this permission.
12604    #[serde(rename = "view persons from campus")]
12605    pub view_persons_from_campus: Vec<i64>,
12606    #[serde(rename = "view station")]
12607    pub view_station: Vec<i64>,
12608    #[serde(rename = "view statistics")]
12609    pub view_statistics: bool,
12610    #[serde(rename = "view tags", default, skip_serializing_if = "Option::is_none")]
12611    #[deprecated = "deprecated in the ChurchTools API"]
12612    pub view_tags: Option<bool>,
12613    #[serde(rename = "write access")]
12614    pub write_access: bool,
12615    /// Fields not described by the spec, e.g. instance-specific DB fields.
12616    #[serde(flatten)]
12617    pub extra: serde_json::Map<String, serde_json::Value>,
12618}
12619
12620#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12621pub struct GlobalPermissionsChurchgroup {
12622    #[serde(rename = "administer global views")]
12623    pub administer_global_views: bool,
12624    #[serde(rename = "administer groups")]
12625    pub administer_groups: bool,
12626    #[serde(rename = "create groups of grouptype")]
12627    pub create_groups_of_grouptype: Vec<i64>,
12628    #[serde(rename = "delete group")]
12629    pub delete_group: Vec<i64>,
12630    #[serde(rename = "delete groups of grouptype")]
12631    pub delete_groups_of_grouptype: Vec<i64>,
12632    #[serde(rename = "edit group")]
12633    pub edit_group: Vec<i64>,
12634    #[serde(rename = "edit group memberships of group")]
12635    pub edit_group_memberships_of_group: Vec<i64>,
12636    #[serde(rename = "edit group memberships of grouptype")]
12637    pub edit_group_memberships_of_grouptype: Vec<i64>,
12638    #[serde(rename = "edit groups of grouptype")]
12639    pub edit_groups_of_grouptype: Vec<i64>,
12640    #[serde(rename = "edit masterdata")]
12641    pub edit_masterdata: bool,
12642    #[serde(rename = "security level group")]
12643    pub security_level_group: Vec<i64>,
12644    pub view: bool,
12645    #[serde(rename = "view group")]
12646    pub view_group: Vec<i64>,
12647    #[serde(rename = "view group history")]
12648    pub view_group_history: bool,
12649    #[serde(rename = "view group tags")]
12650    pub view_group_tags: bool,
12651    #[serde(rename = "view groups of grouptype")]
12652    pub view_groups_of_grouptype: Vec<i64>,
12653    /// Fields not described by the spec, e.g. instance-specific DB fields.
12654    #[serde(flatten)]
12655    pub extra: serde_json::Map<String, serde_json::Value>,
12656}
12657
12658#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12659pub struct GlobalPermissionsChurchreport {
12660    pub view: bool,
12661    #[serde(rename = "view query")]
12662    pub view_query: Vec<i64>,
12663    /// Fields not described by the spec, e.g. instance-specific DB fields.
12664    #[serde(flatten)]
12665    pub extra: serde_json::Map<String, serde_json::Value>,
12666}
12667
12668#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12669pub struct GlobalPermissionsChurchresource {
12670    #[serde(rename = "administer bookings")]
12671    pub administer_bookings: Vec<i64>,
12672    #[serde(rename = "assistance mode")]
12673    pub assistance_mode: bool,
12674    #[serde(rename = "create bookings")]
12675    pub create_bookings: Vec<i64>,
12676    #[serde(rename = "create virtual bookings")]
12677    pub create_virtual_bookings: bool,
12678    #[serde(rename = "edit masterdata")]
12679    pub edit_masterdata: bool,
12680    pub view: bool,
12681    #[serde(rename = "view resource")]
12682    pub view_resource: Vec<i64>,
12683    /// Fields not described by the spec, e.g. instance-specific DB fields.
12684    #[serde(flatten)]
12685    pub extra: serde_json::Map<String, serde_json::Value>,
12686}
12687
12688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12689pub struct GlobalPermissionsChurchservice {
12690    #[serde(rename = "edit agenda")]
12691    pub edit_agenda: Vec<i64>,
12692    #[serde(rename = "edit agenda templates")]
12693    pub edit_agenda_templates: Vec<i64>,
12694    #[serde(rename = "edit events")]
12695    pub edit_events: Vec<i64>,
12696    #[serde(rename = "edit fact")]
12697    pub edit_fact: Vec<i64>,
12698    #[serde(rename = "edit masterdata")]
12699    pub edit_masterdata: bool,
12700    #[serde(rename = "edit servicegroup")]
12701    pub edit_servicegroup: Vec<i64>,
12702    #[serde(rename = "edit songcategory")]
12703    pub edit_songcategory: Vec<i64>,
12704    #[serde(rename = "edit template")]
12705    pub edit_template: bool,
12706    #[serde(rename = "export facts")]
12707    pub export_facts: bool,
12708    #[serde(rename = "manage absent")]
12709    pub manage_absent: bool,
12710    #[serde(rename = "use ccli")]
12711    pub use_ccli: bool,
12712    pub view: bool,
12713    #[serde(rename = "view agenda")]
12714    pub view_agenda: Vec<i64>,
12715    #[serde(rename = "view events")]
12716    pub view_events: Vec<i64>,
12717    #[serde(rename = "view fact")]
12718    pub view_fact: Vec<i64>,
12719    #[serde(rename = "view history")]
12720    pub view_history: bool,
12721    #[serde(rename = "view servicegroup")]
12722    pub view_servicegroup: Vec<i64>,
12723    #[serde(rename = "view song statistics")]
12724    pub view_song_statistics: bool,
12725    #[serde(rename = "view songcategory")]
12726    pub view_songcategory: Vec<i64>,
12727    /// Fields not described by the spec, e.g. instance-specific DB fields.
12728    #[serde(flatten)]
12729    pub extra: serde_json::Map<String, serde_json::Value>,
12730}
12731
12732#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12733pub struct GlobalPermissionsChurchsync {
12734    pub view: bool,
12735    /// Fields not described by the spec, e.g. instance-specific DB fields.
12736    #[serde(flatten)]
12737    pub extra: serde_json::Map<String, serde_json::Value>,
12738}
12739
12740#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12741pub struct GlobalPermissionsChurchwiki {
12742    #[serde(rename = "edit category")]
12743    pub edit_category: Vec<i64>,
12744    #[serde(rename = "edit masterdata")]
12745    pub edit_masterdata: bool,
12746    pub view: bool,
12747    #[serde(rename = "view category")]
12748    pub view_category: Vec<i64>,
12749    /// Fields not described by the spec, e.g. instance-specific DB fields.
12750    #[serde(flatten)]
12751    pub extra: serde_json::Map<String, serde_json::Value>,
12752}
12753
12754#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12755pub struct GlobalPermissionsFinance {
12756    #[serde(rename = "edit accounting period")]
12757    pub edit_accounting_period: Vec<i64>,
12758    #[serde(rename = "edit masterdata")]
12759    pub edit_masterdata: bool,
12760    pub view: bool,
12761    #[serde(rename = "view accounting period")]
12762    pub view_accounting_period: Vec<i64>,
12763    /// Fields not described by the spec, e.g. instance-specific DB fields.
12764    #[serde(flatten)]
12765    pub extra: serde_json::Map<String, serde_json::Value>,
12766}
12767
12768#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12769pub struct GlobalPermissionsPost {
12770    #[serde(rename = "moderate posts")]
12771    pub moderate_posts: bool,
12772    /// Fields not described by the spec, e.g. instance-specific DB fields.
12773    #[serde(flatten)]
12774    pub extra: serde_json::Map<String, serde_json::Value>,
12775}
12776
12777/// The group model structures all information in different objects: `information`, `settings`, `followUp`, and `roles`. Custom group fields are added to the root level of this model.
12778#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12779pub struct Group {
12780    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
12781    pub deprecated: Option<std::collections::BTreeMap<String, String>>,
12782    #[serde(rename = "averageMemberAge", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
12783    pub average_member_age: Option<f64>,
12784    #[serde(rename = "followUp", default, skip_serializing_if = "Option::is_none")]
12785    pub follow_up: Option<GroupFollowUp>,
12786    #[serde(deserialize_with = "crate::lenient::string")]
12787    pub guid: String,
12788    #[serde(rename = "hasPermissions", default, skip_serializing_if = "Option::is_none")]
12789    pub has_permissions: Option<bool>,
12790    #[serde(deserialize_with = "crate::lenient::number")]
12791    pub id: i64,
12792    pub information: GroupInformation,
12793    #[serde(rename = "memberStatistics", default, skip_serializing_if = "Option::is_none")]
12794    pub member_statistics: Option<GroupMemberStatistics>,
12795    pub meta: MetaDataEntityId,
12796    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12797    #[deprecated = "deprecated in the ChurchTools API"]
12798    pub modified_date: Option<String>,
12799    #[serde(rename = "modifiedPerson", default, skip_serializing_if = "Option::is_none")]
12800    #[deprecated = "deprecated in the ChurchTools API"]
12801    pub modified_person: Option<GroupModifiedPerson>,
12802    #[serde(deserialize_with = "crate::lenient::string")]
12803    pub name: String,
12804    pub permissions: GroupPermissions,
12805    #[serde(default, skip_serializing_if = "Option::is_none")]
12806    pub places: Option<Vec<Address>>,
12807    #[serde(rename = "publicPostsStatistic", default, skip_serializing_if = "Option::is_none")]
12808    pub public_posts_statistic: Option<GroupPublicPostsStatistic>,
12809    #[serde(default, skip_serializing_if = "Option::is_none")]
12810    pub roles: Option<Vec<GroupRole>>,
12811    /// You can see group fields up to this security level.
12812    #[serde(rename = "securityLevelForGroup", deserialize_with = "crate::lenient::number")]
12813    pub security_level_for_group: i64,
12814    pub settings: GroupSettings,
12815    #[serde(rename = "signupConditions", default, skip_serializing_if = "Option::is_none")]
12816    pub signup_conditions: Option<GroupSignupConditions>,
12817    #[serde(default, skip_serializing_if = "Option::is_none")]
12818    pub tags: Option<Vec<Tag>>,
12819    /// Fields not described by the spec, e.g. instance-specific DB fields.
12820    #[serde(flatten)]
12821    pub extra: serde_json::Map<String, serde_json::Value>,
12822}
12823
12824/// Address attached to a group, used as a meeting place. All body fields are optional and default to null. Ownership is taken from the path. This operation stores coordinates supplied by the client; it does not look them up from the postal address.
12825#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12826pub struct GroupAddressCreate {
12827    /// Address addition. Whitespace is trimmed; omitted, null or blank clears the value.
12828    ///
12829    /// `None` leaves the field out, `Some(None)` sends `null`.
12830    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12831    pub addition: Option<Option<String>>,
12832    /// Address city. Whitespace is trimmed; omitted, null or blank clears the value.
12833    ///
12834    /// `None` leaves the field out, `Some(None)` sends `null`.
12835    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12836    pub city: Option<Option<String>>,
12837    /// Optional ChurchTools color. The special values default and parent select the default or owning group color. Omitted or null clears the value.
12838    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`, `default`, `parent`.
12839    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
12840    pub color: serde_json::Value,
12841    /// Country code, at most two characters. Whitespace is trimmed; omitted, null or blank clears the value.
12842    ///
12843    /// `None` leaves the field out, `Some(None)` sends `null`.
12844    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12845    pub country: Option<Option<String>>,
12846    /// Address district. Whitespace is trimmed; omitted, null or blank clears the value.
12847    ///
12848    /// `None` leaves the field out, `Some(None)` sends `null`.
12849    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12850    pub district: Option<Option<String>>,
12851    /// Address icon. Whitespace is trimmed; omitted, null or blank clears the value.
12852    ///
12853    /// `None` leaves the field out, `Some(None)` sends `null`.
12854    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12855    pub icon: Option<Option<String>>,
12856    /// Coordinate as a number or decimal string. Omitted or null clears it; geographic range limits are not validated.
12857    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
12858    pub latitude: serde_json::Value,
12859    /// Coordinate as a number or decimal string. Omitted or null clears it; geographic range limits are not validated.
12860    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
12861    pub longitude: serde_json::Value,
12862    /// Address name. Whitespace is trimmed; omitted, null or blank clears the value.
12863    ///
12864    /// `None` leaves the field out, `Some(None)` sends `null`.
12865    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12866    pub name: Option<Option<String>>,
12867    /// Address street. Whitespace is trimmed; omitted, null or blank clears the value.
12868    ///
12869    /// `None` leaves the field out, `Some(None)` sends `null`.
12870    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12871    pub street: Option<Option<String>>,
12872    /// Address zip. Whitespace is trimmed; omitted, null or blank clears the value.
12873    ///
12874    /// `None` leaves the field out, `Some(None)` sends `null`.
12875    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12876    pub zip: Option<Option<String>>,
12877    /// Fields not described by the spec, e.g. instance-specific DB fields.
12878    #[serde(flatten)]
12879    pub extra: serde_json::Map<String, serde_json::Value>,
12880}
12881
12882/// Replacement address details. Omitted fields are cleared, so send all values to retain. No body id is required; addressId comes from the URL.
12883#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12884pub struct GroupAddressUpdate {
12885    /// Address addition. Whitespace is trimmed; omitted, null or blank clears the value.
12886    ///
12887    /// `None` leaves the field out, `Some(None)` sends `null`.
12888    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12889    pub addition: Option<Option<String>>,
12890    /// Address city. Whitespace is trimmed; omitted, null or blank clears the value.
12891    ///
12892    /// `None` leaves the field out, `Some(None)` sends `null`.
12893    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12894    pub city: Option<Option<String>>,
12895    /// Optional ChurchTools color. The special values default and parent select the default or owning group color. Omitted or null clears the value.
12896    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`, `default`, `parent`.
12897    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
12898    pub color: serde_json::Value,
12899    /// Country code, at most two characters. Whitespace is trimmed; omitted, null or blank clears the value.
12900    ///
12901    /// `None` leaves the field out, `Some(None)` sends `null`.
12902    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12903    pub country: Option<Option<String>>,
12904    /// Address district. Whitespace is trimmed; omitted, null or blank clears the value.
12905    ///
12906    /// `None` leaves the field out, `Some(None)` sends `null`.
12907    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12908    pub district: Option<Option<String>>,
12909    /// Address icon. Whitespace is trimmed; omitted, null or blank clears the value.
12910    ///
12911    /// `None` leaves the field out, `Some(None)` sends `null`.
12912    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12913    pub icon: Option<Option<String>>,
12914    /// Coordinate as a number or decimal string. Omitted or null clears it; geographic range limits are not validated.
12915    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
12916    pub latitude: serde_json::Value,
12917    /// Coordinate as a number or decimal string. Omitted or null clears it; geographic range limits are not validated.
12918    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
12919    pub longitude: serde_json::Value,
12920    /// Address name. Whitespace is trimmed; omitted, null or blank clears the value.
12921    ///
12922    /// `None` leaves the field out, `Some(None)` sends `null`.
12923    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12924    pub name: Option<Option<String>>,
12925    /// Address street. Whitespace is trimmed; omitted, null or blank clears the value.
12926    ///
12927    /// `None` leaves the field out, `Some(None)` sends `null`.
12928    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12929    pub street: Option<Option<String>>,
12930    /// Address zip. Whitespace is trimmed; omitted, null or blank clears the value.
12931    ///
12932    /// `None` leaves the field out, `Some(None)` sends `null`.
12933    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12934    pub zip: Option<Option<String>>,
12935    /// Fields not described by the spec, e.g. instance-specific DB fields.
12936    #[serde(flatten)]
12937    pub extra: serde_json::Map<String, serde_json::Value>,
12938}
12939
12940/// A thematic classification for groups, such as worship services or community activities. A group can reference a category through information.groupCategoryId. Categories are separate from group types, which define shared settings and membership roles.
12941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12942pub struct GroupCategory {
12943    /// ChurchTools color token used to display the category, such as blue.
12944    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
12945    #[serde(deserialize_with = "crate::lenient::string")]
12946    pub color: String,
12947    /// Optional explanation of the category. Omitted, null or blank input is stored as null, including on update.
12948    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
12949    pub description: Option<String>,
12950    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
12951    #[serde(deserialize_with = "crate::lenient::string")]
12952    pub name: String,
12953    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
12954    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
12955    pub sort_key: i64,
12956    /// ID of this master-data record in this ChurchTools installation. Use it when assigning this classification to a group.
12957    #[serde(deserialize_with = "crate::lenient::number")]
12958    pub id: i64,
12959    /// Creation and modification timestamps and person IDs for this category.
12960    pub meta: GroupCategoryMeta,
12961    /// Localized display name, translated from the stored name when a translation exists.
12962    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
12963    pub name_translated: String,
12964    /// Fields not described by the spec, e.g. instance-specific DB fields.
12965    #[serde(flatten)]
12966    pub extra: serde_json::Map<String, serde_json::Value>,
12967}
12968
12969#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12970pub struct GroupCategoryCreate {
12971    /// ChurchTools color token used to display the category, such as blue.
12972    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
12973    #[serde(deserialize_with = "crate::lenient::string")]
12974    pub color: String,
12975    /// Optional explanation of the category. Omitted, null or blank input is stored as null, including on update.
12976    ///
12977    /// `None` leaves the field out, `Some(None)` sends `null`.
12978    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
12979    pub description: Option<Option<String>>,
12980    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
12981    #[serde(deserialize_with = "crate::lenient::string")]
12982    pub name: String,
12983    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
12984    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
12985    pub sort_key: i64,
12986    /// Fields not described by the spec, e.g. instance-specific DB fields.
12987    #[serde(flatten)]
12988    pub extra: serde_json::Map<String, serde_json::Value>,
12989}
12990
12991/// Creation and modification timestamps and person IDs for this category.
12992#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12993pub struct GroupCategoryMeta {
12994    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
12995    #[serde(rename = "createdDate", serialize_with = "crate::datetime::serialize_utc")]
12996    pub created_date: chrono::DateTime<chrono::Utc>,
12997    #[serde(rename = "createdPerson")]
12998    pub created_person: MetaDataPersonId,
12999    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
13000    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
13001    pub modified_date: chrono::DateTime<chrono::Utc>,
13002    #[serde(rename = "modifiedPerson")]
13003    pub modified_person: MetaDataPersonId,
13004    /// Fields not described by the spec, e.g. instance-specific DB fields.
13005    #[serde(flatten)]
13006    pub extra: serde_json::Map<String, serde_json::Value>,
13007}
13008
13009/// Options for copying a group. newName must be supplied in the JSON body or query; query values take precedence. The copy flags default to false.
13010#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13011pub struct GroupDuplicateCreate {
13012    /// Copy memberships, including statuses, roles, comments and member field values. Archived persons are excluded; group capacity is ignored and leaders are not informed.
13013    #[serde(rename = "copyMembers", default, skip_serializing_if = "Option::is_none")]
13014    pub copy_members: Option<bool>,
13015    /// Copy group-role permissions and permission inheritance settings. Locked permissions are omitted unless the current user is an authorized person.
13016    #[serde(rename = "copyPermissions", default, skip_serializing_if = "Option::is_none")]
13017    pub copy_permissions: Option<bool>,
13018    /// Copy membership routines and prepare their potential runs for the new group.
13019    #[serde(rename = "copyRoutines", default, skip_serializing_if = "Option::is_none")]
13020    pub copy_routines: Option<bool>,
13021    /// 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.
13022    #[serde(rename = "newName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13023    pub new_name: Option<String>,
13024    /// Fields not described by the spec, e.g. instance-specific DB fields.
13025    #[serde(flatten)]
13026    pub extra: serde_json::Map<String, serde_json::Value>,
13027}
13028
13029/// Selection for a group spreadsheet export. An empty selection produces no group rows.
13030#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13031pub struct GroupExportCreate {
13032    /// Group IDs to export. Unknown or invisible IDs are silently omitted; duplicates do not produce duplicate rows. Rows are sorted by group name, not by this array.
13033    pub ids: Vec<i64>,
13034    /// Fields not described by the spec, e.g. instance-specific DB fields.
13035    #[serde(flatten)]
13036    pub extra: serde_json::Map<String, serde_json::Value>,
13037}
13038
13039#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13040pub struct GroupFollowUp {
13041    #[serde(default, skip_serializing_if = "Option::is_none")]
13042    pub reminder: Option<bool>,
13043    #[serde(rename = "typeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13044    pub type_id: Option<i64>,
13045    /// Fields not described by the spec, e.g. instance-specific DB fields.
13046    #[serde(flatten)]
13047    pub extra: serde_json::Map<String, serde_json::Value>,
13048}
13049
13050/// The hierarchy of one group
13051#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13052pub struct GroupHierarchy {
13053    pub children: Vec<i64>,
13054    #[serde(default, skip_serializing_if = "Option::is_none")]
13055    pub group: Option<DomainObjectGroup>,
13056    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
13057    pub group_id: i64,
13058    pub parents: Vec<i64>,
13059    /// Fields not described by the spec, e.g. instance-specific DB fields.
13060    #[serde(flatten)]
13061    pub extra: serde_json::Map<String, serde_json::Value>,
13062}
13063
13064/// Public group homepage settings, filter definitions, and all public groups displayed on the page.
13065#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13066pub struct GroupHomepage {
13067    /// Maps deprecated response field names to their replacements.
13068    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
13069    pub deprecated: std::collections::BTreeMap<String, String>,
13070    /// Stored custom description for the group homepage header.
13071    #[serde(rename = "customDescription", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13072    pub custom_description: Option<String>,
13073    /// Stored custom title for the group homepage header.
13074    #[serde(rename = "customTitle", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13075    pub custom_title: Option<String>,
13076    /// Type how groups are listed on the page.
13077    /// Allowed values: `list`, `minitile`, `tile`.
13078    #[serde(rename = "defaultView", deserialize_with = "crate::lenient::string")]
13079    pub default_view: String,
13080    /// Stored hierarchy depth. A request depth override changes loaded groups without changing this returned setting.
13081    #[serde(deserialize_with = "crate::lenient::number")]
13082    pub depth: i64,
13083    /// Description of the group that owns the group homepage.
13084    #[serde(deserialize_with = "crate::lenient::string")]
13085    pub description: String,
13086    /// Header rendering choice: none hides the description, group uses description, custom uses customDescription. The API retains both stored texts regardless of this choice.
13087    /// Allowed values: `custom`, `group`, `none`.
13088    #[serde(rename = "descriptionMode", deserialize_with = "crate::lenient::string")]
13089    pub description_mode: String,
13090    /// Deprecated alias of filters.
13091    #[serde(default, skip_serializing_if = "Option::is_none")]
13092    #[deprecated = "deprecated in the ChurchTools API"]
13093    pub filter: Option<Vec<GroupHomepageFilter>>,
13094    /// Specifies all filters that can be applied for this group homepage.
13095    pub filters: Vec<GroupHomepageFilter>,
13096    /// Eligible descendant groups after hierarchy loading and the current session’s public-group feature check. Parent group itself is excluded; clients may construct nesting from children IDs.
13097    pub groups: Vec<PublicGroup>,
13098    /// Group Homepage ID
13099    #[serde(deserialize_with = "crate::lenient::number")]
13100    pub id: i64,
13101    /// If true, nested groups are collapsed by default.
13102    #[serde(rename = "isCollapsed")]
13103    pub is_collapsed: bool,
13104    /// Whether the group homepage is enabled. Clients should not display the group homepage if it is not enabled.
13105    #[serde(rename = "isEnabled")]
13106    pub is_enabled: bool,
13107    pub meta: MetaDataEntityId,
13108    /// Name of the group homepage's parent group.
13109    #[serde(deserialize_with = "crate::lenient::string")]
13110    pub name: String,
13111    /// Group field to sort groups by.
13112    /// Allowed values: `dateOfFoundation`, `name`.
13113    #[serde(rename = "orderBy", deserialize_with = "crate::lenient::string")]
13114    pub order_by: String,
13115    /// Direction if groups are sorted ascending or descending.
13116    /// Allowed values: `ASC`, `DESC`.
13117    #[serde(rename = "orderDirection", deserialize_with = "crate::lenient::string")]
13118    pub order_direction: String,
13119    /// ID of the parent group of all groups that should be displayed in the group homepage
13120    #[serde(rename = "parentGroup", deserialize_with = "crate::lenient::number")]
13121    pub parent_group: i64,
13122    /// The group homepage identifier (same as provided as hash request parameter).
13123    #[serde(rename = "randomUrl", deserialize_with = "crate::lenient::string")]
13124    pub random_url: String,
13125    /// Deprecated alias of showFilters.
13126    #[serde(rename = "showFilter", default, skip_serializing_if = "Option::is_none")]
13127    #[deprecated = "deprecated in the ChurchTools API"]
13128    pub show_filter: Option<bool>,
13129    /// If true, selected filters are displayed.
13130    #[serde(rename = "showFilters")]
13131    pub show_filters: bool,
13132    /// If true, the group homepage is set to display group images.
13133    #[serde(rename = "showGroupImages")]
13134    pub show_group_images: bool,
13135    /// Deprecated alias of showLeaders.
13136    #[serde(rename = "showLeader", default, skip_serializing_if = "Option::is_none")]
13137    #[deprecated = "deprecated in the ChurchTools API"]
13138    pub show_leader: Option<bool>,
13139    /// If true, the group homepage is set to display the leaders of each group.
13140    #[serde(rename = "showLeaders")]
13141    pub show_leaders: bool,
13142    /// Effective map-display setting: true only when both the homepage setting and the installation openstreetmaps_enabled flag are true. Meeting-place data remains in groups when false.
13143    #[serde(rename = "showMap")]
13144    pub show_map: bool,
13145    /// Use 'orderBy' instead.
13146    /// Allowed values: `dateOfFoundation`, `name`.
13147    #[serde(rename = "sortBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13148    #[deprecated = "Use 'orderBy' instead."]
13149    pub sort_by: Option<String>,
13150    /// Header rendering choice: none hides the heading, group uses name, custom uses customTitle. The API returns the individual fields rather than a resolved display title.
13151    /// Allowed values: `custom`, `group`, `none`.
13152    #[serde(rename = "titleMode", deserialize_with = "crate::lenient::string")]
13153    pub title_mode: String,
13154    /// Fields not described by the spec, e.g. instance-specific DB fields.
13155    #[serde(flatten)]
13156    pub extra: serde_json::Map<String, serde_json::Value>,
13157}
13158
13159/// Filter definition for the homepage UI. All five types are returned, including hidden filters; options contain complete master-data catalogs rather than only options used by displayed groups.
13160#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13161pub struct GroupHomepageFilter {
13162    /// If true, this filter is enabled on the group homepage.
13163    pub show: bool,
13164    /// Catalog used by this filter.
13165    /// Allowed values: `agegroups`, `campus`, `groupcategory`, `targetgroups`, `weekday`.
13166    #[serde(deserialize_with = "crate::lenient::string")]
13167    pub r#type: String,
13168    /// Available options for this filter type.
13169    #[serde(default, skip_serializing_if = "Option::is_none")]
13170    pub options: Option<Vec<serde_json::Value>>,
13171    /// Fields not described by the spec, e.g. instance-specific DB fields.
13172    #[serde(flatten)]
13173    pub extra: serde_json::Map<String, serde_json::Value>,
13174}
13175
13176/// Display setting for one of the five supported homepage filters. Only entries with show=true are stored.
13177#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13178pub struct GroupHomepageFilterCreate {
13179    /// If true, this filter is enabled on the group homepage.
13180    pub show: bool,
13181    /// Catalog used by this filter.
13182    /// Allowed values: `agegroups`, `campus`, `groupcategory`, `targetgroups`, `weekday`.
13183    #[serde(deserialize_with = "crate::lenient::string")]
13184    pub r#type: String,
13185    /// Fields not described by the spec, e.g. instance-specific DB fields.
13186    #[serde(flatten)]
13187    pub extra: serde_json::Map<String, serde_json::Value>,
13188}
13189
13190/// Upsert settings. Omitted header modes/custom text are preserved, but omitted layout/order/collapse/depth fields reset to their defaults and omitted filters disables all filters.
13191#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13192pub struct GroupHomepageUpdate {
13193    /// Custom description. Trimmed; null or blank clears the value. Omission preserves the current value on update.
13194    ///
13195    /// `None` leaves the field out, `Some(None)` sends `null`.
13196    #[serde(rename = "customDescription", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13197    pub custom_description: Option<Option<String>>,
13198    /// Custom heading. Trimmed; null or blank clears the value. Omission preserves the current value on update.
13199    ///
13200    /// `None` leaves the field out, `Some(None)` sends `null`.
13201    #[serde(rename = "customTitle", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13202    pub custom_title: Option<Option<String>>,
13203    /// Initial group display layout.
13204    /// Allowed values: `list`, `minitile`, `tile`.
13205    #[serde(rename = "defaultView", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13206    pub default_view: Option<String>,
13207    /// Maximum child hierarchy depth; 1 includes direct children. The public endpoint can override this value.
13208    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13209    pub depth: Option<i64>,
13210    /// Header content source. Omission uses group for a new page and preserves the current setting on update.
13211    /// Allowed values: `custom`, `group`, `none`.
13212    #[serde(rename = "descriptionMode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13213    pub description_mode: Option<String>,
13214    /// Replaces the enabled filters in the supplied order. Omission or an empty array disables all five filters. options from read responses are ignored.
13215    #[serde(default, skip_serializing_if = "Option::is_none")]
13216    pub filters: Option<Vec<GroupHomepageFilterCreate>>,
13217    /// Whether the group list starts collapsed.
13218    #[serde(rename = "isCollapsed", default, skip_serializing_if = "Option::is_none")]
13219    pub is_collapsed: Option<bool>,
13220    /// Whether the public hash URL may be opened.
13221    #[serde(rename = "isEnabled")]
13222    pub is_enabled: bool,
13223    /// Group field used to sort the page.
13224    /// Allowed values: `dateOfFoundation`, `name`.
13225    #[serde(rename = "orderBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13226    pub order_by: Option<String>,
13227    /// Ascending or descending sort order.
13228    /// Allowed values: `ASC`, `DESC`.
13229    #[serde(rename = "orderDirection", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13230    pub order_direction: Option<String>,
13231    /// Display the filter controls. Individual filter visibility is configured with filters.
13232    #[serde(rename = "showFilters")]
13233    pub show_filters: bool,
13234    /// Include group images in public group details.
13235    #[serde(rename = "showGroupImages")]
13236    pub show_group_images: bool,
13237    /// Include leaders in public group details.
13238    #[serde(rename = "showLeaders")]
13239    pub show_leaders: bool,
13240    /// Enable the map when the global OpenStreetMap setting also permits it.
13241    #[serde(rename = "showMap")]
13242    pub show_map: bool,
13243    /// Header content source. Omission uses group for a new page and preserves the current setting on update.
13244    /// Allowed values: `custom`, `group`, `none`.
13245    #[serde(rename = "titleMode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13246    pub title_mode: Option<String>,
13247    /// Fields not described by the spec, e.g. instance-specific DB fields.
13248    #[serde(flatten)]
13249    pub extra: serde_json::Map<String, serde_json::Value>,
13250}
13251
13252#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13253pub struct GroupInformation {
13254    #[serde(rename = "ageGroupIds")]
13255    pub age_group_ids: Vec<i64>,
13256    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13257    pub campus_id: Option<i64>,
13258    /// Room lifecycle status. `STARTING` awaits confirmation from the central chat service.
13259    /// Allowed values: `NOT_STARTED`, `STARTED`, `STARTING`, `STOPPED`.
13260    #[serde(rename = "chatStatus", deserialize_with = "crate::lenient::string")]
13261    pub chat_status: String,
13262    /// A color in ChurchTools
13263    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
13264    #[serde(deserialize_with = "crate::lenient::string")]
13265    pub color: String,
13266    #[serde(rename = "dateOfFoundation", default, skip_serializing_if = "Option::is_none")]
13267    pub date_of_foundation: Option<chrono::NaiveDate>,
13268    #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
13269    pub end_date: Option<chrono::NaiveDate>,
13270    #[serde(rename = "groupCategoryId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13271    pub group_category_id: Option<i64>,
13272    #[serde(rename = "groupHomepageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13273    pub group_homepage_url: Option<String>,
13274    #[serde(rename = "groupStatusId", deserialize_with = "crate::lenient::number")]
13275    pub group_status_id: i64,
13276    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
13277    pub group_type_id: i64,
13278    #[serde(rename = "imageAiGenerated", default, skip_serializing_if = "Option::is_none")]
13279    pub image_ai_generated: Option<bool>,
13280    #[serde(rename = "imageAnnotation", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13281    pub image_annotation: Option<String>,
13282    #[serde(rename = "imageAnnotationLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13283    pub image_annotation_link: Option<String>,
13284    #[serde(rename = "imageDescription", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13285    pub image_description: Option<String>,
13286    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13287    pub image_url: Option<String>,
13288    /// Allowed maximal members
13289    #[serde(rename = "maxMembers", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13290    #[deprecated = "deprecated in the ChurchTools API"]
13291    pub max_members: Option<i64>,
13292    #[serde(rename = "meetingTime", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13293    pub meeting_time: Option<String>,
13294    #[serde(deserialize_with = "crate::lenient::string")]
13295    pub note: String,
13296    #[serde(rename = "signUpOverrideRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13297    pub sign_up_override_role_id: Option<i64>,
13298    #[serde(rename = "targetGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13299    pub target_group_id: Option<i64>,
13300    /// The number of the weekday. Starting with 0 = Sunday, 1 = Monday, ...
13301    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13302    pub weekday: Option<i64>,
13303    /// Fields not described by the spec, e.g. instance-specific DB fields.
13304    #[serde(flatten)]
13305    pub extra: serde_json::Map<String, serde_json::Value>,
13306}
13307
13308/// One dated occurrence of a group meeting, used to record attendance, guest counts and feedback. It is separate from the group itself and its memberships. No independent end time is stored. Cancellation and completion are separate flags; completion locks check-in changes.
13309#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13310pub struct GroupMeeting {
13311    /// Compatibility metadata describing legacy date fields.
13312    #[serde(rename = "@deprecated", default, skip_serializing_if = "Option::is_none")]
13313    pub deprecated: Option<Deprecated>,
13314    /// Optional map from person IDs to attendance states, returned with include=attendances. Visibility and group-history permissions affect which people are included.
13315    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
13316    pub attendances: Option<std::collections::BTreeMap<String, String>>,
13317    /// Meeting notes; null when no text is stored.
13318    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13319    pub comment: Option<String>,
13320    /// Deprecated compatibility value equal to startDate.
13321    #[serde(rename = "dateFrom", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
13322    #[deprecated = "deprecated in the ChurchTools API"]
13323    pub date_from: Option<chrono::DateTime<chrono::Utc>>,
13324    /// Deprecated compatibility value equal to startDate.
13325    #[serde(rename = "dateTo", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
13326    #[deprecated = "deprecated in the ChurchTools API"]
13327    pub date_to: Option<chrono::DateTime<chrono::Utc>>,
13328    /// Legacy compatibility value equal to startDate; this is not an actual end time.
13329    #[serde(rename = "endDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
13330    #[deprecated = "deprecated in the ChurchTools API"]
13331    pub end_date: Option<chrono::DateTime<chrono::Utc>>,
13332    /// ID of the group this meeting belongs to.
13333    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
13334    pub group_id: i64,
13335    /// Whether attendance editing has started. Check-in and bulk attendance changes set this flag; resetting attendance clears it. This does not mean the meeting is completed.
13336    #[serde(rename = "hasEditingStarted")]
13337    pub has_editing_started: bool,
13338    /// ID of this meeting; distinct from the group ID.
13339    #[serde(deserialize_with = "crate::lenient::number")]
13340    pub id: i64,
13341    /// Whether the meeting was canceled. Canceling retains the meeting record.
13342    #[serde(rename = "isCanceled")]
13343    pub is_canceled: bool,
13344    /// Whether attendance and feedback have been marked as completed. Attendance changes through check-in endpoints are rejected while this is true.
13345    #[serde(rename = "isCompleted")]
13346    pub is_completed: bool,
13347    pub meta: MetaDataEntityId,
13348    /// Additional guest headcount entered for the meeting, or null when unspecified. This does not create person or attendance records.
13349    #[serde(rename = "numGuests", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13350    pub num_guests: Option<i64>,
13351    /// Recorded feedback fields and answers for this meeting. The group selects a feedback template through settings.groupMeeting.templateId.
13352    #[serde(rename = "pollResult", default, skip_serializing_if = "Option::is_none")]
13353    pub poll_result: Option<Vec<MeetingTemplateField>>,
13354    /// Start of the group meeting
13355    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
13356    pub start_date: chrono::DateTime<chrono::Utc>,
13357    /// Counts by attendance status. These are calculated for the meeting and are separate from numGuests.
13358    pub statistics: GroupMeetingStatistics,
13359    /// Fields not described by the spec, e.g. instance-specific DB fields.
13360    #[serde(flatten)]
13361    pub extra: serde_json::Map<String, serde_json::Value>,
13362}
13363
13364/// Group meeting as returned by the member history endpoint. Attendance statistics are not calculated here.
13365#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13366pub struct GroupMeetingForMember {
13367    /// Compatibility metadata describing legacy date fields.
13368    #[serde(rename = "@deprecated")]
13369    pub deprecated: Deprecated,
13370    /// Meeting notes; null when no text is stored.
13371    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13372    pub comment: Option<String>,
13373    /// Deprecated compatibility value equal to startDate.
13374    #[serde(rename = "dateFrom", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
13375    #[deprecated = "deprecated in the ChurchTools API"]
13376    pub date_from: Option<chrono::DateTime<chrono::Utc>>,
13377    /// Deprecated compatibility value equal to startDate.
13378    #[serde(rename = "dateTo", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
13379    #[deprecated = "deprecated in the ChurchTools API"]
13380    pub date_to: Option<chrono::DateTime<chrono::Utc>>,
13381    /// Legacy compatibility value equal to startDate; this is not an actual end time.
13382    #[serde(rename = "endDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
13383    #[deprecated = "deprecated in the ChurchTools API"]
13384    pub end_date: Option<chrono::DateTime<chrono::Utc>>,
13385    /// ID of the group this meeting belongs to.
13386    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
13387    pub group_id: i64,
13388    /// Whether attendance editing has started. Check-in and bulk attendance changes set this flag; resetting attendance clears it. This does not mean the meeting is completed.
13389    #[serde(rename = "hasEditingStarted")]
13390    pub has_editing_started: bool,
13391    /// ID of this meeting; distinct from the group ID.
13392    #[serde(deserialize_with = "crate::lenient::number")]
13393    pub id: i64,
13394    /// Whether the meeting was canceled. Canceling retains the meeting record.
13395    #[serde(rename = "isCanceled")]
13396    pub is_canceled: bool,
13397    /// Whether attendance and feedback have been marked as completed. Attendance changes through check-in endpoints are rejected while this is true.
13398    #[serde(rename = "isCompleted")]
13399    pub is_completed: bool,
13400    pub meta: MetaDataEntityId,
13401    /// Additional guest headcount entered for the meeting, or null when unspecified. This does not create person or attendance records.
13402    #[serde(rename = "numGuests", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13403    pub num_guests: Option<i64>,
13404    /// Recorded feedback fields and answers for this meeting. The group selects a feedback template through settings.groupMeeting.templateId.
13405    #[serde(rename = "pollResult", default, skip_serializing_if = "Option::is_none")]
13406    pub poll_result: Option<Vec<MeetingTemplateField>>,
13407    /// Start of the group meeting
13408    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
13409    pub start_date: chrono::DateTime<chrono::Utc>,
13410    /// Always an empty array on this endpoint; attendance counts are not loaded.
13411    pub statistics: Vec<serde_json::Value>,
13412    /// Fields not described by the spec, e.g. instance-specific DB fields.
13413    #[serde(flatten)]
13414    pub extra: serde_json::Map<String, serde_json::Value>,
13415}
13416
13417/// One person in the meeting attendance view. The person ID and attendance remain available even when a current visible active membership cannot be included.
13418#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13419pub struct GroupMeetingMember {
13420    /// True exactly when status is present.
13421    #[serde(rename = "isCheckedIn")]
13422    pub is_checked_in: bool,
13423    /// Current visible active membership, or null if none is available. A null value can represent a former member or a person whose membership details are not visible.
13424    #[serde(default, skip_serializing_if = "Option::is_none")]
13425    pub member: Option<GroupMember>,
13426    /// Person ID. Use this value as memberId when changing this person's meeting attendance.
13427    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
13428    pub person_id: i64,
13429    /// Attendance at one meeting, independent of membership status: present means recorded as attending; absent means recorded as not attending; unsure means attendance has not been decided. not-in-group is also used when no attendance record exists for that person and meeting, so it does not prove that the person is currently outside the group.
13430    /// Allowed values: `absent`, `not-in-group`, `present`, `unsure`.
13431    #[serde(deserialize_with = "crate::lenient::string")]
13432    pub status: String,
13433    /// Fields not described by the spec, e.g. instance-specific DB fields.
13434    #[serde(flatten)]
13435    pub extra: serde_json::Map<String, serde_json::Value>,
13436}
13437
13438/// Counts by attendance status. These are calculated for the meeting and are separate from numGuests.
13439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13440pub struct GroupMeetingStatistics {
13441    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13442    pub absent: Option<i64>,
13443    #[serde(rename = "not-in-group", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13444    pub not_in_group: Option<i64>,
13445    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13446    pub present: Option<i64>,
13447    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13448    pub unsure: Option<i64>,
13449    /// Fields not described by the spec, e.g. instance-specific DB fields.
13450    #[serde(flatten)]
13451    pub extra: serde_json::Map<String, serde_json::Value>,
13452}
13453
13454/// A person’s membership in one group. The membership has its own record ID, a role defined by the group type, and an independent membership status. Use person.domainIdentifier as personId in membership endpoint URLs; id identifies the membership record. Field visibility depends on the current user’s permissions.
13455#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13456pub struct GroupMember {
13457    /// Legacy response-field mapping emitted by the membership transformer.
13458    #[serde(rename = "@deprecated")]
13459    pub deprecated: GroupMemberDeprecated,
13460    /// Comment about this membership. Only included when the current user can view basic group member fields.
13461    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13462    pub comment: Option<String>,
13463    /// Visible additional fields stored on this membership. Each entry identifies the group member field and its value. This is an array in responses; write requests use an object keyed by field ID.
13464    #[serde(default, skip_serializing_if = "Option::is_none")]
13465    pub fields: Option<Vec<GroupMemberFieldsItem>>,
13466    /// Group to which this membership belongs.
13467    pub group: GroupMemberGroup,
13468    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
13469    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
13470    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
13471    pub group_member_status: String,
13472    /// ID of the role definition for the group type, matching Role.id from GET /roles. This identifies the member’s role (for example, participant or leader); GroupRole.id identifies a group-specific role configuration.
13473    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
13474    pub group_type_role_id: i64,
13475    /// ID of the membership record linking the person and group.
13476    #[serde(deserialize_with = "crate::lenient::number")]
13477    pub id: i64,
13478    /// Membership end date, or null if none is set. Only included when the current user can view basic group member fields.
13479    #[serde(rename = "memberEndDate", default, skip_serializing_if = "Option::is_none")]
13480    pub member_end_date: Option<chrono::NaiveDate>,
13481    /// Date on which the membership began (YYYY-MM-DD), or null if no start date is set.
13482    #[serde(rename = "memberStartDate", default, skip_serializing_if = "Option::is_none")]
13483    pub member_start_date: Option<chrono::NaiveDate>,
13484    /// Newsletter subscription information, included when the member list is requested with include=newsletter.
13485    #[serde(default, skip_serializing_if = "Option::is_none")]
13486    pub newsletter: Option<GroupMemberNewsletter>,
13487    /// Person who belongs to the group. domainIdentifier is the person ID as a string.
13488    pub person: GroupMemberPerson,
13489    /// Requested additional person fields, keyed by field name. Values are subject to person-field permissions. Returned as an empty array when no fields were requested. These values belong to the person, whereas fields contains values belonging to this membership.
13490    #[serde(rename = "personFields", default, skip_serializing_if = "serde_json::Value::is_null")]
13491    pub person_fields: serde_json::Value,
13492    /// use person.domainIdentifier (type: string) instead.
13493    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13494    #[deprecated = "deprecated in the ChurchTools API"]
13495    pub person_id: Option<i64>,
13496    /// Person ID recorded as having registered this member, or null if none is recorded.
13497    #[serde(rename = "registeredBy", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13498    pub registered_by: Option<i64>,
13499    /// Timestamp of the most recent role change.
13500    #[serde(rename = "roleChangedDate", serialize_with = "crate::datetime::serialize_utc")]
13501    pub role_changed_date: chrono::DateTime<chrono::Utc>,
13502    /// Timestamp of the most recent membership status change.
13503    #[serde(rename = "statusChangedDate", serialize_with = "crate::datetime::serialize_utc")]
13504    pub status_changed_date: chrono::DateTime<chrono::Utc>,
13505    /// Person tags, included when the member list is requested with include=tags.
13506    #[serde(default, skip_serializing_if = "Option::is_none")]
13507    pub tags: Option<Vec<Tag>>,
13508    /// Position on the group’s waiting list, or null when no position is assigned.
13509    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13510    pub waitinglist_position: Option<i64>,
13511    /// Fields not described by the spec, e.g. instance-specific DB fields.
13512    #[serde(flatten)]
13513    pub extra: serde_json::Map<String, serde_json::Value>,
13514}
13515
13516/// Group-wide capacity counters, independent of the caller’s individual member visibility. These counters have different role/status scopes and are not a partition of one common total.
13517#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13518pub struct GroupMemberCounts {
13519    /// Non-archived memberships in non-hidden roles of this group type, excluding to_delete; includes requested/waiting memberships.
13520    #[serde(rename = "allPlaces", deserialize_with = "crate::lenient::number")]
13521    pub all_places: i64,
13522    /// maxMembers minus takenPlaces, clamped to zero. Null means no maximum is configured; requested/waiting places are not subtracted.
13523    #[serde(rename = "freePlaces", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13524    pub free_places: Option<i64>,
13525    /// Non-archived requested/waiting memberships in seat-counting roles of this group type. Includes entries already assigned a waiting-list position.
13526    #[serde(rename = "requestedPlaces", deserialize_with = "crate::lenient::number")]
13527    pub requested_places: i64,
13528    /// Active, non-archived memberships in active, non-hidden group roles configured to count toward seats.
13529    #[serde(rename = "takenPlaces", deserialize_with = "crate::lenient::number")]
13530    pub taken_places: i64,
13531    /// Subset of requestedPlaces with a non-null waiting-list position, or zero if the group’s waiting list is disabled.
13532    #[serde(rename = "waitinglistPlaces", deserialize_with = "crate::lenient::number")]
13533    pub waitinglist_places: i64,
13534    /// Fields not described by the spec, e.g. instance-specific DB fields.
13535    #[serde(flatten)]
13536    pub extra: serde_json::Map<String, serde_json::Value>,
13537}
13538
13539/// Legacy response-field mapping emitted by the membership transformer.
13540#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13541pub struct GroupMemberDeprecated {
13542    #[serde(rename = "personId", deserialize_with = "crate::lenient::string")]
13543    pub person_id: String,
13544    /// Fields not described by the spec, e.g. instance-specific DB fields.
13545    #[serde(flatten)]
13546    pub extra: serde_json::Map<String, serde_json::Value>,
13547}
13548
13549/// One requested export column. Its header and format are derived from the referenced field; extra display metadata in the request is ignored.
13550#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13551pub struct GroupMemberExportColumn {
13552    /// Column reference. Use person., groupMemberField., relation. or group_type.. Fixed membership columns are member.comment, member.groupMemberStatus, member.groupTypeRoleName, member.memberStartDate, member.memberEndDate, member.registeredBy, member.registeredBy_fullName and member.waitingListPosition. Special columns are special.age, special.Anrede1, special.Anrede2, special.id, special.__combined_name and special.growPath. Some person fields expand to multiple columns. Unknown keys are not reliably rejected.
13553    #[serde(deserialize_with = "crate::lenient::string")]
13554    pub key: String,
13555    /// Fields not described by the spec, e.g. instance-specific DB fields.
13556    #[serde(flatten)]
13557    pub extra: serde_json::Map<String, serde_json::Value>,
13558}
13559
13560/// Version 10 column selection. Columns are emitted in pinned order followed by unpinned order; person.id is prepended to pinned when absent from both lists. Pinned columns are frozen in XLSX; CSV only preserves their ordering. An empty pair of lists still exports person.id.
13561#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13562pub struct GroupMemberExportConfig {
13563    /// Leading columns, frozen horizontally in XLSX.
13564    pub pinned: Vec<GroupMemberExportColumn>,
13565    /// Columns following the pinned columns.
13566    pub unpinned: Vec<GroupMemberExportColumn>,
13567    /// Current configuration version. Use the integer 10.
13568    /// Allowed values: `10`.
13569    #[serde(deserialize_with = "crate::lenient::number")]
13570    pub version: i64,
13571    /// Fields not described by the spec, e.g. instance-specific DB fields.
13572    #[serde(flatten)]
13573    pub extra: serde_json::Map<String, serde_json::Value>,
13574}
13575
13576/// Optional custom column selection. Omit config, send null or an empty object to use the default export.
13577#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13578pub struct GroupMemberExportCreate {
13579    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
13580    pub config: serde_json::Value,
13581    /// Fields not described by the spec, e.g. instance-specific DB fields.
13582    #[serde(flatten)]
13583    pub extra: serde_json::Map<String, serde_json::Value>,
13584}
13585
13586/// Built-in full export preset. Replaces any supplied column lists and version.
13587#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13588pub struct GroupMemberExportTemplate {
13589    /// Select every discoverable person, relationship, group-type, special and accessible membership field.
13590    /// Allowed values: `allin`.
13591    #[serde(deserialize_with = "crate::lenient::string")]
13592    pub template: String,
13593    /// Fields not described by the spec, e.g. instance-specific DB fields.
13594    #[serde(flatten)]
13595    pub extra: serde_json::Map<String, serde_json::Value>,
13596}
13597
13598/// A group-specific membership field definition. Values belong to a person’s membership in this group, rather than to the person globally.
13599#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13600pub struct GroupMemberFieldGroup {
13601    /// Compatibility mapping returned by the serializer.
13602    #[serde(rename = "@deprecated")]
13603    pub deprecated: GroupMemberFieldGroupDeprecated,
13604    /// Normalized default: string for scalar field types, an array of option-ID strings for multiselect, or null when unset. Checkbox defaults are strings 0/1, numeric defaults are strings, and date/datetime defaults are formatted date strings.
13605    #[serde(rename = "defaultValue", default, skip_serializing_if = "serde_json::Value::is_null")]
13606    pub default_value: serde_json::Value,
13607    /// Use `name` instead.
13608    #[serde(rename = "fieldName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13609    #[deprecated = "Use `name` instead."]
13610    pub field_name: Option<String>,
13611    /// Input/storage type. select and radioselect use one option, multiselect uses multiple options. text and textarea require a configured length when created. api identifies an application-specific field type.
13612    /// Allowed values: `api`, `checkbox`, `date`, `datetime`, `multiselect`, `number`, `radioselect`, `select`, `text`, `textarea`.
13613    #[serde(rename = "fieldTypeCode", deserialize_with = "crate::lenient::string")]
13614    pub field_type_code: String,
13615    /// Numeric id of the field type.
13616    #[serde(rename = "fieldTypeId", deserialize_with = "crate::lenient::number")]
13617    pub field_type_id: i64,
13618    /// ID of the group this member field belongs to.
13619    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
13620    pub group_id: i64,
13621    /// ID of the group member field.
13622    #[serde(deserialize_with = "crate::lenient::number")]
13623    pub id: i64,
13624    /// Maximum stored value length for member field data.
13625    #[serde(rename = "maxLength", deserialize_with = "crate::lenient::number")]
13626    pub max_length: i64,
13627    /// Internal field name shown to administrators.
13628    #[serde(deserialize_with = "crate::lenient::string")]
13629    pub name: String,
13630    /// Optional field name shown in the signup form.
13631    #[serde(rename = "nameInSignupForm", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13632    pub name_in_signup_form: Option<String>,
13633    /// Internal field description.
13634    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13635    pub note: Option<String>,
13636    /// Optional field description shown in the signup form.
13637    #[serde(rename = "noteInSignupForm", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13638    pub note_in_signup_form: Option<String>,
13639    /// Backend-assigned options for select-like fields.
13640    pub options: Vec<GroupMemberFieldGroupOption>,
13641    /// Stable machine-readable key for this field.
13642    #[serde(rename = "referenceName", deserialize_with = "crate::lenient::string")]
13643    pub reference_name: String,
13644    /// Whether this field is mandatory in the signup form.
13645    #[serde(rename = "requiredInRegistrationForm")]
13646    pub required_in_registration_form: bool,
13647    /// Security level required to see and edit this field.
13648    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
13649    pub security_level: i64,
13650    /// Sort order among group member fields.
13651    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
13652    pub sort_key: i64,
13653    /// Whether this field is shown in the signup form.
13654    #[serde(rename = "useInRegistrationForm")]
13655    pub use_in_registration_form: bool,
13656    /// Fields not described by the spec, e.g. instance-specific DB fields.
13657    #[serde(flatten)]
13658    pub extra: serde_json::Map<String, serde_json::Value>,
13659}
13660
13661/// Creates a field on memberships of the path group. Its type is fixed after creation. The reference name is generated when omitted; defaults and choices are normalized to the field type.
13662#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13663pub struct GroupMemberFieldGroupCreate {
13664    /// Default value, validated according to fieldTypeCode. Checkbox accepts booleans and supported boolean strings; number accepts numbers or numeric strings. Date/datetime require date/Zulu date-time strings. Text and textarea accept up to 4000 characters; api accepts up to 255. Select/radioselect accept an option name or ID; multiselect accepts an array, comma-separated string or JSON-encoded array of option names/IDs. Responses normalize scalar values to strings and multiselect values to arrays of option-ID strings. Null clears the default.
13665    #[serde(rename = "defaultValue", default, skip_serializing_if = "serde_json::Value::is_null")]
13666    pub default_value: serde_json::Value,
13667    /// One of the ten supported field types. Unlike global database fields, text/textarea member fields do not require a length parameter and have a fixed maximum value size of 4000.
13668    /// Allowed values: `api`, `checkbox`, `date`, `datetime`, `multiselect`, `number`, `radioselect`, `select`, `text`, `textarea`.
13669    #[serde(rename = "fieldTypeCode", deserialize_with = "crate::lenient::string")]
13670    pub field_type_code: String,
13671    /// Internal field name shown to administrators.
13672    #[serde(deserialize_with = "crate::lenient::string")]
13673    pub name: String,
13674    /// Optional field name shown in the signup form. Null or text identical to the internal name/note is stored as null, allowing the internal text to be used.
13675    ///
13676    /// `None` leaves the field out, `Some(None)` sends `null`.
13677    #[serde(rename = "nameInSignupForm", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13678    pub name_in_signup_form: Option<Option<String>>,
13679    /// Internal field description.
13680    ///
13681    /// `None` leaves the field out, `Some(None)` sends `null`.
13682    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13683    pub note: Option<Option<String>>,
13684    /// Optional field description shown in the signup form. Null or text identical to the internal name/note is stored as null, allowing the internal text to be used.
13685    ///
13686    /// `None` leaves the field out, `Some(None)` sends `null`.
13687    #[serde(rename = "noteInSignupForm", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13688    pub note_in_signup_form: Option<Option<String>>,
13689    /// Choices for select, radioselect or multiselect, in display order. Only name is needed; submitted IDs are discarded and new IDs are allocated. Duplicate new names are deduplicated. Omitted/null/empty creates no choices; options for other field types are not retained.
13690    ///
13691    /// `None` leaves the field out, `Some(None)` sends `null`.
13692    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13693    pub options: Option<Option<Vec<GroupMemberFieldGroupOptionCreate>>>,
13694    /// Optional stable machine-readable key. If omitted, it is generated from the field name.
13695    #[serde(rename = "referenceName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13696    pub reference_name: Option<String>,
13697    /// Whether this field is mandatory in the signup form.
13698    #[serde(rename = "requiredInRegistrationForm")]
13699    pub required_in_registration_form: bool,
13700    /// Security level required to see and edit this field.
13701    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
13702    pub security_level: i64,
13703    /// Sort order among group member fields. Defaults to 0.
13704    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13705    pub sort_key: Option<i64>,
13706    /// Whether this field is shown in the signup form.
13707    #[serde(rename = "useInRegistrationForm")]
13708    pub use_in_registration_form: bool,
13709    /// Fields not described by the spec, e.g. instance-specific DB fields.
13710    #[serde(flatten)]
13711    pub extra: serde_json::Map<String, serde_json::Value>,
13712}
13713
13714/// Compatibility mapping returned by the serializer.
13715#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13716pub struct GroupMemberFieldGroupDeprecated {
13717    #[serde(rename = "fieldName", deserialize_with = "crate::lenient::string")]
13718    pub field_name: String,
13719    /// Fields not described by the spec, e.g. instance-specific DB fields.
13720    #[serde(flatten)]
13721    pub extra: serde_json::Map<String, serde_json::Value>,
13722}
13723
13724#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13725pub struct GroupMemberFieldGroupOption {
13726    /// Backend-assigned option ID serialized as a string. Update requests accept its numeric value.
13727    #[serde(deserialize_with = "crate::lenient::string")]
13728    pub id: String,
13729    /// Display value of the option.
13730    #[serde(deserialize_with = "crate::lenient::string")]
13731    pub name: String,
13732    /// Fields not described by the spec, e.g. instance-specific DB fields.
13733    #[serde(flatten)]
13734    pub extra: serde_json::Map<String, serde_json::Value>,
13735}
13736
13737/// A newly created choice. Use an object containing name; compact string entries are rejected by the current controller. Submitted compatibility IDs are discarded on create.
13738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13739pub struct GroupMemberFieldGroupOptionCreate {
13740    /// Option display value, trimmed before storage.
13741    #[serde(deserialize_with = "crate::lenient::string")]
13742    pub name: String,
13743    /// Fields not described by the spec, e.g. instance-specific DB fields.
13744    #[serde(flatten)]
13745    pub extra: serde_json::Map<String, serde_json::Value>,
13746}
13747
13748/// Choice in a replacement option list. Include the existing numeric ID to retain a choice; omit it or use null to create a new choice.
13749#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13750pub struct GroupMemberFieldGroupOptionPatch {
13751    /// Existing option ID belonging to this field, or null for a new option.
13752    ///
13753    /// `None` leaves the field out, `Some(None)` sends `null`.
13754    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13755    pub id: Option<Option<i64>>,
13756    /// Display label, trimmed before storage.
13757    #[serde(deserialize_with = "crate::lenient::string")]
13758    pub name: String,
13759    /// Fields not described by the spec, e.g. instance-specific DB fields.
13760    #[serde(flatten)]
13761    pub extra: serde_json::Map<String, serde_json::Value>,
13762}
13763
13764/// Partial membership field update. Omitted fields are preserved. options, when supplied, replaces the full list and can modify stored member selections. Field type cannot be changed.
13765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13766pub struct GroupMemberFieldGroupPatch {
13767    /// Default value, validated according to fieldTypeCode. Checkbox accepts booleans and supported boolean strings; number accepts numbers or numeric strings. Date/datetime require date/Zulu date-time strings. Text and textarea accept up to 4000 characters; api accepts up to 255. Select/radioselect accept an option name or ID; multiselect accepts an array, comma-separated string or JSON-encoded array of option names/IDs. Responses normalize scalar values to strings and multiselect values to arrays of option-ID strings. Null clears the default.
13768    #[serde(rename = "defaultValue", default, skip_serializing_if = "serde_json::Value::is_null")]
13769    pub default_value: serde_json::Value,
13770    /// Internal field name shown to administrators.
13771    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13772    pub name: Option<String>,
13773    /// Optional field name shown in the signup form. Null or text identical to the internal name/note is stored as null, allowing the internal text to be used.
13774    ///
13775    /// `None` leaves the field out, `Some(None)` sends `null`.
13776    #[serde(rename = "nameInSignupForm", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13777    pub name_in_signup_form: Option<Option<String>>,
13778    /// Internal field description.
13779    ///
13780    /// `None` leaves the field out, `Some(None)` sends `null`.
13781    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13782    pub note: Option<Option<String>>,
13783    /// Optional field description shown in the signup form. Null or text identical to the internal name/note is stored as null, allowing the internal text to be used.
13784    ///
13785    /// `None` leaves the field out, `Some(None)` sends `null`.
13786    #[serde(rename = "noteInSignupForm", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13787    pub note_in_signup_form: Option<Option<String>>,
13788    /// Full replacement list. Retain numeric IDs of existing choices; omitted choices are deleted and removed from member values. \[\] removes all choices. Current backend behavior for null rebuilds existing labels with new IDs, which also clears selections using the previous IDs; preserve the list by omitting options instead.
13789    ///
13790    /// `None` leaves the field out, `Some(None)` sends `null`.
13791    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13792    pub options: Option<Option<Vec<GroupMemberFieldGroupOptionPatch>>>,
13793    /// Machine-readable key, unique within this group. Changing it changes the key used by reference-name clients; existing numeric field IDs remain unchanged.
13794    #[serde(rename = "referenceName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13795    pub reference_name: Option<String>,
13796    /// Whether this field is mandatory in the signup form.
13797    #[serde(rename = "requiredInRegistrationForm", default, skip_serializing_if = "Option::is_none")]
13798    pub required_in_registration_form: Option<bool>,
13799    /// Security level required to see and edit this field.
13800    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13801    pub security_level: Option<i64>,
13802    /// Sort order among group member fields. Defaults to 0.
13803    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13804    pub sort_key: Option<i64>,
13805    /// Whether this field is shown in the signup form.
13806    #[serde(rename = "useInRegistrationForm", default, skip_serializing_if = "Option::is_none")]
13807    pub use_in_registration_form: Option<bool>,
13808    /// Fields not described by the spec, e.g. instance-specific DB fields.
13809    #[serde(flatten)]
13810    pub extra: serde_json::Map<String, serde_json::Value>,
13811}
13812
13813/// Full update of a membership field. Requires name, referenceName, securityLevel and both registration flags. Omitted notes, signup labels and defaultValue are cleared; sortKey resets to zero. Supply options with existing IDs to preserve selections.
13814#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13815pub struct GroupMemberFieldGroupUpdate {
13816    /// Default value, validated according to fieldTypeCode. Checkbox accepts booleans and supported boolean strings; number accepts numbers or numeric strings. Date/datetime require date/Zulu date-time strings. Text and textarea accept up to 4000 characters; api accepts up to 255. Select/radioselect accept an option name or ID; multiselect accepts an array, comma-separated string or JSON-encoded array of option names/IDs. Responses normalize scalar values to strings and multiselect values to arrays of option-ID strings. Null clears the default.
13817    #[serde(rename = "defaultValue", default, skip_serializing_if = "serde_json::Value::is_null")]
13818    pub default_value: serde_json::Value,
13819    /// Internal field name shown to administrators.
13820    #[serde(deserialize_with = "crate::lenient::string")]
13821    pub name: String,
13822    /// Optional field name shown in the signup form. Null or text identical to the internal name/note is stored as null, allowing the internal text to be used.
13823    ///
13824    /// `None` leaves the field out, `Some(None)` sends `null`.
13825    #[serde(rename = "nameInSignupForm", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13826    pub name_in_signup_form: Option<Option<String>>,
13827    /// Internal field description.
13828    ///
13829    /// `None` leaves the field out, `Some(None)` sends `null`.
13830    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13831    pub note: Option<Option<String>>,
13832    /// Optional field description shown in the signup form. Null or text identical to the internal name/note is stored as null, allowing the internal text to be used.
13833    ///
13834    /// `None` leaves the field out, `Some(None)` sends `null`.
13835    #[serde(rename = "noteInSignupForm", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13836    pub note_in_signup_form: Option<Option<String>>,
13837    /// Full replacement list; include IDs of choices to retain. \[\] removes all choices and their selections. Omission or null currently rebuilds the existing labels with new IDs and can clear previous selections. Always send existing IDs when preserving choices in PUT.
13838    ///
13839    /// `None` leaves the field out, `Some(None)` sends `null`.
13840    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
13841    pub options: Option<Option<Vec<GroupMemberFieldGroupOptionPatch>>>,
13842    /// Machine-readable key, unique within this group. Changing it changes the key used by reference-name clients; existing numeric field IDs remain unchanged.
13843    #[serde(rename = "referenceName", deserialize_with = "crate::lenient::string")]
13844    pub reference_name: String,
13845    /// Whether this field is mandatory in the signup form.
13846    #[serde(rename = "requiredInRegistrationForm")]
13847    pub required_in_registration_form: bool,
13848    /// Security level required to see and edit this field.
13849    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
13850    pub security_level: i64,
13851    /// Sort order; omission resets it to zero.
13852    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13853    pub sort_key: Option<i64>,
13854    /// Whether this field is shown in the signup form.
13855    #[serde(rename = "useInRegistrationForm")]
13856    pub use_in_registration_form: bool,
13857    /// Fields not described by the spec, e.g. instance-specific DB fields.
13858    #[serde(flatten)]
13859    pub extra: serde_json::Map<String, serde_json::Value>,
13860}
13861
13862/// A global person field configured for this group’s membership/signup UI. id identifies the configuration row; dbField.id identifies the underlying person field used in the /memberfields/person/{fieldId} path.
13863#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13864pub struct GroupMemberFieldPerson {
13865    /// Whether the person field is required in this group’s signup form.
13866    #[serde(rename = "requiredInRegistrationForm")]
13867    pub required_in_registration_form: bool,
13868    /// Display order among this group’s person and membership fields. Required on both create and update.
13869    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
13870    pub sort_key: i64,
13871    /// Underlying global field definition. Its id, rather than this resource’s id, identifies the person-field link in the API path.
13872    #[serde(rename = "dbField")]
13873    pub db_field: GroupMemberFieldPersonDbField,
13874    /// Group using the person field.
13875    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
13876    pub group_id: i64,
13877    /// ID of the group/person-field configuration row.
13878    #[serde(deserialize_with = "crate::lenient::number")]
13879    pub id: i64,
13880    /// Fields not described by the spec, e.g. instance-specific DB fields.
13881    #[serde(flatten)]
13882    pub extra: serde_json::Map<String, serde_json::Value>,
13883}
13884
13885/// Underlying global field definition. Its id, rather than this resource’s id, identifies the person-field link in the API path.
13886#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13887pub struct GroupMemberFieldPersonDbField {
13888    /// Whether a person field’s value is cleared on archiving. Cannot be true for a non-nullable field.
13889    #[serde(rename = "deleteOnArchive")]
13890    pub delete_on_archive: bool,
13891    /// Whether the field is enabled for normal use.
13892    #[serde(rename = "isActive")]
13893    pub is_active: bool,
13894    /// Whether routines may use this field.
13895    #[serde(rename = "isAvailableInRoutines")]
13896    pub is_available_in_routines: bool,
13897    /// Whether the field is available on new-person forms; primarily relevant to person categories.
13898    #[serde(rename = "isNewPersonField")]
13899    pub is_new_person_field: bool,
13900    /// Configured field length.
13901    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
13902    pub length: Option<i64>,
13903    /// Legacy display-layout setting, retained for compatibility.
13904    #[serde(rename = "lineEnding", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13905    #[deprecated = "deprecated in the ChurchTools API"]
13906    pub line_ending: Option<String>,
13907    /// Stored display name or translation key. nameTranslated is its localized display text.
13908    #[serde(deserialize_with = "crate::lenient::string")]
13909    pub name: String,
13910    /// Security-level ID governing access to this field, resolved from installation masterdata.
13911    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
13912    pub security_level: i64,
13913    /// Abbreviated label.
13914    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13915    pub shorty: Option<String>,
13916    /// Display-order value within its category.
13917    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
13918    pub sort_key: i64,
13919    /// Whether the field may be used as a placeholder.
13920    #[serde(rename = "useAsPlaceholder")]
13921    pub use_as_placeholder: bool,
13922    /// Compatibility mappings emitted by the backend.
13923    #[serde(rename = "@deprecated")]
13924    pub deprecated: DbFieldDeprecated,
13925    /// Underlying database column; prefer key for API requests.
13926    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
13927    #[deprecated = "deprecated in the ChurchTools API"]
13928    pub column: Option<String>,
13929    /// True for a custom field created by this ChurchTools installation.
13930    #[serde(rename = "createdByChurch")]
13931    pub created_by_church: bool,
13932    /// Stored field category and its underlying entity table. Use internCode when creating a field.
13933    #[serde(rename = "fieldCategory")]
13934    pub field_category: DbFieldCategory,
13935    /// Database-field type definition. internCode selects the input/validation behavior; the numeric ID is referenced by field definitions. The name can be a translation key.
13936    #[serde(rename = "fieldType")]
13937    pub field_type: DbFieldType,
13938    /// Stored flag controlling frontend visibility; current updates reset it to false.
13939    #[serde(rename = "hideInFrontend")]
13940    pub hide_in_frontend: bool,
13941    /// Field-definition ID used in /dbfields paths.
13942    #[serde(deserialize_with = "crate::lenient::number")]
13943    pub id: i64,
13944    /// Whether the field is marked as basic information; current updates reset it to false.
13945    #[serde(rename = "isBasicInfo")]
13946    pub is_basic_info: bool,
13947    /// Whether the field is marked as non-configurable; current updates reset it to false.
13948    #[serde(rename = "isNotConfigurable")]
13949    pub is_not_configurable: bool,
13950    /// Whether stored field values may be null. Custom checkbox fields are non-nullable.
13951    #[serde(rename = "isNullable")]
13952    pub is_nullable: bool,
13953    /// API property name. Built-in columns are mapped to API names; custom fields normally retain their generated column name.
13954    #[serde(deserialize_with = "crate::lenient::string")]
13955    pub key: String,
13956    /// Localized display name for the current language.
13957    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
13958    pub name_translated: String,
13959    /// Deprecated alias of isNotConfigurable.
13960    #[serde(rename = "notConfigurable", default, skip_serializing_if = "Option::is_none")]
13961    #[deprecated = "deprecated in the ChurchTools API"]
13962    pub not_configurable: Option<bool>,
13963    /// Deprecated alias of isNullable.
13964    #[serde(default, skip_serializing_if = "Option::is_none")]
13965    #[deprecated = "deprecated in the ChurchTools API"]
13966    pub nullable: Option<bool>,
13967    /// Optional choices, included by an unfiltered list with include\[\]=options. The row shape depends on the field. Campus and group-visibility fields use specialized representations in this expansion.
13968    #[serde(default, skip_serializing_if = "Option::is_none")]
13969    pub options: Option<Vec<DbFieldOption>>,
13970    /// Fields not described by the spec, e.g. instance-specific DB fields.
13971    #[serde(flatten)]
13972    pub extra: serde_json::Map<String, serde_json::Value>,
13973}
13974
13975/// Upsert settings for the person-field link. Both settings are required and replace their current values.
13976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13977pub struct GroupMemberFieldPersonUpdate {
13978    /// Whether the person field is required in this group’s signup form.
13979    #[serde(rename = "requiredInRegistrationForm")]
13980    pub required_in_registration_form: bool,
13981    /// Display order among this group’s person and membership fields. Required on both create and update.
13982    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
13983    pub sort_key: i64,
13984    /// Fields not described by the spec, e.g. instance-specific DB fields.
13985    #[serde(flatten)]
13986    pub extra: serde_json::Map<String, serde_json::Value>,
13987}
13988
13989#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
13990pub struct GroupMemberFieldsItem {
13991    /// ID of the group member field definition.
13992    #[serde(deserialize_with = "crate::lenient::number")]
13993    pub id: i64,
13994    /// Display name of the field.
13995    #[serde(deserialize_with = "crate::lenient::string")]
13996    pub name: String,
13997    /// Field display order.
13998    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
13999    pub sort_key: i64,
14000    /// Value formatted according to the field type. Checkbox values are strings "1" or "0"; select and radioselect values are option IDs as strings or null; multiselect values are arrays of option ID strings. Date and datetime fields use YYYY-MM-DD and UTC timestamps, respectively.
14001    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
14002    pub value: serde_json::Value,
14003    /// Fields not described by the spec, e.g. instance-specific DB fields.
14004    #[serde(flatten)]
14005    pub extra: serde_json::Map<String, serde_json::Value>,
14006}
14007
14008/// Group to which this membership belongs.
14009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14010pub struct GroupMemberGroup {
14011    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
14012    pub api_url: String,
14013    /// Optional display color.
14014    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
14015    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
14016    pub color: serde_json::Value,
14017    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
14018    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
14019    pub domain_identifier: String,
14020    /// Optional image URL.
14021    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14022    pub image_url: Option<String>,
14023    /// Additional localized display lines; not structured resource fields.
14024    #[serde(default, skip_serializing_if = "Option::is_none")]
14025    pub infos: Option<Vec<String>>,
14026    /// Optional initials for an avatar fallback.
14027    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14028    pub initials: Option<String>,
14029    /// Display title of the referenced object.
14030    #[serde(deserialize_with = "crate::lenient::string")]
14031    pub title: String,
14032    #[serde(rename = "domainAttributes")]
14033    pub domain_attributes: DomainObjectGroupDomainAttributes,
14034    /// Allowed values: `group`.
14035    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
14036    pub domain_type: String,
14037    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
14038    pub frontend_url: String,
14039    /// Allowed values: `users`.
14040    #[serde(deserialize_with = "crate::lenient::string")]
14041    pub icon: String,
14042    /// Fields not described by the spec, e.g. instance-specific DB fields.
14043    #[serde(flatten)]
14044    pub extra: serde_json::Map<String, serde_json::Value>,
14045}
14046
14047/// Legacy membership history with snapshots immediately after and before an event. This endpoint is separate from the general history API. current/previous are both objects even for creation/removal; null fields represent absent membership state.
14048#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14049pub struct GroupMemberHistoryEntry {
14050    /// State after this change.
14051    pub current: GroupMemberHistoryEntryCurrent,
14052    /// Group whose membership changed.
14053    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
14054    pub group_id: i64,
14055    /// History entry ID. Use the last returned ID as offset_id to fetch older entries.
14056    #[serde(deserialize_with = "crate::lenient::number")]
14057    pub id: i64,
14058    /// Person ID, not the membership row ID.
14059    #[serde(rename = "memberId", deserialize_with = "crate::lenient::number")]
14060    pub member_id: i64,
14061    pub meta: MetaDataCreatedId,
14062    /// Recorded source of the change; older entries can have no source.
14063    /// Allowed values: `automatic`, `bulk-job`, `check-in`, `cron`, `default`, `duplicate-group`, `follow-up`, `group-creation`, `person-deletion`, `routine`, `self-registration`, `sign-up`, `waitinglist`.
14064    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14065    pub origin: Option<String>,
14066    /// State from the linked previous history entry, independently of filters and pagination. All fields are null when no previous snapshot exists.
14067    pub previous: GroupMemberHistoryEntryPrevious,
14068    /// Fields not described by the spec, e.g. instance-specific DB fields.
14069    #[serde(flatten)]
14070    pub extra: serde_json::Map<String, serde_json::Value>,
14071}
14072
14073/// State after this change.
14074#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14075pub struct GroupMemberHistoryEntryCurrent {
14076    /// Membership comment at this point; empty strings and the string 0 serialize as null.
14077    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14078    pub comment: Option<String>,
14079    /// A simple date in ISO format, e.g. '2022-10-19'
14080    #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
14081    pub end_date: Option<chrono::NaiveDate>,
14082    /// Historical field values by display name. Values and labels reflect the saved snapshot; legacy malformed numeric keys may serialize as an array. Null means no stored field snapshot.
14083    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
14084    pub fields: serde_json::Value,
14085    /// Group-type role ID at this point, or null when there is no membership.
14086    #[serde(rename = "memberRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14087    pub member_role_id: Option<i64>,
14088    /// Membership workflow state at this point, or null after removal/before creation.
14089    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
14090    #[serde(rename = "membershipStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14091    pub membership_status: Option<String>,
14092    /// A simple date in ISO format, e.g. '2022-10-19'
14093    #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
14094    pub start_date: Option<chrono::NaiveDate>,
14095    /// Fields not described by the spec, e.g. instance-specific DB fields.
14096    #[serde(flatten)]
14097    pub extra: serde_json::Map<String, serde_json::Value>,
14098}
14099
14100/// State from the linked previous history entry, independently of filters and pagination. All fields are null when no previous snapshot exists.
14101#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14102pub struct GroupMemberHistoryEntryPrevious {
14103    /// Membership comment at this point; empty strings and the string 0 serialize as null.
14104    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14105    pub comment: Option<String>,
14106    /// A simple date in ISO format, e.g. '2022-10-19'
14107    #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
14108    pub end_date: Option<chrono::NaiveDate>,
14109    /// Historical field values by display name. Values and labels reflect the saved snapshot; legacy malformed numeric keys may serialize as an array. Null means no stored field snapshot.
14110    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
14111    pub fields: serde_json::Value,
14112    /// Group-type role ID at this point, or null when there is no membership.
14113    #[serde(rename = "memberRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14114    pub member_role_id: Option<i64>,
14115    /// Membership workflow state at this point, or null after removal/before creation.
14116    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
14117    #[serde(rename = "membershipStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14118    pub membership_status: Option<String>,
14119    /// A simple date in ISO format, e.g. '2022-10-19'
14120    #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
14121    pub start_date: Option<chrono::NaiveDate>,
14122    /// Fields not described by the spec, e.g. instance-specific DB fields.
14123    #[serde(flatten)]
14124    pub extra: serde_json::Map<String, serde_json::Value>,
14125}
14126
14127/// One group meeting paired with the requested person’s recorded attendance, if any.
14128#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14129pub struct GroupMemberMeeting {
14130    /// Group meeting as returned by the member history endpoint. Attendance statistics are not calculated here.
14131    #[serde(rename = "groupMeeting")]
14132    pub group_meeting: GroupMeetingForMember,
14133    /// Stored attendance status, or null when no attendance record exists. Null does not indicate whether the person is a current group member.
14134    /// Allowed values: `absent`, `not-in-group`, `present`, `unsure`.
14135    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14136    pub status: Option<String>,
14137    /// Fields not described by the spec, e.g. instance-specific DB fields.
14138    #[serde(flatten)]
14139    pub extra: serde_json::Map<String, serde_json::Value>,
14140}
14141
14142/// Newsletter subscription information, included when the member list is requested with include=newsletter.
14143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14144pub struct GroupMemberNewsletter {
14145    #[serde(deserialize_with = "crate::lenient::number")]
14146    pub id: i64,
14147    #[serde(deserialize_with = "crate::lenient::map")]
14148    pub newsletter: std::collections::BTreeMap<String, GroupMemberNewsletterPersonStatus>,
14149    /// Fields not described by the spec, e.g. instance-specific DB fields.
14150    #[serde(flatten)]
14151    pub extra: serde_json::Map<String, serde_json::Value>,
14152}
14153
14154#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14155pub struct GroupMemberNewsletterPersonStatus {
14156    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14157    #[serde(rename = "doiDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14158    pub doi_date: Option<chrono::DateTime<chrono::Utc>>,
14159    #[serde(rename = "isSynced")]
14160    pub is_synced: bool,
14161    #[serde(rename = "isUnsubscribed")]
14162    pub is_unsubscribed: bool,
14163    #[serde(rename = "syncError", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14164    pub sync_error: Option<String>,
14165    /// Fields not described by the spec, e.g. instance-specific DB fields.
14166    #[serde(flatten)]
14167    pub extra: serde_json::Map<String, serde_json::Value>,
14168}
14169
14170/// Person who belongs to the group. domainIdentifier is the person ID as a string.
14171#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14172pub struct GroupMemberPerson {
14173    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
14174    pub api_url: String,
14175    /// Optional display color.
14176    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
14177    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
14178    pub color: serde_json::Value,
14179    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
14180    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
14181    pub domain_identifier: String,
14182    /// Optional image URL.
14183    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14184    pub image_url: Option<String>,
14185    pub infos: Vec<String>,
14186    /// Optional initials for an avatar fallback.
14187    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14188    pub initials: Option<String>,
14189    /// Display title of the referenced object.
14190    #[serde(deserialize_with = "crate::lenient::string")]
14191    pub title: String,
14192    #[serde(rename = "domainAttributes")]
14193    pub domain_attributes: DomainObjectPersonDomainAttributes,
14194    /// Allowed values: `person`.
14195    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
14196    pub domain_type: String,
14197    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
14198    pub frontend_url: String,
14199    /// user for an ordinary person; user-shield for a censored person placeholder.
14200    /// Allowed values: `user`, `user-shield`.
14201    #[serde(deserialize_with = "crate::lenient::string")]
14202    pub icon: String,
14203    /// Fields not described by the spec, e.g. instance-specific DB fields.
14204    #[serde(flatten)]
14205    pub extra: serde_json::Map<String, serde_json::Value>,
14206}
14207
14208#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14209pub struct GroupMemberShort {
14210    /// Whether this row represents a deleted historical membership
14211    pub deleted: bool,
14212    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
14213    pub group_id: i64,
14214    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
14215    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14216    pub group_member_status: Option<String>,
14217    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
14218    pub group_type_role_id: i64,
14219    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14220    #[serde(rename = "lastChange", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14221    pub last_change: Option<chrono::DateTime<chrono::Utc>>,
14222    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
14223    pub person_id: i64,
14224    /// Fields not described by the spec, e.g. instance-specific DB fields.
14225    #[serde(flatten)]
14226    pub extra: serde_json::Map<String, serde_json::Value>,
14227}
14228
14229/// Statistics for one authorized requested field. Group membership fields precede person fields; request order is preserved within each set.
14230#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14231pub struct GroupMemberStatistic {
14232    /// Person date fields return earliest/latest records. Other fields return frequency buckets, normally sorted by descending count.
14233    pub data: Vec<serde_json::Value>,
14234    /// Identifies the namespace of key.
14235    /// Allowed values: `groupMemberField`, `personField`.
14236    #[serde(rename = "fieldType", deserialize_with = "crate::lenient::string")]
14237    pub field_type: String,
14238    /// Input/storage type. select and radioselect use one option, multiselect uses multiple options. text and textarea require a configured length when created. api identifies an application-specific field type.
14239    /// Allowed values: `api`, `checkbox`, `date`, `datetime`, `multiselect`, `number`, `radioselect`, `select`, `text`, `textarea`.
14240    #[serde(rename = "fieldTypeCode", deserialize_with = "crate::lenient::string")]
14241    pub field_type_code: String,
14242    /// Integer membership-field ID for groupMemberField; database field key for personField.
14243    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
14244    pub key: serde_json::Value,
14245    /// Missing values. Membership-field defaults may supply absent values; treatment differs between select-like and other field types.
14246    #[serde(deserialize_with = "crate::lenient::number")]
14247    pub missing: i64,
14248    /// For membership fields and person date fields: matching non-archived memberships. For other person fields: count with non-empty values, excluding missing.
14249    #[serde(deserialize_with = "crate::lenient::number")]
14250    pub total: i64,
14251    /// Fields not described by the spec, e.g. instance-specific DB fields.
14252    #[serde(flatten)]
14253    pub extra: serde_json::Map<String, serde_json::Value>,
14254}
14255
14256/// Frequency of a stored value or option label. Multiselect memberships can contribute to several buckets.
14257#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14258pub struct GroupMemberStatisticBucket {
14259    /// Number of occurrences of this value.
14260    #[serde(deserialize_with = "crate::lenient::number")]
14261    pub count: i64,
14262    /// Stored value; select-like membership fields resolve option IDs to labels.
14263    #[serde(deserialize_with = "crate::lenient::string")]
14264    pub key: String,
14265    /// Fields not described by the spec, e.g. instance-specific DB fields.
14266    #[serde(flatten)]
14267    pub extra: serde_json::Map<String, serde_json::Value>,
14268}
14269
14270/// Earliest or latest non-null value of a person date field.
14271#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14272pub struct GroupMemberStatisticDateExtreme {
14273    /// Person as Domain Object
14274    #[serde(rename = "domainObject")]
14275    pub domain_object: DomainObjectPerson,
14276    /// Person ID for this extreme; ties are not ordered by person ID.
14277    #[serde(deserialize_with = "crate::lenient::number")]
14278    pub id: i64,
14279    /// Translated earliest/latest label in the request language.
14280    #[serde(deserialize_with = "crate::lenient::string")]
14281    pub title: String,
14282    /// Date field value converted to a UTC timestamp.
14283    #[serde(serialize_with = "crate::datetime::serialize_utc")]
14284    pub value: chrono::DateTime<chrono::Utc>,
14285    /// Fields not described by the spec, e.g. instance-specific DB fields.
14286    #[serde(flatten)]
14287    pub extra: serde_json::Map<String, serde_json::Value>,
14288}
14289
14290#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14291pub struct GroupMemberStatistics {
14292    #[serde(deserialize_with = "crate::lenient::number")]
14293    pub active: f64,
14294    #[serde(deserialize_with = "crate::lenient::number")]
14295    pub leaders: f64,
14296    #[serde(deserialize_with = "crate::lenient::number")]
14297    pub participants: f64,
14298    #[serde(deserialize_with = "crate::lenient::number")]
14299    pub requested: f64,
14300    /// Members in counted roles with a status selected in settings.statusesCountedTowardsSeats.
14301    #[serde(rename = "seatsTaken", deserialize_with = "crate::lenient::number")]
14302    pub seats_taken: f64,
14303    #[serde(deserialize_with = "crate::lenient::number")]
14304    pub to_delete: f64,
14305    #[serde(deserialize_with = "crate::lenient::number")]
14306    pub waiting: f64,
14307    /// Fields not described by the spec, e.g. instance-specific DB fields.
14308    #[serde(flatten)]
14309    pub extra: serde_json::Map<String, serde_json::Value>,
14310}
14311
14312/// Binds a routine to one group, group-type role and membership status. Matching memberships use this binding to select their automation; the nested routine contains configuration, not execution history.
14313#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14314pub struct GroupMembershipRoutine {
14315    /// Group using this routine.
14316    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
14317    pub group_id: i64,
14318    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
14319    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
14320    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
14321    pub group_member_status: String,
14322    /// Group-type role ID for which this binding applies.
14323    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
14324    pub group_type_role_id: i64,
14325    /// ID of this role/status binding, distinct from routine.id.
14326    #[serde(deserialize_with = "crate::lenient::number")]
14327    pub id: i64,
14328    /// Automation definition, including enabled and disabled steps as a nested tree. Domain context bindings and per-membership execution progress are separate resources.
14329    pub routine: Routine,
14330    /// Fields not described by the spec, e.g. instance-specific DB fields.
14331    #[serde(flatten)]
14332    pub extra: serde_json::Map<String, serde_json::Value>,
14333}
14334
14335/// Create-if-missing binding request. On an existing binding the current backend ignores routineId and returns the original routine. For a new binding routineId is required to avoid a server error.
14336#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14337pub struct GroupMembershipRoutineUpdate {
14338    /// ID of an existing routine with no steps. Needed when creating a binding; ignored if a binding already exists for this path.
14339    #[serde(rename = "routineId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14340    pub routine_id: Option<i64>,
14341    /// Fields not described by the spec, e.g. instance-specific DB fields.
14342    #[serde(flatten)]
14343    pub extra: serde_json::Map<String, serde_json::Value>,
14344}
14345
14346#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14347pub struct GroupModifiedPerson {
14348    #[serde(deserialize_with = "crate::lenient::number")]
14349    pub id: i64,
14350    /// Fields not described by the spec, e.g. instance-specific DB fields.
14351    #[serde(flatten)]
14352    pub extra: serde_json::Map<String, serde_json::Value>,
14353}
14354
14355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14356pub struct GroupPermissions {
14357    /// Current user can start chat.
14358    #[serde(rename = "startChat")]
14359    pub start_chat: bool,
14360    /// Current user can use the chat.
14361    #[serde(rename = "useChat")]
14362    pub use_chat: bool,
14363    /// Fields not described by the spec, e.g. instance-specific DB fields.
14364    #[serde(flatten)]
14365    pub extra: serde_json::Map<String, serde_json::Value>,
14366}
14367
14368/// Counts currently published, unexpired, non-banned posts by their configured group visibility. Both counters are always present.
14369#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14370pub struct GroupPostStatistics {
14371    /// Posts restricted to group members.
14372    #[serde(deserialize_with = "crate::lenient::number")]
14373    pub group_intern: i64,
14374    /// Posts visible to people who can see the group.
14375    #[serde(deserialize_with = "crate::lenient::number")]
14376    pub group_visible: i64,
14377    /// Fields not described by the spec, e.g. instance-specific DB fields.
14378    #[serde(flatten)]
14379    pub extra: serde_json::Map<String, serde_json::Value>,
14380}
14381
14382#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14383pub struct GroupPublicPostsStatistic {
14384    #[serde(deserialize_with = "crate::lenient::number")]
14385    pub count: f64,
14386    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14387    #[serde(rename = "lastPostDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14388    pub last_post_date: Option<chrono::DateTime<chrono::Utc>>,
14389    /// Fields not described by the spec, e.g. instance-specific DB fields.
14390    #[serde(flatten)]
14391    pub extra: serde_json::Map<String, serde_json::Value>,
14392}
14393
14394/// Stored check-in ticket for one person and group. A ticket is distinct from membership and attendance: reading it does not create a membership or check the person in. Ticket lifecycle timestamps may remain null.
14395#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14396pub struct GroupQRCodeCheckin {
14397    /// ChurchTools group ID.
14398    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
14399    pub domain_id: i64,
14400    /// Ticket domain for these routes.
14401    /// Allowed values: `group`.
14402    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
14403    pub domain_type: String,
14404    /// Most recent PDF-link generation recorded as downloaded; this does not prove the PDF was retrieved.
14405    #[serde(rename = "downloadedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14406    pub downloaded_date: Option<chrono::DateTime<chrono::Utc>>,
14407    /// Optional ticket expiry. Group check-in tickets are currently created without an expiry.
14408    #[serde(rename = "expiryDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14409    pub expiry_date: Option<chrono::DateTime<chrono::Utc>>,
14410    /// Whether an email job is currently queued; this does not confirm delivery.
14411    #[serde(rename = "isQueued")]
14412    pub is_queued: bool,
14413    /// Person for whom the ticket was issued.
14414    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
14415    pub person_id: i64,
14416    /// Most recent recorded email-send time; null until marked sent.
14417    #[serde(rename = "sentDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14418    pub sent_date: Option<chrono::DateTime<chrono::Utc>>,
14419    /// Opaque ticket credential encoded with the person/group IDs in the QR code.
14420    #[serde(deserialize_with = "crate::lenient::string")]
14421    pub token: String,
14422    /// Most recent recorded ticket use; this field alone does not prove attendance was successfully saved.
14423    #[serde(rename = "usedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14424    pub used_date: Option<chrono::DateTime<chrono::Utc>>,
14425    /// Fields not described by the spec, e.g. instance-specific DB fields.
14426    #[serde(flatten)]
14427    pub extra: serde_json::Map<String, serde_json::Value>,
14428}
14429
14430/// A shared group-type role combined with its settings for one concrete group. id identifies this group's role settings; groupTypeRoleId identifies the shared definition. growPathId is also group-specific. The inherited name, type and default/hidden flags describe the shared definition.
14431#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14432pub struct GroupRole {
14433    /// ID of the group type this role belongs to. Discover group types with GET /group/grouptypes.
14434    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
14435    pub group_type_id: i64,
14436    /// Growth-path association for this role in this group, or null when none is set. This is the group-specific value, not the value of the shared role definition.
14437    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14438    pub grow_path_id: Option<i64>,
14439    /// Whether this is the default role for its group type. Setting this to true clears the default flag on the other roles of that type.
14440    #[serde(rename = "isDefault")]
14441    pub is_default: bool,
14442    /// Whether this role is marked as hidden for displays that exclude hidden roles, such as leader listings. Hidden roles are still returned by this endpoint; this flag is not an access permission.
14443    #[serde(rename = "isHidden")]
14444    pub is_hidden: bool,
14445    /// Legacy response field indicating whether type is leader. Use type instead; this field is not used to create or update a role.
14446    #[serde(rename = "isLeader", default, skip_serializing_if = "Option::is_none")]
14447    #[deprecated = "Use type instead; this field is not used to create or update a role."]
14448    pub is_leader: Option<bool>,
14449    /// Stored name of the role. Use nameTranslated from the response for a localized display name.
14450    #[serde(deserialize_with = "crate::lenient::string")]
14451    pub name: String,
14452    /// Abbreviated label for the role, used in compact displays.
14453    #[serde(deserialize_with = "crate::lenient::string")]
14454    pub shorty: String,
14455    /// Display order among roles. Lower values come first.
14456    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
14457    pub sort_key: i64,
14458    /// Functional classification of the role. Multiple roles with different names can share the same classification.
14459    /// Allowed values: `leader`, `participant`.
14460    #[serde(deserialize_with = "crate::lenient::string")]
14461    pub r#type: String,
14462    /// ID of the role settings record for this group. Use this ID in PATCH /groups/{groupId}/roles/{roleId}.
14463    #[serde(deserialize_with = "crate::lenient::number")]
14464    pub id: i64,
14465    /// Localized display name, translated from the stored name when a translation exists.
14466    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
14467    pub name_translated: String,
14468    /// Whether members in this role are allowed to read the group chat.
14469    #[serde(rename = "canReadChat")]
14470    pub can_read_chat: bool,
14471    /// Whether members in this role are allowed to write in the group chat.
14472    #[serde(rename = "canWriteChat")]
14473    pub can_write_chat: bool,
14474    /// Whether memberships in this role count towards the group's participant capacity.
14475    #[serde(rename = "countsTowardsSeats")]
14476    pub counts_towards_seats: bool,
14477    /// Whether members in this role are required to use two-factor authentication.
14478    #[serde(rename = "forceTwoFactorAuth")]
14479    pub force_two_factor_auth: bool,
14480    /// ID of the shared role definition from GET /group/roles. This differs from id, which identifies the settings for this group.
14481    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
14482    pub group_type_role_id: i64,
14483    /// IDs of HTML templates available for membership documents in this role; null when no template list is stored.
14484    #[serde(rename = "htmlTemplateIds", default, skip_serializing_if = "Option::is_none")]
14485    pub html_template_ids: Option<Vec<i64>>,
14486    /// Whether this role is enabled for use in this group. This is a role setting, separate from an individual person's membership status.
14487    #[serde(rename = "isActive")]
14488    pub is_active: bool,
14489    /// Whether members in this role receive a QR code for group check-in.
14490    #[serde(rename = "receiveQRCode")]
14491    pub receive_qr_code: bool,
14492    /// Fields not described by the spec, e.g. instance-specific DB fields.
14493    #[serde(flatten)]
14494    pub extra: serde_json::Map<String, serde_json::Value>,
14495}
14496
14497/// Change only the supplied settings for a role in one group; omitted fields retain their current values.
14498#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14499pub struct GroupRoleUpdate {
14500    /// Allow members in this role to read the group chat.
14501    #[serde(rename = "canReadChat", default, skip_serializing_if = "Option::is_none")]
14502    pub can_read_chat: Option<bool>,
14503    /// Allow members in this role to write in the group chat.
14504    #[serde(rename = "canWriteChat", default, skip_serializing_if = "Option::is_none")]
14505    pub can_write_chat: Option<bool>,
14506    /// Count memberships in this role towards the group's participant capacity.
14507    #[serde(rename = "countsTowardsSeats", default, skip_serializing_if = "Option::is_none")]
14508    pub counts_towards_seats: Option<bool>,
14509    /// Require members in this role to use two-factor authentication.
14510    #[serde(rename = "forceTwoFactorAuth", default, skip_serializing_if = "Option::is_none")]
14511    pub force_two_factor_auth: Option<bool>,
14512    /// Set the growth-path association for this role in this group. Send null to clear it; omit the field to keep the current value.
14513    ///
14514    /// `None` leaves the field out, `Some(None)` sends `null`.
14515    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
14516    pub grow_path_id: Option<Option<i64>>,
14517    /// Replace the list of HTML templates available for membership documents in this role. Send an empty array to clear the list; null is not accepted. Newly added templates must support group membership documents.
14518    #[serde(rename = "htmlTemplateIds", default, skip_serializing_if = "Option::is_none")]
14519    pub html_template_ids: Option<Vec<i64>>,
14520    /// Enable or disable this role in the group. The default role cannot be deactivated. This does not set the membership status of individual people.
14521    #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")]
14522    pub is_active: Option<bool>,
14523    /// Enable check-in QR codes for members in this role.
14524    #[serde(rename = "receiveQRCode", default, skip_serializing_if = "Option::is_none")]
14525    pub receive_qr_code: Option<bool>,
14526    /// Fields not described by the spec, e.g. instance-specific DB fields.
14527    #[serde(flatten)]
14528    pub extra: serde_json::Map<String, serde_json::Value>,
14529}
14530
14531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14532pub struct GroupSettings {
14533    /// Own children are listed as option during group sign up.
14534    #[serde(rename = "allowChildRegistration")]
14535    pub allow_child_registration: bool,
14536    /// It is allowed to sign up other people uring group sign up.
14537    #[serde(rename = "allowOtherRegistration")]
14538    pub allow_other_registration: bool,
14539    /// People with same eMail address are listed as option during group sign up.
14540    #[serde(rename = "allowSameEmailRegistration")]
14541    pub allow_same_email_registration: bool,
14542    /// Spouse is listed as option during group sign up.
14543    #[serde(rename = "allowSpouseRegistration")]
14544    pub allow_spouse_registration: bool,
14545    /// Waiting list is in-/active for this group.
14546    #[serde(rename = "allowWaitinglist")]
14547    pub allow_waitinglist: bool,
14548    /// If set (together with appointmentStartDate), the group is a signup group for the specified appointment
14549    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14550    pub appointment_id: Option<i64>,
14551    /// If set (together with appointmentId), the group is a signup group for the specified appointment
14552    #[serde(rename = "appointmentStartDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14553    pub appointment_start_date: Option<chrono::DateTime<chrono::Utc>>,
14554    /// Indicator if applications are accepted automatically.
14555    #[serde(rename = "autoAccept")]
14556    pub auto_accept: bool,
14557    /// In combination with waiting list: People automatically move up in waiting list.
14558    #[serde(rename = "automaticMoveUp")]
14559    pub automatic_move_up: bool,
14560    /// Indicator whether the chat history should be visible for new chat group members.
14561    #[serde(rename = "chatHistoryVisible")]
14562    pub chat_history_visible: bool,
14563    /// Default value for whether posts can be commented on.
14564    #[serde(rename = "defaultPostCommentsActive")]
14565    pub default_post_comments_active: bool,
14566    /// Default value for post notification scope.
14567    /// Allowed values: `group_intern`, `group_visible`.
14568    #[serde(rename = "defaultPostNotificationScope", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14569    pub default_post_notification_scope: Option<String>,
14570    /// Default placeholder text for entering post content.
14571    #[serde(rename = "defaultPostPlaceholderText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14572    pub default_post_placeholder_text: Option<String>,
14573    /// Allowed values: `group_intern`, `group_visible`.
14574    #[serde(rename = "defaultPostVisibility", deserialize_with = "crate::lenient::string")]
14575    pub default_post_visibility: String,
14576    /// Rule set for dynamic group update.
14577    #[serde(rename = "dynamicGroupRuleSet", default, skip_serializing_if = "Option::is_none")]
14578    pub dynamic_group_rule_set: Option<Vec<DynamicGroupRule>>,
14579    /// Controls automatic membership refresh: active participates in scheduled and manual refreshes; manual allows explicit refresh only; inactive blocks both; none disables dynamic-group behavior without deleting stored rules or existing memberships. Null in group resources means no explicit status is stored.
14580    /// Allowed values: `active`, `inactive`, `manual`, `none`.
14581    #[serde(rename = "dynamicGroupStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14582    pub dynamic_group_status: Option<String>,
14583    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14584    #[serde(rename = "dynamicGroupUpdateFinished", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14585    pub dynamic_group_update_finished: Option<chrono::DateTime<chrono::Utc>>,
14586    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14587    #[serde(rename = "dynamicGroupUpdateStarted", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14588    pub dynamic_group_update_started: Option<chrono::DateTime<chrono::Utc>>,
14589    /// Controls email verification for anonymous group signups.
14590    /// Allowed values: `all`, `existing`, `none`.
14591    #[serde(rename = "emailVerificationMode", deserialize_with = "crate::lenient::string")]
14592    pub email_verification_mode: String,
14593    /// Indicator if posts of this groups are featured to subscribe
14594    #[serde(rename = "externalPostSubscriptionsEnabled")]
14595    pub external_post_subscriptions_enabled: bool,
14596    #[serde(rename = "groupMeeting")]
14597    pub group_meeting: GroupSettingsGroupMeeting,
14598    #[serde(rename = "inStatistic")]
14599    pub in_statistic: bool,
14600    /// Inform leader via e-mail about changes.
14601    #[serde(rename = "informLeader")]
14602    pub inform_leader: bool,
14603    #[serde(rename = "isHidden")]
14604    pub is_hidden: bool,
14605    /// Indicator if people can sign up for group membership.
14606    #[serde(rename = "isOpenForMembers")]
14607    pub is_open_for_members: bool,
14608    #[serde(rename = "isPublic")]
14609    pub is_public: bool,
14610    /// The maximum number of group members in counted roles and statuses.
14611    #[serde(rename = "maxMembers", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14612    pub max_members: Option<i64>,
14613    /// Campus, status, and department for newly created persons.
14614    #[serde(rename = "newMember")]
14615    pub new_member: GroupSettingsNewMember,
14616    #[serde(rename = "postsEnabled")]
14617    pub posts_enabled: bool,
14618    /// QR Codes are sent to participants, which can be used during check-in
14619    #[serde(rename = "qrCodeCheckin")]
14620    pub qr_code_checkin: bool,
14621    /// QR Codes are not automatically sent via email
14622    #[serde(rename = "qrCodeCheckinAutomaticEmail")]
14623    pub qr_code_checkin_automatic_email: bool,
14624    /// Send default sign up email to new members.
14625    #[serde(rename = "sendDefaultSignUpMail")]
14626    pub send_default_sign_up_mail: bool,
14627    #[serde(rename = "showStreet")]
14628    pub show_street: bool,
14629    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14630    #[serde(rename = "signUpClosingDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14631    pub sign_up_closing_date: Option<chrono::DateTime<chrono::Utc>>,
14632    /// Email is required for all participants during group sign up (spouse, children, others).
14633    #[serde(rename = "signUpEmailRequiredForAll", default, skip_serializing_if = "Option::is_none")]
14634    pub sign_up_email_required_for_all: Option<bool>,
14635    /// Headline for group sign up.
14636    #[serde(rename = "signUpHeadline", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14637    pub sign_up_headline: Option<String>,
14638    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14639    #[serde(rename = "signUpNotificationSentDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14640    pub sign_up_notification_sent_date: Option<chrono::DateTime<chrono::Utc>>,
14641    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14642    #[serde(rename = "signUpOpeningDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
14643    pub sign_up_opening_date: Option<chrono::DateTime<chrono::Utc>>,
14644    #[serde(rename = "signUpOverrideRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14645    pub sign_up_override_role_id: Option<i64>,
14646    /// Membership statuses that occupy seats when their role counts towards seats. Defaults to active only. An empty array means no membership occupies a seat.
14647    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
14648    #[serde(rename = "statusesCountedTowardsSeats")]
14649    pub statuses_counted_towards_seats: Vec<String>,
14650    /// The visibility of a group.
14651    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
14652    #[serde(deserialize_with = "crate::lenient::string")]
14653    pub visibility: String,
14654    /// Maximum number of persons on waiting list.
14655    #[serde(rename = "waitinglistMaxPersons", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14656    pub waitinglist_max_persons: Option<i64>,
14657    /// Fields not described by the spec, e.g. instance-specific DB fields.
14658    #[serde(flatten)]
14659    pub extra: serde_json::Map<String, serde_json::Value>,
14660}
14661
14662#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14663pub struct GroupSettingsGroupMeeting {
14664    /// Automatically create group meetings.
14665    #[serde(rename = "autoCreate")]
14666    pub auto_create: bool,
14667    /// Template for group meetings.
14668    #[serde(rename = "templateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14669    pub template_id: Option<i64>,
14670    /// Fields not described by the spec, e.g. instance-specific DB fields.
14671    #[serde(flatten)]
14672    pub extra: serde_json::Map<String, serde_json::Value>,
14673}
14674
14675/// Campus, status, and department for newly created persons.
14676#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14677pub struct GroupSettingsNewMember {
14678    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14679    pub campus_id: Option<i64>,
14680    #[serde(rename = "departmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14681    pub department_id: Option<i64>,
14682    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
14683    pub status_id: Option<i64>,
14684    /// Fields not described by the spec, e.g. instance-specific DB fields.
14685    #[serde(flatten)]
14686    pub extra: serde_json::Map<String, serde_json::Value>,
14687}
14688
14689/// Specifies conditions required to sign up in this group. Not all conditions apply to any user, e.g. some of the conditions only apply to users that are not logged in.
14690#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14691pub struct GroupSignUpConditions {
14692    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
14693    pub deprecated: std::collections::BTreeMap<String, String>,
14694    #[serde(rename = "atLeastOneLeaderCanCreateNewPerson")]
14695    pub at_least_one_leader_can_create_new_person: bool,
14696    /// If false, none of the group's leaders have an email address set. Only persons already signed in can sign up.
14697    #[serde(rename = "canContactLeader")]
14698    pub can_contact_leader: bool,
14699    #[serde(rename = "canSignUp")]
14700    pub can_sign_up: bool,
14701    #[serde(rename = "canSignUpAsNewPerson")]
14702    pub can_sign_up_as_new_person: bool,
14703    #[serde(rename = "defaultRoleSetInGroup", default, skip_serializing_if = "Option::is_none")]
14704    #[deprecated = "deprecated in the ChurchTools API"]
14705    pub default_role_set_in_group: Option<bool>,
14706    /// If false, the group's end date has passed and nobody can sign up.
14707    #[serde(rename = "endDateNotPassed")]
14708    pub end_date_not_passed: bool,
14709    #[serde(rename = "groupAllowsWaitinglist")]
14710    pub group_allows_waitinglist: bool,
14711    /// If false, no leader is set for the group and nobody can sign up.
14712    #[serde(rename = "groupHasLeader")]
14713    pub group_has_leader: bool,
14714    #[serde(rename = "groupHasSpaceForRequests")]
14715    pub group_has_space_for_requests: bool,
14716    #[serde(rename = "groupHasSpaceOnWaitinglist")]
14717    pub group_has_space_on_waitinglist: bool,
14718    /// If false, the group is not in active state and nobody can sign up.
14719    #[serde(rename = "groupIsActive")]
14720    pub group_is_active: bool,
14721    /// If false, the group's max number of members is reached and nobody can sign up.
14722    #[serde(rename = "groupIsNotFull")]
14723    pub group_is_not_full: bool,
14724    /// If false, the group is set to hidden and nobody can sign up.
14725    #[serde(rename = "groupIsNotHidden")]
14726    pub group_is_not_hidden: bool,
14727    /// If false, the group is not set to be open for members and nobody can sign up.
14728    #[serde(rename = "groupIsOpenForMembers")]
14729    pub group_is_open_for_members: bool,
14730    /// If false, the group is not public and only users already signed in are allowed to sign up.
14731    #[serde(rename = "groupIsPublic")]
14732    pub group_is_public: bool,
14733    /// The visibility of a group.
14734    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
14735    #[serde(rename = "groupVisibility", deserialize_with = "crate::lenient::string")]
14736    pub group_visibility: String,
14737    /// If false, the default department for new users is not set. When persons without an account attempt to sign up, no new user accounts will be created but the group leader will be requested by mail.
14738    #[serde(rename = "newPersonDepartmentIsSet")]
14739    pub new_person_department_is_set: bool,
14740    /// If false, the default station for new users is not set. When persons without an account attempt to sign up, no new user accounts will be created but the group leader will be requested by mail.
14741    #[serde(rename = "newPersonStationIsSet")]
14742    pub new_person_station_is_set: bool,
14743    /// If false, the default status for new users is not set. When persons without an account attempt to sign up, no new user accounts will be created but the group leader will be requested by mail.
14744    #[serde(rename = "newPersonStatusIsSet")]
14745    pub new_person_status_is_set: bool,
14746    /// If false, the sign-up role is not set for the group and nobody can sign up when that role is required.
14747    #[serde(rename = "signUpRoleSetInGroup")]
14748    pub sign_up_role_set_in_group: bool,
14749    /// Fields not described by the spec, e.g. instance-specific DB fields.
14750    #[serde(flatten)]
14751    pub extra: serde_json::Map<String, serde_json::Value>,
14752}
14753
14754/// Options for sending or previewing the group sign-up notification. The body is optional.
14755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14756pub struct GroupSignUpNotificationRequest {
14757    /// Preview recipient selection without sending or marking the group as notified. Can also be supplied as a query parameter; use only one location.
14758    #[serde(default, skip_serializing_if = "Option::is_none")]
14759    pub dry_run: Option<bool>,
14760    /// Fields not described by the spec, e.g. instance-specific DB fields.
14761    #[serde(flatten)]
14762    pub extra: serde_json::Map<String, serde_json::Value>,
14763}
14764
14765/// Recipient selection count for a group sign-up push notification. This endpoint returns the object directly, without a data wrapper.
14766#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14767pub struct GroupSignUpNotificationResult {
14768    /// Number of selected recipient rows, also in dry runs. A person with multiple registered push devices can be counted multiple times. This is not a count of unique persons or confirmed deliveries.
14769    #[serde(rename = "sentToCount", deserialize_with = "crate::lenient::number")]
14770    pub sent_to_count: i64,
14771    /// Fields not described by the spec, e.g. instance-specific DB fields.
14772    #[serde(flatten)]
14773    pub extra: serde_json::Map<String, serde_json::Value>,
14774}
14775
14776#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14777pub struct GroupSignupConditions {
14778    #[serde(rename = "canContactLeader")]
14779    pub can_contact_leader: bool,
14780    #[serde(rename = "canSignUp")]
14781    pub can_sign_up: bool,
14782    #[serde(rename = "canSignUpAsNewPerson")]
14783    pub can_sign_up_as_new_person: bool,
14784    #[serde(rename = "defaultRoleSetInGroup")]
14785    pub default_role_set_in_group: bool,
14786    #[serde(rename = "endDateNotPassed")]
14787    pub end_date_not_passed: bool,
14788    #[serde(rename = "groupAllowsWaitinglist")]
14789    pub group_allows_waitinglist: bool,
14790    #[serde(rename = "groupHasLeader")]
14791    pub group_has_leader: bool,
14792    #[serde(rename = "groupHasSpaceForRequests")]
14793    pub group_has_space_for_requests: bool,
14794    #[serde(rename = "groupHasSpaceOnWaitinglist")]
14795    pub group_has_space_on_waitinglist: bool,
14796    #[serde(rename = "groupIsActive")]
14797    pub group_is_active: bool,
14798    #[serde(rename = "groupIsNotFull")]
14799    pub group_is_not_full: bool,
14800    #[serde(rename = "groupIsNotHidden")]
14801    pub group_is_not_hidden: bool,
14802    #[serde(rename = "groupIsOpenForMembers")]
14803    pub group_is_open_for_members: bool,
14804    #[serde(rename = "groupIsPublic")]
14805    pub group_is_public: bool,
14806    /// The visibility of a group.
14807    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
14808    #[serde(rename = "groupVisibility", deserialize_with = "crate::lenient::string")]
14809    pub group_visibility: String,
14810    #[serde(rename = "newPersonDepartmentIsSet")]
14811    pub new_person_department_is_set: bool,
14812    #[serde(rename = "newPersonStationIsSet")]
14813    pub new_person_station_is_set: bool,
14814    #[serde(rename = "newPersonStatusIsSet")]
14815    pub new_person_status_is_set: bool,
14816    #[serde(rename = "signUpRoleSetInGroup")]
14817    pub sign_up_role_set_in_group: bool,
14818    /// Fields not described by the spec, e.g. instance-specific DB fields.
14819    #[serde(flatten)]
14820    pub extra: serde_json::Map<String, serde_json::Value>,
14821}
14822
14823/// Per-role/status counts restricted to visible members, alongside capacity counters for the full group.
14824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14825pub struct GroupStatistics {
14826    /// Histogram keyed by group-type-role ID and membership status, for example 8:active. Only visible persons/members contribute. Empty histogram serializes as \[\].
14827    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
14828    pub members: serde_json::Value,
14829    /// Group-wide capacity counters, independent of the caller’s individual member visibility. These counters have different role/status scopes and are not a partition of one common total.
14830    pub unfiltered: GroupMemberCounts,
14831    /// Fields not described by the spec, e.g. instance-specific DB fields.
14832    #[serde(flatten)]
14833    pub extra: serde_json::Map<String, serde_json::Value>,
14834}
14835
14836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14837pub struct GroupStatisticsMembersVariant1Value {
14838    /// Number of visible memberships in this role/status.
14839    #[serde(deserialize_with = "crate::lenient::number")]
14840    pub count: i64,
14841    /// Repeats the map key: role definition ID followed by workflow status.
14842    #[serde(deserialize_with = "crate::lenient::string")]
14843    pub key: String,
14844    /// Fields not described by the spec, e.g. instance-specific DB fields.
14845    #[serde(flatten)]
14846    pub extra: serde_json::Map<String, serde_json::Value>,
14847}
14848
14849#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14850pub struct GroupStatus {
14851    #[serde(deserialize_with = "crate::lenient::number")]
14852    pub id: i64,
14853    /// Allowed values: `active`, `archived`, `finished`, `pending`.
14854    #[serde(deserialize_with = "crate::lenient::string")]
14855    pub name: String,
14856    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
14857    pub name_translated: String,
14858    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
14859    pub sort_key: i64,
14860    /// Fields not described by the spec, e.g. instance-specific DB fields.
14861    #[serde(flatten)]
14862    pub extra: serde_json::Map<String, serde_json::Value>,
14863}
14864
14865/// A configurable type shared by groups, such as small groups or ministry teams. It defines common settings and the set of membership roles available to those groups. A group references its type through `information.groupTypeId`; a membership role describes a person's function within a group, such as leader or participant.
14866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14867pub struct GroupType {
14868    /// Whether eligible groups of this type are offered for membership selection when creating a person in the ChurchTools UI. This does not automatically add the person to a group or grant membership permissions.
14869    #[serde(rename = "availableForNewPerson")]
14870    pub available_for_new_person: bool,
14871    /// ChurchTools color token used to display this group type; not a hexadecimal color code.
14872    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
14873    #[serde(deserialize_with = "crate::lenient::string")]
14874    pub color: String,
14875    /// Optional explanatory text for this group type. Returned as null when no description is stored.
14876    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
14877    pub description: Option<String>,
14878    /// Whether groups of this type are expected to retain a leader. The ChurchTools UI uses this setting when removing leaders or deactivating leader roles.
14879    #[serde(rename = "isLeaderNecessary")]
14880    pub is_leader_necessary: bool,
14881    /// Stored singular name of the group type. Use nameTranslated from the response for a localized display name.
14882    #[serde(deserialize_with = "crate::lenient::string")]
14883    pub name: String,
14884    /// Stored plural name of the group type. Use namePluralTranslated from the response for a localized display name.
14885    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
14886    pub name_plural: String,
14887    /// Number of child-group levels to which permissions configured for this group type are inherited. 0 disables inheritance to child groups; 1 includes direct children. This setting does not itself grant permissions.
14888    #[serde(rename = "permissionDepth", deserialize_with = "crate::lenient::number")]
14889    pub permission_depth: i64,
14890    /// Whether posts are enabled for groups of this type. Access to individual groups and posts still depends on permissions.
14891    #[serde(rename = "postsEnabled")]
14892    pub posts_enabled: bool,
14893    /// Short label used to identify this group type in compact displays.
14894    #[serde(deserialize_with = "crate::lenient::string")]
14895    pub shorty: String,
14896    /// Display order of the group type. Lower values come first; this endpoint sorts equal values by the stored name.
14897    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
14898    pub sort_key: i64,
14899    /// ID of the group type in this ChurchTools installation. Use this ID when referencing the type from a group or role.
14900    #[serde(deserialize_with = "crate::lenient::number")]
14901    pub id: i64,
14902    /// Creation and last modification timestamps and person IDs for this group type.
14903    pub meta: GroupTypeMeta,
14904    /// Plural display name translated into the current language, if a translation exists.
14905    #[serde(rename = "namePluralTranslated", deserialize_with = "crate::lenient::string")]
14906    pub name_plural_translated: String,
14907    /// Singular display name translated into the current language, if a translation exists.
14908    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
14909    pub name_translated: String,
14910    /// Fields not described by the spec, e.g. instance-specific DB fields.
14911    #[serde(flatten)]
14912    pub extra: serde_json::Map<String, serde_json::Value>,
14913}
14914
14915/// Changes the group type and migrates type-specific role references. Keys and values are group-type role IDs, not group-role row IDs.
14916#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14917pub struct GroupTypeChangeUpdate {
14918    /// ID of the target group type.
14919    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
14920    pub group_type_id: i64,
14921    /// Map each old group-type role ID (JSON key) to its target role ID in the new type. Include every role used by memberships, settings and routines. Many-to-one mapping keeps the first mapped role settings and removes obsolete ones; it is rejected with 400 when affected membership routines cannot be merged. Missing mappings are not reliably rejected before migration.
14922    #[serde(rename = "roleMapping", deserialize_with = "crate::lenient::map")]
14923    pub role_mapping: std::collections::BTreeMap<String, i64>,
14924    /// Fields not described by the spec, e.g. instance-specific DB fields.
14925    #[serde(flatten)]
14926    pub extra: serde_json::Map<String, serde_json::Value>,
14927}
14928
14929#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14930pub struct GroupTypeCreate {
14931    /// Whether eligible groups of this type are offered for membership selection when creating a person in the ChurchTools UI. This does not automatically add the person to a group or grant membership permissions.
14932    #[serde(rename = "availableForNewPerson")]
14933    pub available_for_new_person: bool,
14934    /// ChurchTools color token used to display this group type; not a hexadecimal color code.
14935    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
14936    #[serde(deserialize_with = "crate::lenient::string")]
14937    pub color: String,
14938    /// Optional explanatory text for this group type. Returned as null when no description is stored.
14939    ///
14940    /// `None` leaves the field out, `Some(None)` sends `null`.
14941    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
14942    pub description: Option<Option<String>>,
14943    /// Whether groups of this type are expected to retain a leader. The ChurchTools UI uses this setting when removing leaders or deactivating leader roles.
14944    #[serde(rename = "isLeaderNecessary")]
14945    pub is_leader_necessary: bool,
14946    /// Stored singular name of the group type. Use nameTranslated from the response for a localized display name.
14947    #[serde(deserialize_with = "crate::lenient::string")]
14948    pub name: String,
14949    /// Stored plural name of the group type. Use namePluralTranslated from the response for a localized display name.
14950    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
14951    pub name_plural: String,
14952    /// Number of child-group levels to which permissions configured for this group type are inherited. 0 disables inheritance to child groups; 1 includes direct children. This setting does not itself grant permissions.
14953    #[serde(rename = "permissionDepth", deserialize_with = "crate::lenient::number")]
14954    pub permission_depth: i64,
14955    /// Whether posts are enabled for groups of this type. Access to individual groups and posts still depends on permissions.
14956    #[serde(rename = "postsEnabled")]
14957    pub posts_enabled: bool,
14958    /// Short label used to identify this group type in compact displays.
14959    #[serde(deserialize_with = "crate::lenient::string")]
14960    pub shorty: String,
14961    /// Display order of the group type. Lower values come first; this endpoint sorts equal values by the stored name.
14962    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
14963    pub sort_key: i64,
14964    /// Fields not described by the spec, e.g. instance-specific DB fields.
14965    #[serde(flatten)]
14966    pub extra: serde_json::Map<String, serde_json::Value>,
14967}
14968
14969/// Creation and last modification timestamps and person IDs for this group type.
14970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14971pub struct GroupTypeMeta {
14972    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14973    #[serde(rename = "createdDate", serialize_with = "crate::datetime::serialize_utc")]
14974    pub created_date: chrono::DateTime<chrono::Utc>,
14975    #[serde(rename = "createdPerson")]
14976    pub created_person: MetaDataPersonId,
14977    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
14978    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
14979    pub modified_date: chrono::DateTime<chrono::Utc>,
14980    #[serde(rename = "modifiedPerson")]
14981    pub modified_person: MetaDataPersonId,
14982    /// Fields not described by the spec, e.g. instance-specific DB fields.
14983    #[serde(flatten)]
14984    pub extra: serde_json::Map<String, serde_json::Value>,
14985}
14986
14987/// One wiki category made available through the current user’s role in this group, with a limited list of latest page versions.
14988#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14989pub struct GroupWikiCategoryPagesItem {
14990    /// Category metadata with edit/delete permissions for the current user.
14991    pub category: GroupWikiCategoryPagesItemCategory,
14992    /// Latest page versions ordered by most recent modification then title; contains no text or previews.
14993    pub pages: Vec<SimpleWikiPage>,
14994    /// Total eligible latest-version pages in this category, before the per-category limit.
14995    #[serde(deserialize_with = "crate::lenient::number")]
14996    pub total: i64,
14997    /// Fields not described by the spec, e.g. instance-specific DB fields.
14998    #[serde(flatten)]
14999    pub extra: serde_json::Map<String, serde_json::Value>,
15000}
15001
15002/// Category metadata with edit/delete permissions for the current user.
15003#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15004pub struct GroupWikiCategoryPagesItemCategory {
15005    /// Campus association, or null when no campus is assigned.
15006    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15007    pub campus_id: Option<i64>,
15008    /// Whether files in this wiki category can be read without category-view permission. This flag does not make the wiki pages themselves public.
15009    #[serde(rename = "fileAccessWithoutPermission")]
15010    pub file_access_without_permission: bool,
15011    /// Whether the category should appear in navigation menus; it is still returned by the category catalog when false.
15012    #[serde(rename = "inMenu")]
15013    pub in_menu: bool,
15014    /// Category name; unlike page titles it is not trimmed.
15015    #[serde(deserialize_with = "crate::lenient::string")]
15016    pub name: String,
15017    /// Sort order; negative values are accepted.
15018    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
15019    pub sort_key: i64,
15020    /// Wiki category ID used in category/page endpoint URLs.
15021    #[serde(deserialize_with = "crate::lenient::number")]
15022    pub id: i64,
15023    /// Display name translated for the current request language.
15024    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
15025    pub name_translated: String,
15026    /// Page-operation hints based on category edit rights. Populated by the category list; normally empty in create/update and embedded page categories.
15027    pub permissions: GroupWikiCategoryPagesItemCategoryPermissions,
15028    /// Fields not described by the spec, e.g. instance-specific DB fields.
15029    #[serde(flatten)]
15030    pub extra: serde_json::Map<String, serde_json::Value>,
15031}
15032
15033/// Page-operation hints based on category edit rights. Populated by the category list; normally empty in create/update and embedded page categories.
15034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15035pub struct GroupWikiCategoryPagesItemCategoryPermissions {
15036    #[serde(rename = "canDelete", default, skip_serializing_if = "Option::is_none")]
15037    pub can_delete: Option<bool>,
15038    #[serde(rename = "canEdit", default, skip_serializing_if = "Option::is_none")]
15039    pub can_edit: Option<bool>,
15040    /// Fields not described by the spec, e.g. instance-specific DB fields.
15041    #[serde(flatten)]
15042    pub extra: serde_json::Map<String, serde_json::Value>,
15043}
15044
15045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15046pub struct GroupedGroups {
15047    /// Allowed values: `ageGroup`, `campus`, `groupCategory`, `groupStatus`, `groupType`, `isOpenForMembers`, `targetGroup`, `visibility`.
15048    #[serde(rename = "groupedBy", deserialize_with = "crate::lenient::string")]
15049    pub grouped_by: String,
15050    #[serde(rename = "groupedGroups", deserialize_with = "crate::lenient::map")]
15051    pub grouped_groups: std::collections::BTreeMap<String, GroupedGroupsGroupedGroupsValue>,
15052    /// Fields not described by the spec, e.g. instance-specific DB fields.
15053    #[serde(flatten)]
15054    pub extra: serde_json::Map<String, serde_json::Value>,
15055}
15056
15057#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15058pub struct GroupedGroupsGroupedGroupsValue {
15059    #[serde(deserialize_with = "crate::lenient::number")]
15060    pub all: i64,
15061    #[serde(rename = "groupPreviews")]
15062    pub group_previews: Vec<DomainObjectGroup>,
15063    #[serde(deserialize_with = "crate::lenient::string")]
15064    pub key: String,
15065    /// Fields not described by the spec, e.g. instance-specific DB fields.
15066    #[serde(flatten)]
15067    pub extra: serde_json::Map<String, serde_json::Value>,
15068}
15069
15070/// A growth-path stage used to classify a person’s progress through group participation. Group-type roles and concrete group roles reference its ID. Person calculation selects the matching stage with the highest sortKey; this catalog is not a per-person activity history.
15071#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15072pub struct GrowPath {
15073    /// Stored display color key. Create/update accept CTColor values; existing rows serialize the stored string.
15074    #[serde(deserialize_with = "crate::lenient::string")]
15075    pub color: String,
15076    /// Stage ID referenced by roles and the calculated person growPathId.
15077    #[serde(deserialize_with = "crate::lenient::number")]
15078    pub id: i64,
15079    pub meta: MetaDataEntityId,
15080    /// Stored stage name or translation key.
15081    #[serde(deserialize_with = "crate::lenient::string")]
15082    pub name: String,
15083    /// Display name translated for the current language.
15084    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
15085    pub name_translated: String,
15086    /// Display order and priority for person-stage calculation. The highest matching sort key wins; equal keys have no explicit tie-breaker.
15087    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
15088    pub sort_key: i64,
15089    /// Fields not described by the spec, e.g. instance-specific DB fields.
15090    #[serde(flatten)]
15091    pub extra: serde_json::Map<String, serde_json::Value>,
15092}
15093
15094/// Create a stage used by role-based person growth-path calculation.
15095#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15096pub struct GrowPathCreate {
15097    /// Color key accepted by the growth-path validator.
15098    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
15099    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
15100    pub color: serde_json::Value,
15101    /// Trimmed stage name or translation key, 1–100 characters. Duplicate names are allowed.
15102    #[serde(deserialize_with = "crate::lenient::string")]
15103    pub name: String,
15104    /// Nonnegative display order and calculation priority; defaults to 0. Larger values take precedence when a person qualifies for several stages.
15105    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15106    pub sort_key: Option<i64>,
15107    /// Fields not described by the spec, e.g. instance-specific DB fields.
15108    #[serde(flatten)]
15109    pub extra: serde_json::Map<String, serde_json::Value>,
15110}
15111
15112/// Replacement stage fields. ID comes from the URL. name and color are required; omitting sortKey resets it to 0, unlike the comment-viewer update endpoint.
15113#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15114pub struct GrowPathUpdate {
15115    /// Color key accepted by the growth-path validator.
15116    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
15117    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
15118    pub color: serde_json::Value,
15119    /// Trimmed stage name or translation key, 1–100 characters. Duplicate names are allowed.
15120    #[serde(deserialize_with = "crate::lenient::string")]
15121    pub name: String,
15122    /// Nonnegative display order and calculation priority; defaults to 0. Larger values take precedence when a person qualifies for several stages.
15123    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15124    pub sort_key: Option<i64>,
15125    /// Fields not described by the spec, e.g. instance-specific DB fields.
15126    #[serde(flatten)]
15127    pub extra: serde_json::Map<String, serde_json::Value>,
15128}
15129
15130#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15131pub struct HistoryBeforeAfterValue {
15132    #[serde(rename = "afterValue", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15133    pub after_value: Option<String>,
15134    #[serde(rename = "afterValueTranslated", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15135    pub after_value_translated: Option<String>,
15136    #[serde(rename = "beforeValue", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15137    pub before_value: Option<String>,
15138    #[serde(rename = "beforeValueTranslated", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15139    pub before_value_translated: Option<String>,
15140    #[serde(deserialize_with = "crate::lenient::number")]
15141    pub id: i64,
15142    #[serde(deserialize_with = "crate::lenient::string")]
15143    pub key: String,
15144    #[serde(rename = "keyTranslated", deserialize_with = "crate::lenient::string")]
15145    pub key_translated: String,
15146    /// Type and serialization format of the historical value
15147    /// Allowed values: `boolean`, `date`, `date-list`, `datetime`, `number`, `text`, `text-list`.
15148    #[serde(deserialize_with = "crate::lenient::string")]
15149    pub r#type: String,
15150    /// Fields not described by the spec, e.g. instance-specific DB fields.
15151    #[serde(flatten)]
15152    pub extra: serde_json::Map<String, serde_json::Value>,
15153}
15154
15155#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15156pub struct HistoryEntry {
15157    #[serde(deserialize_with = "crate::lenient::string")]
15158    pub action: String,
15159    #[serde(rename = "beforeAfterValues")]
15160    pub before_after_values: Vec<HistoryBeforeAfterValue>,
15161    #[serde(deserialize_with = "crate::lenient::number")]
15162    pub id: i64,
15163    pub links: Vec<HistoryLink>,
15164    pub meta: MetaDataEntityId,
15165    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15166    pub origin: Option<String>,
15167    #[serde(rename = "translatedTitle", deserialize_with = "crate::lenient::string")]
15168    pub translated_title: String,
15169    #[serde(rename = "translationArgs", deserialize_with = "crate::lenient::map")]
15170    pub translation_args: std::collections::BTreeMap<String, String>,
15171    #[serde(rename = "translationKey", deserialize_with = "crate::lenient::string")]
15172    pub translation_key: String,
15173    /// Fields not described by the spec, e.g. instance-specific DB fields.
15174    #[serde(flatten)]
15175    pub extra: serde_json::Map<String, serde_json::Value>,
15176}
15177
15178#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15179pub struct HistoryLink {
15180    #[serde(rename = "domainId", deserialize_with = "crate::lenient::string")]
15181    pub domain_id: String,
15182    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
15183    pub domain_type: String,
15184    #[serde(deserialize_with = "crate::lenient::number")]
15185    pub id: i64,
15186    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15187    pub role: Option<String>,
15188    /// Fields not described by the spec, e.g. instance-specific DB fields.
15189    #[serde(flatten)]
15190    pub extra: serde_json::Map<String, serde_json::Value>,
15191}
15192
15193/// Stored template metadata. HTML and MJML content are separate file references; retrieve the corresponding content endpoints for source text. Image assets are stored separately.
15194#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15195pub struct HtmlTemplate {
15196    /// Template purpose: email for group-member emails, bulkletter for mail-merged letters, groupmember-document for membership documents, and donation-receipt-letter/attachment for donation receipt output.
15197    /// Allowed values: `bulkletter`, `donation-receipt-attachment`, `donation-receipt-letter`, `email`, `groupmember-document`.
15198    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
15199    pub domain_type: String,
15200    /// Whether the template is shared for its domain. Shared availability still depends on template/domain permissions; ownership is retained even for global templates.
15201    #[serde(rename = "isGlobal")]
15202    pub is_global: bool,
15203    /// Display name of the HTML template.
15204    #[serde(deserialize_with = "crate::lenient::string")]
15205    pub name: String,
15206    /// ID of the stored HTML content file, or `null` if no HTML content is stored.
15207    #[serde(rename = "htmlFileId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15208    pub html_file_id: Option<i64>,
15209    /// ID of the HTML template.
15210    #[serde(deserialize_with = "crate::lenient::number")]
15211    pub id: i64,
15212    pub meta: MetaDataEntityId,
15213    /// ID of the stored MJML content file, or `null` if no MJML content is stored.
15214    #[serde(rename = "mjmlFileId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15215    pub mjml_file_id: Option<i64>,
15216    /// Creator/owner of the template, including global templates; null is possible for imported or legacy ownerless records.
15217    #[serde(default, skip_serializing_if = "Option::is_none")]
15218    pub owner: Option<DomainObjectPerson>,
15219    /// Fields not described by the spec, e.g. instance-specific DB fields.
15220    #[serde(flatten)]
15221    pub extra: serde_json::Map<String, serde_json::Value>,
15222}
15223
15224/// Editor asset descriptor for one stored image upload; does not include a file ID or general file metadata.
15225#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15226pub struct HtmlTemplateAssetUpload {
15227    /// Original uploaded file name.
15228    #[serde(deserialize_with = "crate::lenient::string")]
15229    pub name: String,
15230    /// Absolute image URL with crop=original, suitable for embedding in the template.
15231    #[serde(deserialize_with = "crate::lenient::string")]
15232    pub src: String,
15233    /// Uploaded asset type used by the editor.
15234    /// Allowed values: `image`.
15235    #[serde(deserialize_with = "crate::lenient::string")]
15236    pub r#type: String,
15237    /// Fields not described by the spec, e.g. instance-specific DB fields.
15238    #[serde(flatten)]
15239    pub extra: serde_json::Map<String, serde_json::Value>,
15240}
15241
15242/// Creates template metadata owned by the current user, with independently optional HTML and MJML source files. The API stores both sources as supplied; it does not compile MJML into HTML. Membership-document and donation-receipt purposes require isGlobal=true.
15243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15244pub struct HtmlTemplateCreate {
15245    /// Template purpose: email for group-member emails, bulkletter for mail-merged letters, groupmember-document for membership documents, and donation-receipt-letter/attachment for donation receipt output.
15246    /// Allowed values: `bulkletter`, `donation-receipt-attachment`, `donation-receipt-letter`, `email`, `groupmember-document`.
15247    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
15248    pub domain_type: String,
15249    /// Whether the template is shared for its domain. Shared availability still depends on template/domain permissions; ownership is retained even for global templates.
15250    #[serde(rename = "isGlobal", default, skip_serializing_if = "Option::is_none")]
15251    pub is_global: Option<bool>,
15252    /// Display name of the HTML template.
15253    #[serde(deserialize_with = "crate::lenient::string")]
15254    pub name: String,
15255    /// Copy image asset files from this template ID after creating the new template. Does not copy HTML/MJML or rewrite embedded URLs; omit/null to copy none.
15256    ///
15257    /// `None` leaves the field out, `Some(None)` sends `null`.
15258    #[serde(rename = "copyAssetsFromId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15259    pub copy_assets_from_id: Option<Option<i64>>,
15260    /// HTML source; omitted/null stores no HTML file. The nonempty string 0 is also treated as absent by the current service.
15261    ///
15262    /// `None` leaves the field out, `Some(None)` sends `null`.
15263    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15264    pub html: Option<Option<String>>,
15265    /// MJML editor source; omitted/null stores no MJML file. This input is not compiled or validated as MJML by this endpoint.
15266    ///
15267    /// `None` leaves the field out, `Some(None)` sends `null`.
15268    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15269    pub mjml: Option<Option<String>>,
15270    /// Fields not described by the spec, e.g. instance-specific DB fields.
15271    #[serde(flatten)]
15272    pub extra: serde_json::Map<String, serde_json::Value>,
15273}
15274
15275/// Identifier and display name of an HTML document template. This does not include template content or a generated document.
15276#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15277pub struct HtmlTemplateInfo {
15278    /// Template ID used when requesting the generated membership document.
15279    #[serde(deserialize_with = "crate::lenient::number")]
15280    pub id: i64,
15281    #[serde(deserialize_with = "crate::lenient::string")]
15282    pub name: String,
15283    /// Fields not described by the spec, e.g. instance-specific DB fields.
15284    #[serde(flatten)]
15285    pub extra: serde_json::Map<String, serde_json::Value>,
15286}
15287
15288/// Partial metadata/content update. Omission or null preserves existing values; null does not delete content. HTML/MJML are independent sources and are not rendered/compiled here.
15289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15290pub struct HtmlTemplateUpdate {
15291    /// Replace HTML source when nonempty and truthy; null/omission and the string 0 preserve existing content. Empty string fails validation.
15292    ///
15293    /// `None` leaves the field out, `Some(None)` sends `null`.
15294    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15295    pub html: Option<Option<String>>,
15296    /// Attach a file in the html_template domain, either already belonging to this template or an unbound upload (domainId=-1) created by the current user. Evaluated after html/mjml updates; deletes other content files and clears mjmlFileId. Null/0/omission preserves the current reference.
15297    ///
15298    /// `None` leaves the field out, `Some(None)` sends `null`.
15299    #[serde(rename = "htmlFileId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15300    pub html_file_id: Option<Option<i64>>,
15301    /// Change shared availability; null/omission preserves it. Membership-document and donation-receipt templates must stay global.
15302    ///
15303    /// `None` leaves the field out, `Some(None)` sends `null`.
15304    #[serde(rename = "isGlobal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15305    pub is_global: Option<Option<bool>>,
15306    /// Replace MJML source independently; null/omission and the string 0 preserve it. Empty string fails validation.
15307    ///
15308    /// `None` leaves the field out, `Some(None)` sends `null`.
15309    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15310    pub mjml: Option<Option<String>>,
15311    /// New trimmed display name; null/omission preserves it. The current service also ignores the otherwise valid name 0.
15312    ///
15313    /// `None` leaves the field out, `Some(None)` sends `null`.
15314    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15315    pub name: Option<Option<String>>,
15316    /// Fields not described by the spec, e.g. instance-specific DB fields.
15317    #[serde(flatten)]
15318    pub extra: serde_json::Map<String, serde_json::Value>,
15319}
15320
15321#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15322pub struct Image {
15323    #[serde(rename = "additionalInfos")]
15324    pub additional_infos: Vec<String>,
15325    #[serde(rename = "domainId", deserialize_with = "crate::lenient::string")]
15326    pub domain_id: String,
15327    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
15328    pub domain_type: String,
15329    #[serde(rename = "fileUrl", deserialize_with = "crate::lenient::string")]
15330    pub file_url: String,
15331    #[serde(deserialize_with = "crate::lenient::string")]
15332    pub filename: String,
15333    #[serde(deserialize_with = "crate::lenient::number")]
15334    pub id: i64,
15335    #[serde(rename = "imageOption")]
15336    pub image_option: ImageImageOption,
15337    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::string")]
15338    pub image_url: String,
15339    pub meta: MetaDataEntityId,
15340    #[serde(deserialize_with = "crate::lenient::string")]
15341    pub name: String,
15342    #[serde(rename = "relativeUrl", deserialize_with = "crate::lenient::string")]
15343    pub relative_url: String,
15344    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15345    pub security_level_id: Option<i64>,
15346    #[serde(rename = "showOnlyWhenEditable")]
15347    pub show_only_when_editable: bool,
15348    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15349    pub size: Option<i64>,
15350    #[serde(deserialize_with = "crate::lenient::string")]
15351    pub r#type: String,
15352    /// Fields not described by the spec, e.g. instance-specific DB fields.
15353    #[serde(flatten)]
15354    pub extra: serde_json::Map<String, serde_json::Value>,
15355}
15356
15357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15358pub struct ImageImageOption {
15359    #[serde(default, skip_serializing_if = "Option::is_none")]
15360    pub crop: Option<ImageImageOptionCrop>,
15361    #[serde(default, skip_serializing_if = "Option::is_none")]
15362    pub focus: Option<ImageImageOptionFocus>,
15363    /// Fields not described by the spec, e.g. instance-specific DB fields.
15364    #[serde(flatten)]
15365    pub extra: serde_json::Map<String, serde_json::Value>,
15366}
15367
15368#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15369pub struct ImageImageOptionCrop {
15370    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15371    pub bottom: Option<String>,
15372    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15373    pub left: Option<String>,
15374    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15375    pub right: Option<String>,
15376    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15377    pub top: Option<String>,
15378    /// Fields not described by the spec, e.g. instance-specific DB fields.
15379    #[serde(flatten)]
15380    pub extra: serde_json::Map<String, serde_json::Value>,
15381}
15382
15383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15384pub struct ImageImageOptionFocus {
15385    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15386    pub x: Option<String>,
15387    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15388    pub y: Option<String>,
15389    /// Fields not described by the spec, e.g. instance-specific DB fields.
15390    #[serde(flatten)]
15391    pub extra: serde_json::Map<String, serde_json::Value>,
15392}
15393
15394/// Image metadata returned after an update.
15395#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15396pub struct ImageMetadataUpdateResult {
15397    /// Whether the image was generated with AI.
15398    #[serde(rename = "aiGenerated")]
15399    pub ai_generated: bool,
15400    /// Image credit or attribution.
15401    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15402    pub annotation: Option<String>,
15403    /// Attribution link.
15404    #[serde(rename = "annotationLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15405    pub annotation_link: Option<String>,
15406    /// Image description.
15407    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15408    pub description: Option<String>,
15409    /// Identifier of the object owning the image.
15410    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15411    pub domain_identifier: Option<String>,
15412    /// File domain selecting the owning resource and update policy.
15413    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
15414    pub domain_type: String,
15415    /// Storage filename; different from the public URL hash.
15416    #[serde(deserialize_with = "crate::lenient::string")]
15417    pub filename: String,
15418    /// Stored file ID.
15419    #[serde(deserialize_with = "crate::lenient::number")]
15420    pub id: i64,
15421    /// Original display filename, including extension.
15422    #[serde(deserialize_with = "crate::lenient::string")]
15423    pub name: String,
15424    /// File security level.
15425    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15426    pub security_level_id: Option<i64>,
15427    /// File size in bytes.
15428    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15429    pub size: Option<i64>,
15430    /// Absolute public image URL.
15431    #[serde(deserialize_with = "crate::lenient::string")]
15432    pub url: String,
15433    /// Fields not described by the spec, e.g. instance-specific DB fields.
15434    #[serde(flatten)]
15435    pub extra: serde_json::Map<String, serde_json::Value>,
15436}
15437
15438/// Image metadata update used by both image update routes.
15439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15440pub struct ImageUpdate {
15441    /// Whether the image was generated with AI.
15442    #[serde(rename = "aiGenerated", default, skip_serializing_if = "Option::is_none")]
15443    pub ai_generated: Option<bool>,
15444    /// Image credit or attribution.
15445    ///
15446    /// `None` leaves the field out, `Some(None)` sends `null`.
15447    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15448    pub annotation: Option<Option<String>>,
15449    /// Attribution link.
15450    ///
15451    /// `None` leaves the field out, `Some(None)` sends `null`.
15452    #[serde(rename = "annotationLink", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15453    pub annotation_link: Option<Option<String>>,
15454    /// Alternative text describing the image for screen readers.
15455    ///
15456    /// `None` leaves the field out, `Some(None)` sends `null`.
15457    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15458    pub description: Option<Option<String>>,
15459    /// Legacy alias for `options`.
15460    ///
15461    /// `None` leaves the field out, `Some(None)` sends `null`.
15462    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15463    #[deprecated = "deprecated in the ChurchTools API"]
15464    pub image_options: Option<Option<String>>,
15465    /// JSON-encoded image options. `crop` contains the `top`, `right`, `bottom` and `left` margins relative to the original dimensions. `focus` contains `x` and `y` coordinates relative to the original top-left corner.
15466    ///
15467    /// `None` leaves the field out, `Some(None)` sends `null`.
15468    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
15469    pub options: Option<Option<String>>,
15470    /// Fields not described by the spec, e.g. instance-specific DB fields.
15471    #[serde(flatten)]
15472    pub extra: serde_json::Map<String, serde_json::Value>,
15473}
15474
15475/// Internal permissions derived from the current user's groups linked to service roles. Global rights and other policy grants, such as event administration, are not included. This is not a complete authorization result for an API action.
15476#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15477pub struct InternalEventPermissions {
15478    /// Event-level rights from connected groups with valid service assignments in this event. `+edit agenda` additionally requires an assignment to the current person in the relevant group. Empty when none were found.
15479    #[serde(rename = "internalPerms", default, skip_serializing_if = "serde_json::Value::is_null")]
15480    pub internal_perms: serde_json::Value,
15481    /// Service-group IDs mapped to granted rights. These rights are collected across all connected service roles, independently of whether a role is assigned in this event. Empty results are serialized as \[\].
15482    #[serde(rename = "serviceGroups", default, skip_serializing_if = "serde_json::Value::is_null")]
15483    pub service_groups: serde_json::Value,
15484    /// Service-role IDs mapped to granted rights. Keys are master-data service IDs, not assignment IDs. These rights are collected independently of assignments in the requested event. Empty results are serialized as \[\].
15485    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
15486    pub services: serde_json::Value,
15487    /// Fields not described by the spec, e.g. instance-specific DB fields.
15488    #[serde(flatten)]
15489    pub extra: serde_json::Map<String, serde_json::Value>,
15490}
15491
15492/// Sparse map of granted internal group permissions. Only present keys are granted by this calculation; values are always `true`. Absence does not evaluate grants from other authorization sources.
15493#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15494pub struct InternalEventRights {
15495    #[serde(rename = "+attach file", default, skip_serializing_if = "Option::is_none")]
15496    pub attach_file: Option<bool>,
15497    #[serde(rename = "+edit agenda", default, skip_serializing_if = "Option::is_none")]
15498    pub edit_agenda: Option<bool>,
15499    #[serde(rename = "+edit event", default, skip_serializing_if = "Option::is_none")]
15500    pub edit_event: Option<bool>,
15501    #[serde(rename = "+edit info", default, skip_serializing_if = "Option::is_none")]
15502    pub edit_info: Option<bool>,
15503    /// Fields not described by the spec, e.g. instance-specific DB fields.
15504    #[serde(flatten)]
15505    pub extra: serde_json::Map<String, serde_json::Value>,
15506}
15507
15508/// Sparse map of granted internal group permissions. Only present keys are granted by this calculation; values are always `true`. Absence does not evaluate grants from other authorization sources.
15509#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15510pub struct InternalEventServiceGroupRights {
15511    #[serde(rename = "+view absence", default, skip_serializing_if = "Option::is_none")]
15512    pub view_absence: Option<bool>,
15513    #[serde(rename = "+view service", default, skip_serializing_if = "Option::is_none")]
15514    pub view_service: Option<bool>,
15515    /// Fields not described by the spec, e.g. instance-specific DB fields.
15516    #[serde(flatten)]
15517    pub extra: serde_json::Map<String, serde_json::Value>,
15518}
15519
15520/// Sparse map of granted internal group permissions. Only present keys are granted by this calculation; values are always `true`. Absence does not evaluate grants from other authorization sources.
15521#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15522pub struct InternalEventServiceRights {
15523    #[serde(rename = "+admin service", default, skip_serializing_if = "Option::is_none")]
15524    pub admin_service: Option<bool>,
15525    #[serde(rename = "+edit service", default, skip_serializing_if = "Option::is_none")]
15526    pub edit_service: Option<bool>,
15527    #[serde(rename = "+entry all", default, skip_serializing_if = "Option::is_none")]
15528    pub entry_all: Option<bool>,
15529    #[serde(rename = "+entry free", default, skip_serializing_if = "Option::is_none")]
15530    pub entry_free: Option<bool>,
15531    #[serde(rename = "+see history", default, skip_serializing_if = "Option::is_none")]
15532    pub see_history: Option<bool>,
15533    #[serde(rename = "+see reason", default, skip_serializing_if = "Option::is_none")]
15534    pub see_reason: Option<bool>,
15535    #[serde(rename = "+see workload", default, skip_serializing_if = "Option::is_none")]
15536    pub see_workload: Option<bool>,
15537    #[serde(rename = "+start event chat", default, skip_serializing_if = "Option::is_none")]
15538    pub start_event_chat: Option<bool>,
15539    /// Fields not described by the spec, e.g. instance-specific DB fields.
15540    #[serde(flatten)]
15541    pub extra: serde_json::Map<String, serde_json::Value>,
15542}
15543
15544/// Current user’s group-internal values for a target group, grouped by active module. Grants come from direct role assignments and inherited superior-group assignments. Flags default to false, maximum levels to 0, and selectable permissions can be 0 when absent or integer arrays when granted. Maximum unrestricted access uses 99999. Global grants and object policies are not included.
15545#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15546pub struct InternalGroupPermissions {
15547    /// Group-internal permission values from the churchdb module.
15548    pub churchdb: InternalGroupPermissionsChurchdb,
15549    /// Group-internal permission values from the churchservice module.
15550    #[serde(default, skip_serializing_if = "Option::is_none")]
15551    pub churchservice: Option<InternalGroupPermissionsChurchservice>,
15552    /// Group-internal permission values from the finance module.
15553    #[serde(default, skip_serializing_if = "Option::is_none")]
15554    pub finance: Option<InternalGroupPermissionsFinance>,
15555    /// Fields not described by the spec, e.g. instance-specific DB fields.
15556    #[serde(flatten)]
15557    pub extra: serde_json::Map<String, serde_json::Value>,
15558}
15559
15560/// Group-internal permission values from the churchdb module.
15561#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15562pub struct InternalGroupPermissionsChurchdb {
15563    #[serde(rename = "+add person", default, skip_serializing_if = "Option::is_none")]
15564    pub add_person: Option<bool>,
15565    #[serde(rename = "+admin automatic emails", default, skip_serializing_if = "Option::is_none")]
15566    pub admin_automatic_emails: Option<bool>,
15567    #[serde(rename = "+admin followup", default, skip_serializing_if = "Option::is_none")]
15568    pub admin_followup: Option<bool>,
15569    #[serde(rename = "+admin group chat", default, skip_serializing_if = "Option::is_none")]
15570    pub admin_group_chat: Option<bool>,
15571    /// Use "+admin group member fields" instead.
15572    #[serde(rename = "+admin group fields", default, skip_serializing_if = "Option::is_none")]
15573    #[deprecated = "Use \"+admin group member fields\" instead."]
15574    pub admin_group_fields: Option<bool>,
15575    #[serde(rename = "+admin group member fields", default, skip_serializing_if = "Option::is_none")]
15576    pub admin_group_member_fields: Option<bool>,
15577    #[serde(rename = "+admin meetings", default, skip_serializing_if = "Option::is_none")]
15578    pub admin_meetings: Option<bool>,
15579    #[serde(rename = "+admin posts", default, skip_serializing_if = "Option::is_none")]
15580    pub admin_posts: Option<bool>,
15581    #[serde(rename = "+admin routines", default, skip_serializing_if = "Option::is_none")]
15582    pub admin_routines: Option<bool>,
15583    #[serde(rename = "+create group", default, skip_serializing_if = "serde_json::Value::is_null")]
15584    pub create_group: serde_json::Value,
15585    #[serde(rename = "+create notes", default, skip_serializing_if = "Option::is_none")]
15586    pub create_notes: Option<bool>,
15587    #[serde(rename = "+create post group intern", default, skip_serializing_if = "Option::is_none")]
15588    pub create_post_group_intern: Option<bool>,
15589    #[serde(rename = "+create post group visible", default, skip_serializing_if = "Option::is_none")]
15590    pub create_post_group_visible: Option<bool>,
15591    /// Legacy derived flag, returned by the single-group endpoint as the conjunction of +create post group intern and +create post group visible. Not added by the all-groups endpoint.
15592    #[serde(rename = "+create posts", default, skip_serializing_if = "Option::is_none")]
15593    pub create_posts: Option<bool>,
15594    #[serde(rename = "+do followup", default, skip_serializing_if = "Option::is_none")]
15595    pub do_followup: Option<bool>,
15596    #[serde(rename = "+do group meeting", default, skip_serializing_if = "Option::is_none")]
15597    pub do_group_meeting: Option<bool>,
15598    #[serde(rename = "+edit basic group memberships", default, skip_serializing_if = "Option::is_none")]
15599    pub edit_basic_group_memberships: Option<bool>,
15600    #[serde(rename = "+edit group basic settings", default, skip_serializing_if = "Option::is_none")]
15601    pub edit_group_basic_settings: Option<bool>,
15602    /// Use "edit group member fields" instead.
15603    #[serde(rename = "+edit group fields", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15604    #[deprecated = "Use \"edit group member fields\" instead."]
15605    pub edit_group_fields: Option<i64>,
15606    #[serde(rename = "+edit group hierarchy", default, skip_serializing_if = "Option::is_none")]
15607    pub edit_group_hierarchy: Option<bool>,
15608    #[serde(rename = "+edit group infos", default, skip_serializing_if = "Option::is_none")]
15609    pub edit_group_infos: Option<bool>,
15610    #[serde(rename = "+edit group member fields", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15611    pub edit_group_member_fields: Option<i64>,
15612    /// Compatibility flag derived from +edit basic group memberships OR +edit group member fields.
15613    #[serde(rename = "+edit group memberships", default, skip_serializing_if = "Option::is_none")]
15614    #[deprecated = "deprecated in the ChurchTools API"]
15615    pub edit_group_memberships: Option<bool>,
15616    #[serde(rename = "+edit groupmemberstatus", default, skip_serializing_if = "Option::is_none")]
15617    pub edit_groupmemberstatus: Option<bool>,
15618    #[serde(rename = "+edit own group member fields", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15619    pub edit_own_group_member_fields: Option<i64>,
15620    /// Use "+edit own group member fields" instead.
15621    #[serde(rename = "+edit own groupmemberfields", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15622    #[deprecated = "Use \"+edit own group member fields\" instead."]
15623    pub edit_own_groupmemberfields: Option<i64>,
15624    #[serde(rename = "+edit person fields of group members", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15625    pub edit_person_fields_of_group_members: Option<i64>,
15626    /// Use "+edit person fields of group members" instead.
15627    #[serde(rename = "+edit persons", default, skip_serializing_if = "Option::is_none")]
15628    #[deprecated = "Use \"+edit person fields of group members\" instead."]
15629    pub edit_persons: Option<bool>,
15630    #[serde(rename = "+exit group", default, skip_serializing_if = "Option::is_none")]
15631    pub exit_group: Option<bool>,
15632    #[serde(rename = "+export group members", default, skip_serializing_if = "Option::is_none")]
15633    pub export_group_members: Option<bool>,
15634    #[serde(rename = "+get emails", default, skip_serializing_if = "Option::is_none")]
15635    pub get_emails: Option<bool>,
15636    #[serde(rename = "+invite person", default, skip_serializing_if = "Option::is_none")]
15637    pub invite_person: Option<bool>,
15638    #[serde(rename = "+mail group members", default, skip_serializing_if = "Option::is_none")]
15639    pub mail_group_members: Option<bool>,
15640    #[serde(rename = "+remove from group", default, skip_serializing_if = "Option::is_none")]
15641    pub remove_from_group: Option<bool>,
15642    #[serde(rename = "+see group", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15643    pub see_group: Option<i64>,
15644    #[serde(rename = "+see group member fields", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15645    pub see_group_member_fields: Option<i64>,
15646    #[serde(rename = "+see group tags", default, skip_serializing_if = "Option::is_none")]
15647    pub see_group_tags: Option<bool>,
15648    /// Use "+see group member fields" instead.
15649    #[serde(rename = "+see groupmemberfields", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15650    #[deprecated = "Use \"+see group member fields\" instead."]
15651    pub see_groupmemberfields: Option<i64>,
15652    #[serde(rename = "+see hidden group", default, skip_serializing_if = "Option::is_none")]
15653    pub see_hidden_group: Option<bool>,
15654    #[serde(rename = "+see own group member fields", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15655    pub see_own_group_member_fields: Option<i64>,
15656    #[serde(rename = "+see persons", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15657    pub see_persons: Option<i64>,
15658    #[serde(rename = "+see tags", default, skip_serializing_if = "Option::is_none")]
15659    pub see_tags: Option<bool>,
15660    #[serde(rename = "+view history", default, skip_serializing_if = "Option::is_none")]
15661    pub view_history: Option<bool>,
15662    /// Fields not described by the spec, e.g. instance-specific DB fields.
15663    #[serde(flatten)]
15664    pub extra: serde_json::Map<String, serde_json::Value>,
15665}
15666
15667/// Group-internal permission values from the churchservice module.
15668#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15669pub struct InternalGroupPermissionsChurchservice {
15670    #[serde(rename = "+admin service", default, skip_serializing_if = "Option::is_none")]
15671    pub admin_service: Option<bool>,
15672    #[serde(rename = "+attach file", default, skip_serializing_if = "Option::is_none")]
15673    pub attach_file: Option<bool>,
15674    #[serde(rename = "+edit agenda", default, skip_serializing_if = "Option::is_none")]
15675    pub edit_agenda: Option<bool>,
15676    #[serde(rename = "+edit event", default, skip_serializing_if = "Option::is_none")]
15677    pub edit_event: Option<bool>,
15678    #[serde(rename = "+edit info", default, skip_serializing_if = "Option::is_none")]
15679    pub edit_info: Option<bool>,
15680    #[serde(rename = "+edit service", default, skip_serializing_if = "Option::is_none")]
15681    pub edit_service: Option<bool>,
15682    #[serde(rename = "+entry all", default, skip_serializing_if = "Option::is_none")]
15683    pub entry_all: Option<bool>,
15684    #[serde(rename = "+entry free", default, skip_serializing_if = "Option::is_none")]
15685    pub entry_free: Option<bool>,
15686    #[serde(rename = "+see history", default, skip_serializing_if = "Option::is_none")]
15687    pub see_history: Option<bool>,
15688    #[serde(rename = "+see reason", default, skip_serializing_if = "Option::is_none")]
15689    pub see_reason: Option<bool>,
15690    #[serde(rename = "+see workload", default, skip_serializing_if = "Option::is_none")]
15691    pub see_workload: Option<bool>,
15692    #[serde(rename = "+start event chat", default, skip_serializing_if = "Option::is_none")]
15693    pub start_event_chat: Option<bool>,
15694    #[serde(rename = "+view absence", default, skip_serializing_if = "Option::is_none")]
15695    pub view_absence: Option<bool>,
15696    #[serde(rename = "+view service", default, skip_serializing_if = "Option::is_none")]
15697    pub view_service: Option<bool>,
15698    /// Fields not described by the spec, e.g. instance-specific DB fields.
15699    #[serde(flatten)]
15700    pub extra: serde_json::Map<String, serde_json::Value>,
15701}
15702
15703/// Group-internal permission values from the finance module.
15704#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15705pub struct InternalGroupPermissionsFinance {
15706    #[serde(rename = "+allow posting", default, skip_serializing_if = "Option::is_none")]
15707    pub allow_posting: Option<bool>,
15708    #[serde(rename = "+see cost center budgets", default, skip_serializing_if = "Option::is_none")]
15709    pub see_cost_center_budgets: Option<bool>,
15710    #[serde(rename = "+see cost centers", default, skip_serializing_if = "Option::is_none")]
15711    pub see_cost_centers: Option<bool>,
15712    #[serde(rename = "+see donators in cost centers", default, skip_serializing_if = "Option::is_none")]
15713    pub see_donators_in_cost_centers: Option<bool>,
15714    /// Fields not described by the spec, e.g. instance-specific DB fields.
15715    #[serde(flatten)]
15716    pub extra: serde_json::Map<String, serde_json::Value>,
15717}
15718
15719/// Current user’s internal permission values toward a target person. Combines grants over the target person’s non-archived groups, including pending/waiting/to-delete memberships in the target group selection. This is not the target person’s own permissions or a full authorization decision.
15720#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15721pub struct InternalPersonPermissions {
15722    pub churchdb: InternalPersonPermissionsChurchdb,
15723    /// Only present when the service module and its person-related definitions are active.
15724    #[serde(default, skip_serializing_if = "Option::is_none")]
15725    pub churchservice: Option<InternalPersonPermissionsChurchservice>,
15726    /// Fields not described by the spec, e.g. instance-specific DB fields.
15727    #[serde(flatten)]
15728    pub extra: serde_json::Map<String, serde_json::Value>,
15729}
15730
15731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15732pub struct InternalPersonPermissionsChurchdb {
15733    #[serde(rename = "+do followup", default, skip_serializing_if = "Option::is_none")]
15734    pub do_followup: Option<bool>,
15735    #[serde(rename = "+edit person fields of group members", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15736    pub edit_person_fields_of_group_members: Option<i64>,
15737    /// Compatibility flag derived from +edit person fields of group members > 0.
15738    #[serde(rename = "+edit persons", default, skip_serializing_if = "Option::is_none")]
15739    #[deprecated = "deprecated in the ChurchTools API"]
15740    pub edit_persons: Option<bool>,
15741    #[serde(rename = "+invite person", default, skip_serializing_if = "Option::is_none")]
15742    pub invite_person: Option<bool>,
15743    #[serde(rename = "+see persons", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15744    pub see_persons: Option<i64>,
15745    #[serde(rename = "+see tags", default, skip_serializing_if = "Option::is_none")]
15746    pub see_tags: Option<bool>,
15747    /// Fields not described by the spec, e.g. instance-specific DB fields.
15748    #[serde(flatten)]
15749    pub extra: serde_json::Map<String, serde_json::Value>,
15750}
15751
15752/// Only present when the service module and its person-related definitions are active.
15753#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15754pub struct InternalPersonPermissionsChurchservice {
15755    #[serde(rename = "+see workload", default, skip_serializing_if = "Option::is_none")]
15756    pub see_workload: Option<bool>,
15757    /// Fields not described by the spec, e.g. instance-specific DB fields.
15758    #[serde(flatten)]
15759    pub extra: serde_json::Map<String, serde_json::Value>,
15760}
15761
15762/// Persisted background-job summary. The identifier is a string generated when scheduling, not an integer database ID. Execution arguments and log entries are not included.
15763#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15764pub struct Job {
15765    /// Scheduling timestamp.
15766    #[serde(rename = "createdDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
15767    pub created_date: Option<chrono::DateTime<chrono::Utc>>,
15768    /// ID of the associated business object.
15769    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15770    pub domain_id: Option<i64>,
15771    /// Kind of business object associated with the job.
15772    #[serde(rename = "domainType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15773    pub domain_type: Option<String>,
15774    /// Opaque identifier returned when the job was scheduled.
15775    #[serde(deserialize_with = "crate::lenient::string")]
15776    pub identifier: String,
15777    /// Whether the job was scheduled as a dry run.
15778    #[serde(rename = "isDryRun")]
15779    pub is_dry_run: bool,
15780    /// Last status-update timestamp.
15781    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
15782    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
15783    /// Registered worker job name; an extensible key, not localized display text.
15784    #[serde(deserialize_with = "crate::lenient::string")]
15785    pub name: String,
15786    /// Stored background-job status. The status-update endpoint accepts all values; the list filter accepts only `IN_PROGRESS`, `DONE`, and `ERROR`.
15787    /// Allowed values: `CANCELED`, `DONE`, `ERROR`, `IN_PROGRESS`, `QUEUED`.
15788    #[serde(deserialize_with = "crate::lenient::string")]
15789    pub status: String,
15790    /// Fields not described by the spec, e.g. instance-specific DB fields.
15791    #[serde(flatten)]
15792    pub extra: serde_json::Map<String, serde_json::Value>,
15793}
15794
15795/// Stored sync job configuration. master means ChurchTools; ES means the configured external system.
15796#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15797pub struct JobConfigurationReturn {
15798    /// Whether the periodic scheduler can start this job.
15799    #[serde(rename = "autoScheduleEnabled")]
15800    pub auto_schedule_enabled: bool,
15801    /// Whether records may be created or updated.
15802    /// Allowed values: `always`, `never`.
15803    #[serde(rename = "createBehaviorES", deserialize_with = "crate::lenient::string")]
15804    pub create_behavior_es: String,
15805    /// Whether records may be created or updated.
15806    /// Allowed values: `always`, `never`.
15807    #[serde(rename = "createBehaviorMaster", deserialize_with = "crate::lenient::string")]
15808    pub create_behavior_master: String,
15809    /// Adapter-specific defaults for newly created records on this side.
15810    #[serde(rename = "createDefaultsES", default, skip_serializing_if = "serde_json::Value::is_null")]
15811    pub create_defaults_es: serde_json::Value,
15812    /// Adapter-specific defaults for newly created records on this side.
15813    #[serde(rename = "createDefaultsMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
15814    pub create_defaults_master: serde_json::Value,
15815    /// How deletions are handled on the specified side: retain, archive or delete.
15816    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
15817    #[serde(rename = "deleteBehaviorES", deserialize_with = "crate::lenient::string")]
15818    pub delete_behavior_es: String,
15819    /// How deletions are handled on the specified side: retain, archive or delete.
15820    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
15821    #[serde(rename = "deleteBehaviorMaster", deserialize_with = "crate::lenient::string")]
15822    pub delete_behavior_master: String,
15823    /// Domain supported by the adapter, such as person. Job configuration accepts adapter-specific domain names.
15824    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
15825    pub domain_type: String,
15826    /// Whether matching records are linked: never, use an existing record, or merge when linking.
15827    /// Allowed values: `alwaysMerge`, `alwaysUse`, `never`.
15828    #[serde(rename = "linkBehavior", deserialize_with = "crate::lenient::string")]
15829    pub link_behavior: String,
15830    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
15831    /// Allowed values: `es`, `lastUpdated`, `master`.
15832    #[serde(rename = "linkData", deserialize_with = "crate::lenient::string")]
15833    pub link_data: String,
15834    /// Job display name.
15835    #[serde(deserialize_with = "crate::lenient::string")]
15836    pub name: String,
15837    /// Whether records may be created or updated.
15838    /// Allowed values: `always`, `never`.
15839    #[serde(rename = "updateBehavior", deserialize_with = "crate::lenient::string")]
15840    pub update_behavior: String,
15841    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
15842    /// Allowed values: `es`, `lastUpdated`, `master`.
15843    #[serde(rename = "updateData", deserialize_with = "crate::lenient::string")]
15844    pub update_data: String,
15845    /// Configured external connection with masked access credentials.
15846    #[serde(rename = "externalSystem")]
15847    pub external_system: ExternalSystem,
15848    /// Job configuration ID
15849    #[serde(deserialize_with = "crate::lenient::number")]
15850    pub id: i64,
15851    /// Fields not described by the spec, e.g. instance-specific DB fields.
15852    #[serde(flatten)]
15853    pub extra: serde_json::Map<String, serde_json::Value>,
15854}
15855
15856#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15857pub struct JobGroupStatus {
15858    pub jobs: JobGroupStatusJobs,
15859    /// Name of Job Group. `__single__` is For Jobs Which don't Belong to a Group
15860    #[serde(deserialize_with = "crate::lenient::string")]
15861    pub name: String,
15862    /// Total Jobs in Queue of This Job Group
15863    #[serde(deserialize_with = "crate::lenient::number")]
15864    pub total: i64,
15865    /// Fields not described by the spec, e.g. instance-specific DB fields.
15866    #[serde(flatten)]
15867    pub extra: serde_json::Map<String, serde_json::Value>,
15868}
15869
15870#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15871pub struct JobGroupStatusJobs {
15872    /// Number of Buried Jobs
15873    #[serde(deserialize_with = "crate::lenient::number")]
15874    pub buried: i64,
15875    /// Number of Deleted Jobs (but still in Queue listed)
15876    #[serde(deserialize_with = "crate::lenient::number")]
15877    pub deleted: i64,
15878    /// Number of Pending Jobs
15879    #[serde(deserialize_with = "crate::lenient::number")]
15880    pub pending: i64,
15881    /// Number of Running Jobs
15882    #[serde(deserialize_with = "crate::lenient::number")]
15883    pub running: i64,
15884    /// Fields not described by the spec, e.g. instance-specific DB fields.
15885    #[serde(flatten)]
15886    pub extra: serde_json::Map<String, serde_json::Value>,
15887}
15888
15889/// Message appended to the application log for an existing background job.
15890#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15891pub struct JobLogCreate {
15892    /// Log message.
15893    #[serde(rename = "logMessage", deserialize_with = "crate::lenient::string")]
15894    pub log_message: String,
15895    /// Fields not described by the spec, e.g. instance-specific DB fields.
15896    #[serde(flatten)]
15897    pub extra: serde_json::Map<String, serde_json::Value>,
15898}
15899
15900/// One diagnostic entry produced by a background or bulk job. elementId and elementName identify the job element, whose domain depends on the job.
15901#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15902pub struct JobLogEntry {
15903    /// Identifier of the processed element.
15904    #[serde(rename = "elementId", deserialize_with = "crate::lenient::number")]
15905    pub element_id: i64,
15906    /// Display name recorded for the processed element.
15907    #[serde(rename = "elementName", deserialize_with = "crate::lenient::string")]
15908    pub element_name: String,
15909    /// Source filename recorded with the diagnostic.
15910    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15911    pub file: Option<String>,
15912    /// Source line recorded with the diagnostic.
15913    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
15914    pub line: Option<i64>,
15915    /// Diagnostic text produced by the job; may be localized.
15916    #[serde(deserialize_with = "crate::lenient::string")]
15917    pub message: String,
15918    /// Fields not described by the spec, e.g. instance-specific DB fields.
15919    #[serde(flatten)]
15920    pub extra: serde_json::Map<String, serde_json::Value>,
15921}
15922
15923/// Assigns a stored job status and emits the status-change event. It does not enqueue, interrupt or restart a worker.
15924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15925pub struct JobStatusUpdate {
15926    /// Marks the status change as manual.
15927    #[serde(default, skip_serializing_if = "Option::is_none")]
15928    pub manual: Option<bool>,
15929    /// Stored background-job status. The status-update endpoint accepts all values; the list filter accepts only `IN_PROGRESS`, `DONE`, and `ERROR`.
15930    /// Allowed values: `CANCELED`, `DONE`, `ERROR`, `IN_PROGRESS`, `QUEUED`.
15931    #[serde(deserialize_with = "crate::lenient::string")]
15932    pub status: String,
15933    /// Fields not described by the spec, e.g. instance-specific DB fields.
15934    #[serde(flatten)]
15935    pub extra: serde_json::Map<String, serde_json::Value>,
15936}
15937
15938/// Creates an address-label PDF for the selected visible persons. Uses stored person fields and relationship data at generation time.
15939#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15940pub struct LabelCreate {
15941    /// Combine selected visible spouses linked by relationship type 2 into one label. Their addresses need not match. Birthday sorting always disables this option.
15942    #[serde(rename = "combineSpouses", default, skip_serializing_if = "Option::is_none")]
15943    pub combine_spouses: Option<bool>,
15944    /// Selected person IDs. Prefer an array of integers; legacy comma-separated strings and a single integer are also accepted. Duplicate IDs do not duplicate labels. Empty selection yields no persons; nonexistent or invisible persons are omitted.
15945    #[serde(rename = "personIds", default, skip_serializing_if = "serde_json::Value::is_null")]
15946    pub person_ids: serde_json::Value,
15947    /// name sorts by surname/given name; postal by country/postal code/street/name; birthday by month/day/year/name. Birthday sorting forces separate labels. Unrecognized values currently retain initial name order.
15948    /// Allowed values: `birthday`, `name`, `postal`.
15949    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
15950    pub sortpolicy: Option<String>,
15951    /// A4 sheet layout: Avery3475 has 24 labels (70×36 mm), Herma4425 has 10 (105×57 mm), Herma4677 has 21 (63.5×38.1 mm).
15952    /// Allowed values: `AveryLabels3475`, `HermaLabels4425`, `HermaLabels4677`.
15953    #[serde(deserialize_with = "crate::lenient::string")]
15954    pub r#type: String,
15955    /// Fields not described by the spec, e.g. instance-specific DB fields.
15956    #[serde(flatten)]
15957    pub extra: serde_json::Map<String, serde_json::Value>,
15958}
15959
15960#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15961pub struct LabelTotals {
15962    /// Counts regardless of missing address fields; PDF generation uses this population.
15963    #[serde(rename = "ignoreAddress")]
15964    pub ignore_address: LabelTotalsIgnoreAddress,
15965    /// Counts requiring nonempty street, postal code and city after optional spouse grouping. Completeness uses stored fields, not the requesting user’s field-level visibility.
15966    #[serde(rename = "onlyCompleteAddress")]
15967    pub only_complete_address: LabelTotalsOnlyCompleteAddress,
15968    /// Fields not described by the spec, e.g. instance-specific DB fields.
15969    #[serde(flatten)]
15970    pub extra: serde_json::Map<String, serde_json::Value>,
15971}
15972
15973/// Counts regardless of missing address fields; PDF generation uses this population.
15974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15975pub struct LabelTotalsIgnoreAddress {
15976    /// Count after combining selected visible spouses. It is the resulting label count, not the number of couples.
15977    #[serde(rename = "combinedLabels", deserialize_with = "crate::lenient::number")]
15978    pub combined_labels: i64,
15979    /// Count with one label per visible selected person.
15980    #[serde(rename = "totalLabels", deserialize_with = "crate::lenient::number")]
15981    pub total_labels: i64,
15982    /// Fields not described by the spec, e.g. instance-specific DB fields.
15983    #[serde(flatten)]
15984    pub extra: serde_json::Map<String, serde_json::Value>,
15985}
15986
15987/// Counts requiring nonempty street, postal code and city after optional spouse grouping. Completeness uses stored fields, not the requesting user’s field-level visibility.
15988#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
15989pub struct LabelTotalsOnlyCompleteAddress {
15990    /// Count after combining selected visible spouses. It is the resulting label count, not the number of couples.
15991    #[serde(rename = "combinedLabels", deserialize_with = "crate::lenient::number")]
15992    pub combined_labels: i64,
15993    /// Count with one label per visible selected person.
15994    #[serde(rename = "totalLabels", deserialize_with = "crate::lenient::number")]
15995    pub total_labels: i64,
15996    /// Fields not described by the spec, e.g. instance-specific DB fields.
15997    #[serde(flatten)]
15998    pub extra: serde_json::Map<String, serde_json::Value>,
15999}
16000
16001/// Read-only count request for address labels.
16002#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16003pub struct LabelTotalsRequest {
16004    /// Selected person IDs. Prefer an array of integers; legacy comma-separated strings and a single integer are also accepted. Duplicate IDs do not duplicate labels. Empty selection yields no persons; nonexistent or invisible persons are omitted.
16005    #[serde(rename = "personIds", default, skip_serializing_if = "serde_json::Value::is_null")]
16006    pub person_ids: serde_json::Value,
16007    /// Fields not described by the spec, e.g. instance-specific DB fields.
16008    #[serde(flatten)]
16009    pub extra: serde_json::Map<String, serde_json::Value>,
16010}
16011
16012#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16013pub struct Language {
16014    /// The language code is a two-letter code that represents the language. For example, "en" for English, "de" for German, and "fr" for French.
16015    /// Allowed values: `cn`, `de`, `en`, `es`, `fa`, `fi`, `fr`, `it`, `nl`, `pl`, `pt`, `ru`, `sv`, `tw`.
16016    #[serde(deserialize_with = "crate::lenient::string")]
16017    pub code: String,
16018    #[serde(deserialize_with = "crate::lenient::number")]
16019    pub id: i64,
16020    #[serde(rename = "isActive")]
16021    pub is_active: bool,
16022    #[serde(deserialize_with = "crate::lenient::string")]
16023    pub name: String,
16024    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
16025    pub sort_key: i64,
16026    /// Fields not described by the spec, e.g. instance-specific DB fields.
16027    #[serde(flatten)]
16028    pub extra: serde_json::Map<String, serde_json::Value>,
16029}
16030
16031/// Deprecated raw cc_file database row with an added download URL. Numeric/boolean columns are strings, date columns use SQL datetime strings, JSON columns remain JSON text. SELECT * can expose further database columns as the schema evolves; use CtFile through /files/{id}/meta for a stable normalized contract.
16032#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16033pub struct LegacyFileMetadata {
16034    /// Raw database boolean flag (0 or 1 as string).
16035    /// Allowed values: `0`, `1`.
16036    #[serde(deserialize_with = "crate::lenient::string")]
16037    pub ai_generated_yn: String,
16038    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16039    pub annotation: Option<String>,
16040    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16041    pub annotation_link: Option<String>,
16042    #[serde(deserialize_with = "crate::lenient::string")]
16043    pub bezeichnung: String,
16044    /// Raw SQL datetime string without a timezone suffix; not the normalized ZuluDate representation.
16045    #[serde(deserialize_with = "crate::lenient::string")]
16046    pub created_date: String,
16047    /// Raw database numeric value returned as a string by the legacy connection.
16048    #[serde(deserialize_with = "crate::lenient::string")]
16049    pub created_pid: String,
16050    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16051    pub description: Option<String>,
16052    #[serde(deserialize_with = "crate::lenient::string")]
16053    pub domain_id: String,
16054    /// Raw database numeric value returned as a string by the legacy connection.
16055    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16056    pub domain_id_int: Option<String>,
16057    #[serde(deserialize_with = "crate::lenient::string")]
16058    pub domain_type: String,
16059    /// Raw SQL datetime string without a timezone suffix; not the normalized ZuluDate representation.
16060    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16061    pub expiration_date: Option<String>,
16062    /// Raw database numeric value returned as a string by the legacy connection.
16063    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16064    pub file_size_bytes: Option<String>,
16065    /// Raw storage filename/hash or URL.
16066    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16067    pub filename: Option<String>,
16068    /// Raw database numeric value returned as a string by the legacy connection.
16069    #[serde(deserialize_with = "crate::lenient::string")]
16070    pub id: String,
16071    /// JSON text stored in the database, not an expanded JSON object.
16072    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16073    pub image_metadata: Option<String>,
16074    /// JSON text stored in the database, not an expanded JSON object.
16075    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16076    pub image_options: Option<String>,
16077    /// Raw SQL datetime string without a timezone suffix; not the normalized ZuluDate representation.
16078    #[serde(deserialize_with = "crate::lenient::string")]
16079    pub modified_date: String,
16080    /// Raw database numeric value returned as a string by the legacy connection.
16081    #[serde(deserialize_with = "crate::lenient::string")]
16082    pub modified_pid: String,
16083    /// Raw database numeric value returned as a string by the legacy connection.
16084    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16085    pub securitylevel_id: Option<String>,
16086    /// Raw database boolean flag (0 or 1 as string).
16087    /// Allowed values: `0`, `1`.
16088    #[serde(deserialize_with = "crate::lenient::string")]
16089    pub showonlywheneditable_yn: String,
16090    /// Raw database numeric value returned as a string by the legacy connection.
16091    #[serde(deserialize_with = "crate::lenient::string")]
16092    pub sortkey: String,
16093    /// Legacy download query built from filename without the file ID. For URL attachments this is still a download query, not the original external URL.
16094    #[serde(deserialize_with = "crate::lenient::string")]
16095    pub url: String,
16096    /// Fields not described by the spec, e.g. instance-specific DB fields.
16097    #[serde(flatten)]
16098    pub extra: serde_json::Map<String, serde_json::Value>,
16099}
16100
16101#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16102pub struct LinkingOpenGraph {
16103    /// Allowed values: `http-error`, `success`, `timeout-short`.
16104    #[serde(rename = "fetchStatus", deserialize_with = "crate::lenient::string")]
16105    pub fetch_status: String,
16106    #[serde(deserialize_with = "crate::lenient::string")]
16107    pub url: String,
16108    #[serde(default, skip_serializing_if = "Option::is_none")]
16109    pub data: Option<LinkingOpenGraphData>,
16110    /// Allowed values: `opengraph`.
16111    #[serde(rename = "linkingType", deserialize_with = "crate::lenient::string")]
16112    pub linking_type: String,
16113    /// Fields not described by the spec, e.g. instance-specific DB fields.
16114    #[serde(flatten)]
16115    pub extra: serde_json::Map<String, serde_json::Value>,
16116}
16117
16118#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16119pub struct LinkingOpenGraphData {
16120    #[serde(default, skip_serializing_if = "Option::is_none")]
16121    pub article: Option<OpenGraphArticle>,
16122    #[serde(default, skip_serializing_if = "Option::is_none")]
16123    pub audios: Option<Vec<OpenGraphAudio>>,
16124    #[serde(default, skip_serializing_if = "Option::is_none")]
16125    pub book: Option<OpenGraphBook>,
16126    /// A brief description of the OpenGraph content.
16127    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16128    pub description: Option<String>,
16129    /// The determiner for the noun in the content.
16130    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16131    pub determiner: Option<String>,
16132    #[serde(default, skip_serializing_if = "Option::is_none")]
16133    pub images: Option<Vec<OpenGraphImage>>,
16134    /// The locale of the OpenGraph object.
16135    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16136    pub locale: Option<String>,
16137    /// Alternate locales available.
16138    #[serde(rename = "localesAlternate", default, skip_serializing_if = "Option::is_none")]
16139    pub locales_alternate: Option<Vec<String>>,
16140    #[serde(default, skip_serializing_if = "Option::is_none")]
16141    pub music: Option<OpenGraphMusic>,
16142    #[serde(default, skip_serializing_if = "Option::is_none")]
16143    pub profile: Option<OpenGraphProfile>,
16144    /// The site name of the OpenGraph object.
16145    #[serde(rename = "siteName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16146    pub site_name: Option<String>,
16147    /// The title of the OpenGraph object.
16148    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16149    pub title: Option<String>,
16150    /// The type of OpenGraph object.
16151    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16152    pub r#type: Option<String>,
16153    /// The URL of the OpenGraph object.
16154    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16155    pub url: Option<String>,
16156    #[serde(default, skip_serializing_if = "Option::is_none")]
16157    pub videos: Option<Vec<OpenGraphVideo>>,
16158    /// Fields not described by the spec, e.g. instance-specific DB fields.
16159    #[serde(flatten)]
16160    pub extra: serde_json::Map<String, serde_json::Value>,
16161}
16162
16163/// A global restriction on changing one permission selection, across assignment domains. It does not revoke existing grants. Authorized persons can still modify locked assignments.
16164#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16165pub struct LockedPermission {
16166    /// Numeric permission definition ID; locks may include group-internal (+) permissions as well as global permissions.
16167    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
16168    pub auth_id: i64,
16169    /// Concrete data selection, -1 to lock all selections, or null for a boolean permission. The repository always returns this field.
16170    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
16171    pub data_id: Option<i64>,
16172    /// Fields not described by the spec, e.g. instance-specific DB fields.
16173    #[serde(flatten)]
16174    pub extra: serde_json::Map<String, serde_json::Value>,
16175}
16176
16177/// Permission selection to lock or unlock. dataId may be omitted for boolean permissions; selectable permissions require a non-null integer.
16178#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16179pub struct LockedPermissionChange {
16180    /// Numeric permission definition ID; locks may include group-internal (+) permissions as well as global permissions.
16181    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
16182    pub auth_id: i64,
16183    /// Omit or use null for a boolean permission. For a selectable permission provide a concrete ID or -1 for all selections. Selection existence/range is currently not validated; do not send the internal storage sentinel -2147483648.
16184    ///
16185    /// `None` leaves the field out, `Some(None)` sends `null`.
16186    #[serde(rename = "dataId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16187    pub data_id: Option<Option<i64>>,
16188    /// Fields not described by the spec, e.g. instance-specific DB fields.
16189    #[serde(flatten)]
16190    pub extra: serde_json::Map<String, serde_json::Value>,
16191}
16192
16193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16194pub struct LockedPermissionState {
16195    /// Whether the current person belongs to the installation’s authorized contact-person list. This is distinct from permission-administration rights.
16196    #[serde(rename = "isCurrentUserAuthorizedPerson")]
16197    pub is_current_user_authorized_person: bool,
16198    /// All stored locks ordered by authId and dataId, including any locks for inactive or obsolete definitions.
16199    pub permissions: Vec<LockedPermission>,
16200    /// Fields not described by the spec, e.g. instance-specific DB fields.
16201    #[serde(flatten)]
16202    pub extra: serde_json::Map<String, serde_json::Value>,
16203}
16204
16205/// Atomic additions/removals, not replacement of the full lock list. Both lists are required; empty lists are valid.
16206#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16207pub struct LockedPermissionUpdate {
16208    /// Locks to add. Duplicates are collapsed and existing rows are retained.
16209    pub add: Vec<LockedPermissionChange>,
16210    /// Exact locks to remove. Missing rows are ignored. Removing -1 does not remove separate concrete-value locks.
16211    pub remove: Vec<LockedPermissionChange>,
16212    /// Fields not described by the spec, e.g. instance-specific DB fields.
16213    #[serde(flatten)]
16214    pub extra: serde_json::Map<String, serde_json::Value>,
16215}
16216
16217/// ChurchTools writes log messages for many events and changes. This can be an update for a person or the deletion of an event. You can use the log to debug your system and follow error messages. This is a versitile tool.
16218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16219pub struct Log {
16220    /// Timestamp of log
16221    #[serde(serialize_with = "crate::datetime::serialize_utc")]
16222    pub date: chrono::DateTime<chrono::Utc>,
16223    /// Analog to the domain type, the ID is the explicit resource.
16224    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
16225    pub domain_id: i64,
16226    /// The domain type tells us, where in ChurchTools the action was performed.
16227    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
16228    pub domain_type: String,
16229    #[serde(deserialize_with = "crate::lenient::number")]
16230    pub id: i64,
16231    /// The log level indicates the importance. 1 = Warning, 2 = Notice, 3 = Info.
16232    #[serde(deserialize_with = "crate::lenient::number")]
16233    pub level: i64,
16234    #[serde(deserialize_with = "crate::lenient::string")]
16235    pub message: String,
16236    #[serde(default, skip_serializing_if = "Option::is_none")]
16237    pub person: Option<DomainObjectPerson>,
16238    /// If the person ID is `-1`, that means, no person but the system itself has logged that message.
16239    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
16240    pub person_id: i64,
16241    /// The name of the person, who caused the log message. This is stored in the log, because the person could be deleted later. So we have the name in the log, even if the person is deleted.
16242    #[serde(rename = "personName", deserialize_with = "crate::lenient::string")]
16243    pub person_name: String,
16244    #[serde(rename = "simulatePerson", default, skip_serializing_if = "Option::is_none")]
16245    pub simulate_person: Option<DomainObjectPerson>,
16246    /// If a person is simulated by an administrator, we log the personId as well. This makes it possible to see if a person did the action or an admin, who simulated that person.
16247    #[serde(rename = "simulatePersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
16248    pub simulate_person_id: Option<i64>,
16249    /// Fields not described by the spec, e.g. instance-specific DB fields.
16250    #[serde(flatten)]
16251    pub extra: serde_json::Map<String, serde_json::Value>,
16252}
16253
16254/// Password credentials. The same username may be a ChurchTools login name or an email address. LDAP is tried first when configured, followed by local authentication.
16255#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16256pub struct LoginCreate {
16257    /// Account password; preserve spaces exactly.
16258    #[serde(deserialize_with = "crate::lenient::string")]
16259    pub password: String,
16260    /// Login name or email address.
16261    #[serde(deserialize_with = "crate::lenient::string")]
16262    pub username: String,
16263    /// Request persistent browser login.
16264    ///
16265    /// `None` leaves the field out, `Some(None)` sends `null`.
16266    #[serde(rename = "rememberMe", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16267    pub remember_me: Option<Option<bool>>,
16268    /// Fields not described by the spec, e.g. instance-specific DB fields.
16269    #[serde(flatten)]
16270    pub extra: serde_json::Map<String, serde_json::Value>,
16271}
16272
16273/// Password credentials. The same username may be a ChurchTools login name or an email address. LDAP is tried first when configured, followed by local authentication.
16274#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16275pub struct LoginCredentials {
16276    /// Account password; preserve spaces exactly.
16277    #[serde(deserialize_with = "crate::lenient::string")]
16278    pub password: String,
16279    /// Login name or email address.
16280    #[serde(deserialize_with = "crate::lenient::string")]
16281    pub username: String,
16282    /// Fields not described by the spec, e.g. instance-specific DB fields.
16283    #[serde(flatten)]
16284    pub extra: serde_json::Map<String, serde_json::Value>,
16285}
16286
16287/// Result of the password step. Only success completes the login; totp and twoFactorSetup require further requests using the same browser session.
16288#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16289pub struct LoginResult {
16290    /// Suggested navigation location. Pending TOTP uses ?q=twofactor and pending setup uses ?q=twofactorforce. Normal login may return a relative or absolute location, or null.
16291    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16292    pub location: Option<String>,
16293    /// Human-readable status text; success is localized, while pending two-factor messages are currently fixed English text. Use status for branching.
16294    #[serde(deserialize_with = "crate::lenient::string")]
16295    pub message: String,
16296    /// Authenticated person ID, also returned before two-factor verification. Pass it to the TOTP step.
16297    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
16298    pub person_id: i64,
16299    /// success: session login completed; totp: submit /login/totp; twoFactorSetup: initialize and activate /login/twofactor/setup.
16300    /// Allowed values: `success`, `totp`, `twoFactorSetup`.
16301    #[serde(deserialize_with = "crate::lenient::string")]
16302    pub status: String,
16303    /// Fields not described by the spec, e.g. instance-specific DB fields.
16304    #[serde(flatten)]
16305    pub extra: serde_json::Map<String, serde_json::Value>,
16306}
16307
16308/// Persistent person login token. A previously issued token is reused rather than rotated by this endpoint.
16309#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16310pub struct LoginTokenResult {
16311    /// Person authenticated by the supplied credentials.
16312    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
16313    pub person_id: i64,
16314    /// Sensitive, persistent credential. Send as Authorization: Login  on API requests; this is not an OAuth Bearer token. Logout does not revoke it.
16315    #[serde(deserialize_with = "crate::lenient::string")]
16316    pub token: String,
16317    /// Fields not described by the spec, e.g. instance-specific DB fields.
16318    #[serde(flatten)]
16319    pub extra: serde_json::Map<String, serde_json::Value>,
16320}
16321
16322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16323pub struct LoginTotpVerify {
16324    /// Six-digit current authenticator code. Send it as a string to preserve leading zeroes. A code already accepted recently for this person cannot be reused.
16325    #[serde(deserialize_with = "crate::lenient::string")]
16326    pub code: String,
16327    /// Person ID from the password step; must match the pending two-factor session.
16328    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
16329    pub person_id: i64,
16330    /// Fields not described by the spec, e.g. instance-specific DB fields.
16331    #[serde(flatten)]
16332    pub extra: serde_json::Map<String, serde_json::Value>,
16333}
16334
16335/// Schema for validating markdown conversion requests
16336#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16337pub struct MarkdownRequest {
16338    /// Global options for all sources
16339    #[serde(default, skip_serializing_if = "Option::is_none")]
16340    pub options: Option<MarkdownRequestOptions>,
16341    pub sources: Vec<MarkdownRequestSourcesItem>,
16342    /// Fields not described by the spec, e.g. instance-specific DB fields.
16343    #[serde(flatten)]
16344    pub extra: serde_json::Map<String, serde_json::Value>,
16345}
16346
16347/// Global options for all sources
16348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16349pub struct MarkdownRequestOptions {
16350    #[serde(rename = "commonLanguage", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16351    pub common_language: Option<String>,
16352    /// Allowed values: `description`, `document`, `plaintext`, `richline`.
16353    #[serde(rename = "defaultOutputScope", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16354    pub default_output_scope: Option<String>,
16355    /// Fields not described by the spec, e.g. instance-specific DB fields.
16356    #[serde(flatten)]
16357    pub extra: serde_json::Map<String, serde_json::Value>,
16358}
16359
16360#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16361pub struct MarkdownRequestSourcesItem {
16362    /// The scope of the input content
16363    /// Allowed values: `description`, `document`, `plaintext`, `richline`.
16364    #[serde(rename = "inputScope", deserialize_with = "crate::lenient::string")]
16365    pub input_scope: String,
16366    /// The markdown content to be processed
16367    #[serde(deserialize_with = "crate::lenient::string")]
16368    pub markdown: String,
16369    /// Additional processing options
16370    #[serde(default, skip_serializing_if = "Option::is_none")]
16371    pub options: Option<MarkdownRequestSourcesItemOptions>,
16372    /// List of output formats for the processed markdown content
16373    /// Allowed values: `html`, `md`, `xml`.
16374    #[serde(rename = "outputFormats")]
16375    pub output_formats: Vec<String>,
16376    /// List of scopes for the output content
16377    /// Allowed values: `description`, `document`, `plaintext`, `richline`.
16378    #[serde(rename = "outputScopes")]
16379    pub output_scopes: Vec<String>,
16380    /// A short identifier for the source
16381    #[serde(rename = "shortName", deserialize_with = "crate::lenient::string")]
16382    pub short_name: String,
16383    /// Fields not described by the spec, e.g. instance-specific DB fields.
16384    #[serde(flatten)]
16385    pub extra: serde_json::Map<String, serde_json::Value>,
16386}
16387
16388/// Additional processing options
16389#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16390pub struct MarkdownRequestSourcesItemOptions {
16391    #[serde(rename = "allowHtml", default, skip_serializing_if = "Option::is_none")]
16392    pub allow_html: Option<bool>,
16393    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16394    pub language: Option<String>,
16395    #[serde(rename = "maxLength", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
16396    pub max_length: Option<i64>,
16397    /// Fields not described by the spec, e.g. instance-specific DB fields.
16398    #[serde(flatten)]
16399    pub extra: serde_json::Map<String, serde_json::Value>,
16400}
16401
16402/// Invitation of one person to the stored calendar appointment/series. The response state applies to that request, not to an individual occurrence. Meeting invitations are separate from registration groups and service assignments.
16403#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16404pub struct MeetingRequest {
16405    /// Use `state` instead
16406    #[serde(default, skip_serializing_if = "Option::is_none")]
16407    #[deprecated = "Use `state` instead"]
16408    pub accepted: Option<bool>,
16409    /// Stored calendar appointment defining a single occurrence or a series. id identifies the whole stored appointment; pair it with a local occurrence start date to address a particular occurrence. startDate/endDate are the base occurrence, not necessarily the occurrence currently being displayed. Service-planning events, registration groups, bookings and meeting requests are separate linked resources.
16410    pub appointment: AppointmentBase,
16411    /// Use `appointment` instead
16412    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
16413    #[deprecated = "Use `appointment` instead"]
16414    pub appointment_id: Option<i64>,
16415    /// Start of the stored appointment or series, not necessarily its next occurrence. Use nextStartDate when available.
16416    #[serde(rename = "eventDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16417    #[deprecated = "Use nextStartDate when available."]
16418    pub event_date: Option<chrono::DateTime<chrono::Utc>>,
16419    /// ID of this meeting request.
16420    #[serde(deserialize_with = "crate::lenient::number")]
16421    pub id: i64,
16422    /// Person invited to the appointment.
16423    pub invitee: MeetingRequestInvitee,
16424    /// Person issuing the invitation, derived from onBehalfOfPid when set or the user creating the request.
16425    pub inviter: MeetingRequestInviter,
16426    /// When the invitation mail was sent, or null.
16427    #[serde(rename = "mailSendDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16428    pub mail_send_date: Option<chrono::DateTime<chrono::Utc>>,
16429    pub meta: MetaDataEntityId,
16430    /// Next end date when populated by the calling workflow; may be null.
16431    #[serde(rename = "nextEndDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16432    pub next_end_date: Option<chrono::DateTime<chrono::Utc>>,
16433    /// Next start date when populated by the calling workflow; may be null.
16434    #[serde(rename = "nextStartDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16435    pub next_start_date: Option<chrono::DateTime<chrono::Utc>>,
16436    /// Use `invitee` instead
16437    #[serde(default, skip_serializing_if = "Option::is_none")]
16438    #[deprecated = "Use `invitee` instead"]
16439    pub person: Option<MeetingRequestPerson>,
16440    /// When the invitee last responded, or null.
16441    #[serde(rename = "responseDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16442    pub response_date: Option<chrono::DateTime<chrono::Utc>>,
16443    /// Response state: pending awaits an answer, accepted confirms attendance, declined refuses, tentative is undecided.
16444    /// Allowed values: `accepted`, `declined`, `pending`, `tentative`.
16445    #[serde(deserialize_with = "crate::lenient::string")]
16446    pub state: String,
16447    /// Fields not described by the spec, e.g. instance-specific DB fields.
16448    #[serde(flatten)]
16449    pub extra: serde_json::Map<String, serde_json::Value>,
16450}
16451
16452/// One visible candidate for an appointment invitation. A person can appear through multiple sources; use person.domainIdentifier when selecting invitees.
16453#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16454pub struct MeetingRequestCandidate {
16455    /// Source group name for groupMember candidates; null for other sources.
16456    #[serde(rename = "groupName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16457    pub group_name: Option<String>,
16458    /// Source group type name for groupTypeMember candidates; null for other sources.
16459    #[serde(rename = "groupTypeName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16460    pub group_type_name: Option<String>,
16461    /// Whether an email address is recorded; this does not confirm email delivery.
16462    #[serde(rename = "hasEmail")]
16463    pub has_email: bool,
16464    /// Person as Domain Object
16465    pub person: DomainObjectPerson,
16466    /// Source person status name for personStatus candidates; null for other sources.
16467    #[serde(rename = "personStatusName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16468    pub person_status_name: Option<String>,
16469    /// Candidate source: direct calendar permission, person status, group membership, group type membership, or an existing invitation.
16470    /// Allowed values: `groupMember`, `groupTypeMember`, `meetingRequest`, `person`, `personStatus`.
16471    #[serde(deserialize_with = "crate::lenient::string")]
16472    pub r#type: String,
16473    /// Fields not described by the spec, e.g. instance-specific DB fields.
16474    #[serde(flatten)]
16475    pub extra: serde_json::Map<String, serde_json::Value>,
16476}
16477
16478/// Invite one person to a calendar appointment or series.
16479#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16480pub struct MeetingRequestCreate {
16481    /// ID of the person to invite.
16482    #[serde(rename = "inviteeId", deserialize_with = "crate::lenient::number")]
16483    pub invitee_id: i64,
16484    /// Fields not described by the spec, e.g. instance-specific DB fields.
16485    #[serde(flatten)]
16486    pub extra: serde_json::Map<String, serde_json::Value>,
16487}
16488
16489/// Reply forwarded by the external calendar-mail processor. The token alone identifies and authorizes one invitation; partstat is supplied separately from the ICS payload.
16490#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16491pub struct MeetingRequestIcsReply {
16492    /// Raw ICS reply used to compare appointment scope.
16493    #[serde(rename = "icsContent", deserialize_with = "crate::lenient::string")]
16494    pub ics_content: String,
16495    /// Participation status supplied by the calendar-mail processor.
16496    /// Allowed values: `ACCEPTED`, `DECLINED`, `TENTATIVE`.
16497    #[serde(deserialize_with = "crate::lenient::string")]
16498    pub partstat: String,
16499    /// Reply token embedded in the invitation. Must exist in the meetingrequest_reply domain and remain valid. It is not consumed by this request.
16500    #[serde(deserialize_with = "crate::lenient::string")]
16501    pub token: String,
16502    /// Fields not described by the spec, e.g. instance-specific DB fields.
16503    #[serde(flatten)]
16504    pub extra: serde_json::Map<String, serde_json::Value>,
16505}
16506
16507/// Person invited to the appointment.
16508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16509pub struct MeetingRequestInvitee {
16510    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
16511    pub api_url: String,
16512    /// Optional display color.
16513    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
16514    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
16515    pub color: serde_json::Value,
16516    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
16517    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
16518    pub domain_identifier: String,
16519    /// Optional image URL.
16520    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16521    pub image_url: Option<String>,
16522    pub infos: Vec<String>,
16523    /// Optional initials for an avatar fallback.
16524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16525    pub initials: Option<String>,
16526    /// Display title of the referenced object.
16527    #[serde(deserialize_with = "crate::lenient::string")]
16528    pub title: String,
16529    #[serde(rename = "domainAttributes")]
16530    pub domain_attributes: DomainObjectPersonDomainAttributes,
16531    /// Allowed values: `person`.
16532    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
16533    pub domain_type: String,
16534    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
16535    pub frontend_url: String,
16536    /// user for an ordinary person; user-shield for a censored person placeholder.
16537    /// Allowed values: `user`, `user-shield`.
16538    #[serde(deserialize_with = "crate::lenient::string")]
16539    pub icon: String,
16540    /// Fields not described by the spec, e.g. instance-specific DB fields.
16541    #[serde(flatten)]
16542    pub extra: serde_json::Map<String, serde_json::Value>,
16543}
16544
16545/// Person issuing the invitation, derived from onBehalfOfPid when set or the user creating the request.
16546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16547pub struct MeetingRequestInviter {
16548    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
16549    pub api_url: String,
16550    /// Optional display color.
16551    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
16552    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
16553    pub color: serde_json::Value,
16554    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
16555    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
16556    pub domain_identifier: String,
16557    /// Optional image URL.
16558    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16559    pub image_url: Option<String>,
16560    pub infos: Vec<String>,
16561    /// Optional initials for an avatar fallback.
16562    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16563    pub initials: Option<String>,
16564    /// Display title of the referenced object.
16565    #[serde(deserialize_with = "crate::lenient::string")]
16566    pub title: String,
16567    #[serde(rename = "domainAttributes")]
16568    pub domain_attributes: DomainObjectPersonDomainAttributes,
16569    /// Allowed values: `person`.
16570    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
16571    pub domain_type: String,
16572    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
16573    pub frontend_url: String,
16574    /// user for an ordinary person; user-shield for a censored person placeholder.
16575    /// Allowed values: `user`, `user-shield`.
16576    #[serde(deserialize_with = "crate::lenient::string")]
16577    pub icon: String,
16578    /// Fields not described by the spec, e.g. instance-specific DB fields.
16579    #[serde(flatten)]
16580    pub extra: serde_json::Map<String, serde_json::Value>,
16581}
16582
16583/// Use `invitee` instead
16584#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16585pub struct MeetingRequestPerson {
16586    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::string")]
16587    pub api_url: String,
16588    /// Optional display color.
16589    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
16590    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
16591    pub color: serde_json::Value,
16592    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
16593    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
16594    pub domain_identifier: String,
16595    /// Optional image URL.
16596    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16597    pub image_url: Option<String>,
16598    pub infos: Vec<String>,
16599    /// Optional initials for an avatar fallback.
16600    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16601    pub initials: Option<String>,
16602    /// Display title of the referenced object.
16603    #[serde(deserialize_with = "crate::lenient::string")]
16604    pub title: String,
16605    #[serde(rename = "domainAttributes")]
16606    pub domain_attributes: DomainObjectPersonDomainAttributes,
16607    /// Allowed values: `person`.
16608    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
16609    pub domain_type: String,
16610    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
16611    pub frontend_url: String,
16612    /// user for an ordinary person; user-shield for a censored person placeholder.
16613    /// Allowed values: `user`, `user-shield`.
16614    #[serde(deserialize_with = "crate::lenient::string")]
16615    pub icon: String,
16616    /// Fields not described by the spec, e.g. instance-specific DB fields.
16617    #[serde(flatten)]
16618    pub extra: serde_json::Map<String, serde_json::Value>,
16619}
16620
16621/// Answer a meeting request as its invitee. This updates the series-level invitation response.
16622#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16623pub struct MeetingRequestUpdate {
16624    /// Answer accepted by meeting-request response endpoints.
16625    /// Allowed values: `accept`, `decline`, `maybe`, `reset`, `tentative`.
16626    #[serde(deserialize_with = "crate::lenient::string")]
16627    pub answer: String,
16628    /// Fields not described by the spec, e.g. instance-specific DB fields.
16629    #[serde(flatten)]
16630    pub extra: serde_json::Map<String, serde_json::Value>,
16631}
16632
16633/// Reusable feedback form for group meetings. A group selects a template through settings.groupMeeting.templateId. The template defines form fields; a meeting's pollResult contains fields with the recorded answers. A template is not a meeting date, calendar event or attendance list.
16634#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16635pub struct MeetingTemplate {
16636    /// Name used to select this feedback template in group settings.
16637    #[serde(deserialize_with = "crate::lenient::string")]
16638    pub name: String,
16639    /// Ordered feedback fields and section headings. An empty array defines a form with no fields.
16640    pub template: Vec<MeetingTemplateField>,
16641    /// ID referenced by settings.groupMeeting.templateId on a group.
16642    #[serde(deserialize_with = "crate::lenient::number")]
16643    pub id: i64,
16644    /// Creation and modification timestamps and person IDs for the template.
16645    pub meta: MeetingTemplateMeta,
16646    /// Fields not described by the spec, e.g. instance-specific DB fields.
16647    #[serde(flatten)]
16648    pub extra: serde_json::Map<String, serde_json::Value>,
16649}
16650
16651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16652pub struct MeetingTemplateCreate {
16653    /// Name used to select this feedback template in group settings.
16654    #[serde(deserialize_with = "crate::lenient::string")]
16655    pub name: String,
16656    /// Ordered feedback fields and section headings. An empty array defines a form with no fields.
16657    pub template: Vec<MeetingTemplateField>,
16658    /// Fields not described by the spec, e.g. instance-specific DB fields.
16659    #[serde(flatten)]
16660    pub extra: serde_json::Map<String, serde_json::Value>,
16661}
16662
16663#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16664pub struct MeetingTemplateField {
16665    /// Visible field label, or section heading for caption fields.
16666    #[serde(deserialize_with = "crate::lenient::string")]
16667    pub label: String,
16668    /// Only applicable to select fields, where it is required and non-empty. Strings contain comma-separated legacy options.
16669    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
16670    pub options: serde_json::Value,
16671    /// Form control: input for a single line, textarea for multiple lines, checkbox for a check box, select for an option list, color for a color selection, or caption for a section heading without an answer field.
16672    /// Allowed values: `caption`, `checkbox`, `color`, `input`, `select`, `textarea`.
16673    #[serde(deserialize_with = "crate::lenient::string")]
16674    pub r#type: String,
16675    /// Initial field value in a template, or the recorded answer in a meeting's pollResult. Template write requests accept non-blank text when a value is supplied; omit it to leave the field without an initial value.
16676    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16677    pub value: Option<String>,
16678    /// Fields not described by the spec, e.g. instance-specific DB fields.
16679    #[serde(flatten)]
16680    pub extra: serde_json::Map<String, serde_json::Value>,
16681}
16682
16683/// Creation and modification timestamps and person IDs for the template.
16684#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16685pub struct MeetingTemplateMeta {
16686    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
16687    #[serde(rename = "createdDate", serialize_with = "crate::datetime::serialize_utc")]
16688    pub created_date: chrono::DateTime<chrono::Utc>,
16689    #[serde(rename = "createdPerson")]
16690    pub created_person: MetaDataPersonId,
16691    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
16692    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
16693    pub modified_date: chrono::DateTime<chrono::Utc>,
16694    #[serde(rename = "modifiedPerson")]
16695    pub modified_person: MetaDataPersonId,
16696    /// Fields not described by the spec, e.g. instance-specific DB fields.
16697    #[serde(flatten)]
16698    pub extra: serde_json::Map<String, serde_json::Value>,
16699}
16700
16701/// A role definition and a limited preview of its active, visible group members. Roles without matching members have an empty members array.
16702#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16703pub struct MemberPreview {
16704    /// Members selected for this role, limited by members_per_role. Entries omit fields, personFields and optional newsletter/tag enrichments.
16705    pub members: Vec<GroupMember>,
16706    /// Role definition for the group type. Its id matches groupTypeRoleId on each member.
16707    pub role: MemberPreviewRole,
16708    /// Fields not described by the spec, e.g. instance-specific DB fields.
16709    #[serde(flatten)]
16710    pub extra: serde_json::Map<String, serde_json::Value>,
16711}
16712
16713/// Role definition for the group type. Its id matches groupTypeRoleId on each member.
16714#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16715pub struct MemberPreviewRole {
16716    /// ID of the group type this role belongs to. Discover group types with GET /group/grouptypes.
16717    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
16718    pub group_type_id: i64,
16719    /// ID of the growth path associated with this role, or null for no association. Growth paths track steps in a person's development in ChurchTools.
16720    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
16721    pub grow_path_id: Option<i64>,
16722    /// Whether this is the default role for its group type. Setting this to true clears the default flag on the other roles of that type.
16723    #[serde(rename = "isDefault")]
16724    pub is_default: bool,
16725    /// Whether this role is marked as hidden for displays that exclude hidden roles, such as leader listings. Hidden roles are still returned by this endpoint; this flag is not an access permission.
16726    #[serde(rename = "isHidden")]
16727    pub is_hidden: bool,
16728    /// Legacy response field indicating whether type is leader. Use type instead; this field is not used to create or update a role.
16729    #[serde(rename = "isLeader", default, skip_serializing_if = "Option::is_none")]
16730    #[deprecated = "Use type instead; this field is not used to create or update a role."]
16731    pub is_leader: Option<bool>,
16732    /// Stored name of the role. Use nameTranslated from the response for a localized display name.
16733    #[serde(deserialize_with = "crate::lenient::string")]
16734    pub name: String,
16735    /// Abbreviated label for the role, used in compact displays.
16736    #[serde(deserialize_with = "crate::lenient::string")]
16737    pub shorty: String,
16738    /// Display order among roles. Lower values come first.
16739    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
16740    pub sort_key: i64,
16741    /// Functional classification of the role. Multiple roles with different names can share the same classification.
16742    /// Allowed values: `leader`, `participant`.
16743    #[serde(deserialize_with = "crate::lenient::string")]
16744    pub r#type: String,
16745    /// ID of this role record. For Role this identifies the group-type definition; for GroupRole it identifies the settings record for a specific group.
16746    #[serde(deserialize_with = "crate::lenient::number")]
16747    pub id: i64,
16748    /// Localized display name, translated from the stored name when a translation exists.
16749    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
16750    pub name_translated: String,
16751    /// Fields not described by the spec, e.g. instance-specific DB fields.
16752    #[serde(flatten)]
16753    pub extra: serde_json::Map<String, serde_json::Value>,
16754}
16755
16756/// Creates a membership linking the group and person from the path. All properties are optional. Defaults select the group type’s standard role and active status; active membership starts at the current time unless a start is provided.
16757#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16758pub struct MembershipCreate {
16759    /// Membership comment; surrounding whitespace is trimmed. Null or empty text clears it. Omission clears an existing comment in the legacy update path.
16760    ///
16761    /// `None` leaves the field out, `Some(None)` sends `null`.
16762    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16763    pub comment: Option<Option<String>>,
16764    /// Values keyed by numeric membership-field definition ID. Only submitted known fields are updated; unknown IDs are ignored. Null clears one field; an omitted/null fields container changes no fields. Field-specific validation applies: text up to 4000 characters, numeric values, dates, timestamps, checkbox booleans, option IDs or labels for select/radioselect, and arrays of option IDs or labels for multiselect.
16765    ///
16766    /// `None` leaves the field out, `Some(None)` sends `null`.
16767    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16768    pub fields: Option<Option<std::collections::BTreeMap<String, serde_json::Value>>>,
16769    /// New memberships default to active for omitted/null status. On legacy updates omitted/null preserves the previous status. A supplied waiting-list position can override the status to waiting.
16770    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
16771    ///
16772    /// `None` leaves the field out, `Some(None)` sends `null`.
16773    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16774    pub group_member_status: Option<Option<String>>,
16775    /// Role ID for this group type; 0 or omission selects its default role for creation. Existing memberships retain their role when 0/omitted.
16776    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
16777    pub group_type_role_id: Option<i64>,
16778    /// Skip the group-capacity check when creating the membership.
16779    #[serde(rename = "ignoreGroupFull", default, skip_serializing_if = "Option::is_none")]
16780    pub ignore_group_full: Option<bool>,
16781    /// Allow the update even when it would exceed waiting-list capacity.
16782    #[serde(rename = "ignoreWaitingListFull", default, skip_serializing_if = "Option::is_none")]
16783    pub ignore_waiting_list_full: Option<bool>,
16784    /// Whether membership-change processing should inform group leaders.
16785    #[serde(rename = "informLeader", default, skip_serializing_if = "Option::is_none")]
16786    pub inform_leader: Option<bool>,
16787    /// End date or null; omission clears an existing end date in the legacy update path.
16788    ///
16789    /// `None` leaves the field out, `Some(None)` sends `null`.
16790    #[serde(rename = "memberEndDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16791    pub member_end_date: Option<Option<chrono::NaiveDate>>,
16792    /// Date or UTC timestamp not in the future. Omitted/null defaults to now when a new membership becomes active, otherwise null. Explicit null is rejected if active is explicitly submitted. Legacy updates generally retain an existing start when omitted/null.
16793    ///
16794    /// `None` leaves the field out, `Some(None)` sends `null`.
16795    #[serde(rename = "memberStartDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16796    pub member_start_date: Option<Option<crate::DateOrDateTime>>,
16797    /// Reject with 403 if the person already belongs to the group.
16798    #[serde(default, skip_serializing_if = "Option::is_none")]
16799    pub only_add: Option<bool>,
16800    /// 0 selects the next free waiting-list position; a positive value selects that position. Supplied positions set status to waiting and can shift other positions. For creation, null/omission assigns no position. For legacy updates, null/omission preserves it and -1 removes it but also sets status to waiting; -1 on creation reaches an assertion.
16801    ///
16802    /// `None` leaves the field out, `Some(None)` sends `null`.
16803    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16804    pub waitinglist_position: Option<Option<i64>>,
16805    /// Fields not described by the spec, e.g. instance-specific DB fields.
16806    #[serde(flatten)]
16807    pub extra: serde_json::Map<String, serde_json::Value>,
16808}
16809
16810/// Partial update of an existing membership. Omitted membership properties retain their current values; explicit null clears nullable values. This changes the membership, not the underlying person record.
16811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16812pub struct MembershipUpdate {
16813    /// Membership comment; surrounding whitespace is trimmed. Null or empty text clears it.
16814    ///
16815    /// `None` leaves the field out, `Some(None)` sends `null`.
16816    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16817    pub comment: Option<Option<String>>,
16818    /// Values keyed by numeric membership-field definition ID. Only submitted known fields are updated; unknown IDs are ignored. Null clears one field; an omitted/null fields container changes no fields. Field-specific validation applies: text up to 4000 characters, numeric values, dates, timestamps, checkbox booleans, option IDs or labels for select/radioselect, and arrays of option IDs or labels for multiselect.
16819    ///
16820    /// `None` leaves the field out, `Some(None)` sends `null`.
16821    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16822    pub fields: Option<Option<std::collections::BTreeMap<String, serde_json::Value>>>,
16823    /// Target membership workflow status; omitted preserves the existing status. Explicit null is not a usable status.
16824    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
16825    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16826    pub group_member_status: Option<String>,
16827    /// Role definition ID belonging to the group type. Null resets to its default role.
16828    ///
16829    /// `None` leaves the field out, `Some(None)` sends `null`.
16830    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16831    pub group_type_role_id: Option<Option<i64>>,
16832    /// Allow the update even when it would exceed waiting-list capacity.
16833    #[serde(rename = "ignoreWaitingListFull", default, skip_serializing_if = "Option::is_none")]
16834    pub ignore_waiting_list_full: Option<bool>,
16835    /// Whether membership-change processing should inform group leaders.
16836    #[serde(rename = "informLeader", default, skip_serializing_if = "Option::is_none")]
16837    pub inform_leader: Option<bool>,
16838    /// End date or null to clear. Must not precede the resulting start date.
16839    ///
16840    /// `None` leaves the field out, `Some(None)` sends `null`.
16841    #[serde(rename = "memberEndDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16842    pub member_end_date: Option<Option<chrono::NaiveDate>>,
16843    /// Start date or UTC timestamp, not in the future. If the resulting status is active, an explicitly submitted value must not be null; omission preserves the existing value.
16844    ///
16845    /// `None` leaves the field out, `Some(None)` sends `null`.
16846    #[serde(rename = "memberStartDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16847    pub member_start_date: Option<Option<crate::DateOrDateTime>>,
16848    /// Waiting-list position; 0 selects the next free position, null removes it. Legacy -1 reaches a backend assertion and should be avoided. This PATCH does not automatically change status or shift other positions.
16849    ///
16850    /// `None` leaves the field out, `Some(None)` sends `null`.
16851    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16852    pub waitinglist_position: Option<Option<i64>>,
16853    /// Fields not described by the spec, e.g. instance-specific DB fields.
16854    #[serde(flatten)]
16855    pub extra: serde_json::Map<String, serde_json::Value>,
16856}
16857
16858#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16859pub struct MetaDataCreatedId {
16860    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
16861    #[serde(rename = "createdDate", serialize_with = "crate::datetime::serialize_utc")]
16862    pub created_date: chrono::DateTime<chrono::Utc>,
16863    #[serde(rename = "createdPerson")]
16864    pub created_person: MetaDataPersonId,
16865    /// Fields not described by the spec, e.g. instance-specific DB fields.
16866    #[serde(flatten)]
16867    pub extra: serde_json::Map<String, serde_json::Value>,
16868}
16869
16870#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16871pub struct MetaDataEntityId {
16872    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
16873    #[serde(rename = "createdDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16874    pub created_date: Option<chrono::DateTime<chrono::Utc>>,
16875    #[serde(rename = "createdPerson", default, skip_serializing_if = "Option::is_none")]
16876    pub created_person: Option<MetaDataPersonId>,
16877    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
16878    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16879    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
16880    #[serde(rename = "modifiedPerson", default, skip_serializing_if = "Option::is_none")]
16881    pub modified_person: Option<MetaDataPersonId>,
16882    /// Fields not described by the spec, e.g. instance-specific DB fields.
16883    #[serde(flatten)]
16884    pub extra: serde_json::Map<String, serde_json::Value>,
16885}
16886
16887#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16888pub struct MetaDataEntityPerson {
16889    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
16890    #[serde(rename = "createdDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16891    pub created_date: Option<chrono::DateTime<chrono::Utc>>,
16892    #[serde(rename = "createdPerson", default, skip_serializing_if = "Option::is_none")]
16893    pub created_person: Option<DomainObjectPerson>,
16894    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
16895    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
16896    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
16897    #[serde(rename = "modifiedPerson", default, skip_serializing_if = "Option::is_none")]
16898    pub modified_person: Option<DomainObjectPerson>,
16899    /// Fields not described by the spec, e.g. instance-specific DB fields.
16900    #[serde(flatten)]
16901    pub extra: serde_json::Map<String, serde_json::Value>,
16902}
16903
16904#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16905pub struct MetaDataPersonId {
16906    #[serde(deserialize_with = "crate::lenient::number")]
16907    pub id: i64,
16908    /// Fields not described by the spec, e.g. instance-specific DB fields.
16909    #[serde(flatten)]
16910    pub extra: serde_json::Map<String, serde_json::Value>,
16911}
16912
16913/// Proposed booking field. Values are serialized as strings even for IDs, amounts, dates and booleans.
16914#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16915pub struct MovementSuggestion {
16916    /// Included only with include\[\]=bills. Suggestions other than the bills marker receive an empty array.
16917    #[serde(default, skip_serializing_if = "Option::is_none")]
16918    pub bills: Option<Vec<Bill>>,
16919    /// Generator confidence used to choose between suggestions. Manual changes and user rules use 100.
16920    #[serde(deserialize_with = "crate::lenient::number")]
16921    pub confidence: i64,
16922    #[serde(deserialize_with = "crate::lenient::number")]
16923    pub id: i64,
16924    /// Booking field name, such as accountId, contraAccountId, amount, documentDate, documentNumber, costCenterId or bills.
16925    #[serde(deserialize_with = "crate::lenient::string")]
16926    pub name: String,
16927    /// Generator origin, such as import, user, transaction_details or user_rule-. User-rule IDs are appended to the reason; it is not a closed enum.
16928    #[serde(deserialize_with = "crate::lenient::string")]
16929    pub reason: String,
16930    /// Groups fields belonging to one split child. Null identifies global fields.
16931    #[serde(rename = "splitKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
16932    pub split_key: Option<i64>,
16933    /// Whether the value was manually created or changed.
16934    #[serde(rename = "userOverwrite")]
16935    pub user_overwrite: bool,
16936    /// String representation of the suggested value. The bills field acts as a marker for attached documents.
16937    #[serde(deserialize_with = "crate::lenient::string")]
16938    pub value: String,
16939    /// Fields not described by the spec, e.g. instance-specific DB fields.
16940    #[serde(flatten)]
16941    pub extra: serde_json::Map<String, serde_json::Value>,
16942}
16943
16944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16945pub struct MovementSuggestionUpdate {
16946    /// Field to add or modify. Existing entries are matched by name and splitKey.
16947    #[serde(deserialize_with = "crate::lenient::string")]
16948    pub name: String,
16949    /// Split-child key, or null/omitted for a global suggestion. Requires the split-booking feature when non-null.
16950    ///
16951    /// `None` leaves the field out, `Some(None)` sends `null`.
16952    #[serde(rename = "splitKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
16953    pub split_key: Option<Option<i64>>,
16954    /// String value; an empty string removes a matching suggestion. Dates use YYYY-MM-DD, amounts use minor units, IDs use decimal strings, booleans use true/false strings.
16955    #[serde(deserialize_with = "crate::lenient::string")]
16956    pub value: String,
16957    /// Fields not described by the spec, e.g. instance-specific DB fields.
16958    #[serde(flatten)]
16959    pub extra: serde_json::Map<String, serde_json::Value>,
16960}
16961
16962#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16963pub struct MovementSuggestionsUpdate {
16964    /// Incremental changes. Omitted suggestions are retained; an empty array changes nothing.
16965    pub suggestions: Vec<MovementSuggestionUpdate>,
16966    /// Fields not described by the spec, e.g. instance-specific DB fields.
16967    #[serde(flatten)]
16968    pub extra: serde_json::Map<String, serde_json::Value>,
16969}
16970
16971/// Stored link between one ChurchTools group and one external newsletter list. The provider/list ID pair can be linked to at most one group. This is configuration, not live delivery or subscriber status.
16972#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16973pub struct NewsletterIntegrationGroupMapping {
16974    /// ChurchTools group whose members are synchronized.
16975    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
16976    pub group_id: i64,
16977    /// ID of the ChurchTools mapping record; endpoint URLs identify it by group/provider/list instead.
16978    #[serde(deserialize_with = "crate::lenient::number")]
16979    pub id: i64,
16980    /// Provider-specific list identifier. The list must not already be associated with another group.
16981    #[serde(rename = "listId", deserialize_with = "crate::lenient::string")]
16982    pub list_id: String,
16983    /// List display name cached when the mapping was created; may be null for legacy records and is not refreshed by this GET.
16984    #[serde(rename = "listName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
16985    pub list_name: Option<String>,
16986    /// Whether subscriptions require consent; the provider or ChurchTools handles double opt-in depending on provider capability.
16987    #[serde(rename = "optInRequired")]
16988    pub opt_in_required: bool,
16989    /// Stored provider name. Use the canonical provider value returned by GET /newsletter-integrations when creating links.
16990    #[serde(deserialize_with = "crate::lenient::string")]
16991    pub provider: String,
16992    /// Fields not described by the spec, e.g. instance-specific DB fields.
16993    #[serde(flatten)]
16994    pub extra: serde_json::Map<String, serde_json::Value>,
16995}
16996
16997/// Connects one existing or newly created external list to the path group and immediately synchronizes eligible existing members. Exactly one non-null listId/createListName is required.
16998#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16999pub struct NewsletterIntegrationGroupMappingCreate {
17000    /// Create an external list with this name; only use if the provider advertises canCreateLists=true.
17001    ///
17002    /// `None` leaves the field out, `Some(None)` sends `null`.
17003    #[serde(rename = "createListName", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17004    pub create_list_name: Option<Option<String>>,
17005    /// Controls the initial synchronization only. ignore_opt_in subscribes eligible existing members without double opt-in even when optInRequired=true; the stored flag still governs later synchronization.
17006    /// Allowed values: `ignore_opt_in`, `require_opt_in`.
17007    #[serde(rename = "existingMembersHandling", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17008    pub existing_members_handling: Option<String>,
17009    /// Existing provider list ID. The provider/list pair must not already be mapped to any group.
17010    ///
17011    /// `None` leaves the field out, `Some(None)` sends `null`.
17012    #[serde(rename = "listId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17013    pub list_id: Option<Option<String>>,
17014    /// Require double opt-in for subscriptions. Providers with doesDoubleOptIn=true handle confirmation; otherwise ChurchTools sends confirmation emails.
17015    #[serde(rename = "optInRequired")]
17016    pub opt_in_required: bool,
17017    /// Canonical newsletter provider name. Availability depends on the installation configuration; discover active providers using GET /newsletter-integrations. The backend also accepts case variations but stores the supplied spelling.
17018    /// Allowed values: `CleverReach`, `MailChimp`, `Mailjet`.
17019    #[serde(deserialize_with = "crate::lenient::string")]
17020    pub provider: String,
17021    /// Fields not described by the spec, e.g. instance-specific DB fields.
17022    #[serde(flatten)]
17023    pub extra: serde_json::Map<String, serde_json::Value>,
17024}
17025
17026#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17027pub struct NewsletterIntegrationListOption {
17028    /// Name of the group associated with this list. Omitted when the list is unassigned or the current user cannot view the associated group.
17029    #[serde(rename = "assignedGroupName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17030    pub assigned_group_name: Option<String>,
17031    /// Provider-specific remote list ID, normalized to string.
17032    #[serde(deserialize_with = "crate::lenient::string")]
17033    pub id: String,
17034    /// Whether any stored ChurchTools group mapping uses this provider/list pair, regardless of visibility or current activity of the mapped group.
17035    #[serde(rename = "isAssigned")]
17036    pub is_assigned: bool,
17037    /// Current remote display name.
17038    #[serde(deserialize_with = "crate::lenient::string")]
17039    pub name: String,
17040    /// Fields not described by the spec, e.g. instance-specific DB fields.
17041    #[serde(flatten)]
17042    pub extra: serde_json::Map<String, serde_json::Value>,
17043}
17044
17045/// An active configured newsletter provider and the remote lists available for group mappings.
17046#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17047pub struct NewsletterIntegrationOptions {
17048    /// Whether this provider implementation supports creating a remote list from the group-mapping API.
17049    #[serde(rename = "canCreateLists")]
17050    pub can_create_lists: bool,
17051    /// Whether the provider integration itself uses double opt-in, distinct from the mapping’s ChurchTools optInRequired flag.
17052    #[serde(rename = "doesDoubleOptIn")]
17053    pub does_double_opt_in: bool,
17054    /// Remote lists in provider-returned order. Empty can mean no lists or a caught provider error; assigned lists remain included.
17055    pub lists: Vec<NewsletterIntegrationListOption>,
17056    /// Canonical newsletter provider name. Availability depends on the installation configuration; discover active providers using GET /newsletter-integrations. The backend also accepts case variations but stores the supplied spelling.
17057    /// Allowed values: `CleverReach`, `MailChimp`, `Mailjet`.
17058    #[serde(deserialize_with = "crate::lenient::string")]
17059    pub provider: String,
17060    /// Fields not described by the spec, e.g. instance-specific DB fields.
17061    #[serde(flatten)]
17062    pub extra: serde_json::Map<String, serde_json::Value>,
17063}
17064
17065/// Stored subscription/consent state for a group. Collections use maps when populated and \[\] when empty; this response does not refresh live provider state.
17066#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17067pub struct NewsletterOptInData {
17068    /// Mappings for currently active providers, keyed by provider:listId.
17069    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
17070    pub newsletter: serde_json::Value,
17071    /// Newsletter-person records keyed by person ID. Includes stored records without filtering current membership/person visibility individually; entries for inactive providers may have an empty newsletter map.
17072    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
17073    pub persons: serde_json::Value,
17074    /// Fields not described by the spec, e.g. instance-specific DB fields.
17075    #[serde(flatten)]
17076    pub extra: serde_json::Map<String, serde_json::Value>,
17077}
17078
17079/// One active provider/list mapping represented in the consent overview.
17080#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17081pub struct NewsletterOptInList {
17082    /// True when consent is required and the provider does not handle double opt-in itself.
17083    #[serde(rename = "ctDoesDoubleOptIn")]
17084    pub ct_does_double_opt_in: bool,
17085    /// Composite provider:listId key.
17086    #[serde(deserialize_with = "crate::lenient::string")]
17087    pub id: String,
17088    /// External provider list ID.
17089    #[serde(rename = "listId", deserialize_with = "crate::lenient::string")]
17090    pub list_id: String,
17091    /// Cached list name, potentially absent for legacy mappings.
17092    #[serde(rename = "listName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17093    pub list_name: Option<String>,
17094    /// Whether this mapping requires consent.
17095    #[serde(rename = "optInRequired")]
17096    pub opt_in_required: bool,
17097    /// Stored provider name.
17098    #[serde(deserialize_with = "crate::lenient::string")]
17099    pub provider: String,
17100    /// Fields not described by the spec, e.g. instance-specific DB fields.
17101    #[serde(flatten)]
17102    pub extra: serde_json::Map<String, serde_json::Value>,
17103}
17104
17105/// Person with one or more stored newsletter-person records.
17106#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17107pub struct NewsletterOptInPerson {
17108    /// ChurchTools person ID, not newsletter-person record ID.
17109    #[serde(deserialize_with = "crate::lenient::number")]
17110    pub id: i64,
17111    /// Status keyed by provider:listId for active providers.
17112    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
17113    pub newsletter: serde_json::Value,
17114    /// Fields not described by the spec, e.g. instance-specific DB fields.
17115    #[serde(flatten)]
17116    pub extra: serde_json::Map<String, serde_json::Value>,
17117}
17118
17119/// Local synchronization and consent state, which can lag behind external changes.
17120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17121pub struct NewsletterOptInStatus {
17122    /// Date the ChurchTools double opt-in was confirmed; null when not recorded. This does not represent every provider-managed consent.
17123    #[serde(rename = "doiDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17124    pub doi_date: Option<chrono::DateTime<chrono::Utc>>,
17125    /// Whether the stored record has been marked successfully synchronized.
17126    #[serde(rename = "isSynced")]
17127    pub is_synced: bool,
17128    /// Whether a local unsubscribe timestamp has been recorded.
17129    #[serde(rename = "isUnsubscribed")]
17130    pub is_unsubscribed: bool,
17131    /// Most recently recorded synchronization error, or null.
17132    #[serde(rename = "syncError", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17133    pub sync_error: Option<String>,
17134    /// Fields not described by the spec, e.g. instance-specific DB fields.
17135    #[serde(flatten)]
17136    pub extra: serde_json::Map<String, serde_json::Value>,
17137}
17138
17139/// A note can be linked to multiple business objects. The top-level `domainType`, `domainId`, `securityLevelId`, and `commentViewerId` come from the first stored link, which may differ from the requested route. The note text is shared by every link.
17140#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17141pub struct Note {
17142    /// Person-comment visibility category. Used for person-domain filtering, not for other note domains.
17143    #[serde(rename = "commentViewerId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17144    pub comment_viewer_id: Option<i64>,
17145    /// ID of the linked business object.
17146    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17147    pub domain_id: i64,
17148    /// Kinds of objects with attached notes. Notes for `follow_up` can be read here but must be created through the follow-up API.
17149    /// Allowed values: `follow_up`, `group`, `person`, `song_arrangement`.
17150    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17151    pub domain_type: String,
17152    /// Visibility threshold used for group notes. Other current domains do not filter note lists by this value.
17153    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17154    pub security_level_id: Option<i64>,
17155    #[serde(deserialize_with = "crate::lenient::number")]
17156    pub id: i64,
17157    /// All linked domains, including links not independently authorized by the requested route. Only the last link for each domain type is serialized.
17158    pub links: NoteLinks,
17159    pub meta: NoteMetadata,
17160    /// Shared note content as stored; historical notes may not match current create/update input constraints.
17161    #[serde(deserialize_with = "crate::lenient::string")]
17162    pub text: String,
17163    /// Fields not described by the spec, e.g. instance-specific DB fields.
17164    #[serde(flatten)]
17165    pub extra: serde_json::Map<String, serde_json::Value>,
17166}
17167
17168/// Content and link visibility for a new note. The target domain and object ID come from the URL.
17169#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17170pub struct NoteCreate {
17171    /// Visibility category for person notes. Creating a person note requires permission for this category.
17172    ///
17173    /// `None` leaves the field out, `Some(None)` sends `null`.
17174    #[serde(rename = "commentViewerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17175    pub comment_viewer_id: Option<Option<i64>>,
17176    /// Group-note security threshold; ignored for list filtering in the other domains. The create handler also accepts legacy string representations.
17177    ///
17178    /// `None` leaves the field out, `Some(None)` sends `null`.
17179    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17180    pub security_level_id: Option<Option<i64>>,
17181    /// Note content shared by all links.
17182    #[serde(deserialize_with = "crate::lenient::string")]
17183    pub text: String,
17184    /// Fields not described by the spec, e.g. instance-specific DB fields.
17185    #[serde(flatten)]
17186    pub extra: serde_json::Map<String, serde_json::Value>,
17187}
17188
17189/// Link from a note to a business object, with the visibility settings for that domain. Several links can share the same note text.
17190#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17191pub struct NoteDomainObjectLink {
17192    /// Person-comment visibility category. Used for person-domain filtering, not for other note domains.
17193    #[serde(rename = "commentViewerId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17194    pub comment_viewer_id: Option<i64>,
17195    /// ID of the linked business object.
17196    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17197    pub domain_id: i64,
17198    /// Kinds of objects with attached notes. Notes for `follow_up` can be read here but must be created through the follow-up API.
17199    /// Allowed values: `follow_up`, `group`, `person`, `song_arrangement`.
17200    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17201    pub domain_type: String,
17202    /// Visibility threshold used for group notes. Other current domains do not filter note lists by this value.
17203    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17204    pub security_level_id: Option<i64>,
17205    /// Fields not described by the spec, e.g. instance-specific DB fields.
17206    #[serde(flatten)]
17207    pub extra: serde_json::Map<String, serde_json::Value>,
17208}
17209
17210/// All linked domains, including links not independently authorized by the requested route. Only the last link for each domain type is serialized.
17211#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17212pub struct NoteLinks {
17213    /// Link from a note to a business object, with the visibility settings for that domain. Several links can share the same note text.
17214    #[serde(default, skip_serializing_if = "Option::is_none")]
17215    pub follow_up: Option<NoteDomainObjectLink>,
17216    /// Link from a note to a business object, with the visibility settings for that domain. Several links can share the same note text.
17217    #[serde(default, skip_serializing_if = "Option::is_none")]
17218    pub group: Option<NoteDomainObjectLink>,
17219    /// Link from a note to a business object, with the visibility settings for that domain. Several links can share the same note text.
17220    #[serde(default, skip_serializing_if = "Option::is_none")]
17221    pub person: Option<NoteDomainObjectLink>,
17222    /// Link from a note to a business object, with the visibility settings for that domain. Several links can share the same note text.
17223    #[serde(default, skip_serializing_if = "Option::is_none")]
17224    pub song_arrangement: Option<NoteDomainObjectLink>,
17225    /// Fields not described by the spec, e.g. instance-specific DB fields.
17226    #[serde(flatten)]
17227    pub extra: serde_json::Map<String, serde_json::Value>,
17228}
17229
17230#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17231pub struct NoteMetadata {
17232    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
17233    #[serde(rename = "createdDate", serialize_with = "crate::datetime::serialize_utc")]
17234    pub created_date: chrono::DateTime<chrono::Utc>,
17235    /// Resolved author/editor domain object, or an ID-only fallback when the person cannot be loaded.
17236    #[serde(rename = "createdPerson", default, skip_serializing_if = "serde_json::Value::is_null")]
17237    pub created_person: serde_json::Value,
17238    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
17239    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
17240    pub modified_date: chrono::DateTime<chrono::Utc>,
17241    /// Resolved author/editor domain object, or an ID-only fallback when the person cannot be loaded.
17242    #[serde(rename = "modifiedPerson", default, skip_serializing_if = "serde_json::Value::is_null")]
17243    pub modified_person: serde_json::Value,
17244    /// Fields not described by the spec, e.g. instance-specific DB fields.
17245    #[serde(flatten)]
17246    pub extra: serde_json::Map<String, serde_json::Value>,
17247}
17248
17249#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17250pub struct NoteMetadataCreatedPersonVariant2 {
17251    #[serde(deserialize_with = "crate::lenient::number")]
17252    pub id: i64,
17253    /// Fields not described by the spec, e.g. instance-specific DB fields.
17254    #[serde(flatten)]
17255    pub extra: serde_json::Map<String, serde_json::Value>,
17256}
17257
17258/// Replaces note text and visibility values for the first link matching the path `domainType`.
17259#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17260pub struct NoteUpdate {
17261    /// Person-comment visibility category. The update handler does not repeat the category permission check used on create.
17262    ///
17263    /// `None` leaves the field out, `Some(None)` sends `null`.
17264    #[serde(rename = "commentViewerId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17265    pub comment_viewer_id: Option<Option<i64>>,
17266    /// Group-note security level. Unlike create, the update does not accept legacy string representations.
17267    ///
17268    /// `None` leaves the field out, `Some(None)` sends `null`.
17269    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17270    pub security_level_id: Option<Option<i64>>,
17271    /// Note content shared by all links.
17272    #[serde(deserialize_with = "crate::lenient::string")]
17273    pub text: String,
17274    /// Fields not described by the spec, e.g. instance-specific DB fields.
17275    #[serde(flatten)]
17276    pub extra: serde_json::Map<String, serde_json::Value>,
17277}
17278
17279/// An application registered to use ChurchTools as an OAuth authorization server. This differs from an external-login provider used to sign into ChurchTools. Numeric id is internal; identifier is the OAuth client_id and the management path key. Hidden built-in clients are excluded from management lists.
17280#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17281pub struct OAuthClient {
17282    #[serde(deserialize_with = "crate::lenient::number")]
17283    pub id: i64,
17284    /// OAuth client_id. Newly registered clients receive 64 lowercase hexadecimal characters.
17285    #[serde(deserialize_with = "crate::lenient::string")]
17286    pub identifier: String,
17287    /// Whether token requests authenticate with a client secret. Fixed when the client is created.
17288    #[serde(rename = "isConfidential")]
17289    pub is_confidential: bool,
17290    /// Logo resolved from the redirect URI origin, or null when no logo can be found.
17291    #[serde(rename = "logoUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17292    pub logo_url: Option<String>,
17293    #[serde(deserialize_with = "crate::lenient::string")]
17294    pub name: String,
17295    /// Registered redirect URIs. Responses return an array, whereas create and update accept a single string and replace the array with that entry.
17296    #[serde(rename = "redirectUri")]
17297    pub redirect_uri: Vec<String>,
17298    /// Fields not described by the spec, e.g. instance-specific DB fields.
17299    #[serde(flatten)]
17300    pub extra: serde_json::Map<String, serde_json::Value>,
17301}
17302
17303/// Registers a client application. The client identifier and any secret are generated by ChurchTools. Input accepts one redirect URI string; responses use an array.
17304#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17305pub struct OAuthClientCreate {
17306    /// true generates a secret for a server application able to keep it private; false creates a public client without a secret. This setting cannot be changed by the update endpoint.
17307    #[serde(rename = "isConfidential", default, skip_serializing_if = "Option::is_none")]
17308    pub is_confidential: Option<bool>,
17309    /// Display name, unique across visible and hidden OAuth clients.
17310    #[serde(deserialize_with = "crate::lenient::string")]
17311    pub name: String,
17312    /// Single callback URI stored as the registered redirect entry.
17313    #[serde(rename = "redirectUri", deserialize_with = "crate::lenient::string")]
17314    pub redirect_uri: String,
17315    /// Fields not described by the spec, e.g. instance-specific DB fields.
17316    #[serde(flatten)]
17317    pub extra: serde_json::Map<String, serde_json::Value>,
17318}
17319
17320/// Registered OAuth client. Only confidential clients receive clientSecret, and only in this creation response. Store it securely; management reads and updates cannot retrieve it again.
17321#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17322pub struct OAuthClientCreated {
17323    #[serde(deserialize_with = "crate::lenient::number")]
17324    pub id: i64,
17325    /// OAuth client_id. Newly registered clients receive 64 lowercase hexadecimal characters.
17326    #[serde(deserialize_with = "crate::lenient::string")]
17327    pub identifier: String,
17328    /// Whether token requests authenticate with a client secret. Fixed when the client is created.
17329    #[serde(rename = "isConfidential")]
17330    pub is_confidential: bool,
17331    /// Logo resolved from the redirect URI origin, or null when no logo can be found.
17332    #[serde(rename = "logoUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17333    pub logo_url: Option<String>,
17334    #[serde(deserialize_with = "crate::lenient::string")]
17335    pub name: String,
17336    /// Registered redirect URIs. Responses return an array, whereas create and update accept a single string and replace the array with that entry.
17337    #[serde(rename = "redirectUri")]
17338    pub redirect_uri: Vec<String>,
17339    /// Generated 64-character hexadecimal secret, present only for confidential clients in their creation response.
17340    #[serde(rename = "clientSecret", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17341    pub client_secret: Option<String>,
17342    /// Fields not described by the spec, e.g. instance-specific DB fields.
17343    #[serde(flatten)]
17344    pub extra: serde_json::Map<String, serde_json::Value>,
17345}
17346
17347/// Replacement name and single redirect URI for a visible OAuth client. identifier comes from the URL. This endpoint does not change confidentiality or rotate a secret.
17348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17349pub struct OAuthClientUpdate {
17350    /// Legacy compatibility field.
17351    #[serde(rename = "isConfidential", default, skip_serializing_if = "Option::is_none")]
17352    #[deprecated = "deprecated in the ChurchTools API"]
17353    pub is_confidential: Option<bool>,
17354    /// Display name, unique across visible and hidden OAuth clients.
17355    #[serde(deserialize_with = "crate::lenient::string")]
17356    pub name: String,
17357    /// Single callback URI stored as the registered redirect entry.
17358    #[serde(rename = "redirectUri", deserialize_with = "crate::lenient::string")]
17359    pub redirect_uri: String,
17360    /// Fields not described by the spec, e.g. instance-specific DB fields.
17361    #[serde(flatten)]
17362    pub extra: serde_json::Map<String, serde_json::Value>,
17363}
17364
17365#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17366pub struct OpenGraphActor {
17367    /// The URL or an identifier for the actor's profile.
17368    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17369    pub profile: Option<String>,
17370    /// The role played by the actor.
17371    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17372    pub role: Option<String>,
17373    /// Fields not described by the spec, e.g. instance-specific DB fields.
17374    #[serde(flatten)]
17375    pub extra: serde_json::Map<String, serde_json::Value>,
17376}
17377
17378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17379pub struct OpenGraphAlbum {
17380    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17381    pub disc: Option<i64>,
17382    /// The URL of the album.
17383    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17384    pub url: Option<String>,
17385    /// Fields not described by the spec, e.g. instance-specific DB fields.
17386    #[serde(flatten)]
17387    pub extra: serde_json::Map<String, serde_json::Value>,
17388}
17389
17390#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17391pub struct OpenGraphArticle {
17392    /// The authors of the article.
17393    #[serde(default, skip_serializing_if = "Option::is_none")]
17394    pub authors: Option<Vec<String>>,
17395    /// The expiration time of the article.
17396    #[serde(rename = "expirationTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17397    pub expiration_time: Option<chrono::DateTime<chrono::Utc>>,
17398    /// The last modified time of the article.
17399    #[serde(rename = "modifiedTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17400    pub modified_time: Option<chrono::DateTime<chrono::Utc>>,
17401    /// The publication time of the article.
17402    #[serde(rename = "publishedTime", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17403    pub published_time: Option<chrono::DateTime<chrono::Utc>>,
17404    /// The section of the website where the article is located.
17405    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17406    pub section: Option<String>,
17407    /// Tags associated with the article.
17408    #[serde(default, skip_serializing_if = "Option::is_none")]
17409    pub tags: Option<Vec<String>>,
17410    /// Fields not described by the spec, e.g. instance-specific DB fields.
17411    #[serde(flatten)]
17412    pub extra: serde_json::Map<String, serde_json::Value>,
17413}
17414
17415#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17416pub struct OpenGraphAudio {
17417    /// The secure URL of the audio.
17418    #[serde(rename = "secureUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17419    pub secure_url: Option<String>,
17420    /// The MIME type of the audio.
17421    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17422    pub r#type: Option<String>,
17423    /// The URL of the audio.
17424    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17425    pub url: Option<String>,
17426    /// Fields not described by the spec, e.g. instance-specific DB fields.
17427    #[serde(flatten)]
17428    pub extra: serde_json::Map<String, serde_json::Value>,
17429}
17430
17431#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17432pub struct OpenGraphBook {
17433    /// The authors of the book.
17434    #[serde(default, skip_serializing_if = "Option::is_none")]
17435    pub authors: Option<Vec<String>>,
17436    /// The International Standard Book Number of the book.
17437    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17438    pub isbn: Option<String>,
17439    /// The release date of the book.
17440    #[serde(rename = "releaseDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17441    pub release_date: Option<chrono::DateTime<chrono::Utc>>,
17442    /// Tags associated with the book.
17443    #[serde(default, skip_serializing_if = "Option::is_none")]
17444    pub tags: Option<Vec<String>>,
17445    /// Fields not described by the spec, e.g. instance-specific DB fields.
17446    #[serde(flatten)]
17447    pub extra: serde_json::Map<String, serde_json::Value>,
17448}
17449
17450#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17451pub struct OpenGraphImage {
17452    /// The height of the image in pixels.
17453    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17454    pub height: Option<i64>,
17455    /// The secure URL of the image.
17456    #[serde(rename = "secureUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17457    pub secure_url: Option<String>,
17458    /// The MIME type of the image.
17459    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17460    pub r#type: Option<String>,
17461    /// The URL of the image.
17462    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17463    pub url: Option<String>,
17464    /// The width of the image in pixels.
17465    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17466    pub width: Option<i64>,
17467    /// Fields not described by the spec, e.g. instance-specific DB fields.
17468    #[serde(flatten)]
17469    pub extra: serde_json::Map<String, serde_json::Value>,
17470}
17471
17472#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17473pub struct OpenGraphMusic {
17474    #[serde(default, skip_serializing_if = "Option::is_none")]
17475    pub album: Option<OpenGraphAlbum>,
17476    /// The creators of the music.
17477    #[serde(default, skip_serializing_if = "Option::is_none")]
17478    pub creators: Option<Vec<String>>,
17479    /// The duration of the music in seconds.
17480    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17481    pub duration: Option<i64>,
17482    /// The musicians involved in the music.
17483    #[serde(default, skip_serializing_if = "Option::is_none")]
17484    pub musicians: Option<Vec<String>>,
17485    /// The release date of the music.
17486    #[serde(rename = "releaseDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17487    pub release_date: Option<chrono::DateTime<chrono::Utc>>,
17488    #[serde(default, skip_serializing_if = "Option::is_none")]
17489    pub songs: Option<Vec<OpenGraphSong>>,
17490    /// Fields not described by the spec, e.g. instance-specific DB fields.
17491    #[serde(flatten)]
17492    pub extra: serde_json::Map<String, serde_json::Value>,
17493}
17494
17495#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17496pub struct OpenGraphProfile {
17497    /// The first name of the individual.
17498    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17499    pub first_name: Option<String>,
17500    /// The gender of the individual.
17501    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17502    pub gender: Option<String>,
17503    /// The last name of the individual.
17504    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17505    pub last_name: Option<String>,
17506    /// The username of the individual on the platform.
17507    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17508    pub username: Option<String>,
17509    /// Fields not described by the spec, e.g. instance-specific DB fields.
17510    #[serde(flatten)]
17511    pub extra: serde_json::Map<String, serde_json::Value>,
17512}
17513
17514/// A model representing a song in the OpenGraph data structure.
17515#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17516pub struct OpenGraphSong {
17517    /// The disc number on which the song appears, applicable for albums with multiple discs.
17518    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17519    pub disc: Option<i64>,
17520    /// The track number of the song on its disc.
17521    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17522    pub track: Option<i64>,
17523    /// The URL where the song can be accessed.
17524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17525    pub url: Option<String>,
17526    /// Fields not described by the spec, e.g. instance-specific DB fields.
17527    #[serde(flatten)]
17528    pub extra: serde_json::Map<String, serde_json::Value>,
17529}
17530
17531#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17532pub struct OpenGraphVideo {
17533    #[serde(default, skip_serializing_if = "Option::is_none")]
17534    pub actors: Option<Vec<OpenGraphActor>>,
17535    #[serde(default, skip_serializing_if = "Option::is_none")]
17536    pub directors: Option<Vec<String>>,
17537    /// The duration of the video in seconds.
17538    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17539    pub duration: Option<i64>,
17540    /// The height of the video in pixels.
17541    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17542    pub height: Option<i64>,
17543    /// The release date of the video.
17544    #[serde(rename = "releaseDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17545    pub release_date: Option<chrono::DateTime<chrono::Utc>>,
17546    /// The secure URL of the video.
17547    #[serde(rename = "secureUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17548    pub secure_url: Option<String>,
17549    /// Tags associated with the video.
17550    #[serde(default, skip_serializing_if = "Option::is_none")]
17551    pub tags: Option<Vec<String>>,
17552    /// The MIME type of the video.
17553    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17554    pub r#type: Option<String>,
17555    /// The URL of the video.
17556    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17557    pub url: Option<String>,
17558    /// The width of the video in pixels.
17559    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17560    pub width: Option<i64>,
17561    #[serde(default, skip_serializing_if = "Option::is_none")]
17562    pub writers: Option<Vec<String>>,
17563    /// Fields not described by the spec, e.g. instance-specific DB fields.
17564    #[serde(flatten)]
17565    pub extra: serde_json::Map<String, serde_json::Value>,
17566}
17567
17568/// Unanswered invitation with a remaining occurrence. The next occurrence dates are populated for this view; the embedded appointment retains the stored series data.
17569#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17570pub struct OpenMeetingRequest {
17571    /// Use `state` instead
17572    #[serde(default, skip_serializing_if = "Option::is_none")]
17573    #[deprecated = "Use `state` instead"]
17574    pub accepted: Option<bool>,
17575    /// Stored calendar appointment defining a single occurrence or a series. id identifies the whole stored appointment; pair it with a local occurrence start date to address a particular occurrence. startDate/endDate are the base occurrence, not necessarily the occurrence currently being displayed. Service-planning events, registration groups, bookings and meeting requests are separate linked resources.
17576    pub appointment: AppointmentBase,
17577    /// Use `appointment` instead
17578    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17579    #[deprecated = "Use `appointment` instead"]
17580    pub appointment_id: Option<i64>,
17581    /// Start of the stored appointment or series, not necessarily its next occurrence. Use nextStartDate when available.
17582    #[serde(rename = "eventDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17583    #[deprecated = "Use nextStartDate when available."]
17584    pub event_date: Option<chrono::DateTime<chrono::Utc>>,
17585    /// ID of this meeting request.
17586    #[serde(deserialize_with = "crate::lenient::number")]
17587    pub id: i64,
17588    /// Person invited to the appointment.
17589    pub invitee: MeetingRequestInvitee,
17590    /// Person issuing the invitation, derived from onBehalfOfPid when set or the user creating the request.
17591    pub inviter: MeetingRequestInviter,
17592    /// When the invitation mail was sent, or null.
17593    #[serde(rename = "mailSendDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
17594    pub mail_send_date: Option<chrono::DateTime<chrono::Utc>>,
17595    pub meta: MetaDataEntityId,
17596    /// Next start plus the stored appointment duration, truncated to whole minutes.
17597    #[serde(rename = "nextEndDate", serialize_with = "crate::datetime::serialize_utc")]
17598    pub next_end_date: chrono::DateTime<chrono::Utc>,
17599    /// Start of the next occurrence found by recurrence calculation.
17600    #[serde(rename = "nextStartDate", serialize_with = "crate::datetime::serialize_utc")]
17601    pub next_start_date: chrono::DateTime<chrono::Utc>,
17602    /// Use `invitee` instead
17603    #[serde(default, skip_serializing_if = "Option::is_none")]
17604    #[deprecated = "Use `invitee` instead"]
17605    pub person: Option<MeetingRequestPerson>,
17606    /// No answer has been recorded. Tentative answers have a response date and are excluded.
17607    #[serde(rename = "responseDate", default, skip_serializing_if = "serde_json::Value::is_null")]
17608    pub response_date: serde_json::Value,
17609    /// Response state: pending awaits an answer, accepted confirms attendance, declined refuses, tentative is undecided.
17610    /// Allowed values: `accepted`, `declined`, `pending`, `tentative`.
17611    #[serde(deserialize_with = "crate::lenient::string")]
17612    pub state: String,
17613    /// Fields not described by the spec, e.g. instance-specific DB fields.
17614    #[serde(flatten)]
17615    pub extra: serde_json::Map<String, serde_json::Value>,
17616}
17617
17618#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17619pub struct PasswordResetCreate {
17620    /// Stored email address or login name.
17621    #[serde(rename = "emailOrUsername", deserialize_with = "crate::lenient::string")]
17622    pub email_or_username: String,
17623    /// Fields not described by the spec, e.g. instance-specific DB fields.
17624    #[serde(flatten)]
17625    pub extra: serde_json::Map<String, serde_json::Value>,
17626}
17627
17628#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17629pub struct PatchGroupsIdBody {
17630    /// ID of the appointment this group is linked to. Set to `null` to unlink the group from any appointment.
17631    ///
17632    /// `None` leaves the field out, `Some(None)` sends `null`.
17633    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17634    pub appointment_id: Option<Option<i64>>,
17635    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17636    pub group_type_id: Option<i64>,
17637    /// Start date of the appointment occurrence this group is linked to (used together with `appointmentId` for repeating appointments). Set to `null` to clear.
17638    ///
17639    /// `None` leaves the field out, `Some(None)` sends `null`.
17640    #[serde(rename = "startDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
17641    pub start_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
17642    /// Membership statuses that occupy seats when their role counts towards seats. Defaults to active only. An empty array means no membership occupies a seat.
17643    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
17644    #[serde(rename = "statusesCountedTowardsSeats", default, skip_serializing_if = "Option::is_none")]
17645    pub statuses_counted_towards_seats: Option<Vec<String>>,
17646    /// Fields not described by the spec, e.g. instance-specific DB fields.
17647    #[serde(flatten)]
17648    pub extra: serde_json::Map<String, serde_json::Value>,
17649}
17650
17651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17652pub struct PatchPersonsIdBody {
17653    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17654    pub address_addition: Option<String>,
17655    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17656    pub age: Option<i64>,
17657    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17658    pub baptised_by: Option<String>,
17659    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17660    pub birth_name: Option<String>,
17661    /// `None` leaves the field out, `Some(None)` sends `null`.
17662    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17663    pub birthday: Option<Option<chrono::NaiveDate>>,
17664    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17665    pub birthplace: Option<String>,
17666    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17667    pub campus_id: Option<i64>,
17668    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17669    pub city: Option<String>,
17670    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17671    pub cms_user_id: Option<String>,
17672    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17673    pub country: Option<String>,
17674    /// `None` leaves the field out, `Some(None)` sends `null`.
17675    #[serde(rename = "dateOfBaptism", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17676    pub date_of_baptism: Option<Option<chrono::NaiveDate>>,
17677    /// `None` leaves the field out, `Some(None)` sends `null`.
17678    #[serde(rename = "dateOfBelonging", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17679    pub date_of_belonging: Option<Option<chrono::NaiveDate>>,
17680    /// `None` leaves the field out, `Some(None)` sends `null`.
17681    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17682    pub date_of_death: Option<Option<chrono::NaiveDate>>,
17683    /// `None` leaves the field out, `Some(None)` sends `null`.
17684    #[serde(rename = "dateOfEntry", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
17685    pub date_of_entry: Option<Option<chrono::DateTime<chrono::Utc>>>,
17686    /// `None` leaves the field out, `Some(None)` sends `null`.
17687    #[serde(rename = "dateOfResign", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
17688    pub date_of_resign: Option<Option<chrono::DateTime<chrono::Utc>>>,
17689    /// Department IDs. At least one department MUST be set for a person. The last department ID cannot be deleted.
17690    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
17691    pub department_ids: Option<Vec<i64>>,
17692    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17693    pub email: Option<String>,
17694    /// Save many eMail addresses for person. If `emails` is present in request `email` is ignored.
17695    #[serde(default, skip_serializing_if = "Option::is_none")]
17696    pub emails: Option<Vec<PersonEmail>>,
17697    /// `None` leaves the field out, `Some(None)` sends `null`.
17698    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17699    pub family_status_id: Option<Option<i64>>,
17700    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17701    pub fax: Option<String>,
17702    /// `None` leaves the field out, `Some(None)` sends `null`.
17703    #[serde(rename = "firstContact", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
17704    pub first_contact: Option<Option<chrono::DateTime<chrono::Utc>>>,
17705    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17706    pub first_name: Option<String>,
17707    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17708    pub grow_path_id: Option<i64>,
17709    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17710    pub job: Option<String>,
17711    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17712    pub last_name: Option<String>,
17713    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17714    pub mobile: Option<String>,
17715    /// `None` leaves the field out, `Some(None)` sends `null`.
17716    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17717    pub nationality_id: Option<Option<i64>>,
17718    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17719    pub nickname: Option<String>,
17720    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17721    pub optigem_id: Option<String>,
17722    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17723    pub phone_private: Option<String>,
17724    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17725    pub phone_work: Option<String>,
17726    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17727    pub place_of_baptism: Option<String>,
17728    /// This object can be optional or required. Depending on your ChurchTools data security settings.
17729    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
17730    pub privacy_policy_agreement: Option<PatchPersonsIdBodyPrivacyPolicyAgreement>,
17731    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17732    pub referred_by: Option<String>,
17733    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17734    pub referred_to: Option<String>,
17735    /// `None` leaves the field out, `Some(None)` sends `null`.
17736    #[serde(rename = "sexId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17737    pub sex_id: Option<Option<i64>>,
17738    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17739    pub status_id: Option<i64>,
17740    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17741    pub street: Option<String>,
17742    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17743    pub title: Option<String>,
17744    /// Visibility accepted when creating or updating a person.
17745    /// Allowed values: `hidden`, `visible`.
17746    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17747    pub visibility: Option<String>,
17748    /// `None` leaves the field out, `Some(None)` sends `null`.
17749    #[serde(rename = "weddingDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17750    pub wedding_date: Option<Option<chrono::NaiveDate>>,
17751    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17752    pub zip: Option<String>,
17753    /// Fields not described by the spec, e.g. instance-specific DB fields.
17754    #[serde(flatten)]
17755    pub extra: serde_json::Map<String, serde_json::Value>,
17756}
17757
17758/// This object can be optional or required. Depending on your ChurchTools data security settings.
17759#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17760pub struct PatchPersonsIdBodyPrivacyPolicyAgreement {
17761    /// `None` leaves the field out, `Some(None)` sends `null`.
17762    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17763    pub date: Option<Option<chrono::NaiveDate>>,
17764    /// `None` leaves the field out, `Some(None)` sends `null`.
17765    #[serde(rename = "typeId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17766    pub type_id: Option<Option<i64>>,
17767    /// `None` leaves the field out, `Some(None)` sends `null`.
17768    #[serde(rename = "whoId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
17769    pub who_id: Option<Option<i64>>,
17770    /// Fields not described by the spec, e.g. instance-specific DB fields.
17771    #[serde(flatten)]
17772    pub extra: serde_json::Map<String, serde_json::Value>,
17773}
17774
17775#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17776pub struct PatchPersonsPersonidMergeDuplicateidData {
17777    #[serde(deserialize_with = "crate::lenient::string")]
17778    pub body: String,
17779    #[serde(deserialize_with = "crate::lenient::string")]
17780    pub uridata: String,
17781    /// Fields not described by the spec, e.g. instance-specific DB fields.
17782    #[serde(flatten)]
17783    pub extra: serde_json::Map<String, serde_json::Value>,
17784}
17785
17786#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17787pub struct PatchSecuritylevelsIdBody {
17788    #[serde(default, skip_serializing_if = "Option::is_none")]
17789    pub forcereorder: Option<bool>,
17790    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17791    pub name: Option<String>,
17792    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17793    pub newid: Option<i64>,
17794    /// Fields not described by the spec, e.g. instance-specific DB fields.
17795    #[serde(flatten)]
17796    pub extra: serde_json::Map<String, serde_json::Value>,
17797}
17798
17799#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17800pub struct PatchSecuritylevelsIdResponse {
17801    #[serde(deserialize_with = "crate::lenient::number")]
17802    pub id: i64,
17803    #[serde(deserialize_with = "crate::lenient::string")]
17804    pub name: String,
17805    /// Fields not described by the spec, e.g. instance-specific DB fields.
17806    #[serde(flatten)]
17807    pub extra: serde_json::Map<String, serde_json::Value>,
17808}
17809
17810/// One raw stored grant or revocation. Effective access also depends on other sources, inheritance and object policies. A selectable permission uses one row per dataId; write requests accept several data IDs at once.
17811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17812pub struct Permission {
17813    /// Numeric permission key from the internal authorization table
17814    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
17815    pub auth_id: i64,
17816    /// Concrete selection ID, -1 for unrestricted access including future selections, or null for a permission without a data selection. Null must not be interpreted as unrestricted data access.
17817    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17818    pub data_id: Option<i64>,
17819    /// ID of the object the permission belongs to
17820    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17821    pub domain_id: i64,
17822    /// Assignment owner: person status, role template of a group type, role in a concrete group, or direct person assignment. These are assignment sources, not necessarily the objects on which the permission takes effect.
17823    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17824    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17825    pub domain_type: String,
17826    /// Whether this source applies through inheritance into subordinate groups; not a statement that the current response row was inherited.
17827    #[serde(rename = "isInherited")]
17828    pub is_inherited: bool,
17829    pub meta: PermissionModification,
17830    /// Optional reason why this permission was assigned
17831    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
17832    pub reason: Option<String>,
17833    /// Whether the permission grants or revokes access
17834    /// Allowed values: `grant`, `revoke`.
17835    #[serde(deserialize_with = "crate::lenient::string")]
17836    pub r#type: String,
17837    /// Fields not described by the spec, e.g. instance-specific DB fields.
17838    #[serde(flatten)]
17839    pub extra: serde_json::Map<String, serde_json::Value>,
17840}
17841
17842#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17843pub struct PermissionAssignmentGroup {
17844    /// Group whose role grants the permission
17845    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
17846    pub group_id: i64,
17847    /// Group role IDs contributing to this assignment
17848    #[serde(rename = "groupRoleIds")]
17849    pub group_role_ids: Vec<i64>,
17850    /// Number of distinct non-archived persons reached by this assignment
17851    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
17852    pub person_count: i64,
17853    /// Fields not described by the spec, e.g. instance-specific DB fields.
17854    #[serde(flatten)]
17855    pub extra: serde_json::Map<String, serde_json::Value>,
17856}
17857
17858#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17859pub struct PermissionAssignmentGroupType {
17860    /// Group type whose roles grant the permission
17861    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
17862    pub group_type_id: i64,
17863    /// Group type role IDs contributing to this assignment
17864    #[serde(rename = "groupTypeRoleIds")]
17865    pub group_type_role_ids: Vec<i64>,
17866    /// Number of distinct non-archived persons reached by this assignment
17867    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
17868    pub person_count: i64,
17869    /// Fields not described by the spec, e.g. instance-specific DB fields.
17870    #[serde(flatten)]
17871    pub extra: serde_json::Map<String, serde_json::Value>,
17872}
17873
17874#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17875pub struct PermissionAssignmentPerson {
17876    /// Person with a direct permission assignment
17877    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
17878    pub person_id: i64,
17879    /// Fields not described by the spec, e.g. instance-specific DB fields.
17880    #[serde(flatten)]
17881    pub extra: serde_json::Map<String, serde_json::Value>,
17882}
17883
17884#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17885pub struct PermissionAssignmentStatus {
17886    /// Number of distinct non-archived persons reached by this assignment
17887    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
17888    pub person_count: i64,
17889    /// Person status granting the permission
17890    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
17891    pub status_id: i64,
17892    /// Fields not described by the spec, e.g. instance-specific DB fields.
17893    #[serde(flatten)]
17894    pub extra: serde_json::Map<String, serde_json::Value>,
17895}
17896
17897/// Assignment breakdown for one global permission selection. effectivePersonCount includes all effective sources, but the breakdown only groups status, group-type-role, group-role and direct-person sources. Logged-in defaults, public-user rights and super-admin status can therefore contribute to the total without appearing in assignments.
17898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17899pub struct PermissionAssignmentSummary {
17900    /// Nonempty assignment sources only. Status, group-type and group entries are sorted numerically by their IDs; role IDs within them are unique and sorted. Counts are distinct per entry but overlap across entries.
17901    pub assignments: PermissionAssignmentSummaryAssignments,
17902    /// Numeric permission key
17903    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
17904    pub auth_id: i64,
17905    /// Selected permission value, or null for boolean permissions
17906    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
17907    pub data_id: Option<i64>,
17908    /// Total number of distinct non-archived persons with the effective permission
17909    #[serde(rename = "effectivePersonCount", deserialize_with = "crate::lenient::number")]
17910    pub effective_person_count: i64,
17911    /// Fields not described by the spec, e.g. instance-specific DB fields.
17912    #[serde(flatten)]
17913    pub extra: serde_json::Map<String, serde_json::Value>,
17914}
17915
17916/// Nonempty assignment sources only. Status, group-type and group entries are sorted numerically by their IDs; role IDs within them are unique and sorted. Counts are distinct per entry but overlap across entries.
17917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17918pub struct PermissionAssignmentSummaryAssignments {
17919    #[serde(rename = "groupTypes")]
17920    pub group_types: Vec<PermissionAssignmentGroupType>,
17921    pub groups: Vec<PermissionAssignmentGroup>,
17922    pub persons: Vec<PermissionAssignmentPerson>,
17923    pub statuses: Vec<PermissionAssignmentStatus>,
17924    /// Fields not described by the spec, e.g. instance-specific DB fields.
17925    #[serde(flatten)]
17926    pub extra: serde_json::Map<String, serde_json::Value>,
17927}
17928
17929/// Selectable assignment owner, including owners without existing permission assignments. The pair domainType and domainId identifies the target and can be passed to the permission write endpoints.
17930#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17931pub struct PermissionAssignmentTarget {
17932    /// Status, role template, concrete group role, or person ID. For group_role this is neither the group ID nor the role template ID.
17933    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17934    pub domain_id: i64,
17935    /// Assignment owner: person status, role template of a group type, role in a concrete group, or direct person assignment. These are assignment sources, not necessarily the objects on which the permission takes effect.
17936    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17937    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17938    pub domain_type: String,
17939    /// Display label localized in the current request language
17940    #[serde(deserialize_with = "crate::lenient::string")]
17941    pub label: String,
17942    /// Fields not described by the spec, e.g. instance-specific DB fields.
17943    #[serde(flatten)]
17944    pub extra: serde_json::Map<String, serde_json::Value>,
17945}
17946
17947#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17948pub struct PermissionBulkChange {
17949    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
17950    pub domain_id: i64,
17951    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17952    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
17953    pub domain_type: String,
17954    /// Fields not described by the spec, e.g. instance-specific DB fields.
17955    #[serde(flatten)]
17956    pub extra: serde_json::Map<String, serde_json::Value>,
17957}
17958
17959/// Definition of one assignable permission, not an effective grant. Combine the module key and permission key to identify it by name, or use authId in assignment endpoints.
17960#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17961pub struct PermissionDefinition {
17962    /// Currently always lists status, group_type_role, group_role and person. This is generic metadata and does not establish that every combination is accepted by assignment validation.
17963    /// Allowed values: `group_role`, `group_type_role`, `person`, `status`.
17964    #[serde(rename = "assignmentDomains")]
17965    pub assignment_domains: Vec<String>,
17966    /// Numeric permission key
17967    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
17968    pub auth_id: i64,
17969    /// Currently the same translated text as name; no separate explanatory description is supplied.
17970    #[serde(deserialize_with = "crate::lenient::string")]
17971    pub description: String,
17972    /// Permission key within its module
17973    #[serde(deserialize_with = "crate::lenient::string")]
17974    pub key: String,
17975    /// Translated display name
17976    #[serde(deserialize_with = "crate::lenient::string")]
17977    pub name: String,
17978    /// Selectable data IDs, beginning with the all entry (-1). Empty for permissions without a data field. Values follow the underlying catalog order.
17979    pub selections: Vec<PermissionDefinitionSelection>,
17980    /// boolean combines grants as a flag; multiple combines selected IDs; maximum selects the highest level. Selections describe available IDs, and -1 denotes unrestricted access including future values.
17981    /// Allowed values: `boolean`, `maximum`, `multiple`.
17982    #[serde(rename = "valueType", deserialize_with = "crate::lenient::string")]
17983    pub value_type: String,
17984    /// Fields not described by the spec, e.g. instance-specific DB fields.
17985    #[serde(flatten)]
17986    pub extra: serde_json::Map<String, serde_json::Value>,
17987}
17988
17989/// Module containing at least one definition matching the requested scope. Modules follow the application module order; keys can include custom modules.
17990#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
17991pub struct PermissionDefinitionModule {
17992    /// Technical module key
17993    #[serde(deserialize_with = "crate::lenient::string")]
17994    pub key: String,
17995    /// Translated module name
17996    #[serde(deserialize_with = "crate::lenient::string")]
17997    pub name: String,
17998    pub permissions: Vec<PermissionDefinition>,
17999    /// Fields not described by the spec, e.g. instance-specific DB fields.
18000    #[serde(flatten)]
18001    pub extra: serde_json::Map<String, serde_json::Value>,
18002}
18003
18004#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18005pub struct PermissionDefinitionSelection {
18006    /// Selection ID; -1 represents unrestricted access to all current and future values
18007    #[serde(rename = "dataId", deserialize_with = "crate::lenient::number")]
18008    pub data_id: i64,
18009    /// Allowed values: `all`, `value`.
18010    #[serde(deserialize_with = "crate::lenient::string")]
18011    pub kind: String,
18012    /// Translated selection name
18013    #[serde(deserialize_with = "crate::lenient::string")]
18014    pub name: String,
18015    /// Fields not described by the spec, e.g. instance-specific DB fields.
18016    #[serde(flatten)]
18017    pub extra: serde_json::Map<String, serde_json::Value>,
18018}
18019
18020/// Select raw assignments to delete. Omitting dataId, null or \[\] removes every data selection for the selected owner/authId/inheritance mode; this does not revoke access from other sources.
18021#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18022pub struct PermissionDelete {
18023    /// Permission ID. status and person require values below 10000. Role domains also accept internal permission IDs. 10127 is obsolete and returns 410.
18024    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18025    pub auth_id: i64,
18026    /// Concrete selections to delete. Omission, null or an empty array removes all selection rows, including the null row. A nonempty array uses exact IDs; -1 only matches the unrestricted row.
18027    ///
18028    /// `None` leaves the field out, `Some(None)` sends `null`.
18029    #[serde(rename = "dataId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18030    pub data_id: Option<Option<Vec<i64>>>,
18031    /// Select inherited-source rows when true, otherwise direct rows. Only role domains allow true.
18032    #[serde(rename = "isInherited", default, skip_serializing_if = "Option::is_none")]
18033    pub is_inherited: Option<bool>,
18034    /// Fields not described by the spec, e.g. instance-specific DB fields.
18035    #[serde(flatten)]
18036    pub extra: serde_json::Map<String, serde_json::Value>,
18037}
18038
18039#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18040pub struct PermissionModification {
18041    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
18042    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
18043    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
18044    /// ID of the person that last changed the stored assignment, or null when unavailable.
18045    #[serde(rename = "modifiedPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18046    pub modified_pid: Option<i64>,
18047    /// Fields not described by the spec, e.g. instance-specific DB fields.
18048    #[serde(flatten)]
18049    pub extra: serde_json::Map<String, serde_json::Value>,
18050}
18051
18052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18053pub struct PermissionPersonSelection {
18054    /// Permission selection value, or null for permissions without selection values
18055    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18056    pub data_id: Option<i64>,
18057    /// Matching non-archived person IDs in ascending numeric order. With pagination these are only the requested page, not all matches. System users are not generally excluded.
18058    #[serde(rename = "personIds")]
18059    pub person_ids: Vec<i64>,
18060    /// Present when `include=origins` is requested
18061    #[serde(default, skip_serializing_if = "Option::is_none")]
18062    pub persons: Option<Vec<PermissionPersonWithOrigins>>,
18063    /// Fields not described by the spec, e.g. instance-specific DB fields.
18064    #[serde(flatten)]
18065    pub extra: serde_json::Map<String, serde_json::Value>,
18066}
18067
18068/// One registered global permission in definition order. Selections include zero-count values; data-field permissions start with -1 followed by configured IDs in numeric order.
18069#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18070pub struct PermissionPersonSummaryEntry {
18071    /// Numeric permission key from the internal authorization table
18072    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18073    pub auth_id: i64,
18074    pub selections: Vec<PermissionPersonSummarySelection>,
18075    /// Fields not described by the spec, e.g. instance-specific DB fields.
18076    #[serde(flatten)]
18077    pub extra: serde_json::Map<String, serde_json::Value>,
18078}
18079
18080#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18081pub struct PermissionPersonSummarySelection {
18082    /// Configured selection ID, -1 for unrestricted access including future values, or null for a boolean permission.
18083    #[serde(rename = "dataId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18084    pub data_id: Option<i64>,
18085    /// Distinct matching non-archived persons. Counts overlap across selections; a maximum-level grant contributes to every configured level it reaches.
18086    #[serde(rename = "personCount", deserialize_with = "crate::lenient::number")]
18087    pub person_count: i64,
18088    /// Up to three sorted person IDs for an overview preview
18089    #[serde(rename = "previewPersonIds")]
18090    pub preview_person_ids: Vec<i64>,
18091    /// Fields not described by the spec, e.g. instance-specific DB fields.
18092    #[serde(flatten)]
18093    pub extra: serde_json::Map<String, serde_json::Value>,
18094}
18095
18096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18097pub struct PermissionPersonWithOrigins {
18098    /// Sources that contribute the requested permission selection
18099    pub origins: Vec<serde_json::Value>,
18100    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
18101    pub person_id: i64,
18102    /// Fields not described by the spec, e.g. instance-specific DB fields.
18103    #[serde(flatten)]
18104    pub extra: serde_json::Map<String, serde_json::Value>,
18105}
18106
18107#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18108pub struct PermissionPersonWithOriginsOriginsItemVariant1 {
18109    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18110    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18111    pub revoked_by_group_role_id: Option<i64>,
18112    /// Value this source contributes: `true` for simple permissions, a number for level permissions (e.g. security levels) or a list of IDs for data permissions
18113    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18114    pub value: serde_json::Value,
18115    /// Allowed values: `loggedIn`.
18116    #[serde(deserialize_with = "crate::lenient::string")]
18117    pub r#type: String,
18118    /// Fields not described by the spec, e.g. instance-specific DB fields.
18119    #[serde(flatten)]
18120    pub extra: serde_json::Map<String, serde_json::Value>,
18121}
18122
18123#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18124pub struct PermissionPersonWithOriginsOriginsItemVariant2 {
18125    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18126    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18127    pub revoked_by_group_role_id: Option<i64>,
18128    /// Value this source contributes: `true` for simple permissions, a number for level permissions (e.g. security levels) or a list of IDs for data permissions
18129    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18130    pub value: serde_json::Value,
18131    /// Allowed values: `superAdmin`.
18132    #[serde(deserialize_with = "crate::lenient::string")]
18133    pub r#type: String,
18134    /// Fields not described by the spec, e.g. instance-specific DB fields.
18135    #[serde(flatten)]
18136    pub extra: serde_json::Map<String, serde_json::Value>,
18137}
18138
18139#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18140pub struct PermissionPersonWithOriginsOriginsItemVariant3 {
18141    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18142    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18143    pub revoked_by_group_role_id: Option<i64>,
18144    /// Value this source contributes: `true` for simple permissions, a number for level permissions (e.g. security levels) or a list of IDs for data permissions
18145    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18146    pub value: serde_json::Value,
18147    /// Allowed values: `publicUser`.
18148    #[serde(deserialize_with = "crate::lenient::string")]
18149    pub r#type: String,
18150    /// Fields not described by the spec, e.g. instance-specific DB fields.
18151    #[serde(flatten)]
18152    pub extra: serde_json::Map<String, serde_json::Value>,
18153}
18154
18155#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18156pub struct PermissionPersonWithOriginsOriginsItemVariant4 {
18157    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18158    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18159    pub revoked_by_group_role_id: Option<i64>,
18160    /// Value this source contributes: `true` for simple permissions, a number for level permissions (e.g. security levels) or a list of IDs for data permissions
18161    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18162    pub value: serde_json::Value,
18163    /// ID of the person the permission is set on directly
18164    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
18165    pub person_id: i64,
18166    /// Allowed values: `person`.
18167    #[serde(deserialize_with = "crate::lenient::string")]
18168    pub r#type: String,
18169    /// Fields not described by the spec, e.g. instance-specific DB fields.
18170    #[serde(flatten)]
18171    pub extra: serde_json::Map<String, serde_json::Value>,
18172}
18173
18174#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18175pub struct PermissionPersonWithOriginsOriginsItemVariant5 {
18176    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18177    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18178    pub revoked_by_group_role_id: Option<i64>,
18179    /// Value this source contributes: `true` for simple permissions, a number for level permissions (e.g. security levels) or a list of IDs for data permissions
18180    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18181    pub value: serde_json::Value,
18182    /// ID of the person status that grants the permission
18183    #[serde(rename = "statusId", deserialize_with = "crate::lenient::number")]
18184    pub status_id: i64,
18185    /// Allowed values: `status`.
18186    #[serde(deserialize_with = "crate::lenient::string")]
18187    pub r#type: String,
18188    /// Fields not described by the spec, e.g. instance-specific DB fields.
18189    #[serde(flatten)]
18190    pub extra: serde_json::Map<String, serde_json::Value>,
18191}
18192
18193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18194pub struct PermissionPersonWithOriginsOriginsItemVariant6 {
18195    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18196    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18197    pub revoked_by_group_role_id: Option<i64>,
18198    /// Value this source contributes: `true` for simple permissions, a number for level permissions (e.g. security levels) or a list of IDs for data permissions
18199    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18200    pub value: serde_json::Value,
18201    /// Group of the membership that grants the permission. For inherited permissions this is the superior group, not the target group.
18202    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
18203    pub group_id: i64,
18204    /// ID of the group role (`cdb_group_role`) that grants the permission
18205    #[serde(rename = "groupRoleId", deserialize_with = "crate::lenient::number")]
18206    pub group_role_id: i64,
18207    /// ID of the group type role of the membership
18208    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
18209    pub group_type_role_id: i64,
18210    /// Whether the permission reaches the target group through inheritance from a superior group
18211    pub inherited: bool,
18212    /// Allowed values: `groupRole`.
18213    #[serde(deserialize_with = "crate::lenient::string")]
18214    pub r#type: String,
18215    /// Fields not described by the spec, e.g. instance-specific DB fields.
18216    #[serde(flatten)]
18217    pub extra: serde_json::Map<String, serde_json::Value>,
18218}
18219
18220#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18221pub struct PermissionPersonWithOriginsOriginsItemVariant7 {
18222    /// If set, this group type role permission is revoked by the group role with this ID and does not contribute to the effective value
18223    #[serde(rename = "revokedByGroupRoleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18224    pub revoked_by_group_role_id: Option<i64>,
18225    /// Value this source contributes: `true` for simple permissions, a number for level permissions (e.g. security levels) or a list of IDs for data permissions
18226    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18227    pub value: serde_json::Value,
18228    /// Group of the membership that grants the permission. For inherited permissions this is the superior group, not the target group.
18229    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
18230    pub group_id: i64,
18231    /// ID of the group type whose role grants the permission
18232    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
18233    pub group_type_id: i64,
18234    /// ID of the group type role of the membership
18235    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
18236    pub group_type_role_id: i64,
18237    /// Whether the permission reaches the target group through inheritance from a superior group
18238    pub inherited: bool,
18239    /// Allowed values: `groupTypeRole`.
18240    #[serde(deserialize_with = "crate::lenient::string")]
18241    pub r#type: String,
18242    /// Fields not described by the spec, e.g. instance-specific DB fields.
18243    #[serde(flatten)]
18244    pub extra: serde_json::Map<String, serde_json::Value>,
18245}
18246
18247/// Persons for one permission, grouped by selection. Global queries return one selection; internal data_id=-1 can return several. Pagination and per-person origins are available only for global queries.
18248#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18249pub struct PermissionPersons {
18250    /// Numeric permission key from the internal authorization table
18251    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18252    pub auth_id: i64,
18253    /// Present when page, limit or include=origins enables pagination. Nested under data, not a top-level response meta field.
18254    #[serde(default, skip_serializing_if = "Option::is_none")]
18255    pub meta: Option<PermissionPersonsMeta>,
18256    /// Effective persons grouped by the requested permission selection values
18257    pub selections: Vec<PermissionPersonSelection>,
18258    /// Fields not described by the spec, e.g. instance-specific DB fields.
18259    #[serde(flatten)]
18260    pub extra: serde_json::Map<String, serde_json::Value>,
18261}
18262
18263/// Present when page, limit or include=origins enables pagination. Nested under data, not a top-level response meta field.
18264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18265pub struct PermissionPersonsMeta {
18266    #[serde(deserialize_with = "crate::lenient::number")]
18267    pub limit: i64,
18268    #[serde(deserialize_with = "crate::lenient::number")]
18269    pub page: i64,
18270    #[serde(deserialize_with = "crate::lenient::number")]
18271    pub total: i64,
18272    /// Fields not described by the spec, e.g. instance-specific DB fields.
18273    #[serde(flatten)]
18274    pub extra: serde_json::Map<String, serde_json::Value>,
18275}
18276
18277/// Atomically replace all stored selection rows for one permission, inheritance mode and source owner. An empty dataId list removes the assignment.
18278#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18279pub struct PermissionReplace {
18280    /// Permission ID. status and person require values below 10000. Role domains also accept internal permission IDs. 10127 is obsolete and returns 410.
18281    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18282    pub auth_id: i64,
18283    /// Complete replacement selection. Use \[-1\] for unrestricted selection access or \[\] to remove the assignment.
18284    #[serde(rename = "dataId")]
18285    pub data_id: Vec<i64>,
18286    /// Select inherited-source rows when true, otherwise direct rows. Only role domains allow true.
18287    #[serde(rename = "isInherited", default, skip_serializing_if = "Option::is_none")]
18288    pub is_inherited: Option<bool>,
18289    /// Optional explanation for the replacement assignment.
18290    ///
18291    /// `None` leaves the field out, `Some(None)` sends `null`.
18292    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18293    pub reason: Option<Option<String>>,
18294    /// Grant a permission, or revoke a contribution for a concrete group_role. revoke is rejected for all other source domains.
18295    /// Allowed values: `grant`, `revoke`.
18296    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18297    pub r#type: Option<String>,
18298    /// Fields not described by the spec, e.g. instance-specific DB fields.
18299    #[serde(flatten)]
18300    pub extra: serde_json::Map<String, serde_json::Value>,
18301}
18302
18303/// Add or update stored assignment rows. This is not full replacement of the owner’s permissions. Path parameters identify the source owner.
18304#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18305pub struct PermissionUpdate {
18306    /// Permission ID. status and person require values below 10000. Role domains also accept internal permission IDs. 10127 is obsolete and returns 410.
18307    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18308    pub auth_id: i64,
18309    /// Selections to add/update. Omission, null or \[\] writes a null-data row, normally used for boolean permissions. Use \[-1\] for unrestricted selection access. Existing other selections remain. If a -1 row already exists for this key/inheritance mode, any nonempty request currently returns without changing rows, type or reason.
18310    ///
18311    /// `None` leaves the field out, `Some(None)` sends `null`.
18312    #[serde(rename = "dataId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18313    pub data_id: Option<Option<Vec<i64>>>,
18314    /// Select inherited-source rows when true, otherwise direct rows. Only role domains allow true.
18315    #[serde(rename = "isInherited", default, skip_serializing_if = "Option::is_none")]
18316    pub is_inherited: Option<bool>,
18317    /// Trimmed optional explanation. Empty/whitespace input becomes null. No maximum length is validated by the controller.
18318    ///
18319    /// `None` leaves the field out, `Some(None)` sends `null`.
18320    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18321    pub reason: Option<Option<String>>,
18322    /// Grant a permission, or revoke a contribution for a concrete group_role. revoke is rejected for all other source domains.
18323    /// Allowed values: `grant`, `revoke`.
18324    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18325    pub r#type: Option<String>,
18326    /// Fields not described by the spec, e.g. instance-specific DB fields.
18327    #[serde(flatten)]
18328    pub extra: serde_json::Map<String, serde_json::Value>,
18329}
18330
18331/// Permission with recorded origins and its effective value. A record can remain when all contributions were revoked, with false, 0 or \[\] as the effective value.
18332#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18333pub struct PermissionWithOrigins {
18334    /// Permission key within the module. Group internal permissions start with `+`.
18335    #[serde(deserialize_with = "crate::lenient::string")]
18336    pub auth: String,
18337    /// Numeric permission key from the internal authorization table
18338    #[serde(rename = "authId", deserialize_with = "crate::lenient::number")]
18339    pub auth_id: i64,
18340    /// Combined effective value: flag, maximum level (99999 for unrestricted), or selected IDs. No effective grant is false, 0 or \[\] according to value type. Multi-value unrestricted grants expand to current IDs, so their original unrestricted assignment is not preserved in this value.
18341    #[serde(rename = "effectiveValue", default, skip_serializing_if = "serde_json::Value::is_null")]
18342    pub effective_value: serde_json::Value,
18343    /// Module the permission belongs to
18344    #[serde(deserialize_with = "crate::lenient::string")]
18345    pub module: String,
18346    pub origins: Vec<serde_json::Value>,
18347    /// Fields not described by the spec, e.g. instance-specific DB fields.
18348    #[serde(flatten)]
18349    pub extra: serde_json::Map<String, serde_json::Value>,
18350}
18351
18352/// A person object includes all fields the logged in user may see depending on the security level. Additional DB fields, created by the admin, are also part of the response. Those fields have the same name as the column name.
18353#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18354pub struct Person {
18355    /// A simple date in ISO format, e.g. '2022-10-19'
18356    #[serde(default, skip_serializing_if = "Option::is_none")]
18357    pub acceptedsecurity: Option<chrono::NaiveDate>,
18358    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18359    pub address_addition: Option<String>,
18360    /// This computed field contains the age of this person if the date of birth is visible. If this person already dead, the age is calculated until the date of death.
18361    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18362    pub age: Option<i64>,
18363    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18364    pub baptised_by: Option<String>,
18365    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18366    pub birth_name: Option<String>,
18367    /// A simple date in ISO format, e.g. '2022-10-19'
18368    #[serde(default, skip_serializing_if = "Option::is_none")]
18369    pub birthday: Option<chrono::NaiveDate>,
18370    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18371    pub birthplace: Option<String>,
18372    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18373    pub campus_id: Option<i64>,
18374    #[serde(rename = "canChat", default, skip_serializing_if = "Option::is_none")]
18375    pub can_chat: Option<bool>,
18376    #[serde(rename = "chatActive", default, skip_serializing_if = "Option::is_none")]
18377    pub chat_active: Option<bool>,
18378    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18379    pub city: Option<String>,
18380    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18381    pub cms_user_id: Option<String>,
18382    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18383    pub country: Option<String>,
18384    /// A simple date in ISO format, e.g. '2022-10-19'
18385    #[serde(rename = "dateOfBaptism", default, skip_serializing_if = "Option::is_none")]
18386    pub date_of_baptism: Option<chrono::NaiveDate>,
18387    /// A simple date in ISO format, e.g. '2022-10-19'
18388    #[serde(rename = "dateOfBelonging", default, skip_serializing_if = "Option::is_none")]
18389    pub date_of_belonging: Option<chrono::NaiveDate>,
18390    /// A simple date in ISO format, e.g. '2022-10-19'
18391    #[serde(rename = "dateOfDeath", default, skip_serializing_if = "Option::is_none")]
18392    pub date_of_death: Option<chrono::NaiveDate>,
18393    /// A simple date in ISO format, e.g. '2022-10-19'
18394    #[serde(rename = "dateOfEntry", default, skip_serializing_if = "Option::is_none")]
18395    pub date_of_entry: Option<chrono::NaiveDate>,
18396    /// A simple date in ISO format, e.g. '2022-10-19'
18397    #[serde(rename = "dateOfResign", default, skip_serializing_if = "Option::is_none")]
18398    pub date_of_resign: Option<chrono::NaiveDate>,
18399    /// List of department IDs
18400    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
18401    pub department_ids: Option<Vec<i64>>,
18402    /// Edit security level of the current person. The user can edit fields upto this level.
18403    #[serde(rename = "editSecurityLevelForPerson", deserialize_with = "crate::lenient::number")]
18404    pub edit_security_level_for_person: i64,
18405    /// Primary email address of the person.
18406    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18407    pub email: Option<String>,
18408    #[serde(default, skip_serializing_if = "Option::is_none")]
18409    pub emails: Option<Vec<PersonEmailsItem>>,
18410    #[serde(rename = "familyImageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18411    pub family_image_url: Option<String>,
18412    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18413    pub family_status_id: Option<i64>,
18414    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18415    pub fax: Option<String>,
18416    /// A simple date in ISO format, e.g. '2022-10-19'
18417    #[serde(rename = "firstContact", default, skip_serializing_if = "Option::is_none")]
18418    pub first_contact: Option<chrono::NaiveDate>,
18419    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18420    pub first_name: Option<String>,
18421    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18422    pub grow_path_id: Option<i64>,
18423    #[serde(deserialize_with = "crate::lenient::string")]
18424    pub guid: String,
18425    #[serde(deserialize_with = "crate::lenient::number")]
18426    pub id: i64,
18427    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18428    pub image_url: Option<String>,
18429    /// Allowed values: `accepted`, `not_invited`, `pending`.
18430    #[serde(rename = "invitationStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18431    pub invitation_status: Option<String>,
18432    #[serde(rename = "isArchived", default, skip_serializing_if = "Option::is_none")]
18433    pub is_archived: Option<bool>,
18434    /// This computed field is true iff a date of death is set for this person.
18435    #[serde(rename = "isDead", default, skip_serializing_if = "Option::is_none")]
18436    pub is_dead: Option<bool>,
18437    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18438    pub job: Option<String>,
18439    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
18440    #[serde(rename = "lastEditedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
18441    pub last_edited_date: Option<chrono::DateTime<chrono::Utc>>,
18442    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
18443    #[serde(rename = "lastLogin", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
18444    pub last_login: Option<chrono::DateTime<chrono::Utc>>,
18445    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18446    pub last_name: Option<String>,
18447    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18448    pub latitude: Option<f64>,
18449    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18450    pub latitude_loose: Option<f64>,
18451    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18452    pub longitude: Option<f64>,
18453    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18454    pub longitude_loose: Option<f64>,
18455    #[serde(default, skip_serializing_if = "Option::is_none")]
18456    pub meta: Option<MetaDataEntityId>,
18457    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18458    pub mobile: Option<String>,
18459    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18460    pub nationality_id: Option<i64>,
18461    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18462    pub nickname: Option<String>,
18463    /// String with Optigem ID or empty string if no ID is set.
18464    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18465    pub optigem_id: Option<String>,
18466    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18467    pub phone_private: Option<String>,
18468    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18469    pub phone_work: Option<String>,
18470    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18471    pub place_of_baptism: Option<String>,
18472    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
18473    #[deprecated = "deprecated in the ChurchTools API"]
18474    pub privacy_policy_agreement: Option<PersonPrivacyPolicyAgreement>,
18475    /// A simple date in ISO format, e.g. '2022-10-19'
18476    #[serde(rename = "privacyPolicyAgreementDate", default, skip_serializing_if = "Option::is_none")]
18477    pub privacy_policy_agreement_date: Option<chrono::NaiveDate>,
18478    #[serde(rename = "privacyPolicyAgreementTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18479    pub privacy_policy_agreement_type_id: Option<i64>,
18480    #[serde(rename = "privacyPolicyAgreementWhoId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18481    pub privacy_policy_agreement_who_id: Option<i64>,
18482    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18483    pub referred_by: Option<String>,
18484    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18485    pub referred_to: Option<String>,
18486    /// Security level of the current person. The user sees fields upto this level.
18487    #[serde(rename = "securityLevelForPerson", deserialize_with = "crate::lenient::number")]
18488    pub security_level_for_person: i64,
18489    #[serde(rename = "sexId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18490    pub sex_id: Option<i64>,
18491    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18492    pub status_id: Option<i64>,
18493    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18494    pub street: Option<String>,
18495    #[serde(default, skip_serializing_if = "Option::is_none")]
18496    pub tags: Option<Vec<Tag>>,
18497    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18498    pub title: Option<String>,
18499    /// Extensible visibility of a person.
18500    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18501    pub visibility: Option<String>,
18502    /// A simple date in ISO format, e.g. '2022-10-19'
18503    #[serde(rename = "weddingDate", default, skip_serializing_if = "Option::is_none")]
18504    pub wedding_date: Option<chrono::NaiveDate>,
18505    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18506    pub zip: Option<String>,
18507    /// Fields not described by the spec, e.g. instance-specific DB fields.
18508    #[serde(flatten)]
18509    pub extra: serde_json::Map<String, serde_json::Value>,
18510}
18511
18512#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18513pub struct PersonDuplicate {
18514    #[serde(deserialize_with = "crate::lenient::string")]
18515    pub key: String,
18516    pub p1: MetaDataPersonId,
18517    pub p2: MetaDataPersonId,
18518    #[serde(rename = "relationshipId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18519    pub relationship_id: Option<i64>,
18520    /// Fields not described by the spec, e.g. instance-specific DB fields.
18521    #[serde(flatten)]
18522    pub extra: serde_json::Map<String, serde_json::Value>,
18523}
18524
18525#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18526pub struct PersonEmail {
18527    #[serde(rename = "contactLabelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18528    pub contact_label_id: Option<i64>,
18529    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18530    pub email: Option<String>,
18531    /// Marks the default eMail address.
18532    #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")]
18533    pub is_default: Option<bool>,
18534    /// Fields not described by the spec, e.g. instance-specific DB fields.
18535    #[serde(flatten)]
18536    pub extra: serde_json::Map<String, serde_json::Value>,
18537}
18538
18539#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18540pub struct PersonEmailsItem {
18541    #[serde(rename = "contactLabelId", deserialize_with = "crate::lenient::number")]
18542    pub contact_label_id: i64,
18543    #[serde(deserialize_with = "crate::lenient::string")]
18544    pub email: String,
18545    #[serde(rename = "isDefault")]
18546    pub is_default: bool,
18547    /// Fields not described by the spec, e.g. instance-specific DB fields.
18548    #[serde(flatten)]
18549    pub extra: serde_json::Map<String, serde_json::Value>,
18550}
18551
18552/// Download information for a newly generated personal data sheet. The PDF is a separate download, not the body of this API response.
18553#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18554pub struct PersonInformationExport {
18555    /// Absolute download URL of the generated PDF. The stored file is scheduled for deletion after one day; this is not a permanent document URL.
18556    #[serde(rename = "pdfLink", deserialize_with = "crate::lenient::string")]
18557    pub pdf_link: String,
18558    /// Fields not described by the spec, e.g. instance-specific DB fields.
18559    #[serde(flatten)]
18560    pub extra: serde_json::Map<String, serde_json::Value>,
18561}
18562
18563/// Reference catalogs for People & Groups. These are definitions such as role/status types, not memberships or person records. Each array is returned in full without pagination or per-object visibility filtering.
18564#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18565pub struct PersonMasterData {
18566    /// Age-range classifications for groups.
18567    #[serde(rename = "ageGroups")]
18568    pub age_groups: Vec<AgeGroup>,
18569    /// Profiles of type campus only, ordered by sortKey; church profiles are excluded.
18570    pub campuses: Vec<Campus>,
18571    /// Visibility categories for person comments.
18572    #[serde(rename = "commentViewers")]
18573    pub comment_viewers: Vec<CommentViewer>,
18574    /// Labels for contact information.
18575    #[serde(rename = "contactLabels")]
18576    pub contact_labels: Vec<ContactLabel>,
18577    /// Department definitions used in person/group organization.
18578    pub departments: Vec<Department>,
18579    /// Categories used to organize groups.
18580    #[serde(rename = "groupCategories")]
18581    pub group_categories: Vec<GroupCategory>,
18582    /// Reusable meeting feedback form definitions, not meeting dates.
18583    #[serde(rename = "groupMeetingTemplates")]
18584    pub group_meeting_templates: Vec<MeetingTemplate>,
18585    /// Lifecycle status definitions for groups.
18586    #[serde(rename = "groupStatuses")]
18587    pub group_statuses: Vec<GroupStatus>,
18588    /// Group-type definitions controlling available group features.
18589    #[serde(rename = "groupTypes")]
18590    pub group_types: Vec<GroupType>,
18591    /// Growth-path definitions associated with membership roles.
18592    #[serde(rename = "growPaths")]
18593    pub grow_paths: Vec<GrowPath>,
18594    /// Person relationship definitions, including directional labels.
18595    #[serde(rename = "relationshipTypes")]
18596    pub relationship_types: Vec<RelationshipType>,
18597    /// Membership role definitions across group types, ordered by role type and sortKey. Group-specific role settings are returned elsewhere.
18598    pub roles: Vec<Role>,
18599    /// Sex/gender master-data choices.
18600    pub sexes: Vec<Sex>,
18601    /// Person status definitions; distinct from group status and membership workflow state.
18602    pub statuses: Vec<Status>,
18603    /// Audience classifications for groups.
18604    #[serde(rename = "targetGroups")]
18605    pub target_groups: Vec<TargetGroup>,
18606    /// Fields not described by the spec, e.g. instance-specific DB fields.
18607    #[serde(flatten)]
18608    pub extra: serde_json::Map<String, serde_json::Value>,
18609}
18610
18611#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18612pub struct PersonMergeGroupDiff {
18613    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
18614    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
18615    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
18616    pub group_member_status: String,
18617    /// ID of the group
18618    #[serde(deserialize_with = "crate::lenient::number")]
18619    pub id: i64,
18620    /// Name of the member role
18621    #[serde(deserialize_with = "crate::lenient::string")]
18622    pub role: String,
18623    /// ID of the member role
18624    #[serde(rename = "roleId", deserialize_with = "crate::lenient::number")]
18625    pub role_id: i64,
18626    /// Name of the group
18627    #[serde(deserialize_with = "crate::lenient::string")]
18628    pub title: String,
18629    /// Name of the group type
18630    #[serde(deserialize_with = "crate::lenient::string")]
18631    pub r#type: String,
18632    /// Fields not described by the spec, e.g. instance-specific DB fields.
18633    #[serde(flatten)]
18634    pub extra: serde_json::Map<String, serde_json::Value>,
18635}
18636
18637#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18638pub struct PersonMergeGroupsDiff {
18639    /// IDs of groups in which both persons are members
18640    pub both: Vec<i64>,
18641    /// Groups in which the duplicate person is involved
18642    pub new: Vec<PersonMergeGroupDiff>,
18643    /// Groups in which the original person is involved
18644    pub old: Vec<PersonMergeGroupDiff>,
18645    /// Fields not described by the spec, e.g. instance-specific DB fields.
18646    #[serde(flatten)]
18647    pub extra: serde_json::Map<String, serde_json::Value>,
18648}
18649
18650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18651pub struct PersonMergeInfo {
18652    #[serde(rename = "groupsDiff")]
18653    pub groups_diff: PersonMergeGroupsDiff,
18654    #[serde(rename = "personDiff")]
18655    pub person_diff: Vec<PersonMergePersonDiff>,
18656    /// Fields not described by the spec, e.g. instance-specific DB fields.
18657    #[serde(flatten)]
18658    pub extra: serde_json::Map<String, serde_json::Value>,
18659}
18660
18661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18662pub struct PersonMergePersonDiff {
18663    /// Translation key of the person field
18664    #[serde(deserialize_with = "crate::lenient::string")]
18665    pub key: String,
18666    /// Name of the person field
18667    #[serde(deserialize_with = "crate::lenient::string")]
18668    pub name: String,
18669    /// Value from the duplicate person
18670    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18671    pub new: serde_json::Value,
18672    /// Value from the original person
18673    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18674    pub old: serde_json::Value,
18675    /// Whether the difference should be included in change logs
18676    #[serde(rename = "printDiff")]
18677    pub print_diff: bool,
18678    /// Fields not described by the spec, e.g. instance-specific DB fields.
18679    #[serde(flatten)]
18680    pub extra: serde_json::Map<String, serde_json::Value>,
18681}
18682
18683/// Password inputs are not trimmed. The minimum length can be configured by the installation.
18684#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18685pub struct PersonPasswordUpdate {
18686    /// New password satisfying the installation’s length and strength rules.
18687    #[serde(rename = "newPassword", deserialize_with = "crate::lenient::string")]
18688    pub new_password: String,
18689    /// Must exactly match newPassword.
18690    #[serde(rename = "newPasswordConfirm", deserialize_with = "crate::lenient::string")]
18691    pub new_password_confirm: String,
18692    /// Current password, or an empty string for a password-reset session or initial setup without a password.
18693    #[serde(rename = "oldPassword", deserialize_with = "crate::lenient::string")]
18694    pub old_password: String,
18695    /// Fields not described by the spec, e.g. instance-specific DB fields.
18696    #[serde(flatten)]
18697    pub extra: serde_json::Map<String, serde_json::Value>,
18698}
18699
18700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18701pub struct PersonPostStatistics {
18702    #[serde(rename = "countBanned", deserialize_with = "crate::lenient::number")]
18703    pub count_banned: f64,
18704    #[serde(rename = "countExpirationFuture", deserialize_with = "crate::lenient::number")]
18705    pub count_expiration_future: f64,
18706    #[serde(rename = "countExpirationPast", deserialize_with = "crate::lenient::number")]
18707    pub count_expiration_past: f64,
18708    #[serde(rename = "countPublicationFuture", deserialize_with = "crate::lenient::number")]
18709    pub count_publication_future: f64,
18710    #[serde(rename = "countPublished", deserialize_with = "crate::lenient::number")]
18711    pub count_published: f64,
18712    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18713    #[deprecated = "deprecated in the ChurchTools API"]
18714    pub total: Option<f64>,
18715    /// Fields not described by the spec, e.g. instance-specific DB fields.
18716    #[serde(flatten)]
18717    pub extra: serde_json::Map<String, serde_json::Value>,
18718}
18719
18720/// Privacy-consent view for the selected person and their child relationships (relationship type 1). Privacy consent is separate from the confidentiality agreement. Display flags guide the consent UI; mutations still perform their own permission checks.
18721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18722pub struct PersonPrivacyPolicy {
18723    /// Minimum age for independent consent and self-registration, even when registration is disabled.
18724    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::number")]
18725    pub minimum_age: i64,
18726    pub owner: PersonPrivacyPolicyOwner,
18727    pub relationships: Vec<PersonPrivacyPolicyRelationshipsItem>,
18728    /// Whether the configured banner should be shown for outstanding own or child consent.
18729    #[serde(rename = "showBanner")]
18730    pub show_banner: bool,
18731    /// Configured own-consent confirmation text.
18732    #[serde(deserialize_with = "crate::lenient::string")]
18733    pub text: String,
18734    /// Configured child-consent confirmation text.
18735    #[serde(rename = "textRelations", deserialize_with = "crate::lenient::string")]
18736    pub text_relations: String,
18737    /// Suggested consent type: self-confirmation.
18738    #[serde(rename = "typeId", deserialize_with = "crate::lenient::number")]
18739    pub type_id: i64,
18740    /// Suggested consent-giver category: the person themselves.
18741    #[serde(rename = "whoId", deserialize_with = "crate::lenient::number")]
18742    pub who_id: i64,
18743    /// Fields not described by the spec, e.g. instance-specific DB fields.
18744    #[serde(flatten)]
18745    pub extra: serde_json::Map<String, serde_json::Value>,
18746}
18747
18748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18749pub struct PersonPrivacyPolicyAgreement {
18750    /// A simple date in ISO format, e.g. '2022-10-19'
18751    #[serde(default, skip_serializing_if = "Option::is_none")]
18752    pub date: Option<chrono::NaiveDate>,
18753    #[serde(rename = "typeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18754    pub type_id: Option<i64>,
18755    #[serde(rename = "whoId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18756    pub who_id: Option<i64>,
18757    /// Fields not described by the spec, e.g. instance-specific DB fields.
18758    #[serde(flatten)]
18759    pub extra: serde_json::Map<String, serde_json::Value>,
18760}
18761
18762/// Outcome for one child marked accepted in the request. The HTTP 200 response can include non-successful outcomes.
18763#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18764pub struct PersonPrivacyPolicyChildResult {
18765    /// Localized error text for error outcomes; empty string otherwise.
18766    #[serde(deserialize_with = "crate::lenient::string")]
18767    pub error: String,
18768    #[serde(deserialize_with = "crate::lenient::number")]
18769    pub id: i64,
18770    /// Per-child outcome.
18771    /// Allowed values: `error`, `not allowed`, `success`.
18772    #[serde(deserialize_with = "crate::lenient::string")]
18773    pub r#type: String,
18774    /// Fields not described by the spec, e.g. instance-specific DB fields.
18775    #[serde(flatten)]
18776    pub extra: serde_json::Map<String, serde_json::Value>,
18777}
18778
18779/// Child-consent selection consumed by the service. Nested fields are not validated by the controller; supply all fields with the documented types.
18780#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18781pub struct PersonPrivacyPolicyChildUpdate {
18782    /// Whether to request consent for this child.
18783    pub accepted: bool,
18784    /// Birthday as YYYY-MM-DD when adding one, otherwise an empty string. This endpoint does not perform structured date validation.
18785    #[serde(deserialize_with = "crate::lenient::string")]
18786    pub birthday: String,
18787    /// Whether the submitted birthday should be written.
18788    #[serde(rename = "editBirthday")]
18789    pub edit_birthday: bool,
18790    /// Person ID of the child.
18791    #[serde(deserialize_with = "crate::lenient::number")]
18792    pub id: i64,
18793    /// Fields not described by the spec, e.g. instance-specific DB fields.
18794    #[serde(flatten)]
18795    pub extra: serde_json::Map<String, serde_json::Value>,
18796}
18797
18798#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18799pub struct PersonPrivacyPolicyOwner {
18800    pub accepted: bool,
18801    /// Stored consent timestamp, or null. Not normalized to a UTC timestamp by this transformer.
18802    #[serde(rename = "acceptedDate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18803    pub accepted_date: Option<String>,
18804    /// Stored label of the consent type, not its ID or a translated label; null without a type. A legacy zero ID can remain 0.
18805    #[serde(rename = "acceptedType", default, skip_serializing_if = "serde_json::Value::is_null")]
18806    pub accepted_type: serde_json::Value,
18807    /// Consent-giver category ID, or null.
18808    #[serde(rename = "acceptedWho", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18809    pub accepted_who: Option<i64>,
18810    /// Age in years, or 0 when the birthday is unknown.
18811    #[serde(deserialize_with = "crate::lenient::number")]
18812    pub age: i64,
18813    /// UI flag based on enabled consent banner and the configured minimumAge; not a complete authorization decision.
18814    #[serde(rename = "allowedToAccept")]
18815    pub allowed_to_accept: bool,
18816    /// True when no birthday is stored, independently of consent status.
18817    #[serde(rename = "editBirthday")]
18818    pub edit_birthday: bool,
18819    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
18820    pub first_name: String,
18821    #[serde(deserialize_with = "crate::lenient::number")]
18822    pub id: i64,
18823    /// Image URL of the person.
18824    #[serde(deserialize_with = "crate::lenient::string")]
18825    pub image: String,
18826    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
18827    pub last_name: String,
18828    /// Fields not described by the spec, e.g. instance-specific DB fields.
18829    #[serde(flatten)]
18830    pub extra: serde_json::Map<String, serde_json::Value>,
18831}
18832
18833/// Child-side person of a parent/child relationship, with consent flags. Relationships can include adults; their flags normally prevent child-consent actions.
18834#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18835pub struct PersonPrivacyPolicyRelationshipsItem {
18836    pub accepted: bool,
18837    /// Stored consent timestamp, or null. Not normalized to a UTC timestamp by this transformer.
18838    #[serde(rename = "acceptedDate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18839    pub accepted_date: Option<String>,
18840    /// Stored consent-type label, or an empty string if none is found.
18841    #[serde(rename = "acceptedType", deserialize_with = "crate::lenient::string")]
18842    pub accepted_type: String,
18843    /// Consent-giver category ID, or null.
18844    #[serde(rename = "acceptedWho", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
18845    pub accepted_who: Option<i64>,
18846    #[serde(deserialize_with = "crate::lenient::number")]
18847    pub age: i64,
18848    #[serde(rename = "allowedToAccept")]
18849    pub allowed_to_accept: bool,
18850    #[serde(rename = "allowedToDecline")]
18851    pub allowed_to_decline: bool,
18852    /// Stored date of death, if any.
18853    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18854    pub date_of_death: Option<String>,
18855    #[serde(rename = "editBirthday")]
18856    pub edit_birthday: bool,
18857    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
18858    pub first_name: String,
18859    #[serde(deserialize_with = "crate::lenient::string")]
18860    pub guid: String,
18861    #[serde(deserialize_with = "crate::lenient::number")]
18862    pub id: i64,
18863    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18864    pub image: Option<String>,
18865    /// Archive status of the related person.
18866    #[serde(rename = "isArchived")]
18867    pub is_archived: bool,
18868    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
18869    pub last_name: String,
18870    #[serde(rename = "relationshipType")]
18871    pub relationship_type: PersonPrivacyPolicyRelationshipsItemRelationshipType,
18872    /// Fields not described by the spec, e.g. instance-specific DB fields.
18873    #[serde(flatten)]
18874    pub extra: serde_json::Map<String, serde_json::Value>,
18875}
18876
18877#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18878pub struct PersonPrivacyPolicyRelationshipsItemRelationshipType {
18879    #[serde(rename = "degreeOfRelationship", deserialize_with = "crate::lenient::string")]
18880    pub degree_of_relationship: String,
18881    /// ID of this relationship instance, not the relationship type.
18882    #[serde(deserialize_with = "crate::lenient::number")]
18883    pub id: i64,
18884    #[serde(rename = "relationshipName", deserialize_with = "crate::lenient::string")]
18885    pub relationship_name: String,
18886    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
18887    pub relationship_type_id: i64,
18888    /// Fields not described by the spec, e.g. instance-specific DB fields.
18889    #[serde(flatten)]
18890    pub extra: serde_json::Map<String, serde_json::Value>,
18891}
18892
18893/// Record own consent and/or consent for child relationships. All flags and the persons array are required, even when a branch is not used. This operation can partially change data before a later error.
18894#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18895pub struct PersonPrivacyPolicyUpdate {
18896    /// Birthday for the URL person if no birthday is stored. Prefer YYYY-MM-DD. Empty text becomes null; malformed date text is not reliably rejected as 400.
18897    ///
18898    /// `None` leaves the field out, `Some(None)` sends `null`.
18899    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18900    pub birthday: Option<Option<String>>,
18901    /// Whether to process the persons array.
18902    #[serde(rename = "childrenAccepted")]
18903    pub children_accepted: bool,
18904    /// Whether to process consent for the URL person.
18905    #[serde(rename = "ownAccepted")]
18906    pub own_accepted: bool,
18907    /// Child selections; use an empty array when not processing children.
18908    pub persons: Vec<PersonPrivacyPolicyChildUpdate>,
18909    /// Consent-type catalog ID used for own consent; typically the typeId from GET. Child consent always uses self-confirmation (2).
18910    #[serde(rename = "typeId", deserialize_with = "crate::lenient::number")]
18911    pub type_id: i64,
18912    /// Consent-giver catalog ID used for own consent; typically the whoId from GET. Child consent always uses parent (2).
18913    #[serde(rename = "whoId", deserialize_with = "crate::lenient::number")]
18914    pub who_id: i64,
18915    /// Fields not described by the spec, e.g. instance-specific DB fields.
18916    #[serde(flatten)]
18917    pub extra: serde_json::Map<String, serde_json::Value>,
18918}
18919
18920#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18921pub struct PersonProperties {
18922    #[serde(rename = "canChat")]
18923    pub can_chat: bool,
18924    #[serde(rename = "hasEmail")]
18925    pub has_email: bool,
18926    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
18927    pub image_url: Option<String>,
18928    /// Allowed values: `accepted`, `not_invited`, `pending`.
18929    #[serde(rename = "invitationStatus", deserialize_with = "crate::lenient::string")]
18930    pub invitation_status: String,
18931    #[serde(rename = "isArchived")]
18932    pub is_archived: bool,
18933    #[serde(rename = "isDead")]
18934    pub is_dead: bool,
18935    /// Extensible visibility of a person.
18936    #[serde(deserialize_with = "crate::lenient::string")]
18937    pub visibility: String,
18938    /// Fields not described by the spec, e.g. instance-specific DB fields.
18939    #[serde(flatten)]
18940    pub extra: serde_json::Map<String, serde_json::Value>,
18941}
18942
18943/// Relationship information of a person. Notice, that a relationship has a security level. That means you only see those relationships, you are allowed to see.
18944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18945pub struct PersonRelationship {
18946    /// Name of type, what this relative is for the user.
18947    #[serde(rename = "degreeOfRelationship", deserialize_with = "crate::lenient::string")]
18948    pub degree_of_relationship: String,
18949    /// ID of the relationship
18950    #[serde(deserialize_with = "crate::lenient::number")]
18951    pub id: i64,
18952    /// Name of Relationship
18953    #[serde(rename = "relationshipName", deserialize_with = "crate::lenient::string")]
18954    pub relationship_name: String,
18955    /// ID of relationship type
18956    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
18957    pub relationship_type_id: i64,
18958    /// Person as Domain Object
18959    pub relative: DomainObjectPerson,
18960    /// Fields not described by the spec, e.g. instance-specific DB fields.
18961    #[serde(flatten)]
18962    pub extra: serde_json::Map<String, serde_json::Value>,
18963}
18964
18965/// Update the assignment using personId from the path. The path already provides the assignee; do not supply an external name. The legacy agreed field is accepted as an alias for isAccepted.
18966#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18967pub struct PersonServiceRequestUpdate {
18968    /// Legacy alias for isAccepted. Prefer isAccepted in new integrations.
18969    #[serde(default, skip_serializing_if = "Option::is_none")]
18970    #[deprecated = "deprecated in the ChurchTools API"]
18971    pub agreed: Option<bool>,
18972    /// Accepted for compatibility but ignored by this update operation; the replacement record starts without a comment. Use the accept or decline action for a response comment.
18973    ///
18974    /// `None` leaves the field out, `Some(None)` sends `null`.
18975    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
18976    pub comment: Option<Option<String>>,
18977    /// Accepted for compatibility; this flag does not control notifications in the current implementation. Notifications follow the assignment workflow.
18978    #[serde(default, skip_serializing_if = "Option::is_none")]
18979    pub inform_person: Option<bool>,
18980    /// true creates a confirmed assignment; false creates an assignment awaiting confirmation. false does not decline it.
18981    #[serde(rename = "isAccepted", default, skip_serializing_if = "Option::is_none")]
18982    pub is_accepted: Option<bool>,
18983    /// Fields not described by the spec, e.g. instance-specific DB fields.
18984    #[serde(flatten)]
18985    pub extra: serde_json::Map<String, serde_json::Value>,
18986}
18987
18988/// One stored person preference, identified by module namespace and attribute key. Read endpoints include stored settings beyond the write allowlist. This is not a person master-data field.
18989#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18990pub struct PersonSetting {
18991    /// Setting key within the module namespace.
18992    #[serde(deserialize_with = "crate::lenient::string")]
18993    pub attribute: String,
18994    /// Stored namespace. Read results are not restricted to the modules writable through this API.
18995    #[serde(deserialize_with = "crate::lenient::string")]
18996    pub module: String,
18997    /// Decoded stored value. Serialized arrays/booleans retain their JSON type; un-serialized numeric values can be strings when read from storage. The type depends on the setting and may differ from the immediate PUT response.
18998    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
18999    pub value: serde_json::Value,
19000    /// Fields not described by the spec, e.g. instance-specific DB fields.
19001    #[serde(flatten)]
19002    pub extra: serde_json::Map<String, serde_json::Value>,
19003}
19004
19005/// Value for one allowed person setting. numeric accepts JSON numbers or numeric strings; boolean requires a JSON boolean; array accepts lists or associative objects; string requires a string. Null is not accepted. The module and attribute are taken from the URL.
19006///
19007/// Supported module/attribute pairs and value categories:
19008///
19009/// | Module | Attributes (value type) |
19010/// | --- | --- |
19011/// | churchcore | `saml-id` (numeric), `hidden-hints` (array), `hidden-hints-temporarily` (string), `alpha-consent` (numeric), `language` (string), `tour-completion-stats` (array) |
19012/// | churchhome | `startpageWidgets` (array), `hiddenStartpageWidgets` (array) |
19013/// | churchdb | `group-custom-views` (string), `favorite-groups` (array), `mailerBCC` (numeric), `sendBCCMail` (numeric), `signature` (string), `labelTemplateSelection` (string) |
19014/// | churchcal | `filterGemeindekalendar` (string), `filterGruppenKalender` (string), `filterPersonalKalender` (string), `currentBirthdayScope` (string) |
19015/// | churchservice | `file_attachToAllEvents` (numeric), `agendaExportSettings` (array) |
19016/// | churchcheckin | `category_id` (numeric), `distrikt_id` (numeric), `group_id` (string), `event_datum` (string), `rolename` (string), `viewCheckin` (string), `sortnames` (string), `printer_id` (string), `starthelpReaded` (string), `printgrouplist` (boolean), `station_id` (string), `status_id` (string), `bereich_id` (string), `personsSortBy` (string) |
19017/// | finance | `selected-client` (numeric), `transaction-mode` (string), `selected-accounting-period` (array), `selected-donation-receipt-letter-template` (string), `selected-donation-receipt-attachment-template` (string), `show-purposes-in-import` (numeric), `donation-download-mode` (string), `donation-download-double-page` (string), `show-entries-without-budget` (boolean), `eubp-mock-scenario` (string), `statements-document-number-type` (array), `statements-booking-number-template` (array) |
19018/// | wiki | `showMarkdownHints` (numeric) |
19019/// | global | `recent-searches` (array), `recent-persons` (array), `recent-groups` (array), `recent-wiki_pages` (array), `recent-songs` (array), `recent-appointments` (array), `simulatedPersons` (array), `station` (string) |
19020/// | app | `excluded-calendars` (array), `excluded-widgets` (array), `sorted-widgets` (array) |
19021/// | push | `birthday-type` (string), `disableGroupSignUpNotifications` (numeric), `groupSignUpNotificationsAgeGroupIds` (array), `groupSignUpNotificationsTargetGroupIds` (array), `groupSignUpNotificationsCategoryIds` (array) |
19022#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19023pub struct PersonSettingUpdate {
19024    /// Value of the selected setting, using its required type. Calendar filters require a string containing a JSON array, not a JSON array directly.
19025    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
19026    pub value: serde_json::Value,
19027    /// Fields not described by the spec, e.g. instance-specific DB fields.
19028    #[serde(flatten)]
19029    pub extra: serde_json::Map<String, serde_json::Value>,
19030}
19031
19032/// One stored person preference, identified by module namespace and attribute key. Read endpoints include stored settings beyond the write allowlist. This is not a person master-data field.
19033#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19034pub struct PersonTwoFactorEnabled {
19035    #[serde(deserialize_with = "crate::lenient::string")]
19036    pub attribute: String,
19037    #[serde(deserialize_with = "crate::lenient::string")]
19038    pub module: String,
19039    /// Whether the person has enabled TOTP authentication. False if no setting exists.
19040    pub value: bool,
19041    /// Fields not described by the spec, e.g. instance-specific DB fields.
19042    #[serde(flatten)]
19043    pub extra: serde_json::Map<String, serde_json::Value>,
19044}
19045
19046/// One stored person preference, identified by module namespace and attribute key. Read endpoints include stored settings beyond the write allowlist. This is not a person master-data field.
19047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19048pub struct PersonTwoFactorForce {
19049    #[serde(deserialize_with = "crate::lenient::string")]
19050    pub attribute: String,
19051    #[serde(deserialize_with = "crate::lenient::string")]
19052    pub module: String,
19053    /// Explicit person-level requirement. Group-role requirements are not included.
19054    pub value: bool,
19055    /// Fields not described by the spec, e.g. instance-specific DB fields.
19056    #[serde(flatten)]
19057    pub extra: serde_json::Map<String, serde_json::Value>,
19058}
19059
19060#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19061pub struct PersonTwoFactorForceUpdate {
19062    /// Whether the person must configure two-factor authentication.
19063    pub value: bool,
19064    /// Fields not described by the spec, e.g. instance-specific DB fields.
19065    #[serde(flatten)]
19066    pub extra: serde_json::Map<String, serde_json::Value>,
19067}
19068
19069#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19070pub struct PersonTwoFactorVerify {
19071    /// Six-digit current authenticator code. Send it as a string to preserve leading zeroes. A code already accepted recently for this person cannot be reused.
19072    #[serde(deserialize_with = "crate::lenient::string")]
19073    pub code: String,
19074    /// ID of the current person whose initialized secret is checked.
19075    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
19076    pub person_id: i64,
19077    /// Fields not described by the spec, e.g. instance-specific DB fields.
19078    #[serde(flatten)]
19079    pub extra: serde_json::Map<String, serde_json::Value>,
19080}
19081
19082/// Fields applicable to upate a person
19083#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19084pub struct PersonUpdateable {
19085    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19086    pub address_addition: Option<String>,
19087    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19088    pub age: Option<i64>,
19089    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19090    pub baptised_by: Option<String>,
19091    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19092    pub birth_name: Option<String>,
19093    /// `None` leaves the field out, `Some(None)` sends `null`.
19094    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19095    pub birthday: Option<Option<chrono::NaiveDate>>,
19096    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19097    pub birthplace: Option<String>,
19098    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19099    pub campus_id: Option<i64>,
19100    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19101    pub city: Option<String>,
19102    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19103    pub cms_user_id: Option<String>,
19104    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19105    pub country: Option<String>,
19106    /// `None` leaves the field out, `Some(None)` sends `null`.
19107    #[serde(rename = "dateOfBaptism", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19108    pub date_of_baptism: Option<Option<chrono::NaiveDate>>,
19109    /// `None` leaves the field out, `Some(None)` sends `null`.
19110    #[serde(rename = "dateOfBelonging", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19111    pub date_of_belonging: Option<Option<chrono::NaiveDate>>,
19112    /// `None` leaves the field out, `Some(None)` sends `null`.
19113    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19114    pub date_of_death: Option<Option<chrono::NaiveDate>>,
19115    /// `None` leaves the field out, `Some(None)` sends `null`.
19116    #[serde(rename = "dateOfEntry", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19117    pub date_of_entry: Option<Option<chrono::DateTime<chrono::Utc>>>,
19118    /// `None` leaves the field out, `Some(None)` sends `null`.
19119    #[serde(rename = "dateOfResign", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19120    pub date_of_resign: Option<Option<chrono::DateTime<chrono::Utc>>>,
19121    /// Department IDs. At least one department MUST be set for a person. The last department ID cannot be deleted.
19122    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
19123    pub department_ids: Option<Vec<i64>>,
19124    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19125    pub email: Option<String>,
19126    /// Save many eMail addresses for person. If `emails` is present in request `email` is ignored.
19127    #[serde(default, skip_serializing_if = "Option::is_none")]
19128    pub emails: Option<Vec<PersonEmail>>,
19129    /// `None` leaves the field out, `Some(None)` sends `null`.
19130    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19131    pub family_status_id: Option<Option<i64>>,
19132    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19133    pub fax: Option<String>,
19134    /// `None` leaves the field out, `Some(None)` sends `null`.
19135    #[serde(rename = "firstContact", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19136    pub first_contact: Option<Option<chrono::DateTime<chrono::Utc>>>,
19137    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19138    pub first_name: Option<String>,
19139    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19140    pub grow_path_id: Option<i64>,
19141    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19142    pub job: Option<String>,
19143    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19144    pub last_name: Option<String>,
19145    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19146    pub mobile: Option<String>,
19147    /// `None` leaves the field out, `Some(None)` sends `null`.
19148    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19149    pub nationality_id: Option<Option<i64>>,
19150    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19151    pub nickname: Option<String>,
19152    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19153    pub optigem_id: Option<String>,
19154    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19155    pub phone_private: Option<String>,
19156    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19157    pub phone_work: Option<String>,
19158    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19159    pub place_of_baptism: Option<String>,
19160    /// This object can be optional or required. Depending on your ChurchTools data security settings.
19161    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
19162    pub privacy_policy_agreement: Option<PatchPersonsIdBodyPrivacyPolicyAgreement>,
19163    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19164    pub referred_by: Option<String>,
19165    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19166    pub referred_to: Option<String>,
19167    /// `None` leaves the field out, `Some(None)` sends `null`.
19168    #[serde(rename = "sexId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19169    pub sex_id: Option<Option<i64>>,
19170    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19171    pub status_id: Option<i64>,
19172    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19173    pub street: Option<String>,
19174    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19175    pub title: Option<String>,
19176    /// Visibility accepted when creating or updating a person.
19177    /// Allowed values: `hidden`, `visible`.
19178    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19179    pub visibility: Option<String>,
19180    /// `None` leaves the field out, `Some(None)` sends `null`.
19181    #[serde(rename = "weddingDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19182    pub wedding_date: Option<Option<chrono::NaiveDate>>,
19183    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19184    pub zip: Option<String>,
19185    /// Fields not described by the spec, e.g. instance-specific DB fields.
19186    #[serde(flatten)]
19187    pub extra: serde_json::Map<String, serde_json::Value>,
19188}
19189
19190/// Entry in a recursive placeholder menu. Items with `items` are menu groups; items with `placeholder` and `label` are selectable placeholders.
19191#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19192pub struct PlaceholderItem {
19193    /// Nested placeholder menu entries. Entries have the same shape as PlaceholderItem, but are documented without a recursive $ref because some OpenAPI tooling cannot resolve recursive schemas.
19194    #[serde(default, skip_serializing_if = "Option::is_none")]
19195    pub items: Option<Vec<PlaceholderItemItemsItem>>,
19196    /// Translated label shown for a selectable placeholder
19197    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19198    pub label: Option<String>,
19199    /// Optional shorter label shown in nested placeholder menus
19200    #[serde(rename = "menuLabel", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19201    pub menu_label: Option<String>,
19202    /// Translated name of a placeholder menu group
19203    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19204    pub name: Option<String>,
19205    /// Placeholder expression to insert into a template
19206    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19207    pub placeholder: Option<String>,
19208    /// Fields not described by the spec, e.g. instance-specific DB fields.
19209    #[serde(flatten)]
19210    pub extra: serde_json::Map<String, serde_json::Value>,
19211}
19212
19213#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19214pub struct PlaceholderItemItemsItem {
19215    /// Further nested placeholder menu entries.
19216    #[serde(default, skip_serializing_if = "Option::is_none")]
19217    pub items: Option<Vec<std::collections::BTreeMap<String, serde_json::Value>>>,
19218    /// Translated label shown for a selectable placeholder
19219    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19220    pub label: Option<String>,
19221    /// Optional shorter label shown in nested placeholder menus
19222    #[serde(rename = "menuLabel", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19223    pub menu_label: Option<String>,
19224    /// Translated name of a placeholder menu group
19225    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19226    pub name: Option<String>,
19227    /// Placeholder expression to insert into a template
19228    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19229    pub placeholder: Option<String>,
19230    /// Fields not described by the spec, e.g. instance-specific DB fields.
19231    #[serde(flatten)]
19232    pub extra: serde_json::Map<String, serde_json::Value>,
19233}
19234
19235#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19236pub struct PlaceholderMenuGroup {
19237    /// Selectable placeholders and further menu groups.
19238    pub items: Vec<PlaceholderItem>,
19239    /// Translated menu-section label.
19240    #[serde(deserialize_with = "crate::lenient::string")]
19241    pub name: String,
19242    /// Fields not described by the spec, e.g. instance-specific DB fields.
19243    #[serde(flatten)]
19244    pub extra: serde_json::Map<String, serde_json::Value>,
19245}
19246
19247#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19248pub struct PollForNewsResult {
19249    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
19250    pub domain_id: i64,
19251    /// Allowed values: `agenda`, `agenda_item`, `appointment`, `booking`, `calendar`, `event`, `event_service`, `follow_up`, `group`, `group_meeting`, `person`, `resource`, `routine`.
19252    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
19253    pub domain_type: String,
19254    /// The person id of the person that changed the object
19255    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
19256    pub person_id: i64,
19257    /// Fields not described by the spec, e.g. instance-specific DB fields.
19258    #[serde(flatten)]
19259    pub extra: serde_json::Map<String, serde_json::Value>,
19260}
19261
19262/// One visible candidate for assigning a service role at an event. Scores are advisory: even unavailable persons remain in the list. Higher scores indicate fewer penalties or stronger preferences. The endpoint does not sort by score.
19263#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19264pub struct PossibleEventPerson {
19265    /// Absences overlapping the event interval. Candidates with an absence are retained and receive a score penalty.
19266    pub absences: Vec<Absence>,
19267    /// Connected groups through whose active, visible-role memberships this person was found. A group can occur more than once.
19268    #[serde(rename = "connectedGroups")]
19269    pub connected_groups: Vec<DomainObjectGroup>,
19270    /// Latest valid assignment in the same service group starting strictly before this event, within the loaded history window. Null if none was found.
19271    #[serde(rename = "lastService", default, skip_serializing_if = "Option::is_none")]
19272    pub last_service: Option<ServiceCandidateAssignment>,
19273    /// Counts of valid assignments in the same service group, including outstanding and confirmed assignments. Keys are YYYY-MM, initialized from four months before the event and advanced six times by calendar months; values include zero. Counts are per assignment, not per distinct event.
19274    #[serde(rename = "monthlyUtilization", deserialize_with = "crate::lenient::map")]
19275    pub monthly_utilization: std::collections::BTreeMap<String, i64>,
19276    /// Next valid assignment in the same service group starting strictly after this event, within the loaded history window. Null if none was found.
19277    #[serde(rename = "nextService", default, skip_serializing_if = "Option::is_none")]
19278    pub next_service: Option<ServiceCandidateAssignment>,
19279    /// Whether a person linked as a partner (relationship type 2) has an assignment in this event. The lookup includes historical and unconfirmed records.
19280    #[serde(rename = "partnerServices")]
19281    pub partner_services: bool,
19282    /// Person as Domain Object
19283    pub person: DomainObjectPerson,
19284    /// Advisory suitability score. Zero when there are no hints. This is not a probability or a guarantee that assignment will succeed.
19285    #[serde(deserialize_with = "crate::lenient::number")]
19286    pub score: i64,
19287    /// Reasons contributing to the score. An empty array is allowed.
19288    #[serde(rename = "scoreHints")]
19289    pub score_hints: Vec<ServiceCandidateScoreHint>,
19290    #[serde(rename = "serviceGroupPreferences", default, skip_serializing_if = "Option::is_none")]
19291    pub service_group_preferences: Option<ServiceGroupPersonPreference>,
19292    /// Whether servicesOnSameDay is nonempty.
19293    #[serde(rename = "serviceOnSameDay")]
19294    pub service_on_same_day: bool,
19295    /// Selected valid assignment on the same day for another service role. The repository retains at most one other-service assignment per person; this is not an exhaustive conflict list.
19296    #[serde(rename = "servicesOnSameDay")]
19297    pub services_on_same_day: Vec<ServiceCandidateAssignment>,
19298    /// Declined records for this event and service, plus the selected invalid assignment for another service on the same day, if any. The latter can be a superseded record rather than a decline.
19299    #[serde(rename = "servicesPreviouslyDeclined")]
19300    pub services_previously_declined: Vec<ServiceCandidateAssignment>,
19301    /// Fields not described by the spec, e.g. instance-specific DB fields.
19302    #[serde(flatten)]
19303    pub extra: serde_json::Map<String, serde_json::Value>,
19304}
19305
19306#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19307pub struct PossiblePostGroup {
19308    #[serde(rename = "favoriteGroup")]
19309    pub favorite_group: bool,
19310    #[serde(rename = "featuredGroup")]
19311    pub featured_group: bool,
19312    pub group: DomainObjectGroup,
19313    #[serde(rename = "roleName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19314    pub role_name: Option<String>,
19315    /// Allowed values: `postPossible`, `signupAndPostPossible`.
19316    #[serde(deserialize_with = "crate::lenient::string")]
19317    pub r#type: String,
19318    /// Fields not described by the spec, e.g. instance-specific DB fields.
19319    #[serde(flatten)]
19320    pub extra: serde_json::Map<String, serde_json::Value>,
19321}
19322
19323#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19324pub struct Post {
19325    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19326    pub content: Option<String>,
19327    #[serde(rename = "expirationDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19328    pub expiration_date: Option<chrono::DateTime<chrono::Utc>>,
19329    #[serde(rename = "publicationDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19330    pub publication_date: Option<chrono::DateTime<chrono::Utc>>,
19331    #[serde(deserialize_with = "crate::lenient::string")]
19332    pub title: String,
19333    /// Allowed values: `group_intern`, `group_visible`.
19334    #[serde(deserialize_with = "crate::lenient::string")]
19335    pub visibility: String,
19336    /// Person as Domain Object
19337    pub actor: DomainObjectPerson,
19338    #[serde(default, skip_serializing_if = "Option::is_none")]
19339    pub comments: Option<Vec<PostComment>>,
19340    #[serde(rename = "commentsActive")]
19341    pub comments_active: bool,
19342    /// Person identified by expirationPid. Null when expirationPid is null or identifies the post author; otherwise populated with the person who last set or changed the expiration date.
19343    #[serde(rename = "expirationPerson", default, skip_serializing_if = "Option::is_none")]
19344    pub expiration_person: Option<DomainObjectPerson>,
19345    /// ID of the person who last set or changed the expiration date.
19346    #[serde(rename = "expirationPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19347    pub expiration_pid: Option<i64>,
19348    pub group: DomainObjectGroup,
19349    /// The visibility of a group.
19350    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
19351    #[serde(rename = "groupVisibility", deserialize_with = "crate::lenient::string")]
19352    pub group_visibility: String,
19353    #[serde(deserialize_with = "crate::lenient::string")]
19354    pub guid: String,
19355    #[serde(deserialize_with = "crate::lenient::number")]
19356    pub id: i64,
19357    pub images: Vec<String>,
19358    #[serde(rename = "imagesMeta")]
19359    pub images_meta: Vec<PostImageMeta>,
19360    #[serde(default, skip_serializing_if = "Option::is_none")]
19361    pub instance: Option<PostInstance>,
19362    #[serde(rename = "isBanned")]
19363    pub is_banned: bool,
19364    /// Last edit timestamp only when later than publicationDate; otherwise null.
19365    #[serde(rename = "lastEditedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19366    pub last_edited_date: Option<chrono::DateTime<chrono::Utc>>,
19367    #[serde(default, skip_serializing_if = "Option::is_none")]
19368    pub linkings: Option<Vec<LinkingOpenGraph>>,
19369    pub meta: MetaDataEntityId,
19370    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
19371    #[serde(rename = "publishedDate", serialize_with = "crate::datetime::serialize_utc")]
19372    pub published_date: chrono::DateTime<chrono::Utc>,
19373    #[serde(default, skip_serializing_if = "Option::is_none")]
19374    pub reactions: Option<Vec<PostReaction>>,
19375    /// Fields not described by the spec, e.g. instance-specific DB fields.
19376    #[serde(flatten)]
19377    pub extra: serde_json::Map<String, serde_json::Value>,
19378}
19379
19380#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19381pub struct PostActionsBody {
19382    /// One or more domain types to filter actions by.
19383    /// Allowed values: `group_membership`, `person`.
19384    pub domain_type: Vec<String>,
19385    /// Optional filter criteria to further narrow the returned actions. The structure depends on the domain type.
19386    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
19387    pub filter: Option<std::collections::BTreeMap<String, serde_json::Value>>,
19388    /// Fields not described by the spec, e.g. instance-specific DB fields.
19389    #[serde(flatten)]
19390    pub extra: serde_json::Map<String, serde_json::Value>,
19391}
19392
19393#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19394pub struct PostCaptchaBody {
19395    #[serde(deserialize_with = "crate::lenient::string")]
19396    pub solution: String,
19397    /// Fields not described by the spec, e.g. instance-specific DB fields.
19398    #[serde(flatten)]
19399    pub extra: serde_json::Map<String, serde_json::Value>,
19400}
19401
19402#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19403pub struct PostCaptchaResponse {
19404    #[serde(rename = "isValid")]
19405    pub is_valid: bool,
19406    /// Fields not described by the spec, e.g. instance-specific DB fields.
19407    #[serde(flatten)]
19408    pub extra: serde_json::Map<String, serde_json::Value>,
19409}
19410
19411#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19412pub struct PostComment {
19413    #[serde(deserialize_with = "crate::lenient::string")]
19414    pub content: String,
19415    #[serde(deserialize_with = "crate::lenient::number")]
19416    pub id: i64,
19417    pub meta: MetaDataEntityId,
19418    #[serde(rename = "parentCommentId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19419    pub parent_comment_id: Option<i64>,
19420    /// Person as Domain Object
19421    pub person: DomainObjectPerson,
19422    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
19423    pub post_id: i64,
19424    pub reactions: Vec<PostCommentReaction>,
19425    /// Fields not described by the spec, e.g. instance-specific DB fields.
19426    #[serde(flatten)]
19427    pub extra: serde_json::Map<String, serde_json::Value>,
19428}
19429
19430#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19431pub struct PostCommentCreate {
19432    #[serde(deserialize_with = "crate::lenient::string")]
19433    pub content: String,
19434    /// `None` leaves the field out, `Some(None)` sends `null`.
19435    #[serde(rename = "parentCommentId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19436    pub parent_comment_id: Option<Option<i64>>,
19437    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
19438    pub post_id: i64,
19439    /// Fields not described by the spec, e.g. instance-specific DB fields.
19440    #[serde(flatten)]
19441    pub extra: serde_json::Map<String, serde_json::Value>,
19442}
19443
19444#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19445pub struct PostCommentReaction {
19446    #[serde(rename = "commentId", deserialize_with = "crate::lenient::number")]
19447    pub comment_id: i64,
19448    #[serde(deserialize_with = "crate::lenient::string")]
19449    pub emoji: String,
19450    pub meta: MetaDataEntityId,
19451    #[serde(default, skip_serializing_if = "Option::is_none")]
19452    pub person: Option<DomainObjectPerson>,
19453    /// Fields not described by the spec, e.g. instance-specific DB fields.
19454    #[serde(flatten)]
19455    pub extra: serde_json::Map<String, serde_json::Value>,
19456}
19457
19458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19459pub struct PostCommentReactionCreate {
19460    #[serde(deserialize_with = "crate::lenient::string")]
19461    pub emoji: String,
19462    /// Fields not described by the spec, e.g. instance-specific DB fields.
19463    #[serde(flatten)]
19464    pub extra: serde_json::Map<String, serde_json::Value>,
19465}
19466
19467#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19468pub struct PostCreate {
19469    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19470    pub content: Option<String>,
19471    /// `None` leaves the field out, `Some(None)` sends `null`.
19472    #[serde(rename = "expirationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19473    pub expiration_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
19474    /// `None` leaves the field out, `Some(None)` sends `null`.
19475    #[serde(rename = "publicationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19476    pub publication_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
19477    #[serde(deserialize_with = "crate::lenient::string")]
19478    pub title: String,
19479    /// Allowed values: `group_intern`, `group_visible`.
19480    #[serde(deserialize_with = "crate::lenient::string")]
19481    pub visibility: String,
19482    #[serde(rename = "commentsActive", default, skip_serializing_if = "Option::is_none")]
19483    pub comments_active: Option<bool>,
19484    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
19485    pub group_id: i64,
19486    #[serde(rename = "imageIds", default, skip_serializing_if = "Option::is_none")]
19487    pub image_ids: Option<Vec<i64>>,
19488    /// Fields not described by the spec, e.g. instance-specific DB fields.
19489    #[serde(flatten)]
19490    pub extra: serde_json::Map<String, serde_json::Value>,
19491}
19492
19493#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19494pub struct PostExternalloginsSamlMetadataParseData {
19495    pub descriptors: Vec<SamlIdpMetadataDescriptor>,
19496    /// Fields not described by the spec, e.g. instance-specific DB fields.
19497    #[serde(flatten)]
19498    pub extra: serde_json::Map<String, serde_json::Value>,
19499}
19500
19501#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19502pub struct PostFeatureusageBody {
19503    #[serde(default, skip_serializing_if = "Option::is_none")]
19504    pub data: Option<Vec<FeatureUsage>>,
19505    /// Fields not described by the spec, e.g. instance-specific DB fields.
19506    #[serde(flatten)]
19507    pub extra: serde_json::Map<String, serde_json::Value>,
19508}
19509
19510#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19511pub struct PostFinanceEubpSubmissionsIdGenerateData {
19512    /// URL to download the generated ZIP file
19513    #[serde(rename = "downloadUrl", deserialize_with = "crate::lenient::string")]
19514    pub download_url: String,
19515    /// Fields not described by the spec, e.g. instance-specific DB fields.
19516    #[serde(flatten)]
19517    pub extra: serde_json::Map<String, serde_json::Value>,
19518}
19519
19520#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19521pub struct PostGroupsBody {
19522    /// Campus Id if group is connected to a campus
19523    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19524    pub campus_id: Option<i64>,
19525    /// Need to be true, if another group with that name already exists
19526    #[serde(default, skip_serializing_if = "Option::is_none")]
19527    pub force: Option<bool>,
19528    /// ID of group category
19529    #[serde(rename = "groupCategoryId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19530    pub group_category_id: Option<i64>,
19531    /// ID of the group status. Values are fixed: 1 is active, 2 is pending (draft), 3 is archived, and 4 is finished. ChurchTools clients normally use active for a new group.
19532    #[serde(rename = "groupStatusId", deserialize_with = "crate::lenient::number")]
19533    pub group_status_id: i64,
19534    /// Id of group type
19535    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
19536    pub group_type_id: i64,
19537    /// Group name
19538    #[serde(deserialize_with = "crate::lenient::string")]
19539    pub name: String,
19540    /// Group ID of parent group
19541    #[serde(rename = "parentGroupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19542    pub parent_group_id: Option<i64>,
19543    /// put yourself in this role
19544    #[serde(rename = "roleId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19545    pub role_id: Option<i64>,
19546    /// The visibility of a group.
19547    /// Allowed values: `hidden`, `intern`, `public`, `restricted`.
19548    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19549    pub visibility: Option<String>,
19550    /// Fields not described by the spec, e.g. instance-specific DB fields.
19551    #[serde(flatten)]
19552    pub extra: serde_json::Map<String, serde_json::Value>,
19553}
19554
19555#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19556pub struct PostGroupsGroupIdMeetingsMeetingIdMembersMissingBody {
19557    /// Attendance state to assign to currently unsure records.
19558    /// Allowed values: `absent`, `present`.
19559    #[serde(deserialize_with = "crate::lenient::string")]
19560    pub status: String,
19561    /// Fields not described by the spec, e.g. instance-specific DB fields.
19562    #[serde(flatten)]
19563    pub extra: serde_json::Map<String, serde_json::Value>,
19564}
19565
19566#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19567pub struct PostGroupsIdMeetingsBody {
19568    /// Start of the meeting in UTC.
19569    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
19570    pub start_date: chrono::DateTime<chrono::Utc>,
19571    /// Fields not described by the spec, e.g. instance-specific DB fields.
19572    #[serde(flatten)]
19573    pub extra: serde_json::Map<String, serde_json::Value>,
19574}
19575
19576#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19577pub struct PostImageMeta {
19578    #[serde(rename = "aspectRatio", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19579    pub aspect_ratio: Option<f64>,
19580    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::string")]
19581    pub image_url: String,
19582    /// Fields not described by the spec, e.g. instance-specific DB fields.
19583    #[serde(flatten)]
19584    pub extra: serde_json::Map<String, serde_json::Value>,
19585}
19586
19587#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19588pub struct PostInstallationSyncOidcBody {
19589    /// Compact RS256 JWS containing the configuration.
19590    #[serde(rename = "configurationToken", deserialize_with = "crate::lenient::string")]
19591    pub configuration_token: String,
19592    /// Fields not described by the spec, e.g. instance-specific DB fields.
19593    #[serde(flatten)]
19594    pub extra: serde_json::Map<String, serde_json::Value>,
19595}
19596
19597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19598pub struct PostInstallationSyncOidcData {
19599    #[serde(rename = "externalLoginId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19600    pub external_login_id: Option<i64>,
19601    #[serde(rename = "installationId", deserialize_with = "crate::lenient::string")]
19602    pub installation_id: String,
19603    #[serde(deserialize_with = "crate::lenient::number")]
19604    pub revision: i64,
19605    /// Fields not described by the spec, e.g. instance-specific DB fields.
19606    #[serde(flatten)]
19607    pub extra: serde_json::Map<String, serde_json::Value>,
19608}
19609
19610#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19611pub struct PostInstance {
19612    #[serde(deserialize_with = "crate::lenient::string")]
19613    pub guid: String,
19614    #[serde(rename = "siteName", deserialize_with = "crate::lenient::string")]
19615    pub site_name: String,
19616    #[serde(rename = "siteUrl", deserialize_with = "crate::lenient::string")]
19617    pub site_url: String,
19618    /// Fields not described by the spec, e.g. instance-specific DB fields.
19619    #[serde(flatten)]
19620    pub extra: serde_json::Map<String, serde_json::Value>,
19621}
19622
19623#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19624pub struct PostLabelsData {
19625    /// Absolute URL of the generated file, scheduled to expire after one day.
19626    #[serde(deserialize_with = "crate::lenient::string")]
19627    pub pdf: String,
19628    /// Fields not described by the spec, e.g. instance-specific DB fields.
19629    #[serde(flatten)]
19630    pub extra: serde_json::Map<String, serde_json::Value>,
19631}
19632
19633/// Two-factor completion result. The legacy disabled-two-factor branch returns only status and does not complete login.
19634#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19635pub struct PostLoginTwofactorSetupActivateData {
19636    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::string")]
19637    pub redirect_to: String,
19638    #[serde(deserialize_with = "crate::lenient::string")]
19639    pub status: String,
19640    /// Fields not described by the spec, e.g. instance-specific DB fields.
19641    #[serde(flatten)]
19642    pub extra: serde_json::Map<String, serde_json::Value>,
19643}
19644
19645#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19646pub struct PostMarkdownCheckBody {
19647    /// Validates the provided Markdown content against the specified scope's rules and restrictions.
19648    /// This ensures the content adheres to the allowed formatting and elements for the given context.
19649    /// Allowed values: `description`, `document`, `plaintext`, `richline`.
19650    #[serde(rename = "inputScope", deserialize_with = "crate::lenient::string")]
19651    pub input_scope: String,
19652    /// The Markdown text to be processed
19653    #[serde(deserialize_with = "crate::lenient::string")]
19654    pub markdown: String,
19655    /// Fields not described by the spec, e.g. instance-specific DB fields.
19656    #[serde(flatten)]
19657    pub extra: serde_json::Map<String, serde_json::Value>,
19658}
19659
19660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19661pub struct PostMarkdownCheckData {
19662    /// Indicates if the provided Markdown content adheres to the specified scope's rules. - `true`: The content is valid and contains only allowed elements for the given scope - `false`: The content contains unsupported elements or formatting. Check the `reason` array for specific validation errors.
19663    #[serde(rename = "isValid")]
19664    pub is_valid: bool,
19665    /// Array of validation error messages
19666    pub reason: Vec<PostMarkdownCheckDataReasonItem>,
19667    /// Fields not described by the spec, e.g. instance-specific DB fields.
19668    #[serde(flatten)]
19669    pub extra: serde_json::Map<String, serde_json::Value>,
19670}
19671
19672#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19673pub struct PostMarkdownCheckDataReasonItem {
19674    /// The details of the validation error
19675    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19676    pub message: Option<String>,
19677    /// The invalid line from the Markdown source
19678    #[serde(rename = "sourceLineContent", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19679    pub source_line_content: Option<String>,
19680    /// The invalid line number in the Markdown source
19681    #[serde(rename = "sourceLineNumber", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19682    pub source_line_number: Option<i64>,
19683    /// Fields not described by the spec, e.g. instance-specific DB fields.
19684    #[serde(flatten)]
19685    pub extra: serde_json::Map<String, serde_json::Value>,
19686}
19687
19688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19689pub struct PostNpsBody {
19690    #[serde(deserialize_with = "crate::lenient::number")]
19691    pub score: i64,
19692    /// Fields not described by the spec, e.g. instance-specific DB fields.
19693    #[serde(flatten)]
19694    pub extra: serde_json::Map<String, serde_json::Value>,
19695}
19696
19697#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19698pub struct PostNpsResponse {
19699    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
19700    pub date: Option<chrono::DateTime<chrono::Utc>>,
19701    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19702    pub score: Option<i64>,
19703    /// Fields not described by the spec, e.g. instance-specific DB fields.
19704    #[serde(flatten)]
19705    pub extra: serde_json::Map<String, serde_json::Value>,
19706}
19707
19708#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19709pub struct PostPermissionsBulkBody {
19710    pub changes: Vec<PermissionBulkChange>,
19711    /// Fields not described by the spec, e.g. instance-specific DB fields.
19712    #[serde(flatten)]
19713    pub extra: serde_json::Map<String, serde_json::Value>,
19714}
19715
19716/// Required IDs must be resolved from this installation's masterdata; optional fields may be omitted.
19717#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19718pub struct PostPersonsBody {
19719    #[serde(rename = "addressAddition", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19720    pub address_addition: Option<String>,
19721    #[serde(rename = "baptisedBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19722    pub baptised_by: Option<String>,
19723    #[serde(rename = "birthName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19724    pub birth_name: Option<String>,
19725    /// `None` leaves the field out, `Some(None)` sends `null`.
19726    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19727    pub birthday: Option<Option<chrono::NaiveDate>>,
19728    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19729    pub birthplace: Option<String>,
19730    /// ID of a campus returned by `GET /person/masterdata`.
19731    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19732    pub campus_id: Option<i64>,
19733    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19734    pub city: Option<String>,
19735    #[serde(rename = "cmsUserId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19736    pub cms_user_id: Option<String>,
19737    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19738    pub country: Option<String>,
19739    /// `None` leaves the field out, `Some(None)` sends `null`.
19740    #[serde(rename = "dateOfBaptism", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19741    pub date_of_baptism: Option<Option<chrono::NaiveDate>>,
19742    /// `None` leaves the field out, `Some(None)` sends `null`.
19743    #[serde(rename = "dateOfBelonging", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19744    pub date_of_belonging: Option<Option<chrono::NaiveDate>>,
19745    /// `None` leaves the field out, `Some(None)` sends `null`.
19746    #[serde(rename = "dateOfDeath", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19747    pub date_of_death: Option<Option<chrono::NaiveDate>>,
19748    /// `None` leaves the field out, `Some(None)` sends `null`.
19749    #[serde(rename = "dateOfEntry", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19750    pub date_of_entry: Option<Option<chrono::DateTime<chrono::Utc>>>,
19751    /// `None` leaves the field out, `Some(None)` sends `null`.
19752    #[serde(rename = "dateOfResign", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19753    pub date_of_resign: Option<Option<chrono::DateTime<chrono::Utc>>>,
19754    /// Department IDs returned by `GET /person/masterdata`. At least one department must be set.
19755    #[serde(rename = "departmentIds")]
19756    pub department_ids: Vec<i64>,
19757    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19758    pub email: Option<String>,
19759    /// Save many eMail addresses for person. If `emails` is present in request `email` is ignored.
19760    #[serde(default, skip_serializing_if = "Option::is_none")]
19761    pub emails: Option<Vec<PersonEmail>>,
19762    /// `None` leaves the field out, `Some(None)` sends `null`.
19763    #[serde(rename = "familyStatusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19764    pub family_status_id: Option<Option<i64>>,
19765    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19766    pub fax: Option<String>,
19767    /// `None` leaves the field out, `Some(None)` sends `null`.
19768    #[serde(rename = "firstContact", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
19769    pub first_contact: Option<Option<chrono::DateTime<chrono::Utc>>>,
19770    #[serde(rename = "firstName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19771    pub first_name: Option<String>,
19772    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19773    pub grow_path_id: Option<i64>,
19774    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19775    pub job: Option<String>,
19776    #[serde(rename = "lastName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19777    pub last_name: Option<String>,
19778    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19779    pub mobile: Option<String>,
19780    /// `None` leaves the field out, `Some(None)` sends `null`.
19781    #[serde(rename = "nationalityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19782    pub nationality_id: Option<Option<i64>>,
19783    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19784    pub nickname: Option<String>,
19785    #[serde(rename = "optigemId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19786    pub optigem_id: Option<String>,
19787    #[serde(rename = "phonePrivate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19788    pub phone_private: Option<String>,
19789    #[serde(rename = "phoneWork", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19790    pub phone_work: Option<String>,
19791    #[serde(rename = "placeOfBaptism", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19792    pub place_of_baptism: Option<String>,
19793    /// Legacy representation of the privacy agreement. Use the three flat `privacyPolicyAgreement*` fields instead. When this object is used, all three values must be provided if privacy agreement fields are mandatory.
19794    #[serde(rename = "privacyPolicyAgreement", default, skip_serializing_if = "Option::is_none")]
19795    #[deprecated = "Use the three flat `privacyPolicyAgreement*` fields instead."]
19796    pub privacy_policy_agreement: Option<CheckinPersonDataCreatePrivacyPolicyAgreement>,
19797    /// Date of the privacy policy agreement. Required together with agreement type and person when `privacy_policy_fields_mandatory` is enabled.
19798    #[serde(rename = "privacyPolicyAgreementDate", default, skip_serializing_if = "Option::is_none")]
19799    pub privacy_policy_agreement_date: Option<chrono::NaiveDate>,
19800    /// ID of the configured agreement type describing how the agreement was obtained. This is independent from who gave the agreement. Required together with agreement date and person when `privacy_policy_fields_mandatory` is enabled.
19801    #[serde(rename = "privacyPolicyAgreementTypeId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19802    pub privacy_policy_agreement_type_id: Option<i64>,
19803    /// ID of the configured agreement source describing who gave the agreement. This is independent from how the agreement was obtained. Required together with agreement date and type when `privacy_policy_fields_mandatory` is enabled.
19804    #[serde(rename = "privacyPolicyAgreementWhoId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19805    pub privacy_policy_agreement_who_id: Option<i64>,
19806    #[serde(rename = "referredBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19807    pub referred_by: Option<String>,
19808    #[serde(rename = "referredTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19809    pub referred_to: Option<String>,
19810    /// `None` leaves the field out, `Some(None)` sends `null`.
19811    #[serde(rename = "sexId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19812    pub sex_id: Option<Option<i64>>,
19813    /// ID of a person status returned by `GET /person/masterdata`.
19814    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19815    pub status_id: Option<i64>,
19816    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19817    pub street: Option<String>,
19818    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19819    pub title: Option<String>,
19820    /// Visibility accepted when creating or updating a person.
19821    /// Allowed values: `hidden`, `visible`.
19822    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19823    pub visibility: Option<String>,
19824    /// `None` leaves the field out, `Some(None)` sends `null`.
19825    #[serde(rename = "weddingDate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
19826    pub wedding_date: Option<Option<chrono::NaiveDate>>,
19827    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19828    pub zip: Option<String>,
19829    /// Fields not described by the spec, e.g. instance-specific DB fields.
19830    #[serde(flatten)]
19831    pub extra: serde_json::Map<String, serde_json::Value>,
19832}
19833
19834#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19835pub struct PostPersonsPersonIdArchiveBody {
19836    /// if true the person is archived, if false the archive operation is undone
19837    #[serde(default, skip_serializing_if = "Option::is_none")]
19838    pub archived: Option<bool>,
19839    /// Fields not described by the spec, e.g. instance-specific DB fields.
19840    #[serde(flatten)]
19841    pub extra: serde_json::Map<String, serde_json::Value>,
19842}
19843
19844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19845pub struct PostPersonsPersonIdRelationshipsBody {
19846    #[serde(rename = "otherPersonId", deserialize_with = "crate::lenient::number")]
19847    pub other_person_id: i64,
19848    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
19849    pub relationship_type_id: i64,
19850    /// Fields not described by the spec, e.g. instance-specific DB fields.
19851    #[serde(flatten)]
19852    pub extra: serde_json::Map<String, serde_json::Value>,
19853}
19854
19855#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19856pub struct PostPersonsPropertiesBody {
19857    /// Person IDs for which properties should be returned
19858    #[serde(default, skip_serializing_if = "Option::is_none")]
19859    pub ids: Option<Vec<i64>>,
19860    /// Fields not described by the spec, e.g. instance-specific DB fields.
19861    #[serde(flatten)]
19862    pub extra: serde_json::Map<String, serde_json::Value>,
19863}
19864
19865#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19866pub struct PostProbesBody {
19867    /// One or more domain types to filter probes by.
19868    /// Allowed values: `person`.
19869    pub domain_type: Vec<String>,
19870    /// Optional domain-specific filter criteria.
19871    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
19872    pub filter: Option<std::collections::BTreeMap<String, serde_json::Value>>,
19873    /// Fields not described by the spec, e.g. instance-specific DB fields.
19874    #[serde(flatten)]
19875    pub extra: serde_json::Map<String, serde_json::Value>,
19876}
19877
19878#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19879pub struct PostPublicgroupsGroupIdMailToLeadersData {
19880    #[serde(deserialize_with = "crate::lenient::string")]
19881    pub success: String,
19882    /// Fields not described by the spec, e.g. instance-specific DB fields.
19883    #[serde(flatten)]
19884    pub extra: serde_json::Map<String, serde_json::Value>,
19885}
19886
19887#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19888pub struct PostPublicgroupsGroupIdSignupResponse {
19889    /// The hash of the group homepage. This allows the client to return to the group homepage.
19890    #[serde(rename = "groupHomepageHash", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19891    pub group_homepage_hash: Option<String>,
19892    /// Neutral notice that the anonymous requester should check their email. It does not disclose whether a person matched.
19893    #[serde(rename = "verificationNotice")]
19894    pub verification_notice: bool,
19895    /// Fields not described by the spec, e.g. instance-specific DB fields.
19896    #[serde(flatten)]
19897    pub extra: serde_json::Map<String, serde_json::Value>,
19898}
19899
19900#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19901pub struct PostPublicgroupsGroupIdTokenDataVariant2 {
19902    #[serde(deserialize_with = "crate::lenient::string")]
19903    pub success: String,
19904    /// Fields not described by the spec, e.g. instance-specific DB fields.
19905    #[serde(flatten)]
19906    pub extra: serde_json::Map<String, serde_json::Value>,
19907}
19908
19909#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19910pub struct PostPublicgroupsSignupConfirmConfirmationTokenData {
19911    #[serde(rename = "groupHomepageHash", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19912    pub group_homepage_hash: Option<String>,
19913    #[serde(rename = "groupId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
19914    pub group_id: Option<i64>,
19915    #[serde(rename = "groupName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19916    pub group_name: Option<String>,
19917    /// Allowed values: `active`, `requested`, `waiting`.
19918    #[serde(rename = "membershipStatus", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19919    pub membership_status: Option<String>,
19920    /// Allowed values: `closed`, `expired`, `success`.
19921    #[serde(deserialize_with = "crate::lenient::string")]
19922    pub state: String,
19923    /// Fields not described by the spec, e.g. instance-specific DB fields.
19924    #[serde(flatten)]
19925    pub extra: serde_json::Map<String, serde_json::Value>,
19926}
19927
19928#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19929pub struct PostQueuesQueueData {
19930    /// Messages from Worker
19931    #[serde(default, skip_serializing_if = "Option::is_none")]
19932    pub messages: Option<Vec<String>>,
19933    /// Name of Queue
19934    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19935    pub queue: Option<String>,
19936    /// Fields not described by the spec, e.g. instance-specific DB fields.
19937    #[serde(flatten)]
19938    pub extra: serde_json::Map<String, serde_json::Value>,
19939}
19940
19941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19942pub struct PostReaction {
19943    #[serde(deserialize_with = "crate::lenient::string")]
19944    pub emoji: String,
19945    #[serde(default, skip_serializing_if = "Option::is_none")]
19946    pub meta: Option<MetaDataEntityId>,
19947    /// Person as Domain Object
19948    pub person: DomainObjectPerson,
19949    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
19950    pub post_id: i64,
19951    /// Fields not described by the spec, e.g. instance-specific DB fields.
19952    #[serde(flatten)]
19953    pub extra: serde_json::Map<String, serde_json::Value>,
19954}
19955
19956#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19957pub struct PostResetPasswordData {
19958    /// Translated confirmation messages intended for display; wording depends on the user language.
19959    pub infos: Vec<String>,
19960    /// Fields not described by the spec, e.g. instance-specific DB fields.
19961    #[serde(flatten)]
19962    pub extra: serde_json::Map<String, serde_json::Value>,
19963}
19964
19965#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19966pub struct PostSecuritylevelsIdBody {
19967    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
19968    pub name: Option<String>,
19969    /// Fields not described by the spec, e.g. instance-specific DB fields.
19970    #[serde(flatten)]
19971    pub extra: serde_json::Map<String, serde_json::Value>,
19972}
19973
19974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19975pub struct PostSecuritylevelsIdResponse {
19976    #[serde(deserialize_with = "crate::lenient::number")]
19977    pub id: i64,
19978    #[serde(deserialize_with = "crate::lenient::string")]
19979    pub name: String,
19980    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
19981    pub sort_key: i64,
19982    /// Fields not described by the spec, e.g. instance-specific DB fields.
19983    #[serde(flatten)]
19984    pub extra: serde_json::Map<String, serde_json::Value>,
19985}
19986
19987#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19988pub struct PostSimulateBody {
19989    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
19990    pub person_id: i64,
19991    /// Fields not described by the spec, e.g. instance-specific DB fields.
19992    #[serde(flatten)]
19993    pub extra: serde_json::Map<String, serde_json::Value>,
19994}
19995
19996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19997pub struct PostSummarySubscriptionOptions {
19998    /// Which posts to include in the email summary.
19999    /// Allowed values: `all`, `featured_groups`, `my_campus`, `my_groups`.
20000    #[serde(deserialize_with = "crate::lenient::string")]
20001    pub filter: String,
20002    /// Delivery weekdays, Sunday=0 through Saturday=6.
20003    pub weekdays: Vec<i64>,
20004    /// Fields not described by the spec, e.g. instance-specific DB fields.
20005    #[serde(flatten)]
20006    pub extra: serde_json::Map<String, serde_json::Value>,
20007}
20008
20009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20010pub struct PostTwofactorTotpData {
20011    #[serde(deserialize_with = "crate::lenient::string")]
20012    pub status: String,
20013    /// Fields not described by the spec, e.g. instance-specific DB fields.
20014    #[serde(flatten)]
20015    pub extra: serde_json::Map<String, serde_json::Value>,
20016}
20017
20018#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20019pub struct PostUpdate {
20020    #[serde(rename = "commentsActive", default, skip_serializing_if = "Option::is_none")]
20021    pub comments_active: Option<bool>,
20022    /// `None` leaves the field out, `Some(None)` sends `null`.
20023    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20024    pub content: Option<Option<String>>,
20025    /// `None` leaves the field out, `Some(None)` sends `null`.
20026    #[serde(rename = "expirationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
20027    pub expiration_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
20028    #[serde(rename = "imageIds", default, skip_serializing_if = "Option::is_none")]
20029    pub image_ids: Option<Vec<i64>>,
20030    /// `None` leaves the field out, `Some(None)` sends `null`.
20031    #[serde(rename = "publicationDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
20032    pub publication_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
20033    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20034    pub title: Option<String>,
20035    /// Allowed values: `group_intern`, `group_visible`.
20036    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20037    pub visibility: Option<String>,
20038    /// Fields not described by the spec, e.g. instance-specific DB fields.
20039    #[serde(flatten)]
20040    pub extra: serde_json::Map<String, serde_json::Value>,
20041}
20042
20043/// A printer designated to print check-in codes
20044#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20045pub struct Printer {
20046    /// Whether this printer is active and available for check-in printing.
20047    pub active: bool,
20048    #[serde(deserialize_with = "crate::lenient::number")]
20049    pub id: i64,
20050    /// Human-readable location of the printer.
20051    #[serde(deserialize_with = "crate::lenient::string")]
20052    pub location: String,
20053    pub meta: MetaDataEntityId,
20054    /// Human-readable printer name.
20055    #[serde(deserialize_with = "crate::lenient::string")]
20056    pub title: String,
20057    /// Fields not described by the spec, e.g. instance-specific DB fields.
20058    #[serde(flatten)]
20059    pub extra: serde_json::Map<String, serde_json::Value>,
20060}
20061
20062/// An operation that can evaluate domain objects as a predicate.
20063#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20064pub struct Probe {
20065    #[serde(rename = "actionMetaData")]
20066    pub action_meta_data: ActionMetaData,
20067    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
20068    pub domain_type: String,
20069    /// Domain types for which this probe can evaluate entities.
20070    #[serde(rename = "domainTypes")]
20071    pub domain_types: Vec<String>,
20072    #[serde(default, skip_serializing_if = "Option::is_none")]
20073    pub group: Option<ActionGroup>,
20074    /// Allowed values: `probe-group-meeting-attendance`, `probe-group-membership`, `probe-person-avatar`, `probe-person-email`, `probe-person-field`.
20075    #[serde(deserialize_with = "crate::lenient::string")]
20076    pub key: String,
20077    /// Fields not described by the spec, e.g. instance-specific DB fields.
20078    #[serde(flatten)]
20079    pub extra: serde_json::Map<String, serde_json::Value>,
20080}
20081
20082#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20083pub struct ProbeInvocation {
20084    /// Probe-specific configuration.
20085    #[serde(deserialize_with = "crate::lenient::map")]
20086    pub data: std::collections::BTreeMap<String, serde_json::Value>,
20087    /// Allowed values: `probe-group-meeting-attendance`, `probe-group-membership`, `probe-person-avatar`, `probe-person-email`, `probe-person-field`.
20088    #[serde(deserialize_with = "crate::lenient::string")]
20089    pub probe: String,
20090    /// Fields not described by the spec, e.g. instance-specific DB fields.
20091    #[serde(flatten)]
20092    pub extra: serde_json::Map<String, serde_json::Value>,
20093}
20094
20095/// A logical probe expression. The complete expression may be at most 10 levels deep and contain at most 100 expression nodes.
20096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20097pub struct ProbeLogicalExpression {
20098    /// Nested expressions. The `not` operator requires exactly one child; all other operators accept between one and 20 children. Entries have the same shape as ProbeExpression, but are documented without a recursive $ref because some OpenAPI tooling cannot resolve recursive schemas.
20099    pub children: Vec<std::collections::BTreeMap<String, serde_json::Value>>,
20100    /// Allowed values: `and`, `not`, `or`, `xor`.
20101    #[serde(deserialize_with = "crate::lenient::string")]
20102    pub operator: String,
20103    /// Fields not described by the spec, e.g. instance-specific DB fields.
20104    #[serde(flatten)]
20105    pub extra: serde_json::Map<String, serde_json::Value>,
20106}
20107
20108/// Matches each source person with any visible related target person. If `where` is supplied, at least one visible target must also match that nested expression.
20109#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20110pub struct ProbeTraversalExpression {
20111    pub data: ProbeTraversalExpressionData,
20112    #[serde(deserialize_with = "crate::lenient::string")]
20113    pub quantifier: String,
20114    #[serde(deserialize_with = "crate::lenient::string")]
20115    pub traversal: String,
20116    /// Optional nested expression that must match a related person. It has the same shape as ProbeExpression, but is documented without a recursive $ref because some OpenAPI tooling cannot resolve recursive schemas.
20117    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
20118    pub r#where: Option<std::collections::BTreeMap<String, serde_json::Value>>,
20119    /// Fields not described by the spec, e.g. instance-specific DB fields.
20120    #[serde(flatten)]
20121    pub extra: serde_json::Map<String, serde_json::Value>,
20122}
20123
20124#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20125pub struct ProbeTraversalExpressionData {
20126    /// Allowed values: `person-a-to-person-b`, `person-b-to-person-a`.
20127    #[serde(deserialize_with = "crate::lenient::string")]
20128    pub direction: String,
20129    #[serde(rename = "relationshipTypeId", deserialize_with = "crate::lenient::number")]
20130    pub relationship_type_id: i64,
20131    /// Fields not described by the spec, e.g. instance-specific DB fields.
20132    #[serde(flatten)]
20133    pub extra: serde_json::Map<String, serde_json::Value>,
20134}
20135
20136/// Profiles are representing campuses and the church itself.
20137#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20138pub struct Profile {
20139    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
20140    pub deprecated: Option<std::collections::BTreeMap<String, String>>,
20141    #[serde(default, skip_serializing_if = "Option::is_none")]
20142    pub address: Option<Address>,
20143    /// Will be the same for all profiles.
20144    #[serde(default, skip_serializing_if = "Option::is_none")]
20145    pub association: Option<Association>,
20146    #[serde(default, skip_serializing_if = "Option::is_none")]
20147    pub banner: Option<DomainObjectFile>,
20148    #[serde(default, skip_serializing_if = "Option::is_none")]
20149    pub denomination: Option<Denomination>,
20150    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20151    pub description: Option<String>,
20152    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20153    pub email: Option<String>,
20154    #[serde(rename = "finderUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20155    pub finder_url: Option<String>,
20156    pub gallery: Vec<DomainObjectFile>,
20157    pub groups: Vec<ProfileGroupsItem>,
20158    #[serde(deserialize_with = "crate::lenient::string")]
20159    pub guid: String,
20160    #[serde(deserialize_with = "crate::lenient::number")]
20161    pub id: i64,
20162    #[serde(rename = "isPublished")]
20163    pub is_published: bool,
20164    /// Indicates whether registration is currently available for this profile. Only present when registration is active.
20165    #[serde(rename = "isRegistrationOpen", default, skip_serializing_if = "Option::is_none")]
20166    pub is_registration_open: Option<bool>,
20167    #[serde(default, skip_serializing_if = "Option::is_none")]
20168    pub logo: Option<DomainObjectFile>,
20169    pub meta: MetaDataEntityId,
20170    #[serde(deserialize_with = "crate::lenient::string")]
20171    pub name: String,
20172    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
20173    pub name_translated: String,
20174    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20175    pub phone: Option<String>,
20176    /// church: Church profile for this installation; campus: one specific campus profile
20177    /// Allowed values: `campus`, `church`.
20178    #[serde(rename = "profileType", deserialize_with = "crate::lenient::string")]
20179    pub profile_type: String,
20180    /// Use `serviceBanner_new` instead.
20181    #[serde(rename = "serviceBanner", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20182    #[deprecated = "Use `serviceBanner_new` instead."]
20183    pub service_banner: Option<String>,
20184    #[serde(rename = "serviceBanner_new", default, skip_serializing_if = "Option::is_none")]
20185    pub service_banner_new: Option<DomainObjectFile>,
20186    #[serde(default, skip_serializing_if = "Option::is_none")]
20187    pub services: Option<Vec<ProfileServicesItem>>,
20188    #[serde(rename = "shortName", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20189    pub short_name: Option<String>,
20190    #[serde(deserialize_with = "crate::lenient::string")]
20191    pub shorty: String,
20192    #[serde(rename = "signUpGroup", default, skip_serializing_if = "Option::is_none")]
20193    pub sign_up_group: Option<ProfileSignUpGroupVariant1>,
20194    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20195    pub slug: Option<String>,
20196    #[serde(rename = "socialMedia", deserialize_with = "crate::lenient::map")]
20197    pub social_media: std::collections::BTreeMap<String, String>,
20198    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20199    pub sort_key: i64,
20200    pub tags: Vec<ProfileTagsItem>,
20201    pub team: Vec<ProfileTeamItem>,
20202    #[serde(rename = "teamTitle", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20203    pub team_title: Option<String>,
20204    #[serde(deserialize_with = "crate::lenient::number")]
20205    pub visitors: i64,
20206    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20207    pub website: Option<String>,
20208    /// Fields not described by the spec, e.g. instance-specific DB fields.
20209    #[serde(flatten)]
20210    pub extra: serde_json::Map<String, serde_json::Value>,
20211}
20212
20213#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20214pub struct ProfileAddressUpdate {
20215    /// `None` leaves the field out, `Some(None)` sends `null`.
20216    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20217    pub addition: Option<Option<String>>,
20218    /// `None` leaves the field out, `Some(None)` sends `null`.
20219    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20220    pub city: Option<Option<String>>,
20221    /// `None` leaves the field out, `Some(None)` sends `null`.
20222    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20223    pub country: Option<Option<String>>,
20224    /// `None` leaves the field out, `Some(None)` sends `null`.
20225    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20226    pub district: Option<Option<String>>,
20227    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20228    pub latitude: serde_json::Value,
20229    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20230    pub longitude: serde_json::Value,
20231    /// Alias for `name` in the API request.
20232    ///
20233    /// `None` leaves the field out, `Some(None)` sends `null`.
20234    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20235    pub meeting_at: Option<Option<String>>,
20236    /// `None` leaves the field out, `Some(None)` sends `null`.
20237    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20238    pub name: Option<Option<String>>,
20239    /// `None` leaves the field out, `Some(None)` sends `null`.
20240    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20241    pub street: Option<Option<String>>,
20242    /// `None` leaves the field out, `Some(None)` sends `null`.
20243    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20244    pub zip: Option<Option<String>>,
20245    /// Fields not described by the spec, e.g. instance-specific DB fields.
20246    #[serde(flatten)]
20247    pub extra: serde_json::Map<String, serde_json::Value>,
20248}
20249
20250#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20251pub struct ProfileGroupsItem {
20252    pub group: DomainObjectGroup,
20253    #[serde(rename = "groupHomepageApi", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20254    pub group_homepage_api: Option<String>,
20255    #[serde(rename = "groupHomepageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20256    pub group_homepage_url: Option<String>,
20257    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20258    pub sort_key: i64,
20259    /// Fields not described by the spec, e.g. instance-specific DB fields.
20260    #[serde(flatten)]
20261    pub extra: serde_json::Map<String, serde_json::Value>,
20262}
20263
20264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20265pub struct ProfileServicesItem {
20266    #[serde(deserialize_with = "crate::lenient::number")]
20267    pub day: i64,
20268    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20269    pub note: Option<String>,
20270    /// Allowed values: `biweekly`, `every_fourth_week`, `every_third_week`, `monthly`, `weekly`.
20271    #[serde(deserialize_with = "crate::lenient::string")]
20272    pub repetition: String,
20273    #[serde(deserialize_with = "crate::lenient::string")]
20274    pub time: String,
20275    /// Fields not described by the spec, e.g. instance-specific DB fields.
20276    #[serde(flatten)]
20277    pub extra: serde_json::Map<String, serde_json::Value>,
20278}
20279
20280#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20281pub struct ProfileSignUpGroupVariant1 {
20282    pub group: DomainObjectGroup,
20283    #[serde(rename = "groupHomepageApi", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20284    pub group_homepage_api: Option<String>,
20285    #[serde(rename = "groupHomepageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20286    pub group_homepage_url: Option<String>,
20287    /// Fields not described by the spec, e.g. instance-specific DB fields.
20288    #[serde(flatten)]
20289    pub extra: serde_json::Map<String, serde_json::Value>,
20290}
20291
20292#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20293pub struct ProfileTagsItem {
20294    #[serde(deserialize_with = "crate::lenient::string")]
20295    pub key: String,
20296    #[serde(deserialize_with = "crate::lenient::string")]
20297    pub name: String,
20298    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
20299    pub name_translated: String,
20300    /// Fields not described by the spec, e.g. instance-specific DB fields.
20301    #[serde(flatten)]
20302    pub extra: serde_json::Map<String, serde_json::Value>,
20303}
20304
20305#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20306pub struct ProfileTeamItem {
20307    #[serde(deserialize_with = "crate::lenient::string")]
20308    pub note: String,
20309    /// Person as Domain Object
20310    pub person: DomainObjectPerson,
20311    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20312    pub sort_key: i64,
20313    /// Fields not described by the spec, e.g. instance-specific DB fields.
20314    #[serde(flatten)]
20315    pub extra: serde_json::Map<String, serde_json::Value>,
20316}
20317
20318#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20319pub struct ProfileUpdate {
20320    /// `None` leaves the field out, `Some(None)` sends `null`.
20321    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20322    pub address: Option<Option<ProfileAddressUpdate>>,
20323    /// `None` leaves the field out, `Some(None)` sends `null`.
20324    #[serde(rename = "associationId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20325    pub association_id: Option<Option<i64>>,
20326    /// Either exact denomination key or denomination object with name property.
20327    /// Allowed values: `denomination.catholic`, `denomination.ecumenical`, `denomination.free.evangelical`, `denomination.none`, `denomination.orthodox`, `denomination.protestant`.
20328    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20329    pub denomination: serde_json::Value,
20330    /// `None` leaves the field out, `Some(None)` sends `null`.
20331    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20332    pub description: Option<Option<String>>,
20333    /// `None` leaves the field out, `Some(None)` sends `null`.
20334    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20335    pub email: Option<Option<String>>,
20336    /// List of group IDs shown on the profile.
20337    #[serde(default, skip_serializing_if = "Option::is_none")]
20338    pub groups: Option<Vec<i64>>,
20339    #[serde(rename = "isPublished", default, skip_serializing_if = "Option::is_none")]
20340    pub is_published: Option<bool>,
20341    #[serde(deserialize_with = "crate::lenient::string")]
20342    pub name: String,
20343    /// `None` leaves the field out, `Some(None)` sends `null`.
20344    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20345    pub phone: Option<Option<String>>,
20346    #[serde(default, skip_serializing_if = "Option::is_none")]
20347    pub services: Option<Vec<ProfileUpdateServicesItem>>,
20348    /// `None` leaves the field out, `Some(None)` sends `null`.
20349    #[serde(rename = "shortName", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20350    pub short_name: Option<Option<String>>,
20351    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20352    pub shorty: Option<String>,
20353    /// Group ID used for profile sign-up or null to disable sign-up.
20354    ///
20355    /// `None` leaves the field out, `Some(None)` sends `null`.
20356    #[serde(rename = "signUpGroupId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20357    pub sign_up_group_id: Option<Option<i64>>,
20358    /// `None` leaves the field out, `Some(None)` sends `null`.
20359    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20360    pub slug: Option<Option<String>>,
20361    /// Key-Value Pair, where key is the name of the network and value is the absolute link
20362    #[serde(rename = "socialMedia", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
20363    pub social_media: Option<std::collections::BTreeMap<String, String>>,
20364    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20365    pub sort_key: Option<i64>,
20366    /// List of tags.
20367    #[serde(default, skip_serializing_if = "Option::is_none")]
20368    pub tags: Option<Vec<String>>,
20369    #[serde(default, skip_serializing_if = "Option::is_none")]
20370    pub team: Option<Vec<ProfileUpdateTeamItem>>,
20371    /// `None` leaves the field out, `Some(None)` sends `null`.
20372    #[serde(rename = "teamTitle", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20373    pub team_title: Option<Option<String>>,
20374    /// Single integer, which represents a range.
20375    /// Allowed values: `0`, `1`, `100`, `1000`, `250`, `50`, `500`.
20376    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20377    pub visitors: Option<i64>,
20378    /// `None` leaves the field out, `Some(None)` sends `null`.
20379    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20380    pub website: Option<Option<String>>,
20381    /// Campus profile ID. For `/profiles/church`, this is ignored.
20382    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20383    pub id: Option<i64>,
20384    /// Fields not described by the spec, e.g. instance-specific DB fields.
20385    #[serde(flatten)]
20386    pub extra: serde_json::Map<String, serde_json::Value>,
20387}
20388
20389#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20390pub struct ProfileUpdateDenominationVariant2 {
20391    /// Allowed values: `denomination.catholic`, `denomination.ecumenical`, `denomination.free.evangelical`, `denomination.none`, `denomination.orthodox`, `denomination.protestant`.
20392    #[serde(deserialize_with = "crate::lenient::string")]
20393    pub name: String,
20394    /// Fields not described by the spec, e.g. instance-specific DB fields.
20395    #[serde(flatten)]
20396    pub extra: serde_json::Map<String, serde_json::Value>,
20397}
20398
20399#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20400pub struct ProfileUpdateServicesItem {
20401    #[serde(deserialize_with = "crate::lenient::number")]
20402    pub day: i64,
20403    /// `None` leaves the field out, `Some(None)` sends `null`.
20404    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
20405    pub note: Option<Option<String>>,
20406    /// Allowed values: `biweekly`, `every_fourth_week`, `every_third_week`, `monthly`, `weekly`.
20407    #[serde(deserialize_with = "crate::lenient::string")]
20408    pub repetition: String,
20409    #[serde(deserialize_with = "crate::lenient::string")]
20410    pub time: String,
20411    /// Fields not described by the spec, e.g. instance-specific DB fields.
20412    #[serde(flatten)]
20413    pub extra: serde_json::Map<String, serde_json::Value>,
20414}
20415
20416#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20417pub struct ProfileUpdateTeamItem {
20418    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20419    pub note: Option<String>,
20420    /// DomainObject
20421    #[serde(default, skip_serializing_if = "Option::is_none")]
20422    pub person: Option<ProfileUpdateTeamItemPerson>,
20423    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
20424    pub person_id: i64,
20425    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20426    pub sort_key: Option<i64>,
20427    /// Fields not described by the spec, e.g. instance-specific DB fields.
20428    #[serde(flatten)]
20429    pub extra: serde_json::Map<String, serde_json::Value>,
20430}
20431
20432/// DomainObject
20433#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20434pub struct ProfileUpdateTeamItemPerson {
20435    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::number")]
20436    pub domain_identifier: i64,
20437    /// Fields not described by the spec, e.g. instance-specific DB fields.
20438    #[serde(flatten)]
20439    pub extra: serde_json::Map<String, serde_json::Value>,
20440}
20441
20442/// Information about a public group, e.g. to be displayed on a group homepage.
20443#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20444pub struct PublicGroup {
20445    /// Compatibility aliases emitted by the transformer.
20446    #[serde(rename = "@deprecated")]
20447    pub deprecated: PublicGroupDeprecated,
20448    /// If true, group sign is allowed even if group is full.
20449    #[serde(rename = "allowWaitinglist")]
20450    pub allow_waitinglist: bool,
20451    /// If true, group sign up requests will be accepted automatically.
20452    #[serde(rename = "autoAccept")]
20453    pub auto_accept: bool,
20454    /// Indicates if the current user (either logged in or not) can sign up. This summarizes the information in signUpConditions.
20455    #[serde(rename = "canSignUp")]
20456    pub can_sign_up: bool,
20457    /// Direct active, non-hidden hierarchy child IDs. These are not re-filtered against displayed groups and can reference a group excluded by page depth/public eligibility.
20458    #[serde(default, skip_serializing_if = "Option::is_none")]
20459    pub children: Option<Vec<i64>>,
20460    /// Occupied seats, accounting for membership status and role seat-counting rules; not necessarily the number of membership rows.
20461    #[serde(rename = "currentMemberCount", deserialize_with = "crate::lenient::number")]
20462    pub current_member_count: i64,
20463    /// The public group ID.
20464    #[serde(deserialize_with = "crate::lenient::number")]
20465    pub id: i64,
20466    /// General information about the group.
20467    pub information: PublicGroupInformation,
20468    /// Maximum number of members until the group is considered as full.
20469    #[serde(rename = "maxMemberCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20470    pub max_member_count: Option<i64>,
20471    /// Name of the group, e.g. to be displayed as title.
20472    #[serde(deserialize_with = "crate::lenient::string")]
20473    pub name: String,
20474    /// Use `requestedSeatsCount` instead.
20475    #[serde(rename = "requestedPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20476    #[deprecated = "Use `requestedSeatsCount` instead."]
20477    pub requested_places_count: Option<i64>,
20478    /// Number of requested seats
20479    #[serde(rename = "requestedSeatsCount", deserialize_with = "crate::lenient::number")]
20480    pub requested_seats_count: i64,
20481    /// Use `requestedWaitinglistSeatsCount` instead.
20482    #[serde(rename = "requestedWaitinglistPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20483    #[deprecated = "Use `requestedWaitinglistSeatsCount` instead."]
20484    pub requested_waitinglist_places_count: Option<i64>,
20485    /// Number of requested seats with waiting list position
20486    #[serde(rename = "requestedWaitinglistSeatsCount", deserialize_with = "crate::lenient::number")]
20487    pub requested_waitinglist_seats_count: i64,
20488    pub settings: PublicGroupSettings,
20489    #[serde(rename = "showPublicCannotViewGroup")]
20490    pub show_public_cannot_view_group: bool,
20491    /// Specifies conditions required to sign up in this group. Not all conditions apply to any user, e.g. some of the conditions only apply to users that are not logged in.
20492    #[serde(rename = "signUpConditions")]
20493    pub sign_up_conditions: GroupSignUpConditions,
20494    /// Whether a normal signup occupies a seat, based on its assigned role and membership status.
20495    #[serde(rename = "signUpCountsTowardsSeats")]
20496    pub sign_up_counts_towards_seats: bool,
20497    /// Text which can be displayed as a headline for the sign up section
20498    #[serde(rename = "signUpHeadline", deserialize_with = "crate::lenient::string")]
20499    pub sign_up_headline: String,
20500    /// Only returned by the single-public-group detail endpoint, not by a homepage list. Eligible persons depend on the signed-in user and signup settings.
20501    #[serde(rename = "signUpPersons", default, skip_serializing_if = "Option::is_none")]
20502    pub sign_up_persons: Option<Vec<PublicGroupSignUpPersonsItem>>,
20503    /// Maximum number of persons on the waiting list.
20504    #[serde(rename = "waitinglistMaxPersons", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20505    pub waitinglist_max_persons: Option<i64>,
20506    /// Fields not described by the spec, e.g. instance-specific DB fields.
20507    #[serde(flatten)]
20508    pub extra: serde_json::Map<String, serde_json::Value>,
20509}
20510
20511/// Public group meeting place. If showStreet=false, street/addition and precise latitude/longitude aliases are omitted; loose coordinates and the remaining location metadata remain.
20512#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20513pub struct PublicGroupAddress {
20514    #[serde(rename = "@deprecated")]
20515    pub deprecated: StoredAddressDeprecated,
20516    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20517    pub addition: Option<String>,
20518    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20519    pub city: Option<String>,
20520    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`, `default`, `parent`.
20521    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20522    pub color: serde_json::Value,
20523    /// A country's ISO-code
20524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20525    pub country: Option<String>,
20526    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20527    pub district: Option<String>,
20528    /// The identifier of the domain object. This field is set automatically from the path parameter and should not be included in the request body.
20529    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
20530    pub domain_identifier: String,
20531    /// The domain type of the address. This field is set automatically from the path parameter and should not be included in the request body.
20532    /// Allowed values: `appointment`, `campus`, `church`, `group`.
20533    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
20534    pub domain_type: String,
20535    /// Use `latitude` instead
20536    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20537    #[deprecated = "Use `latitude` instead"]
20538    pub geo_lat: Option<String>,
20539    /// Use `longitude` instead
20540    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20541    #[deprecated = "Use `longitude` instead"]
20542    pub geo_lng: Option<String>,
20543    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20544    pub icon: Option<String>,
20545    #[serde(deserialize_with = "crate::lenient::number")]
20546    pub id: i64,
20547    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20548    pub latitude: Option<String>,
20549    /// Use `latitude` instead
20550    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20551    #[deprecated = "Use `latitude` instead"]
20552    pub latitude_loose: Option<String>,
20553    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20554    pub longitude: Option<String>,
20555    /// Use `longitude` instead
20556    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20557    #[deprecated = "Use `longitude` instead"]
20558    pub longitude_loose: Option<String>,
20559    /// Allowed values: `default`, `parent`, `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
20560    #[serde(rename = "markerColor", default, skip_serializing_if = "serde_json::Value::is_null")]
20561    #[deprecated = "deprecated in the ChurchTools API"]
20562    pub marker_color: serde_json::Value,
20563    /// Use `icon` instead
20564    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20565    #[deprecated = "Use `icon` instead"]
20566    pub marker_icon: Option<String>,
20567    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20568    #[deprecated = "deprecated in the ChurchTools API"]
20569    pub marker_url: Option<String>,
20570    /// Use `name` instead
20571    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20572    #[deprecated = "Use `name` instead"]
20573    pub meeting_at: Option<String>,
20574    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20575    pub name: Option<String>,
20576    /// Use `zip` instead
20577    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20578    #[deprecated = "Use `zip` instead"]
20579    pub postalcode: Option<String>,
20580    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20581    pub street: Option<String>,
20582    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20583    pub zip: Option<String>,
20584    /// Fields not described by the spec, e.g. instance-specific DB fields.
20585    #[serde(flatten)]
20586    pub extra: serde_json::Map<String, serde_json::Value>,
20587}
20588
20589/// Compatibility aliases emitted by the transformer.
20590#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20591pub struct PublicGroupDeprecated {
20592    #[serde(rename = "requestedPlacesCount", deserialize_with = "crate::lenient::string")]
20593    pub requested_places_count: String,
20594    #[serde(rename = "requestedWaitinglistPlacesCount", deserialize_with = "crate::lenient::string")]
20595    pub requested_waitinglist_places_count: String,
20596    /// Fields not described by the spec, e.g. instance-specific DB fields.
20597    #[serde(flatten)]
20598    pub extra: serde_json::Map<String, serde_json::Value>,
20599}
20600
20601/// Single public-group response, including eligible signup persons.
20602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20603pub struct PublicGroupDetail {
20604    /// Compatibility aliases emitted by the transformer.
20605    #[serde(rename = "@deprecated")]
20606    pub deprecated: PublicGroupDeprecated,
20607    /// If true, group sign is allowed even if group is full.
20608    #[serde(rename = "allowWaitinglist")]
20609    pub allow_waitinglist: bool,
20610    /// If true, group sign up requests will be accepted automatically.
20611    #[serde(rename = "autoAccept")]
20612    pub auto_accept: bool,
20613    /// Indicates if the current user (either logged in or not) can sign up. This summarizes the information in signUpConditions.
20614    #[serde(rename = "canSignUp")]
20615    pub can_sign_up: bool,
20616    /// Direct active, non-hidden hierarchy child IDs. These are not re-filtered against displayed groups and can reference a group excluded by page depth/public eligibility.
20617    #[serde(default, skip_serializing_if = "Option::is_none")]
20618    pub children: Option<Vec<i64>>,
20619    /// Occupied seats, accounting for membership status and role seat-counting rules; not necessarily the number of membership rows.
20620    #[serde(rename = "currentMemberCount", deserialize_with = "crate::lenient::number")]
20621    pub current_member_count: i64,
20622    /// The public group ID.
20623    #[serde(deserialize_with = "crate::lenient::number")]
20624    pub id: i64,
20625    /// General information about the group.
20626    pub information: PublicGroupInformation,
20627    /// Maximum number of members until the group is considered as full.
20628    #[serde(rename = "maxMemberCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20629    pub max_member_count: Option<i64>,
20630    /// Name of the group, e.g. to be displayed as title.
20631    #[serde(deserialize_with = "crate::lenient::string")]
20632    pub name: String,
20633    /// Use `requestedSeatsCount` instead.
20634    #[serde(rename = "requestedPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20635    #[deprecated = "Use `requestedSeatsCount` instead."]
20636    pub requested_places_count: Option<i64>,
20637    /// Number of requested seats
20638    #[serde(rename = "requestedSeatsCount", deserialize_with = "crate::lenient::number")]
20639    pub requested_seats_count: i64,
20640    /// Use `requestedWaitinglistSeatsCount` instead.
20641    #[serde(rename = "requestedWaitinglistPlacesCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20642    #[deprecated = "Use `requestedWaitinglistSeatsCount` instead."]
20643    pub requested_waitinglist_places_count: Option<i64>,
20644    /// Number of requested seats with waiting list position
20645    #[serde(rename = "requestedWaitinglistSeatsCount", deserialize_with = "crate::lenient::number")]
20646    pub requested_waitinglist_seats_count: i64,
20647    pub settings: PublicGroupSettings,
20648    #[serde(rename = "showPublicCannotViewGroup")]
20649    pub show_public_cannot_view_group: bool,
20650    /// Specifies conditions required to sign up in this group. Not all conditions apply to any user, e.g. some of the conditions only apply to users that are not logged in.
20651    #[serde(rename = "signUpConditions")]
20652    pub sign_up_conditions: GroupSignUpConditions,
20653    /// Whether a normal signup occupies a seat, based on its assigned role and membership status.
20654    #[serde(rename = "signUpCountsTowardsSeats")]
20655    pub sign_up_counts_towards_seats: bool,
20656    /// Text which can be displayed as a headline for the sign up section
20657    #[serde(rename = "signUpHeadline", deserialize_with = "crate::lenient::string")]
20658    pub sign_up_headline: String,
20659    /// Only returned by the single-public-group detail endpoint, not by a homepage list. Eligible persons depend on the signed-in user and signup settings.
20660    #[serde(rename = "signUpPersons")]
20661    pub sign_up_persons: Vec<PublicGroupSignUpPersonsItem>,
20662    /// Maximum number of persons on the waiting list.
20663    #[serde(rename = "waitinglistMaxPersons", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20664    pub waitinglist_max_persons: Option<i64>,
20665    /// Fields not described by the spec, e.g. instance-specific DB fields.
20666    #[serde(flatten)]
20667    pub extra: serde_json::Map<String, serde_json::Value>,
20668}
20669
20670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20671pub struct PublicGroupFormField {
20672    /// Configured default, including checkbox booleans; not necessarily a string.
20673    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20674    pub default: serde_json::Value,
20675    /// Allowed values: `api`, `checkbox`, `date`, `datetime`, `multiselect`, `number`, `radioselect`, `select`, `text`, `textarea`.
20676    #[serde(rename = "fieldTypeCode", default, skip_serializing_if = "serde_json::Value::is_null")]
20677    pub field_type_code: serde_json::Value,
20678    /// ID of the form field. Only IDs within the same form field type are unique, i.e. a form field is identified by its type and its ID.
20679    #[serde(deserialize_with = "crate::lenient::number")]
20680    pub id: i64,
20681    /// A human readable label for the form field.
20682    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20683    pub label: Option<String>,
20684    /// Maximum length when available.
20685    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20686    pub length: Option<i64>,
20687    /// If this is true, the field is required.
20688    pub mandatory: bool,
20689    /// The field's internal name. Not intended to be displayed.
20690    #[serde(deserialize_with = "crate::lenient::string")]
20691    pub name: String,
20692    /// A note for the user filling out the form, e.g. to explain why certain information is required.
20693    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20694    pub note: Option<String>,
20695    /// Provides the set of allowed options for select fields.
20696    #[serde(default, skip_serializing_if = "Option::is_none")]
20697    pub options: Option<Vec<PublicGroupFormFieldOptionsItem>>,
20698    /// Person field is locked, for example an email captured by the token.
20699    #[serde(default, skip_serializing_if = "Option::is_none")]
20700    pub readonly: Option<bool>,
20701    /// Form fields should be sorted by this key ascending.
20702    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
20703    pub sort_key: i64,
20704    /// Field domain; combine with id to identify a submitted field.
20705    /// Allowed values: `comment`, `custom`, `person`, `privacy`, `privacyForChild`, `privacyForOther`, `privacyForSelf`, `relation`.
20706    #[serde(deserialize_with = "crate::lenient::string")]
20707    pub r#type: String,
20708    /// Fields not described by the spec, e.g. instance-specific DB fields.
20709    #[serde(flatten)]
20710    pub extra: serde_json::Map<String, serde_json::Value>,
20711}
20712
20713#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20714pub struct PublicGroupFormFieldOptionsItem {
20715    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20716    pub id: serde_json::Value,
20717    #[serde(deserialize_with = "crate::lenient::string")]
20718    pub name: String,
20719    /// Fields not described by the spec, e.g. instance-specific DB fields.
20720    #[serde(flatten)]
20721    pub extra: serde_json::Map<String, serde_json::Value>,
20722}
20723
20724#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20725pub struct PublicGroupFormResult {
20726    #[serde(rename = "acceptPrivacyForChildForm")]
20727    pub accept_privacy_for_child_form: Vec<PublicGroupFormField>,
20728    #[serde(rename = "acceptPrivacyForOtherForm")]
20729    pub accept_privacy_for_other_form: Vec<PublicGroupFormField>,
20730    #[serde(rename = "acceptPrivacyForSelfForm")]
20731    pub accept_privacy_for_self_form: Vec<PublicGroupFormField>,
20732    #[serde(rename = "addChildForm", default, skip_serializing_if = "Option::is_none")]
20733    pub add_child_form: Option<Vec<PublicGroupFormField>>,
20734    #[serde(rename = "addOtherForm", default, skip_serializing_if = "Option::is_none")]
20735    pub add_other_form: Option<Vec<PublicGroupFormField>>,
20736    #[serde(rename = "addSpouseForm", default, skip_serializing_if = "Option::is_none")]
20737    pub add_spouse_form: Option<Vec<PublicGroupFormField>>,
20738    /// If the user is not yet signed in, this specifies the email address the user has provided.
20739    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20740    pub email: Option<String>,
20741    /// List of form fields.
20742    pub form: Vec<PublicGroupFormField>,
20743    /// Information about a public group, e.g. to be displayed on a group homepage.
20744    pub group: PublicGroup,
20745    /// If the user is signed in, this specifies the user ID of the requester.
20746    #[serde(rename = "requesterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20747    pub requester_id: Option<i64>,
20748    /// Lists all persons the current user is allowed to sign up. This includes spouses, children below the age of 16 and all persons with the same email address.
20749    #[serde(rename = "signUpPersons")]
20750    pub sign_up_persons: Vec<PublicGroupFormResultSignUpPersonsItem>,
20751    /// The sign up token.
20752    #[serde(deserialize_with = "crate::lenient::string")]
20753    pub token: String,
20754    /// Fields not described by the spec, e.g. instance-specific DB fields.
20755    #[serde(flatten)]
20756    pub extra: serde_json::Map<String, serde_json::Value>,
20757}
20758
20759#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20760pub struct PublicGroupFormResultSignUpPersonsItem {
20761    /// List of form field values
20762    #[serde(rename = "formData")]
20763    pub form_data: Vec<PublicGroupFormResultSignUpPersonsItemFormDataItem>,
20764    #[serde(rename = "hasAcceptedPrivacy")]
20765    pub has_accepted_privacy: bool,
20766    /// Person as Domain Object
20767    pub person: DomainObjectPerson,
20768    /// Relation of this sign-up person to the requester.
20769    /// Allowed values: `child`, `other`, `spouse`.
20770    #[serde(rename = "relationType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20771    pub relation_type: Option<String>,
20772    /// Specifies whether this person is already in the group (IN_GROUP), in pending state for the group (REQUESTED), or selected by the user to be added into the group (CLICKED). Otherwise NOT_CLICKED.
20773    /// Allowed values: `CLICKED`, `IN_GROUP`, `NOT_CLICKED`, `REQUESTED`.
20774    #[serde(deserialize_with = "crate::lenient::string")]
20775    pub status: String,
20776    /// Fields not described by the spec, e.g. instance-specific DB fields.
20777    #[serde(flatten)]
20778    pub extra: serde_json::Map<String, serde_json::Value>,
20779}
20780
20781#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20782pub struct PublicGroupFormResultSignUpPersonsItemFormDataItem {
20783    #[serde(deserialize_with = "crate::lenient::string")]
20784    pub name: String,
20785    /// Stored person-field value; may be null or a scalar/list/object depending on the field.
20786    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
20787    pub value: serde_json::Value,
20788    /// Fields not described by the spec, e.g. instance-specific DB fields.
20789    #[serde(flatten)]
20790    pub extra: serde_json::Map<String, serde_json::Value>,
20791}
20792
20793/// General information about the group.
20794#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20795pub struct PublicGroupInformation {
20796    /// List of target age groups for this group.
20797    #[serde(rename = "ageGroups")]
20798    pub age_groups: Vec<AgeGroup>,
20799    #[serde(default, skip_serializing_if = "Option::is_none")]
20800    pub campus: Option<Campus>,
20801    /// Color key used for displaying the group.
20802    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20803    pub color: Option<String>,
20804    #[serde(rename = "dateOfFoundation", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
20805    pub date_of_foundation: Option<chrono::DateTime<chrono::Utc>>,
20806    #[serde(rename = "groupCategory", default, skip_serializing_if = "Option::is_none")]
20807    pub group_category: Option<GroupCategory>,
20808    /// Meeting places are returned regardless of the showMap UI flag. showStreet controls removal of street/addition/precise coordinates.
20809    #[serde(rename = "groupPlaces")]
20810    pub group_places: Vec<PublicGroupAddress>,
20811    #[serde(rename = "groupStatusId", deserialize_with = "crate::lenient::number")]
20812    pub group_status_id: i64,
20813    /// Whether the group image was generated with AI.
20814    #[serde(rename = "imageAiGenerated", default, skip_serializing_if = "Option::is_none")]
20815    pub image_ai_generated: Option<bool>,
20816    /// Annotation text for the group image if provided.
20817    #[serde(rename = "imageAnnotation", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20818    pub image_annotation: Option<String>,
20819    /// Link to the original source of the group image if provided.
20820    #[serde(rename = "imageAnnotationLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20821    pub image_annotation_link: Option<String>,
20822    /// Alternative text describing the group image if provided.
20823    #[serde(rename = "imageDescription", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20824    pub image_description: Option<String>,
20825    /// URL to a group image if provided.
20826    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20827    pub image_url: Option<String>,
20828    /// List of person objects of all group leaders if the group is set to display leaders.
20829    #[serde(default, skip_serializing_if = "Option::is_none")]
20830    pub leader: Option<Vec<DomainObjectPerson>>,
20831    /// Free text field when group meetings take place.
20832    #[serde(rename = "meetingTime", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20833    pub meeting_time: Option<String>,
20834    /// The group description.
20835    #[serde(deserialize_with = "crate::lenient::string")]
20836    pub note: String,
20837    #[serde(rename = "targetGroup", default, skip_serializing_if = "Option::is_none")]
20838    pub target_group: Option<TargetGroup>,
20839    /// Meeting weekday master data, or null.
20840    #[serde(default, skip_serializing_if = "Option::is_none")]
20841    pub weekday: Option<Weekday>,
20842    /// Fields not described by the spec, e.g. instance-specific DB fields.
20843    #[serde(flatten)]
20844    pub extra: serde_json::Map<String, serde_json::Value>,
20845}
20846
20847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20848pub struct PublicGroupLeaderMailCreate {
20849    /// E-Mail Address of the sender.
20850    #[serde(deserialize_with = "crate::lenient::string")]
20851    pub email: String,
20852    /// Message to be sent.
20853    #[serde(deserialize_with = "crate::lenient::string")]
20854    pub message: String,
20855    /// Name of the sender.
20856    #[serde(deserialize_with = "crate::lenient::string")]
20857    pub name: String,
20858    /// Required when normal group signup access is unavailable.
20859    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20860    pub token: Option<String>,
20861    /// Fields not described by the spec, e.g. instance-specific DB fields.
20862    #[serde(flatten)]
20863    pub extra: serde_json::Map<String, serde_json::Value>,
20864}
20865
20866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20867pub struct PublicGroupPossibleRequesters {
20868    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20869    pub email: Option<String>,
20870    #[serde(rename = "groupName", deserialize_with = "crate::lenient::string")]
20871    pub group_name: String,
20872    #[serde(rename = "possibleRequesters")]
20873    pub possible_requesters: Vec<PublicGroupSignUpPersonsItem>,
20874    /// Fields not described by the spec, e.g. instance-specific DB fields.
20875    #[serde(flatten)]
20876    pub extra: serde_json::Map<String, serde_json::Value>,
20877}
20878
20879#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20880pub struct PublicGroupSettings {
20881    #[serde(rename = "allowChildRegistration")]
20882    pub allow_child_registration: bool,
20883    #[serde(rename = "allowOtherRegistration")]
20884    pub allow_other_registration: bool,
20885    #[serde(rename = "allowSameEmailRegistration", default, skip_serializing_if = "Option::is_none")]
20886    pub allow_same_email_registration: Option<bool>,
20887    /// Use `allowSameEmailRegistration` instead.
20888    #[serde(rename = "allowSameemailRegistration", default, skip_serializing_if = "Option::is_none")]
20889    #[deprecated = "Use `allowSameEmailRegistration` instead."]
20890    pub allow_sameemail_registration: Option<bool>,
20891    #[serde(rename = "allowSpouseRegistration")]
20892    pub allow_spouse_registration: bool,
20893    /// Controls email verification for anonymous group signups.
20894    /// Allowed values: `all`, `existing`, `none`.
20895    #[serde(rename = "emailVerificationMode", deserialize_with = "crate::lenient::string")]
20896    pub email_verification_mode: String,
20897    #[serde(rename = "hideContactLeader")]
20898    pub hide_contact_leader: bool,
20899    #[serde(rename = "hideLogin")]
20900    pub hide_login: bool,
20901    #[serde(rename = "showStreet")]
20902    pub show_street: bool,
20903    /// Last signup-notification timestamp, or null.
20904    #[serde(rename = "signUpNotificationSent", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
20905    pub sign_up_notification_sent: Option<chrono::DateTime<chrono::Utc>>,
20906    /// Fields not described by the spec, e.g. instance-specific DB fields.
20907    #[serde(flatten)]
20908    pub extra: serde_json::Map<String, serde_json::Value>,
20909}
20910
20911/// Select memberships to withdraw. Use an existing requester’s sign-up token, or omit token and use the current user’s permissions.
20912#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20913pub struct PublicGroupSignOutRequest {
20914    /// Person IDs, not membership IDs. Each person must be the requester or have been registered by the requester, and must be eligible for self sign-out. An empty list is accepted.
20915    #[serde(rename = "personIds")]
20916    pub person_ids: Vec<i64>,
20917    /// Sign-up token belonging to this group and an existing requester. A token for a new, not-yet-created person cannot be used for sign-out.
20918    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20919    pub token: Option<String>,
20920    /// Fields not described by the spec, e.g. instance-specific DB fields.
20921    #[serde(flatten)]
20922    pub extra: serde_json::Map<String, serde_json::Value>,
20923}
20924
20925#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20926pub struct PublicGroupSignUpPersonsItem {
20927    /// Person as Domain Object
20928    pub person: DomainObjectPerson,
20929    /// Existing membership/request status, or NOT_CLICKED for an eligible person not yet requested. CLICKED is a client state and is not returned.
20930    /// Allowed values: `IN_GROUP`, `NOT_CLICKED`, `REQUESTED`.
20931    #[serde(deserialize_with = "crate::lenient::string")]
20932    pub status: String,
20933    /// Fields not described by the spec, e.g. instance-specific DB fields.
20934    #[serde(flatten)]
20935    pub extra: serde_json::Map<String, serde_json::Value>,
20936}
20937
20938#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20939pub struct PublicGroupSignoutData {
20940    pub group: DomainObjectGroup,
20941    #[serde(rename = "groupHasAutoAccept")]
20942    pub group_has_auto_accept: bool,
20943    #[serde(rename = "leaderSignOutPersons", default, skip_serializing_if = "Option::is_none")]
20944    pub leader_sign_out_persons: Option<Vec<DomainObjectPerson>>,
20945    /// Only present for the special no-person-created requester.
20946    #[serde(rename = "noUserCreated", default, skip_serializing_if = "Option::is_none")]
20947    pub no_user_created: Option<bool>,
20948    #[serde(default, skip_serializing_if = "Option::is_none")]
20949    pub requester: Option<DomainObjectPerson>,
20950    #[serde(rename = "requesterEmail", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20951    pub requester_email: Option<String>,
20952    #[serde(rename = "selfSignOutPersons", default, skip_serializing_if = "Option::is_none")]
20953    pub self_sign_out_persons: Option<Vec<DomainObjectPerson>>,
20954    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20955    pub token: Option<String>,
20956    /// Fields not described by the spec, e.g. instance-specific DB fields.
20957    #[serde(flatten)]
20958    pub extra: serde_json::Map<String, serde_json::Value>,
20959}
20960
20961#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20962pub struct PublicGroupSignupCreate {
20963    /// One entry per signup person; the controller does not enforce a nonempty list.
20964    pub forms: Vec<PublicGroupSignupCreateFormsItem>,
20965    /// Required when any new spouse, child or other-person form is included.
20966    #[serde(rename = "hasAcceptedPrivacyForOther", default, skip_serializing_if = "Option::is_none")]
20967    pub has_accepted_privacy_for_other: Option<bool>,
20968    /// Url used in the mail sent to the user.
20969    #[serde(rename = "signOutUrlTemplate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
20970    pub sign_out_url_template: Option<String>,
20971    /// The sign up token.
20972    #[serde(deserialize_with = "crate::lenient::string")]
20973    pub token: String,
20974    /// Fields not described by the spec, e.g. instance-specific DB fields.
20975    #[serde(flatten)]
20976    pub extra: serde_json::Map<String, serde_json::Value>,
20977}
20978
20979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20980pub struct PublicGroupSignupCreateFormsItem {
20981    /// The form data for the current person.
20982    pub form: Vec<PublicGroupSignupCreateFormsItemFormItem>,
20983    /// The person ID the current form applies to. Can be empty if a single new user is about to sign up.
20984    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
20985    pub person_id: Option<i64>,
20986    /// Fields not described by the spec, e.g. instance-specific DB fields.
20987    #[serde(flatten)]
20988    pub extra: serde_json::Map<String, serde_json::Value>,
20989}
20990
20991#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
20992pub struct PublicGroupSignupCreateFormsItemFormItem {
20993    /// Field ID paired with its type; use the IDs from the form response.
20994    #[serde(deserialize_with = "crate::lenient::number")]
20995    pub id: i64,
20996    /// Allowed values: `comment`, `custom`, `person`, `privacy`, `privacyForChild`, `privacyForOther`, `privacyForSelf`, `relation`.
20997    #[serde(deserialize_with = "crate::lenient::string")]
20998    pub r#type: String,
20999    /// Value according to the dynamic field definition: scalar, null, or an array for multiple choices.
21000    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
21001    pub value: serde_json::Value,
21002    /// Fields not described by the spec, e.g. instance-specific DB fields.
21003    #[serde(flatten)]
21004    pub extra: serde_json::Map<String, serde_json::Value>,
21005}
21006
21007#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21008pub struct PublicGroupToken {
21009    /// Provide eMail
21010    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21011    pub email: Option<String>,
21012    /// The group model structures all information in different objects: `information`, `settings`, `followUp`, and `roles`. Custom group fields are added to the root level of this model.
21013    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
21014    pub group: serde_json::Value,
21015    /// Provided PersonId
21016    #[serde(rename = "requesterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21017    pub requester_id: Option<i64>,
21018    /// Sign Up Token
21019    #[serde(deserialize_with = "crate::lenient::string")]
21020    pub token: String,
21021    /// Link To Sign Up Form
21022    #[serde(deserialize_with = "crate::lenient::string")]
21023    pub url: String,
21024    /// Fields not described by the spec, e.g. instance-specific DB fields.
21025    #[serde(flatten)]
21026    pub extra: serde_json::Map<String, serde_json::Value>,
21027}
21028
21029#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21030pub struct PublicGroupTokenCreate {
21031    /// Array of person ids, which are clicked on group detail page. Those persons, will be also checked on the form site.
21032    /// The `clicked` field will be saved only in combination with `personId`.
21033    #[serde(default, skip_serializing_if = "Option::is_none")]
21034    pub clicked: Option<Vec<i64>>,
21035    /// Email address of an anonymous requester. Required in verification mode `all` when `personId` is not supplied. May be omitted in modes `existing` and `none`; in mode `existing`, matching uses the email from the signup form.
21036    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21037    pub email: Option<String>,
21038    /// The hash of the group homepage. If specified, the user can return to the group homepage after the sign up was successful.
21039    #[serde(rename = "groupHomepageHash", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21040    pub group_homepage_hash: Option<String>,
21041    /// Current logged-in person ID; an arbitrary person cannot be selected here.
21042    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21043    pub person_id: Option<i64>,
21044    /// Email link template. $groupId and $token are replaced; omission uses the ChurchTools public signup page.
21045    #[serde(rename = "signUpUrlTemplate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21046    pub sign_up_url_template: Option<String>,
21047    /// Fields not described by the spec, e.g. instance-specific DB fields.
21048    #[serde(flatten)]
21049    pub extra: serde_json::Map<String, serde_json::Value>,
21050}
21051
21052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21053pub struct PublicRelationGroupHomepage {
21054    /// Absolute public URL of the group homepage.
21055    #[serde(rename = "groupHomepageUrl", deserialize_with = "crate::lenient::string")]
21056    pub group_homepage_url: String,
21057    /// ID of the group that owns the public group homepage.
21058    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
21059    pub group_id: i64,
21060    /// Fields not described by the spec, e.g. instance-specific DB fields.
21061    #[serde(flatten)]
21062    pub extra: serde_json::Map<String, serde_json::Value>,
21063}
21064
21065#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21066pub struct PublicRelationTag {
21067    /// Technical enum case name used by ChurchTools.
21068    /// Allowed values: `ACTIVE`, `BIBLICALLY_DEVOTED`, `CHARISMATIC`, `CHILD_FRIENDLY`, `CLASSICAL`, `CONTEMPLATIVE`, `INTERNATIONAL`, `LIVELY`, `MISSIONARY`, `MODERN`, `OPEN_TO_GUESTS`, `PERSONAL`, `PROGRESSIVE`, `TRADITIONAL`.
21069    #[serde(deserialize_with = "crate::lenient::string")]
21070    pub key: String,
21071    /// Translation key of the public relation profile tag.
21072    /// Allowed values: `active`, `biblically.devoted`, `charismatic`, `child.friendly`, `classical`, `contemplative`, `international`, `lively`, `missionary`, `modern`, `open.to.guests`, `personal`, `progressive`, `traditional`.
21073    #[serde(deserialize_with = "crate::lenient::string")]
21074    pub name: String,
21075    /// Localized public relation profile tag name.
21076    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
21077    pub name_translated: String,
21078    /// Fields not described by the spec, e.g. instance-specific DB fields.
21079    #[serde(flatten)]
21080    pub extra: serde_json::Map<String, serde_json::Value>,
21081}
21082
21083/// Master data used by the public relations and public profile UI.
21084#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21085pub struct PublicRelationsMasterData {
21086    /// Associations that can be assigned to a public profile.
21087    pub associations: Vec<Association>,
21088    /// Denominations that can be assigned to a public profile.
21089    pub denominations: Vec<Denomination>,
21090    /// Public group homepages with their owning group IDs and URLs.
21091    #[serde(rename = "groupHomepages")]
21092    pub group_homepages: Vec<PublicRelationGroupHomepage>,
21093    /// Supported social media channels for public profile links.
21094    /// Allowed values: `Facebook`, `Instagram`, `Pinterest`, `Snapchat`, `Soundcloud`, `Spotify`, `Telegram`, `TikTok`, `Twitter`, `Vimeo`, `WhatsApp`, `YouTube`.
21095    #[serde(rename = "socialMedia")]
21096    pub social_media: Vec<String>,
21097    /// Tags that can describe a public profile.
21098    pub tags: Vec<PublicRelationTag>,
21099    /// Fields not described by the spec, e.g. instance-specific DB fields.
21100    #[serde(flatten)]
21101    pub extra: serde_json::Map<String, serde_json::Value>,
21102}
21103
21104#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21105pub struct PutConfigRequest {
21106    #[serde(default, skip_serializing_if = "Option::is_none")]
21107    pub accept_datasecurity: Option<bool>,
21108    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21109    pub access_control_allow_origins: Option<String>,
21110    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21111    pub admin_mail: Option<String>,
21112    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21113    pub admin_message: Option<String>,
21114    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21115    pub ai_description_available_generation_tests: Option<f64>,
21116    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21117    pub ai_description_generation_count: Option<f64>,
21118    #[serde(default, skip_serializing_if = "Option::is_none")]
21119    pub ai_description_generation_enabled: Option<bool>,
21120    #[serde(default, skip_serializing_if = "Option::is_none")]
21121    pub allowaiassistant: Option<bool>,
21122    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21123    pub authorized_persons: Option<String>,
21124    #[serde(default, skip_serializing_if = "Option::is_none")]
21125    pub ccli_auto_reporting_enabled: Option<bool>,
21126    #[serde(default, skip_serializing_if = "Option::is_none")]
21127    pub churchcal_active: Option<bool>,
21128    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21129    pub churchcal_css: Option<String>,
21130    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21131    pub churchcal_entries_last_days: Option<i64>,
21132    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21133    pub churchcal_firstdayinweek: Option<i64>,
21134    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21135    pub churchcal_maincalname: Option<String>,
21136    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21137    pub churchcal_name: Option<String>,
21138    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21139    pub churchcal_sortcode: Option<i64>,
21140    #[serde(default, skip_serializing_if = "Option::is_none")]
21141    pub churchchat_allow_event_chat: Option<bool>,
21142    #[serde(default, skip_serializing_if = "Option::is_none")]
21143    pub churchchat_allow_group_chat: Option<bool>,
21144    #[serde(default, skip_serializing_if = "Option::is_none")]
21145    pub churchchat_allow_person_chat: Option<bool>,
21146    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21147    pub churchchat_delete_event_chat_after_x_days: Option<i64>,
21148    #[serde(default, skip_serializing_if = "Option::is_none")]
21149    pub churchchat_invite_ct_event_chat: Option<bool>,
21150    #[serde(default, skip_serializing_if = "Option::is_none")]
21151    pub churchchat_invite_ct_group_chat: Option<bool>,
21152    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21153    pub churchchat_start_event_chat_before_x_days: Option<i64>,
21154    /// A stringified array of calendar ids
21155    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21156    pub churchchat_start_event_chat_for_calendars: Option<String>,
21157    #[serde(default, skip_serializing_if = "Option::is_none")]
21158    pub churchcheckin_active: Option<bool>,
21159    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21160    pub churchcheckin_label_child: Option<String>,
21161    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21162    pub churchcheckin_label_parent: Option<String>,
21163    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21164    pub churchcheckin_label_standard: Option<String>,
21165    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21166    pub churchcheckin_name: Option<String>,
21167    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21168    pub churchcheckin_sortcode: Option<i64>,
21169    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21170    pub churchcheckin_tags: Option<String>,
21171    #[serde(default, skip_serializing_if = "Option::is_none")]
21172    pub churchdb_active: Option<bool>,
21173    #[serde(default, skip_serializing_if = "Option::is_none")]
21174    pub churchdb_archivedeletehistory: Option<bool>,
21175    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21176    pub churchdb_birthdaylist_station: Option<String>,
21177    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21178    pub churchdb_birthdaylist_status: Option<String>,
21179    /// Allowed values: `false`, `true`.
21180    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21181    pub churchdb_cleverreach_connected: Option<String>,
21182    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21183    pub churchdb_emailseparator: Option<String>,
21184    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21185    pub churchdb_groupnotchoosable: Option<i64>,
21186    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21187    pub churchdb_home_lat: Option<String>,
21188    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21189    pub churchdb_home_lng: Option<String>,
21190    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21191    pub churchdb_mailchimp_apikey: Option<String>,
21192    #[serde(default, skip_serializing_if = "Option::is_none")]
21193    pub churchdb_mailchimp_connected: Option<bool>,
21194    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21195    pub churchdb_mailjet_apikey: Option<String>,
21196    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21197    pub churchdb_mailjet_apisecret: Option<String>,
21198    #[serde(default, skip_serializing_if = "Option::is_none")]
21199    pub churchdb_mailjet_connected: Option<bool>,
21200    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21201    pub churchdb_memberlist_station: Option<String>,
21202    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21203    pub churchdb_memberlist_status: Option<String>,
21204    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21205    pub churchdb_name: Option<String>,
21206    #[serde(default, skip_serializing_if = "Option::is_none")]
21207    pub churchdb_sendgroupmails: Option<bool>,
21208    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21209    pub churchdb_smscmtelecom_apikey: Option<String>,
21210    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21211    pub churchdb_sortcode: Option<i64>,
21212    #[serde(default, skip_serializing_if = "Option::is_none")]
21213    pub churchfinance_active: Option<bool>,
21214    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21215    pub churchfinance_name: Option<String>,
21216    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21217    pub churchfinance_sortcode: Option<i64>,
21218    #[serde(default, skip_serializing_if = "Option::is_none")]
21219    pub churchgroup_active: Option<bool>,
21220    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21221    pub churchgroup_name: Option<String>,
21222    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21223    pub churchgroup_sortcode: Option<i64>,
21224    #[serde(default, skip_serializing_if = "Option::is_none")]
21225    pub churchreport_active: Option<bool>,
21226    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21227    pub churchreport_name: Option<String>,
21228    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21229    pub churchreport_sortcode: Option<i64>,
21230    #[serde(default, skip_serializing_if = "Option::is_none")]
21231    pub churchresource_active: Option<bool>,
21232    #[serde(default, skip_serializing_if = "Option::is_none")]
21233    pub churchresource_anonymize_for_public_user: Option<bool>,
21234    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21235    pub churchresource_entries_last_days: Option<i64>,
21236    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21237    pub churchresource_name: Option<String>,
21238    #[serde(default, skip_serializing_if = "Option::is_none")]
21239    pub churchresource_send_emails: Option<bool>,
21240    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21241    pub churchresource_sortcode: Option<i64>,
21242    #[serde(default, skip_serializing_if = "Option::is_none")]
21243    pub churchservice_active: Option<bool>,
21244    #[serde(default, skip_serializing_if = "Option::is_none")]
21245    pub churchservice_agendashowenumeration: Option<bool>,
21246    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21247    pub churchservice_ccli_token: Option<String>,
21248    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21249    pub churchservice_ccli_token_secret: Option<String>,
21250    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21251    pub churchservice_entries_last_days: Option<i64>,
21252    #[serde(default, skip_serializing_if = "Option::is_none")]
21253    pub churchservice_invite_persons: Option<bool>,
21254    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21255    pub churchservice_name: Option<String>,
21256    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21257    pub churchservice_openservice_rememberdays: Option<i64>,
21258    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21259    pub churchservice_reminderhours: Option<i64>,
21260    #[serde(default, skip_serializing_if = "Option::is_none")]
21261    pub churchservice_songwithcategoryasdir: Option<bool>,
21262    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21263    pub churchservice_sortcode: Option<i64>,
21264    #[serde(default, skip_serializing_if = "Option::is_none")]
21265    pub churchsync_active: Option<bool>,
21266    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21267    pub churchsync_name: Option<String>,
21268    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21269    pub churchsync_sortcode: Option<i64>,
21270    #[serde(default, skip_serializing_if = "Option::is_none")]
21271    pub churchwiki_active: Option<bool>,
21272    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21273    pub churchwiki_name: Option<String>,
21274    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21275    pub churchwiki_sortcode: Option<i64>,
21276    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21277    pub cronjob_delay: Option<i64>,
21278    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21279    pub data_privacy_text: Option<String>,
21280    #[serde(default, skip_serializing_if = "Option::is_none")]
21281    pub datasecurity_banner_enabled: Option<bool>,
21282    /// Only in extended config
21283    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21284    pub datasecurity_privacy_agreement_text: Option<String>,
21285    /// Only in extended config
21286    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21287    pub datasecurity_privacy_agreement_text_for_children: Option<String>,
21288    #[serde(default, skip_serializing_if = "Option::is_none")]
21289    pub deactivate_default_login: Option<bool>,
21290    /// Allowed values: `churchtools`, `own`.
21291    #[serde(rename = "emailServer", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21292    pub email_server: Option<String>,
21293    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21294    pub evangelische_termine_api_key: Option<String>,
21295    #[serde(default, skip_serializing_if = "Option::is_none")]
21296    pub evangelische_termine_enabled: Option<bool>,
21297    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21298    pub evangelische_termine_name: Option<String>,
21299    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21300    pub evangelische_termine_url: Option<String>,
21301    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21302    pub evangelische_termine_vid: Option<String>,
21303    #[serde(default, skip_serializing_if = "Option::is_none")]
21304    pub feature_sessionless_login: Option<bool>,
21305    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21306    pub hide_licensetab: Option<String>,
21307    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21308    pub impressum_external: Option<String>,
21309    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21310    pub impressum_external_link: Option<String>,
21311    /// This is a string that can only be true or false.
21312    /// Allowed values: `0`, `1`.
21313    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21314    pub impressum_internal: Option<String>,
21315    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21316    pub invite_email_text: Option<String>,
21317    #[serde(default, skip_serializing_if = "Option::is_none")]
21318    pub is_churchtools_blog_widget_active: Option<bool>,
21319    #[serde(default, skip_serializing_if = "Option::is_none")]
21320    pub is_churchtools_onboarding_widget_active: Option<bool>,
21321    #[serde(default, skip_serializing_if = "Option::is_none")]
21322    pub is_pr_widget_active: Option<bool>,
21323    #[serde(default, skip_serializing_if = "Option::is_none")]
21324    pub is_rss_widget_active: Option<bool>,
21325    #[serde(default, skip_serializing_if = "Option::is_none")]
21326    pub ldap_otp_enabled: Option<bool>,
21327    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21328    pub login_message: Option<String>,
21329    #[serde(default, skip_serializing_if = "Option::is_none")]
21330    pub mail_enabled: Option<bool>,
21331    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21332    pub mail_smtp_args_host: Option<String>,
21333    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21334    pub mail_smtp_args_password: Option<String>,
21335    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21336    pub mail_smtp_args_port: Option<String>,
21337    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21338    pub mail_smtp_args_smtpsecure: Option<String>,
21339    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21340    pub mail_smtp_args_username: Option<String>,
21341    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21342    pub matomo_uri: Option<String>,
21343    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21344    pub max_uploadfile_size_kb: Option<i64>,
21345    #[serde(default, skip_serializing_if = "Option::is_none")]
21346    pub post_active: Option<bool>,
21347    #[serde(default, skip_serializing_if = "Option::is_none")]
21348    pub post_edit_time_limited: Option<bool>,
21349    #[serde(default, skip_serializing_if = "Option::is_none")]
21350    pub post_email_summary_default_enabled: Option<bool>,
21351    /// Allowed values: `all`, `featured_groups`, `my_groups`.
21352    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21353    pub post_email_summary_default_filter: Option<String>,
21354    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21355    pub post_email_summary_default_weekdays: Option<String>,
21356    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21357    pub post_featured_groups: Option<String>,
21358    #[serde(default, skip_serializing_if = "Option::is_none")]
21359    pub post_inmenu: Option<bool>,
21360    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21361    pub post_name: Option<String>,
21362    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21363    pub post_sortcode: Option<i64>,
21364    #[serde(default, skip_serializing_if = "Option::is_none")]
21365    pub post_wizard_completed: Option<bool>,
21366    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21367    pub post_wizard_groups: Option<String>,
21368    #[serde(default, skip_serializing_if = "Option::is_none")]
21369    pub prevent_export: Option<bool>,
21370    #[serde(default, skip_serializing_if = "Option::is_none")]
21371    pub privacy_policy_external: Option<bool>,
21372    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21373    pub privacy_policy_external_link: Option<String>,
21374    #[serde(default, skip_serializing_if = "Option::is_none")]
21375    pub privacy_policy_fields_mandatory: Option<bool>,
21376    #[serde(default, skip_serializing_if = "Option::is_none")]
21377    pub privacy_policy_fields_mandatory_api: Option<bool>,
21378    #[serde(default, skip_serializing_if = "Option::is_none")]
21379    pub privacy_policy_internal: Option<bool>,
21380    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21381    pub rss_widget_link: Option<String>,
21382    #[serde(default, skip_serializing_if = "Option::is_none")]
21383    pub send_data_security_mails: Option<bool>,
21384    #[serde(default, skip_serializing_if = "Option::is_none")]
21385    pub show_remember_me: Option<bool>,
21386    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21387    pub site_licensekey: Option<String>,
21388    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21389    pub site_logo: Option<String>,
21390    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21391    pub site_mail: Option<String>,
21392    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21393    pub site_name: Option<String>,
21394    #[serde(default, skip_serializing_if = "Option::is_none")]
21395    pub site_offline: Option<bool>,
21396    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21397    pub site_region: Option<String>,
21398    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21399    pub site_startpage: Option<String>,
21400    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
21401    #[serde(rename = "support-user-active-since", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
21402    pub support_user_active_since: Option<chrono::DateTime<chrono::Utc>>,
21403    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21404    pub timezone: Option<String>,
21405    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21406    pub welcome: Option<String>,
21407    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21408    pub welcome_subtext: Option<String>,
21409    /// Fields not described by the spec, e.g. instance-specific DB fields.
21410    #[serde(flatten)]
21411    pub extra: serde_json::Map<String, serde_json::Value>,
21412}
21413
21414#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21415pub struct PutDynamicgroupsIdRulesetResponse {
21416    #[serde(rename = "dynamicGroupRuleSet", default, skip_serializing_if = "Option::is_none")]
21417    pub dynamic_group_rule_set: Option<Vec<DynamicGroupRule>>,
21418    /// Fields not described by the spec, e.g. instance-specific DB fields.
21419    #[serde(flatten)]
21420    pub extra: serde_json::Map<String, serde_json::Value>,
21421}
21422
21423#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21424pub struct PutGroupsGroupIdMeetingsMeetingIdBody {
21425    /// Meeting notes; omitted, null or blank text clears them.
21426    ///
21427    /// `None` leaves the field out, `Some(None)` sends `null`.
21428    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21429    pub comment: Option<Option<String>>,
21430    /// Whether the meeting was canceled. Canceling retains the meeting record.
21431    #[serde(rename = "isCanceled")]
21432    pub is_canceled: bool,
21433    /// Whether attendance and feedback have been marked as completed. Attendance changes through check-in endpoints are rejected while this is true.
21434    #[serde(rename = "isCompleted")]
21435    pub is_completed: bool,
21436    /// Additional guest headcount entered for the meeting, or null when unspecified. This does not create person or attendance records.
21437    ///
21438    /// `None` leaves the field out, `Some(None)` sends `null`.
21439    #[serde(rename = "numGuests", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21440    pub num_guests: Option<Option<i64>>,
21441    /// Feedback data to store for this meeting, typically MeetingTemplateField objects with answer values. The endpoint validates the outer array but not individual field contents. Omit or send null to clear.
21442    ///
21443    /// `None` leaves the field out, `Some(None)` sends `null`.
21444    #[serde(rename = "pollResult", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21445    pub poll_result: Option<Option<Vec<serde_json::Value>>>,
21446    /// New start timestamp in UTC; dateFrom is a legacy alias.
21447    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
21448    pub start_date: chrono::DateTime<chrono::Utc>,
21449    /// Fields not described by the spec, e.g. instance-specific DB fields.
21450    #[serde(flatten)]
21451    pub extra: serde_json::Map<String, serde_json::Value>,
21452}
21453
21454/// A person’s membership in one group. The membership has its own record ID, a role defined by the group type, and an independent membership status. Use person.domainIdentifier as personId in membership endpoint URLs; id identifies the membership record. Field visibility depends on the current user’s permissions.
21455#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21456pub struct PutGroupsGroupIdMembersPersonIdData {
21457    /// Legacy response-field mapping emitted by the membership transformer.
21458    #[serde(rename = "@deprecated")]
21459    pub deprecated: GroupMemberDeprecated,
21460    /// Comment about this membership. Only included when the current user can view basic group member fields.
21461    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21462    pub comment: Option<String>,
21463    /// Visible additional fields stored on this membership. Each entry identifies the group member field and its value. This is an array in responses; write requests use an object keyed by field ID.
21464    #[serde(default, skip_serializing_if = "Option::is_none")]
21465    pub fields: Option<Vec<GroupMemberFieldsItem>>,
21466    /// Group to which this membership belongs.
21467    pub group: GroupMemberGroup,
21468    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
21469    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
21470    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
21471    pub group_member_status: String,
21472    /// ID of the role definition for the group type, matching Role.id from GET /roles. This identifies the member’s role (for example, participant or leader); GroupRole.id identifies a group-specific role configuration.
21473    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
21474    pub group_type_role_id: i64,
21475    /// ID of the membership record linking the person and group.
21476    #[serde(deserialize_with = "crate::lenient::number")]
21477    pub id: i64,
21478    /// Membership end date, or null if none is set. Only included when the current user can view basic group member fields.
21479    #[serde(rename = "memberEndDate", default, skip_serializing_if = "Option::is_none")]
21480    pub member_end_date: Option<chrono::NaiveDate>,
21481    /// Date on which the membership began (YYYY-MM-DD), or null if no start date is set.
21482    #[serde(rename = "memberStartDate", default, skip_serializing_if = "Option::is_none")]
21483    pub member_start_date: Option<chrono::NaiveDate>,
21484    /// Newsletter subscription information, included when the member list is requested with include=newsletter.
21485    #[serde(default, skip_serializing_if = "Option::is_none")]
21486    pub newsletter: Option<GroupMemberNewsletter>,
21487    /// Person who belongs to the group. domainIdentifier is the person ID as a string.
21488    pub person: GroupMemberPerson,
21489    /// Requested additional person fields, keyed by field name. Values are subject to person-field permissions. Returned as an empty array when no fields were requested. These values belong to the person, whereas fields contains values belonging to this membership.
21490    #[serde(rename = "personFields", default, skip_serializing_if = "serde_json::Value::is_null")]
21491    pub person_fields: serde_json::Value,
21492    /// use person.domainIdentifier (type: string) instead.
21493    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21494    #[deprecated = "deprecated in the ChurchTools API"]
21495    pub person_id: Option<i64>,
21496    /// Person ID recorded as having registered this member, or null if none is recorded.
21497    #[serde(rename = "registeredBy", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21498    pub registered_by: Option<i64>,
21499    /// Timestamp of the most recent role change.
21500    #[serde(rename = "roleChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21501    pub role_changed_date: chrono::DateTime<chrono::Utc>,
21502    /// Timestamp of the most recent membership status change.
21503    #[serde(rename = "statusChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21504    pub status_changed_date: chrono::DateTime<chrono::Utc>,
21505    /// Person tags, included when the member list is requested with include=tags.
21506    #[serde(default, skip_serializing_if = "Option::is_none")]
21507    pub tags: Option<Vec<Tag>>,
21508    /// Position on the group’s waiting list, or null when no position is assigned.
21509    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21510    pub waitinglist_position: Option<i64>,
21511    /// Legacy duplicate of this membership.
21512    #[serde(rename = "0", default, skip_serializing_if = "Option::is_none")]
21513    #[deprecated = "deprecated in the ChurchTools API"]
21514    pub f_0: Option<PutGroupsGroupIdMembersPersonIdDataT0>,
21515    /// Fields not described by the spec, e.g. instance-specific DB fields.
21516    #[serde(flatten)]
21517    pub extra: serde_json::Map<String, serde_json::Value>,
21518}
21519
21520/// Legacy duplicate of this membership.
21521#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21522pub struct PutGroupsGroupIdMembersPersonIdDataT0 {
21523    /// Legacy response-field mapping emitted by the membership transformer.
21524    #[serde(rename = "@deprecated")]
21525    pub deprecated: GroupMemberDeprecated,
21526    /// Comment about this membership. Only included when the current user can view basic group member fields.
21527    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21528    pub comment: Option<String>,
21529    /// Visible additional fields stored on this membership. Each entry identifies the group member field and its value. This is an array in responses; write requests use an object keyed by field ID.
21530    #[serde(default, skip_serializing_if = "Option::is_none")]
21531    pub fields: Option<Vec<GroupMemberFieldsItem>>,
21532    /// Group to which this membership belongs.
21533    pub group: GroupMemberGroup,
21534    /// State of a person's membership in a group, independent of their role. active is an active membership; requested awaits confirmation; waiting is on the waiting list; to_delete is pending removal. Use GET /group/memberstatus for localized display names. A pending-removal membership still exists.
21535    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
21536    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::string")]
21537    pub group_member_status: String,
21538    /// ID of the role definition for the group type, matching Role.id from GET /roles. This identifies the member’s role (for example, participant or leader); GroupRole.id identifies a group-specific role configuration.
21539    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
21540    pub group_type_role_id: i64,
21541    /// ID of the membership record linking the person and group.
21542    #[serde(deserialize_with = "crate::lenient::number")]
21543    pub id: i64,
21544    /// Membership end date, or null if none is set. Only included when the current user can view basic group member fields.
21545    #[serde(rename = "memberEndDate", default, skip_serializing_if = "Option::is_none")]
21546    pub member_end_date: Option<chrono::NaiveDate>,
21547    /// Date on which the membership began (YYYY-MM-DD), or null if no start date is set.
21548    #[serde(rename = "memberStartDate", default, skip_serializing_if = "Option::is_none")]
21549    pub member_start_date: Option<chrono::NaiveDate>,
21550    /// Newsletter subscription information, included when the member list is requested with include=newsletter.
21551    #[serde(default, skip_serializing_if = "Option::is_none")]
21552    pub newsletter: Option<GroupMemberNewsletter>,
21553    /// Person who belongs to the group. domainIdentifier is the person ID as a string.
21554    pub person: GroupMemberPerson,
21555    /// Requested additional person fields, keyed by field name. Values are subject to person-field permissions. Returned as an empty array when no fields were requested. These values belong to the person, whereas fields contains values belonging to this membership.
21556    #[serde(rename = "personFields", default, skip_serializing_if = "serde_json::Value::is_null")]
21557    pub person_fields: serde_json::Value,
21558    /// use person.domainIdentifier (type: string) instead.
21559    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21560    #[deprecated = "deprecated in the ChurchTools API"]
21561    pub person_id: Option<i64>,
21562    /// Person ID recorded as having registered this member, or null if none is recorded.
21563    #[serde(rename = "registeredBy", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21564    pub registered_by: Option<i64>,
21565    /// Timestamp of the most recent role change.
21566    #[serde(rename = "roleChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21567    pub role_changed_date: chrono::DateTime<chrono::Utc>,
21568    /// Timestamp of the most recent membership status change.
21569    #[serde(rename = "statusChangedDate", serialize_with = "crate::datetime::serialize_utc")]
21570    pub status_changed_date: chrono::DateTime<chrono::Utc>,
21571    /// Person tags, included when the member list is requested with include=tags.
21572    #[serde(default, skip_serializing_if = "Option::is_none")]
21573    pub tags: Option<Vec<Tag>>,
21574    /// Position on the group’s waiting list, or null when no position is assigned.
21575    #[serde(rename = "waitinglistPosition", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21576    pub waitinglist_position: Option<i64>,
21577    /// Fields not described by the spec, e.g. instance-specific DB fields.
21578    #[serde(flatten)]
21579    pub extra: serde_json::Map<String, serde_json::Value>,
21580}
21581
21582#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21583pub struct PutPermissionsLockedData {
21584    pub permissions: Vec<LockedPermission>,
21585    /// Fields not described by the spec, e.g. instance-specific DB fields.
21586    #[serde(flatten)]
21587    pub extra: serde_json::Map<String, serde_json::Value>,
21588}
21589
21590/// Pending self-registration.
21591#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21592pub struct Registration {
21593    /// Configuration GUID, despite the `configId` property name.
21594    #[serde(rename = "configId", deserialize_with = "crate::lenient::string")]
21595    pub config_id: String,
21596    #[serde(deserialize_with = "crate::lenient::string")]
21597    pub email: String,
21598    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
21599    pub first_name: String,
21600    #[serde(deserialize_with = "crate::lenient::string")]
21601    pub guid: String,
21602    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
21603    pub last_name: String,
21604    pub meta: MetaDataEntityId,
21605    /// Only included after confirmation when active persons share the default email address; omitted when there are no matches.
21606    #[serde(rename = "possibleMatches", default, skip_serializing_if = "Option::is_none")]
21607    pub possible_matches: Option<Vec<RegistrationPossibleMatchesItem>>,
21608    #[serde(rename = "redirectAfterRegistration", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21609    pub redirect_after_registration: Option<String>,
21610    /// Fields not described by the spec, e.g. instance-specific DB fields.
21611    #[serde(flatten)]
21612    pub extra: serde_json::Map<String, serde_json::Value>,
21613}
21614
21615/// Self-registration form configuration. Administrative properties are included for callers with "churchcore administer persons" permission.
21616#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21617pub struct RegistrationConfig {
21618    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21619    pub deprecated: Option<String>,
21620    /// Administrators only. Blocked email patterns; `*` matches arbitrary text, case-insensitively.
21621    #[serde(default, skip_serializing_if = "Option::is_none")]
21622    pub blacklist: Option<Vec<String>>,
21623    pub campuses: Vec<RegistrationConfigCampusesItem>,
21624    /// Administrators only. Departments assigned to newly created persons.
21625    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
21626    pub department_ids: Option<Vec<i64>>,
21627    pub fields: Vec<RegistrationConfigFieldsItem>,
21628    #[serde(deserialize_with = "crate::lenient::string")]
21629    pub guid: String,
21630    #[serde(deserialize_with = "crate::lenient::number")]
21631    pub id: i64,
21632    #[serde(rename = "isActive")]
21633    pub is_active: bool,
21634    /// True when `statusId` is set and department/campus configurations are nonempty; independent of `isActive`.
21635    #[serde(rename = "isComplete")]
21636    pub is_complete: bool,
21637    #[serde(default, skip_serializing_if = "Option::is_none")]
21638    pub meta: Option<MetaDataEntityId>,
21639    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::number")]
21640    pub minimum_age: i64,
21641    /// Shows the registration entry point and permits numeric-ID public reads.
21642    #[serde(rename = "showButton")]
21643    pub show_button: bool,
21644    /// Administrators only. Status assigned to newly created persons.
21645    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21646    pub status_id: Option<i64>,
21647    /// Administrative compatibility alias for `tagsForNewPersons`.
21648    #[serde(default, skip_serializing_if = "Option::is_none")]
21649    #[deprecated = "deprecated in the ChurchTools API"]
21650    pub tags: Option<Vec<String>>,
21651    /// Administrators only. Person tag names added when linking an existing person.
21652    #[serde(rename = "tagsForExistingPersons", default, skip_serializing_if = "Option::is_none")]
21653    pub tags_for_existing_persons: Option<Vec<String>>,
21654    /// Administrators only. Person tag names added to newly created persons.
21655    #[serde(rename = "tagsForNewPersons", default, skip_serializing_if = "Option::is_none")]
21656    pub tags_for_new_persons: Option<Vec<String>>,
21657    /// Fields not described by the spec, e.g. instance-specific DB fields.
21658    #[serde(flatten)]
21659    pub extra: serde_json::Map<String, serde_json::Value>,
21660}
21661
21662/// Configuration as returned to administrators; includes assignment settings and audit metadata.
21663#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21664pub struct RegistrationConfigAdmin {
21665    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::string")]
21666    pub deprecated: String,
21667    /// Administrators only. Blocked email patterns; `*` matches arbitrary text, case-insensitively.
21668    pub blacklist: Vec<String>,
21669    pub campuses: Vec<RegistrationConfigCampusesItem>,
21670    /// Administrators only. Departments assigned to newly created persons.
21671    #[serde(rename = "departmentIds")]
21672    pub department_ids: Vec<i64>,
21673    pub fields: Vec<RegistrationConfigFieldsItem>,
21674    #[serde(deserialize_with = "crate::lenient::string")]
21675    pub guid: String,
21676    #[serde(deserialize_with = "crate::lenient::number")]
21677    pub id: i64,
21678    #[serde(rename = "isActive")]
21679    pub is_active: bool,
21680    /// True when `statusId` is set and department/campus configurations are nonempty; independent of `isActive`.
21681    #[serde(rename = "isComplete")]
21682    pub is_complete: bool,
21683    pub meta: MetaDataEntityId,
21684    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::number")]
21685    pub minimum_age: i64,
21686    /// Shows the registration entry point and permits numeric-ID public reads.
21687    #[serde(rename = "showButton")]
21688    pub show_button: bool,
21689    /// Administrators only. Status assigned to newly created persons.
21690    #[serde(rename = "statusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21691    pub status_id: Option<i64>,
21692    /// Administrative compatibility alias for `tagsForNewPersons`.
21693    #[serde(default, skip_serializing_if = "Option::is_none")]
21694    #[deprecated = "deprecated in the ChurchTools API"]
21695    pub tags: Option<Vec<String>>,
21696    /// Administrators only. Person tag names added when linking an existing person.
21697    #[serde(rename = "tagsForExistingPersons")]
21698    pub tags_for_existing_persons: Vec<String>,
21699    /// Administrators only. Person tag names added to newly created persons.
21700    #[serde(rename = "tagsForNewPersons")]
21701    pub tags_for_new_persons: Vec<String>,
21702    /// Fields not described by the spec, e.g. instance-specific DB fields.
21703    #[serde(flatten)]
21704    pub extra: serde_json::Map<String, serde_json::Value>,
21705}
21706
21707#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21708pub struct RegistrationConfigCampusesItem {
21709    /// Profiles are representing campuses and the church itself.
21710    pub campus: Profile,
21711    #[serde(rename = "campusId", deserialize_with = "crate::lenient::number")]
21712    pub campus_id: i64,
21713    /// Automatic membership groups for new persons; administrators only.
21714    #[serde(rename = "groupIds", default, skip_serializing_if = "Option::is_none")]
21715    pub group_ids: Option<Vec<i64>>,
21716    /// Fields not described by the spec, e.g. instance-specific DB fields.
21717    #[serde(flatten)]
21718    pub extra: serde_json::Map<String, serde_json::Value>,
21719}
21720
21721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21722pub struct RegistrationConfigFieldsItem {
21723    /// Expanded database-field definition when resolvable.
21724    #[serde(default, skip_serializing_if = "Option::is_none")]
21725    pub field: Option<RegistrationConfigFieldsItemField>,
21726    #[serde(rename = "fieldId", deserialize_with = "crate::lenient::number")]
21727    pub field_id: i64,
21728    #[serde(rename = "isRequired")]
21729    pub is_required: bool,
21730    /// Fields not described by the spec, e.g. instance-specific DB fields.
21731    #[serde(flatten)]
21732    pub extra: serde_json::Map<String, serde_json::Value>,
21733}
21734
21735/// Expanded database-field definition when resolvable.
21736#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21737pub struct RegistrationConfigFieldsItemField {
21738    /// Whether a person field’s value is cleared on archiving. Cannot be true for a non-nullable field.
21739    #[serde(rename = "deleteOnArchive")]
21740    pub delete_on_archive: bool,
21741    /// Whether the field is enabled for normal use.
21742    #[serde(rename = "isActive")]
21743    pub is_active: bool,
21744    /// Whether routines may use this field.
21745    #[serde(rename = "isAvailableInRoutines")]
21746    pub is_available_in_routines: bool,
21747    /// Whether the field is available on new-person forms; primarily relevant to person categories.
21748    #[serde(rename = "isNewPersonField")]
21749    pub is_new_person_field: bool,
21750    /// Configured field length.
21751    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21752    pub length: Option<i64>,
21753    /// Legacy display-layout setting, retained for compatibility.
21754    #[serde(rename = "lineEnding", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21755    #[deprecated = "deprecated in the ChurchTools API"]
21756    pub line_ending: Option<String>,
21757    /// Stored display name or translation key. nameTranslated is its localized display text.
21758    #[serde(deserialize_with = "crate::lenient::string")]
21759    pub name: String,
21760    /// Security-level ID governing access to this field, resolved from installation masterdata.
21761    #[serde(rename = "securityLevel", deserialize_with = "crate::lenient::number")]
21762    pub security_level: i64,
21763    /// Abbreviated label.
21764    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21765    pub shorty: Option<String>,
21766    /// Display-order value within its category.
21767    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
21768    pub sort_key: i64,
21769    /// Whether the field may be used as a placeholder.
21770    #[serde(rename = "useAsPlaceholder")]
21771    pub use_as_placeholder: bool,
21772    /// Compatibility mappings emitted by the backend.
21773    #[serde(rename = "@deprecated")]
21774    pub deprecated: DbFieldDeprecated,
21775    /// Underlying database column; prefer key for API requests.
21776    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21777    #[deprecated = "deprecated in the ChurchTools API"]
21778    pub column: Option<String>,
21779    /// True for a custom field created by this ChurchTools installation.
21780    #[serde(rename = "createdByChurch")]
21781    pub created_by_church: bool,
21782    /// Stored field category and its underlying entity table. Use internCode when creating a field.
21783    #[serde(rename = "fieldCategory")]
21784    pub field_category: DbFieldCategory,
21785    /// Database-field type definition. internCode selects the input/validation behavior; the numeric ID is referenced by field definitions. The name can be a translation key.
21786    #[serde(rename = "fieldType")]
21787    pub field_type: DbFieldType,
21788    /// Stored flag controlling frontend visibility; current updates reset it to false.
21789    #[serde(rename = "hideInFrontend")]
21790    pub hide_in_frontend: bool,
21791    /// Field-definition ID used in /dbfields paths.
21792    #[serde(deserialize_with = "crate::lenient::number")]
21793    pub id: i64,
21794    /// Whether the field is marked as basic information; current updates reset it to false.
21795    #[serde(rename = "isBasicInfo")]
21796    pub is_basic_info: bool,
21797    /// Whether the field is marked as non-configurable; current updates reset it to false.
21798    #[serde(rename = "isNotConfigurable")]
21799    pub is_not_configurable: bool,
21800    /// Whether stored field values may be null. Custom checkbox fields are non-nullable.
21801    #[serde(rename = "isNullable")]
21802    pub is_nullable: bool,
21803    /// API property name. Built-in columns are mapped to API names; custom fields normally retain their generated column name.
21804    #[serde(deserialize_with = "crate::lenient::string")]
21805    pub key: String,
21806    /// Localized display name for the current language.
21807    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
21808    pub name_translated: String,
21809    /// Deprecated alias of isNotConfigurable.
21810    #[serde(rename = "notConfigurable", default, skip_serializing_if = "Option::is_none")]
21811    #[deprecated = "deprecated in the ChurchTools API"]
21812    pub not_configurable: Option<bool>,
21813    /// Deprecated alias of isNullable.
21814    #[serde(default, skip_serializing_if = "Option::is_none")]
21815    #[deprecated = "deprecated in the ChurchTools API"]
21816    pub nullable: Option<bool>,
21817    /// Optional choices, included by an unfiltered list with include\[\]=options. The row shape depends on the field. Campus and group-visibility fields use specialized representations in this expansion.
21818    #[serde(default, skip_serializing_if = "Option::is_none")]
21819    pub options: Option<Vec<DbFieldOption>>,
21820    /// Fields not described by the spec, e.g. instance-specific DB fields.
21821    #[serde(flatten)]
21822    pub extra: serde_json::Map<String, serde_json::Value>,
21823}
21824
21825/// Partial self-registration configuration update.
21826#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21827pub struct RegistrationConfigUpdate {
21828    /// Case-insensitive email patterns; `*` is a wildcard. Replaces the full blacklist.
21829    #[serde(default, skip_serializing_if = "Option::is_none")]
21830    pub blacklist: Option<Vec<String>>,
21831    #[serde(default, skip_serializing_if = "Option::is_none")]
21832    pub campuses: Option<Vec<RegistrationConfigUpdateCampusesItem>>,
21833    #[serde(rename = "departmentIds", default, skip_serializing_if = "Option::is_none")]
21834    pub department_ids: Option<Vec<i64>>,
21835    /// Complete replacement of configured person fields.
21836    #[serde(default, skip_serializing_if = "Option::is_none")]
21837    pub fields: Option<Vec<RegistrationConfigUpdateFieldsItem>>,
21838    #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")]
21839    pub is_active: Option<bool>,
21840    #[serde(rename = "minimumAge", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21841    pub minimum_age: Option<i64>,
21842    #[serde(rename = "showButton", default, skip_serializing_if = "Option::is_none")]
21843    pub show_button: Option<bool>,
21844    /// `None` leaves the field out, `Some(None)` sends `null`.
21845    #[serde(rename = "statusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21846    pub status_id: Option<Option<i64>>,
21847    /// Legacy input alias; prefer `tagsForNewPersons`.
21848    #[serde(default, skip_serializing_if = "Option::is_none")]
21849    #[deprecated = "deprecated in the ChurchTools API"]
21850    pub tags: Option<Vec<String>>,
21851    #[serde(rename = "tagsForExistingPersons", default, skip_serializing_if = "Option::is_none")]
21852    pub tags_for_existing_persons: Option<Vec<String>>,
21853    #[serde(rename = "tagsForNewPersons", default, skip_serializing_if = "Option::is_none")]
21854    pub tags_for_new_persons: Option<Vec<String>>,
21855    /// Fields not described by the spec, e.g. instance-specific DB fields.
21856    #[serde(flatten)]
21857    pub extra: serde_json::Map<String, serde_json::Value>,
21858}
21859
21860#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21861pub struct RegistrationConfigUpdateCampusesItem {
21862    #[serde(rename = "campusId", deserialize_with = "crate::lenient::number")]
21863    pub campus_id: i64,
21864    #[serde(rename = "groupIds")]
21865    pub group_ids: Vec<i64>,
21866    /// Fields not described by the spec, e.g. instance-specific DB fields.
21867    #[serde(flatten)]
21868    pub extra: serde_json::Map<String, serde_json::Value>,
21869}
21870
21871#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21872pub struct RegistrationConfigUpdateFieldsItem {
21873    #[serde(rename = "fieldId", deserialize_with = "crate::lenient::number")]
21874    pub field_id: i64,
21875    #[serde(rename = "isRequired")]
21876    pub is_required: bool,
21877    /// Fields not described by the spec, e.g. instance-specific DB fields.
21878    #[serde(flatten)]
21879    pub extra: serde_json::Map<String, serde_json::Value>,
21880}
21881
21882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21883pub struct RegistrationConfirm {
21884    /// Confirmation token from the emailed link.
21885    #[serde(deserialize_with = "crate::lenient::string")]
21886    pub token: String,
21887    /// Fields not described by the spec, e.g. instance-specific DB fields.
21888    #[serde(flatten)]
21889    pub extra: serde_json::Map<String, serde_json::Value>,
21890}
21891
21892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21893pub struct RegistrationConvert {
21894    /// Consent fields plus configured person fields by numeric field ID or modern field name.
21895    #[serde(rename = "formData")]
21896    pub form_data: RegistrationConvertFormData,
21897    /// Eligible existing person to link; without it, a new person is created.
21898    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21899    pub person_id: Option<i64>,
21900    /// Same token used for email confirmation.
21901    #[serde(deserialize_with = "crate::lenient::string")]
21902    pub token: String,
21903    /// Fields not described by the spec, e.g. instance-specific DB fields.
21904    #[serde(flatten)]
21905    pub extra: serde_json::Map<String, serde_json::Value>,
21906}
21907
21908/// Consent fields plus configured person fields by numeric field ID or modern field name.
21909#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21910pub struct RegistrationConvertFormData {
21911    /// Explicit acceptance of the data privacy policy.
21912    #[serde(rename = "acceptDataPrivacy")]
21913    pub accept_data_privacy: bool,
21914    /// Required when `accept_datasecurity` is enabled.
21915    #[serde(rename = "acceptDataSecurity", default, skip_serializing_if = "Option::is_none")]
21916    pub accept_data_security: Option<bool>,
21917    /// Configured campus for a new person. Required with multiple campus choices.
21918    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
21919    pub campus_id: Option<i64>,
21920    /// Fields not described by the spec, e.g. instance-specific DB fields.
21921    #[serde(flatten)]
21922    pub extra: serde_json::Map<String, serde_json::Value>,
21923}
21924
21925#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21926pub struct RegistrationCreate {
21927    /// GUID from `RegistrationConfig.guid`.
21928    #[serde(rename = "configId", deserialize_with = "crate::lenient::string")]
21929    pub config_id: String,
21930    /// Email address used for confirmation.
21931    #[serde(deserialize_with = "crate::lenient::string")]
21932    pub email: String,
21933    /// Given name.
21934    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
21935    pub first_name: String,
21936    /// Applicant confirms the configured minimum age.
21937    #[serde(rename = "hasMinimumAge", default, skip_serializing_if = "Option::is_none")]
21938    pub has_minimum_age: Option<bool>,
21939    /// Family name.
21940    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
21941    pub last_name: String,
21942    /// Must satisfy the configured password-strength requirements.
21943    #[serde(deserialize_with = "crate::lenient::string")]
21944    pub password: String,
21945    /// Destination for the client after completion.
21946    ///
21947    /// `None` leaves the field out, `Some(None)` sends `null`.
21948    #[serde(rename = "redirectAfterRegistration", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
21949    pub redirect_after_registration: Option<Option<String>>,
21950    /// Fields not described by the spec, e.g. instance-specific DB fields.
21951    #[serde(flatten)]
21952    pub extra: serde_json::Map<String, serde_json::Value>,
21953}
21954
21955#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21956pub struct RegistrationPossibleMatchesItem {
21957    /// Person as Domain Object
21958    #[serde(rename = "domainObject")]
21959    pub domain_object: DomainObjectPerson,
21960    /// Configured active person fields, keyed by person field name. Available for the email-verified applicant.
21961    #[serde(rename = "formData", deserialize_with = "crate::lenient::map")]
21962    pub form_data: std::collections::BTreeMap<String, serde_json::Value>,
21963    #[serde(rename = "hasPassword")]
21964    pub has_password: bool,
21965    /// Fields not described by the spec, e.g. instance-specific DB fields.
21966    #[serde(flatten)]
21967    pub extra: serde_json::Map<String, serde_json::Value>,
21968}
21969
21970/// Definition of a relationship between two persons, such as Parent / Child or Friend / Friend. This is catalog metadata, not an actual relationship between named persons. The two role labels describe its sides; identical stored labels make it undirected in the backend. Security and export settings concern use of relationships of this type.
21971#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
21972pub struct RelationshipType {
21973    /// Role label for side A. Identical labels on both sides make the type undirected.
21974    #[serde(rename = "degreeNameA", deserialize_with = "crate::lenient::string")]
21975    pub degree_name_a: String,
21976    /// Role label for side B and counterpart of `degreeNameA`.
21977    #[serde(rename = "degreeNameB", deserialize_with = "crate::lenient::string")]
21978    pub degree_name_b: String,
21979    /// Heading for the combined export column. The export otherwise uses the type name or synthesized role labels.
21980    #[serde(rename = "exportTitle", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21981    pub export_title: Option<String>,
21982    /// Whether selected export values from both relationship directions are combined in one column. `false` still permits separate-direction export.
21983    #[serde(rename = "includeInExport")]
21984    pub include_in_export: bool,
21985    /// Stored type name or translation key. Use `nameTranslated` for the synthesized display label.
21986    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
21987    pub name: Option<String>,
21988    /// Security level configured for relationships of this type.
21989    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
21990    pub security_level_id: i64,
21991    /// Primary ascending catalog sort key. Ties are ordered by stored name, not by the translated or synthesized display name.
21992    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
21993    pub sort_key: i64,
21994    /// Side A role label translated for the current language.
21995    #[serde(rename = "degreeNameATranslated", deserialize_with = "crate::lenient::string")]
21996    pub degree_name_a_translated: String,
21997    /// Side B role label translated for the current language.
21998    #[serde(rename = "degreeNameBTranslated", deserialize_with = "crate::lenient::string")]
21999    pub degree_name_b_translated: String,
22000    /// Built-in behavior flags; always an array, empty for ordinary custom types. `nodelete` protects the type from deletion; `noduplicate` and `openduplicate` identify types used by duplicate-person handling.
22001    /// Allowed values: `nodelete`, `noduplicate`, `openduplicate`.
22002    #[serde(rename = "functionKeys")]
22003    pub function_keys: Vec<String>,
22004    /// Relationship-type ID used when creating or reading a relationship between persons.
22005    #[serde(deserialize_with = "crate::lenient::number")]
22006    pub id: i64,
22007    /// Translated display name, using the translated side labels as a fallback.
22008    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22009    pub name_translated: String,
22010    /// Fields not described by the spec, e.g. instance-specific DB fields.
22011    #[serde(flatten)]
22012    pub extra: serde_json::Map<String, serde_json::Value>,
22013}
22014
22015/// Creates a relationship-type catalog definition, not a relationship between persons.
22016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22017pub struct RelationshipTypeCreate {
22018    /// Role label for side A. Identical labels on both sides make the type undirected.
22019    #[serde(rename = "degreeNameA", deserialize_with = "crate::lenient::string")]
22020    pub degree_name_a: String,
22021    /// Role label for side B and counterpart of `degreeNameA`.
22022    #[serde(rename = "degreeNameB", deserialize_with = "crate::lenient::string")]
22023    pub degree_name_b: String,
22024    /// Heading for the combined export column. The export otherwise uses the type name or synthesized role labels.
22025    ///
22026    /// `None` leaves the field out, `Some(None)` sends `null`.
22027    #[serde(rename = "exportTitle", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22028    pub export_title: Option<Option<String>>,
22029    /// Controls column aggregation when this relationship is selected for person export. `true` combines both directions into one column; `false` uses separate columns. It does not disable export.
22030    ///
22031    /// `None` leaves the field out, `Some(None)` sends `null`.
22032    #[serde(rename = "includeInExport", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22033    pub include_in_export: Option<Option<bool>>,
22034    /// Stored name or translation key. The response derives `nameTranslated` from the side labels when necessary.
22035    ///
22036    /// `None` leaves the field out, `Some(None)` sends `null`.
22037    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22038    pub name: Option<Option<String>>,
22039    /// ID of an existing, installation-specific security level for relationships of this type.
22040    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
22041    pub security_level_id: i64,
22042    /// Ascending catalog sort key.
22043    ///
22044    /// `None` leaves the field out, `Some(None)` sends `null`.
22045    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22046    pub sort_key: Option<Option<i64>>,
22047    /// Fields not described by the spec, e.g. instance-specific DB fields.
22048    #[serde(flatten)]
22049    pub extra: serde_json::Map<String, serde_json::Value>,
22050}
22051
22052/// Replacement fields for an existing relationship type.
22053#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22054pub struct RelationshipTypeUpdate {
22055    /// Role label for side A. Identical labels on both sides make the type undirected.
22056    #[serde(rename = "degreeNameA", deserialize_with = "crate::lenient::string")]
22057    pub degree_name_a: String,
22058    /// Role label for side B and counterpart of `degreeNameA`.
22059    #[serde(rename = "degreeNameB", deserialize_with = "crate::lenient::string")]
22060    pub degree_name_b: String,
22061    /// Heading for the combined export column. The export otherwise uses the type name or synthesized role labels.
22062    ///
22063    /// `None` leaves the field out, `Some(None)` sends `null`.
22064    #[serde(rename = "exportTitle", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22065    pub export_title: Option<Option<String>>,
22066    /// Controls column aggregation when this relationship is selected for person export. `true` combines both directions into one column; `false` uses separate columns. It does not disable export.
22067    ///
22068    /// `None` leaves the field out, `Some(None)` sends `null`.
22069    #[serde(rename = "includeInExport", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22070    pub include_in_export: Option<Option<bool>>,
22071    /// Stored name or translation key. The response derives `nameTranslated` from the side labels when necessary.
22072    ///
22073    /// `None` leaves the field out, `Some(None)` sends `null`.
22074    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22075    pub name: Option<Option<String>>,
22076    /// ID of an existing, installation-specific security level for relationships of this type.
22077    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
22078    pub security_level_id: i64,
22079    /// Ascending catalog sort key.
22080    ///
22081    /// `None` leaves the field out, `Some(None)` sends `null`.
22082    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22083    pub sort_key: Option<Option<i64>>,
22084    /// Fields not described by the spec, e.g. instance-specific DB fields.
22085    #[serde(flatten)]
22086    pub extra: serde_json::Map<String, serde_json::Value>,
22087}
22088
22089/// Echo of the transient recurrence definition.
22090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22091pub struct RepeatCalculationBase {
22092    pub additions: Vec<std::collections::BTreeMap<String, serde_json::Value>>,
22093    #[serde(rename = "allDay")]
22094    pub all_day: bool,
22095    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
22096    #[serde(rename = "endDate")]
22097    pub end_date: crate::DateOrDateTime,
22098    pub exceptions: Vec<std::collections::BTreeMap<String, serde_json::Value>>,
22099    /// Placeholder ID because no appointment is stored.
22100    /// Allowed values: `-1`.
22101    #[serde(deserialize_with = "crate::lenient::number")]
22102    pub id: i64,
22103    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
22104    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22105    pub repeat_frequency: Option<i64>,
22106    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
22107    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
22108    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::number")]
22109    pub repeat_id: i64,
22110    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
22111    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22112    pub repeat_option: Option<i64>,
22113    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
22114    #[serde(rename = "repeatUntil", default, skip_serializing_if = "Option::is_none")]
22115    pub repeat_until: Option<chrono::NaiveDate>,
22116    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
22117    #[serde(rename = "startDate")]
22118    pub start_date: crate::DateOrDateTime,
22119    /// Fields not described by the spec, e.g. instance-specific DB fields.
22120    #[serde(flatten)]
22121    pub extra: serde_json::Map<String, serde_json::Value>,
22122}
22123
22124/// Calculate occurrence dates without persisting an appointment.
22125#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22126pub struct RepeatCalculationCreate {
22127    #[serde(default, skip_serializing_if = "Option::is_none")]
22128    pub additionals: Option<Vec<AppointmentAdditionalCreate>>,
22129    /// End of the base occurrence. For timed appointments it must be later than startDate. For all-day appointments this date is inclusive and may equal startDate for a one-day appointment.
22130    #[serde(rename = "endDate")]
22131    pub end_date: crate::DateOrDateTime,
22132    #[serde(default, skip_serializing_if = "Option::is_none")]
22133    pub exceptions: Option<Vec<AppointmentExceptionCreate>>,
22134    /// Interval between repetitions; use a positive integer for automatic patterns, for example 2 with repeatId=7 for every two weeks. Irrelevant for once/manual patterns.
22135    ///
22136    /// `None` leaves the field out, `Some(None)` sends `null`.
22137    #[serde(rename = "repeatFrequency", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22138    pub repeat_frequency: Option<Option<i64>>,
22139    /// Recurrence pattern: 0 = once, 1 = daily, 7 = weekly, 31 = monthly by date, 32 = monthly by weekday, 365 = yearly, 999 = manually selected dates. Automatic patterns use repeatFrequency and repeatUntil; manual dates use additionals.
22140    /// Allowed values: `0`, `1`, `31`, `32`, `365`, `7`, `999`.
22141    #[serde(rename = "repeatId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22142    pub repeat_id: Option<i64>,
22143    /// For repeatId=32, ordinal of the weekday within the month: 1–5 for first through fifth, 6 for last. The weekday comes from startDate.
22144    ///
22145    /// `None` leaves the field out, `Some(None)` sends `null`.
22146    #[serde(rename = "repeatOption", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22147    pub repeat_option: Option<Option<i64>>,
22148    /// Inclusive last date of an automatic series. Supply this with automatic recurrence; omission does not represent an unlimited series in these write endpoints.
22149    ///
22150    /// `None` leaves the field out, `Some(None)` sends `null`.
22151    #[serde(rename = "repeatUntil", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22152    pub repeat_until: Option<Option<chrono::NaiveDate>>,
22153    /// Start of the base occurrence. For all-day appointments, send YYYY-MM-DD.
22154    #[serde(rename = "startDate")]
22155    pub start_date: crate::DateOrDateTime,
22156    /// Fields not described by the spec, e.g. instance-specific DB fields.
22157    #[serde(flatten)]
22158    pub extra: serde_json::Map<String, serde_json::Value>,
22159}
22160
22161/// One computed occurrence of a transient recurrence definition. No iCalendar UID is assigned.
22162#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22163pub struct RepeatCalculationOccurrence {
22164    /// Echo of the transient recurrence definition.
22165    pub base: RepeatCalculationBase,
22166    pub calculated: RepeatCalculationOccurrenceCalculated,
22167    /// Fields not described by the spec, e.g. instance-specific DB fields.
22168    #[serde(flatten)]
22169    pub extra: serde_json::Map<String, serde_json::Value>,
22170}
22171
22172#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22173pub struct RepeatCalculationOccurrenceCalculated {
22174    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
22175    #[serde(rename = "endDate")]
22176    pub end_date: crate::DateOrDateTime,
22177    /// Use a UTC timestamp for a timed appointment or YYYY-MM-DD for an all-day appointment. ChurchTools interprets dates in the installation’s timezone. Seconds on appointment input are discarded.
22178    #[serde(rename = "startDate")]
22179    pub start_date: crate::DateOrDateTime,
22180    /// Fields not described by the spec, e.g. instance-specific DB fields.
22181    #[serde(flatten)]
22182    pub extra: serde_json::Map<String, serde_json::Value>,
22183}
22184
22185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22186pub struct Report {
22187    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22188    pub comment: Option<String>,
22189    pub meta: MetaDataEntityId,
22190    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
22191    pub reporter: serde_json::Value,
22192    /// Allowed values: `accepted`, `declined`, `pending`.
22193    #[serde(deserialize_with = "crate::lenient::string")]
22194    pub status: String,
22195    /// Fields not described by the spec, e.g. instance-specific DB fields.
22196    #[serde(flatten)]
22197    pub extra: serde_json::Map<String, serde_json::Value>,
22198}
22199
22200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22201pub struct ReportAnswer {
22202    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22203    pub domain_id: i64,
22204    /// Allowed values: `post`, `post_comment`.
22205    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22206    pub domain_type: String,
22207    /// Allowed values: `accept`, `decline`.
22208    #[serde(deserialize_with = "crate::lenient::string")]
22209    pub response: String,
22210    /// Fields not described by the spec, e.g. instance-specific DB fields.
22211    #[serde(flatten)]
22212    pub extra: serde_json::Map<String, serde_json::Value>,
22213}
22214
22215#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22216pub struct ReportCreate {
22217    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22218    pub captcha: Option<String>,
22219    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22220    pub comment: Option<String>,
22221    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22222    pub domain_id: i64,
22223    /// Allowed values: `post`, `post_comment`.
22224    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22225    pub domain_type: String,
22226    #[serde(default, skip_serializing_if = "Option::is_none")]
22227    pub reporter: Option<ReportCreateReporter>,
22228    /// Fields not described by the spec, e.g. instance-specific DB fields.
22229    #[serde(flatten)]
22230    pub extra: serde_json::Map<String, serde_json::Value>,
22231}
22232
22233#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22234pub struct ReportCreateReporter {
22235    #[serde(deserialize_with = "crate::lenient::string")]
22236    pub email: String,
22237    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
22238    pub first_name: String,
22239    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
22240    pub last_name: String,
22241    /// Fields not described by the spec, e.g. instance-specific DB fields.
22242    #[serde(flatten)]
22243    pub extra: serde_json::Map<String, serde_json::Value>,
22244}
22245
22246#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22247pub struct ReportObjectPost {
22248    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22249    pub comment: Option<String>,
22250    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22251    pub domain_id: i64,
22252    #[serde(deserialize_with = "crate::lenient::number")]
22253    pub id: i64,
22254    pub meta: MetaDataEntityId,
22255    pub reports: Vec<Report>,
22256    /// Allowed values: `accepted`, `declined`, `pending`, `pending-again`.
22257    #[serde(deserialize_with = "crate::lenient::string")]
22258    pub status: String,
22259    #[serde(rename = "domainObject")]
22260    pub domain_object: Post,
22261    /// Allowed values: `post`.
22262    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22263    pub domain_type: String,
22264    /// Fields not described by the spec, e.g. instance-specific DB fields.
22265    #[serde(flatten)]
22266    pub extra: serde_json::Map<String, serde_json::Value>,
22267}
22268
22269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22270pub struct ReportObjectPostComment {
22271    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22272    pub comment: Option<String>,
22273    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22274    pub domain_id: i64,
22275    #[serde(deserialize_with = "crate::lenient::number")]
22276    pub id: i64,
22277    pub meta: MetaDataEntityId,
22278    pub reports: Vec<Report>,
22279    /// Allowed values: `accepted`, `declined`, `pending`, `pending-again`.
22280    #[serde(deserialize_with = "crate::lenient::string")]
22281    pub status: String,
22282    #[serde(rename = "domainObject")]
22283    pub domain_object: PostComment,
22284    /// Allowed values: `post_comment`.
22285    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22286    pub domain_type: String,
22287    /// Fields not described by the spec, e.g. instance-specific DB fields.
22288    #[serde(flatten)]
22289    pub extra: serde_json::Map<String, serde_json::Value>,
22290}
22291
22292/// A compact object returned by the registered domain resolver. Match results by `domainType` and `domainIdentifier`, not by array index.
22293#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22294pub struct ResolvedDomainObject {
22295    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
22296    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22297    pub api_url: Option<String>,
22298    /// Optional display color.
22299    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
22300    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
22301    pub color: serde_json::Value,
22302    /// Optional image URL.
22303    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22304    pub image_url: Option<String>,
22305    /// Additional localized display lines; not structured resource fields.
22306    pub infos: Vec<String>,
22307    /// Optional initials for an avatar fallback.
22308    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22309    pub initials: Option<String>,
22310    /// Fields not described by the spec, e.g. instance-specific DB fields.
22311    #[serde(flatten)]
22312    pub extra: serde_json::Map<String, serde_json::Value>,
22313}
22314
22315/// An individual bookable resource, such as a room, vehicle or item of equipment. A resource type groups similar resources. Bookings reserve this resource for specific dates.
22316#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22317pub struct Resource {
22318    /// Persons responsible for this resource. Resource administrators can view and administer its bookings; changing resource settings still requires permission to edit resource master data.
22319    #[serde(rename = "adminIds")]
22320    pub admin_ids: Vec<i64>,
22321    /// Additional information about the resource, such as capacity or available equipment.
22322    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22323    pub description: Option<String>,
22324    /// Location text used in the resource’s iCalendar export.
22325    #[serde(rename = "iCalLocation", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22326    pub i_cal_location: Option<String>,
22327    /// Automatically approves pending bookings when there are no conflicts. For virtual resources, automatic approval bypasses the conflict check. This does not grant permission to edit resource settings.
22328    #[serde(rename = "isAutoAccept")]
22329    pub is_auto_accept: bool,
22330    /// Whether this is a virtual resource. Virtual bookings have a separate creation permission and bypass conflicts when checking automatic approval.
22331    #[serde(rename = "isVirtual")]
22332    pub is_virtual: bool,
22333    /// Internal location of the resource.
22334    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22335    pub location: Option<String>,
22336    /// Name of the individual resource, for example a room or vehicle.
22337    #[serde(deserialize_with = "crate::lenient::string")]
22338    pub name: String,
22339    /// Number of units available for simultaneous bookings.
22340    #[serde(deserialize_with = "crate::lenient::number")]
22341    pub quantity: i64,
22342    /// Access token used by the legacy public iCalendar export. Changing or clearing it invalidates subscriptions using the previous token.
22343    #[serde(rename = "randomString", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22344    pub random_string: Option<String>,
22345    /// Resource type used to group this resource, such as rooms or vehicles. Resource types are available from `/resourcetypes`.
22346    #[serde(rename = "resourceTypeId", deserialize_with = "crate::lenient::number")]
22347    pub resource_type_id: i64,
22348    /// Sort value for displaying resources.
22349    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22350    pub sort_key: i64,
22351    /// Use `needsAppointment` instead.
22352    #[serde(rename = "doesRequireCalEntry", default, skip_serializing_if = "Option::is_none")]
22353    #[deprecated = "Use `needsAppointment` instead."]
22354    pub does_require_cal_entry: Option<bool>,
22355    #[serde(deserialize_with = "crate::lenient::number")]
22356    pub id: i64,
22357    /// Included with `include[]=involvedPersonsDomainObjects`. Contains person references for resolvable `adminIds`; missing persons are omitted.
22358    #[serde(rename = "involvedPersonsDomainObjects", default, skip_serializing_if = "Option::is_none")]
22359    pub involved_persons_domain_objects: Option<BookingCalculatedWithIncludesBaseResourceInvolvedPersonsDomainObjects>,
22360    pub meta: MetaDataEntityId,
22361    /// Resource name translated for the current language, falling back to name.
22362    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22363    pub name_translated: String,
22364    /// Whether bookings must be linked to a calendar appointment. Legacy resources can return null.
22365    #[serde(rename = "needsAppointment", default, skip_serializing_if = "Option::is_none")]
22366    pub needs_appointment: Option<bool>,
22367    /// Fields not described by the spec, e.g. instance-specific DB fields.
22368    #[serde(flatten)]
22369    pub extra: serde_json::Map<String, serde_json::Value>,
22370}
22371
22372/// Configuration for an individual bookable resource.
22373#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22374pub struct ResourceCreate {
22375    /// Persons responsible for this resource. Resource administrators can view and administer its bookings; changing resource settings still requires permission to edit resource master data.
22376    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
22377    pub admin_ids: Option<Vec<i64>>,
22378    /// Additional information about the resource, such as capacity or available equipment.
22379    ///
22380    /// `None` leaves the field out, `Some(None)` sends `null`.
22381    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22382    pub description: Option<Option<String>>,
22383    /// Location text used in the resource’s iCalendar export.
22384    ///
22385    /// `None` leaves the field out, `Some(None)` sends `null`.
22386    #[serde(rename = "iCalLocation", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22387    pub i_cal_location: Option<Option<String>>,
22388    /// Automatically approves pending bookings when there are no conflicts. For virtual resources, automatic approval bypasses the conflict check. This does not grant permission to edit resource settings.
22389    #[serde(rename = "isAutoAccept", default, skip_serializing_if = "Option::is_none")]
22390    pub is_auto_accept: Option<bool>,
22391    /// Whether this is a virtual resource. Virtual bookings have a separate creation permission and bypass conflicts when checking automatic approval.
22392    #[serde(rename = "isVirtual", default, skip_serializing_if = "Option::is_none")]
22393    pub is_virtual: Option<bool>,
22394    /// Internal location of the resource.
22395    ///
22396    /// `None` leaves the field out, `Some(None)` sends `null`.
22397    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22398    pub location: Option<Option<String>>,
22399    /// Name of the individual resource, for example a room or vehicle.
22400    #[serde(deserialize_with = "crate::lenient::string")]
22401    pub name: String,
22402    /// Number of units available for simultaneous bookings.
22403    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22404    pub quantity: Option<i64>,
22405    /// Access token used by the legacy public iCalendar export. Changing or clearing it invalidates subscriptions using the previous token.
22406    ///
22407    /// `None` leaves the field out, `Some(None)` sends `null`.
22408    #[serde(rename = "randomString", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22409    pub random_string: Option<Option<String>>,
22410    /// Resource type used to group this resource, such as rooms or vehicles. Resource types are available from `/resourcetypes`.
22411    #[serde(rename = "resourceTypeId", deserialize_with = "crate::lenient::number")]
22412    pub resource_type_id: i64,
22413    /// Sort value for displaying resources.
22414    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22415    pub sort_key: i64,
22416    /// Requires bookings to be linked to a calendar appointment. When true, create bookings through the appointment APIs; `POST /bookings` cannot create independent bookings for this resource.
22417    #[serde(rename = "needsAppointment", default, skip_serializing_if = "Option::is_none")]
22418    pub needs_appointment: Option<bool>,
22419    /// Fields not described by the spec, e.g. instance-specific DB fields.
22420    #[serde(flatten)]
22421    pub extra: serde_json::Map<String, serde_json::Value>,
22422}
22423
22424/// Resource planning reference data: all resource types and the resources visible to the current user.
22425#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22426pub struct ResourceMasterData {
22427    /// All resource types ordered by sortKey ascending, including types without visible resources.
22428    #[serde(rename = "resourceTypes")]
22429    pub resource_types: Vec<ResourceType>,
22430    /// Resources the current user is allowed to view.
22431    pub resources: Vec<Resource>,
22432    /// Fields not described by the spec, e.g. instance-specific DB fields.
22433    #[serde(flatten)]
22434    pub extra: serde_json::Map<String, serde_json::Value>,
22435}
22436
22437/// Pending booking workload for one resource.
22438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22439pub struct ResourceStatistics {
22440    /// Number of pending booking occurrences from now onward, rather than distinct booking IDs. Candidate series are selected in a ten-year lookahead window; their remaining occurrences are then expanded without an upper date limit.
22441    #[serde(rename = "numRequestedBookingsInFuture", deserialize_with = "crate::lenient::number")]
22442    pub num_requested_bookings_in_future: i64,
22443    /// Fields not described by the spec, e.g. instance-specific DB fields.
22444    #[serde(flatten)]
22445    pub extra: serde_json::Map<String, serde_json::Value>,
22446}
22447
22448/// Category used by `Resource.resourceTypeId`. Resource types are returned even when the reader has no visible resources of that type.
22449#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22450pub struct ResourceType {
22451    /// Associated campus, or null for no campus assignment.
22452    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22453    pub campus_id: Option<i64>,
22454    /// Singular label for one resource of this type.
22455    #[serde(deserialize_with = "crate::lenient::string")]
22456    pub name: String,
22457    /// Plural label for resources of this type.
22458    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
22459    pub name_plural: String,
22460    /// Sort value for displaying resource types.
22461    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22462    pub sort_key: i64,
22463    #[serde(deserialize_with = "crate::lenient::number")]
22464    pub id: i64,
22465    pub meta: MetaDataEntityId,
22466    /// Plural label translated for the current language.
22467    #[serde(rename = "namePluralTranslated", deserialize_with = "crate::lenient::string")]
22468    pub name_plural_translated: String,
22469    /// Singular label translated for the current language.
22470    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22471    pub name_translated: String,
22472    /// Fields not described by the spec, e.g. instance-specific DB fields.
22473    #[serde(flatten)]
22474    pub extra: serde_json::Map<String, serde_json::Value>,
22475}
22476
22477/// A category for resources, such as rooms or vehicles. A campus is an organizational location in ChurchTools; `campusId` is optional.
22478#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22479pub struct ResourceTypeCreate {
22480    /// Associated campus, or null for no campus assignment.
22481    ///
22482    /// `None` leaves the field out, `Some(None)` sends `null`.
22483    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22484    pub campus_id: Option<Option<i64>>,
22485    /// Singular label for one resource of this type.
22486    #[serde(deserialize_with = "crate::lenient::string")]
22487    pub name: String,
22488    /// Plural label for resources of this type.
22489    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
22490    pub name_plural: String,
22491    /// Sort value for displaying resource types.
22492    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22493    pub sort_key: i64,
22494    /// Fields not described by the spec, e.g. instance-specific DB fields.
22495    #[serde(flatten)]
22496    pub extra: serde_json::Map<String, serde_json::Value>,
22497}
22498
22499/// Complete resource-type input. The resource type ID is supplied in the path.
22500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22501pub struct ResourceTypeUpdate {
22502    /// Associated campus, or null for no campus assignment.
22503    ///
22504    /// `None` leaves the field out, `Some(None)` sends `null`.
22505    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22506    pub campus_id: Option<Option<i64>>,
22507    /// Singular label for one resource of this type.
22508    #[serde(deserialize_with = "crate::lenient::string")]
22509    pub name: String,
22510    /// Plural label for resources of this type.
22511    #[serde(rename = "namePlural", deserialize_with = "crate::lenient::string")]
22512    pub name_plural: String,
22513    /// Sort value for displaying resource types.
22514    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22515    pub sort_key: i64,
22516    /// Fields not described by the spec, e.g. instance-specific DB fields.
22517    #[serde(flatten)]
22518    pub extra: serde_json::Map<String, serde_json::Value>,
22519}
22520
22521/// Complete resource configuration. The resource ID is supplied in the path.
22522#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22523pub struct ResourceUpdate {
22524    /// Persons responsible for this resource. Resource administrators can view and administer its bookings; changing resource settings still requires permission to edit resource master data.
22525    #[serde(rename = "adminIds", default, skip_serializing_if = "Option::is_none")]
22526    pub admin_ids: Option<Vec<i64>>,
22527    /// Additional information about the resource, such as capacity or available equipment.
22528    ///
22529    /// `None` leaves the field out, `Some(None)` sends `null`.
22530    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22531    pub description: Option<Option<String>>,
22532    /// Location text used in the resource’s iCalendar export.
22533    ///
22534    /// `None` leaves the field out, `Some(None)` sends `null`.
22535    #[serde(rename = "iCalLocation", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22536    pub i_cal_location: Option<Option<String>>,
22537    /// Automatically approves pending bookings when there are no conflicts. For virtual resources, automatic approval bypasses the conflict check. This does not grant permission to edit resource settings.
22538    #[serde(rename = "isAutoAccept", default, skip_serializing_if = "Option::is_none")]
22539    pub is_auto_accept: Option<bool>,
22540    /// Whether this is a virtual resource. Virtual bookings have a separate creation permission and bypass conflicts when checking automatic approval.
22541    #[serde(rename = "isVirtual", default, skip_serializing_if = "Option::is_none")]
22542    pub is_virtual: Option<bool>,
22543    /// Internal location of the resource.
22544    ///
22545    /// `None` leaves the field out, `Some(None)` sends `null`.
22546    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22547    pub location: Option<Option<String>>,
22548    /// Name of the individual resource, for example a room or vehicle.
22549    #[serde(deserialize_with = "crate::lenient::string")]
22550    pub name: String,
22551    /// Number of units available for simultaneous bookings.
22552    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22553    pub quantity: Option<i64>,
22554    /// Access token used by the legacy public iCalendar export. Changing or clearing it invalidates subscriptions using the previous token.
22555    ///
22556    /// `None` leaves the field out, `Some(None)` sends `null`.
22557    #[serde(rename = "randomString", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22558    pub random_string: Option<Option<String>>,
22559    /// Resource type used to group this resource, such as rooms or vehicles. Resource types are available from `/resourcetypes`.
22560    #[serde(rename = "resourceTypeId", deserialize_with = "crate::lenient::number")]
22561    pub resource_type_id: i64,
22562    /// Sort value for displaying resources.
22563    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22564    pub sort_key: i64,
22565    /// Requires bookings to be linked to a calendar appointment. When true, create bookings through the appointment APIs; `POST /bookings` cannot create independent bookings for this resource.
22566    #[serde(rename = "needsAppointment", default, skip_serializing_if = "Option::is_none")]
22567    pub needs_appointment: Option<bool>,
22568    /// Fields not described by the spec, e.g. instance-specific DB fields.
22569    #[serde(flatten)]
22570    pub extra: serde_json::Map<String, serde_json::Value>,
22571}
22572
22573/// A membership role defined for a group type, such as leader or participant. Groups of that type use this definition and add their own settings through GroupRole. A role describes a person's function; MemberStatus separately describes whether their membership is active, requested, waiting or pending removal.
22574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22575pub struct Role {
22576    /// ID of the group type this role belongs to. Discover group types with GET /group/grouptypes.
22577    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
22578    pub group_type_id: i64,
22579    /// ID of the growth path associated with this role, or null for no association. Growth paths track steps in a person's development in ChurchTools.
22580    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22581    pub grow_path_id: Option<i64>,
22582    /// Whether this is the default role for its group type. Setting this to true clears the default flag on the other roles of that type.
22583    #[serde(rename = "isDefault")]
22584    pub is_default: bool,
22585    /// Whether this role is marked as hidden for displays that exclude hidden roles, such as leader listings. Hidden roles are still returned by this endpoint; this flag is not an access permission.
22586    #[serde(rename = "isHidden")]
22587    pub is_hidden: bool,
22588    /// Legacy response field indicating whether type is leader. Use type instead; this field is not used to create or update a role.
22589    #[serde(rename = "isLeader", default, skip_serializing_if = "Option::is_none")]
22590    #[deprecated = "Use type instead; this field is not used to create or update a role."]
22591    pub is_leader: Option<bool>,
22592    /// Stored name of the role. Use nameTranslated from the response for a localized display name.
22593    #[serde(deserialize_with = "crate::lenient::string")]
22594    pub name: String,
22595    /// Abbreviated label for the role, used in compact displays.
22596    #[serde(deserialize_with = "crate::lenient::string")]
22597    pub shorty: String,
22598    /// Display order among roles. Lower values come first.
22599    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22600    pub sort_key: i64,
22601    /// Functional classification of the role. Multiple roles with different names can share the same classification.
22602    /// Allowed values: `leader`, `participant`.
22603    #[serde(deserialize_with = "crate::lenient::string")]
22604    pub r#type: String,
22605    /// ID of this role record. For Role this identifies the group-type definition; for GroupRole it identifies the settings record for a specific group.
22606    #[serde(deserialize_with = "crate::lenient::number")]
22607    pub id: i64,
22608    /// Localized display name, translated from the stored name when a translation exists.
22609    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
22610    pub name_translated: String,
22611    /// Fields not described by the spec, e.g. instance-specific DB fields.
22612    #[serde(flatten)]
22613    pub extra: serde_json::Map<String, serde_json::Value>,
22614}
22615
22616#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22617pub struct RoleCreate {
22618    /// ID of the group type this role belongs to. Discover group types with GET /group/grouptypes.
22619    #[serde(rename = "groupTypeId", deserialize_with = "crate::lenient::number")]
22620    pub group_type_id: i64,
22621    /// ID of the growth path associated with this role, or null for no association. Growth paths track steps in a person's development in ChurchTools.
22622    #[serde(rename = "growPathId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22623    pub grow_path_id: Option<i64>,
22624    /// Whether this is the default role for its group type. Setting this to true clears the default flag on the other roles of that type.
22625    #[serde(rename = "isDefault")]
22626    pub is_default: bool,
22627    /// Whether this role is marked as hidden for displays that exclude hidden roles, such as leader listings. Hidden roles are still returned by this endpoint; this flag is not an access permission.
22628    #[serde(rename = "isHidden")]
22629    pub is_hidden: bool,
22630    /// Legacy response field indicating whether type is leader. Use type instead; this field is not used to create or update a role.
22631    #[serde(rename = "isLeader", default, skip_serializing_if = "Option::is_none")]
22632    #[deprecated = "Use type instead; this field is not used to create or update a role."]
22633    pub is_leader: Option<bool>,
22634    /// Stored name of the role. Use nameTranslated from the response for a localized display name.
22635    #[serde(deserialize_with = "crate::lenient::string")]
22636    pub name: String,
22637    /// Abbreviated label for the role, used in compact displays.
22638    #[serde(deserialize_with = "crate::lenient::string")]
22639    pub shorty: String,
22640    /// Display order among roles. Lower values come first.
22641    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22642    pub sort_key: i64,
22643    /// Functional classification of the role. Multiple roles with different names can share the same classification.
22644    /// Allowed values: `leader`, `participant`.
22645    #[serde(deserialize_with = "crate::lenient::string")]
22646    pub r#type: String,
22647    /// Fields not described by the spec, e.g. instance-specific DB fields.
22648    #[serde(flatten)]
22649    pub extra: serde_json::Map<String, serde_json::Value>,
22650}
22651
22652/// Personal setting containing the secret used by a roster calendar subscription.
22653#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22654pub struct RosterICalSetting {
22655    /// Allowed values: `rosterICalSecret`.
22656    #[serde(deserialize_with = "crate::lenient::string")]
22657    pub attribute: String,
22658    /// Allowed values: `churchservice`.
22659    #[serde(deserialize_with = "crate::lenient::string")]
22660    pub module: String,
22661    /// Secret identifying the person in the subscription URL. Creating a new roster link replaces this value.
22662    #[serde(deserialize_with = "crate::lenient::string")]
22663    pub value: String,
22664    /// Fields not described by the spec, e.g. instance-specific DB fields.
22665    #[serde(flatten)]
22666    pub extra: serde_json::Map<String, serde_json::Value>,
22667}
22668
22669/// Automation definition, including enabled and disabled steps as a nested tree. Domain context bindings and per-membership execution progress are separate resources.
22670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22671pub struct Routine {
22672    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22673    pub description: Option<String>,
22674    /// Allowed values: `group_membership`.
22675    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22676    pub domain_type: String,
22677    #[serde(deserialize_with = "crate::lenient::number")]
22678    pub id: i64,
22679    #[serde(rename = "isEnabled")]
22680    pub is_enabled: bool,
22681    #[serde(deserialize_with = "crate::lenient::string")]
22682    pub name: String,
22683    #[serde(deserialize_with = "crate::lenient::number")]
22684    pub priority: i64,
22685    /// Root steps in sort order, with children nested on their parent steps. Empty child arrays are omitted by the serializer.
22686    pub steps: Vec<serde_json::Value>,
22687    /// Fields not described by the spec, e.g. instance-specific DB fields.
22688    #[serde(flatten)]
22689    pub extra: serde_json::Map<String, serde_json::Value>,
22690}
22691
22692#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22693pub struct RoutineActionValidation {
22694    /// Action-specific data. Omission defaults to an empty PHP array.
22695    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
22696    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
22697    /// Registered action key, or special:wait / special:repeat.
22698    #[serde(rename = "actionKey", deserialize_with = "crate::lenient::string")]
22699    pub action_key: String,
22700    /// Fields not described by the spec, e.g. instance-specific DB fields.
22701    #[serde(flatten)]
22702    pub extra: serde_json::Map<String, serde_json::Value>,
22703}
22704
22705#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22706pub struct RoutineCreate {
22707    /// `None` leaves the field out, `Some(None)` sends `null`.
22708    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22709    pub description: Option<Option<String>>,
22710    /// Context for the currently supported group_membership domain. Group and role IDs are required by the domain handler.
22711    #[serde(rename = "domainContext")]
22712    pub domain_context: RoutineCreateDomainContext,
22713    /// Allowed values: `group_membership`.
22714    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22715    pub domain_type: String,
22716    #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")]
22717    pub is_enabled: Option<bool>,
22718    /// Trimmed automation name.
22719    #[serde(deserialize_with = "crate::lenient::string")]
22720    pub name: String,
22721    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22722    pub priority: Option<i64>,
22723    /// Fields not described by the spec, e.g. instance-specific DB fields.
22724    #[serde(flatten)]
22725    pub extra: serde_json::Map<String, serde_json::Value>,
22726}
22727
22728/// Context for the currently supported group_membership domain. Group and role IDs are required by the domain handler.
22729#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22730pub struct RoutineCreateDomainContext {
22731    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
22732    pub group_id: i64,
22733    /// Optional membership status for the binding; null means the active/default status representation.
22734    /// Allowed values: `active`, `requested`, `to_delete`, `waiting`.
22735    ///
22736    /// `None` leaves the field out, `Some(None)` sends `null`.
22737    #[serde(rename = "groupMemberStatus", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22738    pub group_member_status: Option<Option<String>>,
22739    #[serde(rename = "groupTypeRoleId", deserialize_with = "crate::lenient::number")]
22740    pub group_type_role_id: i64,
22741    /// Fields not described by the spec, e.g. instance-specific DB fields.
22742    #[serde(flatten)]
22743    pub extra: serde_json::Map<String, serde_json::Value>,
22744}
22745
22746#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22747pub struct RoutineRun {
22748    /// Current iteration while in a loop, otherwise this attribute is undefined
22749    #[serde(rename = "currentIteration", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22750    pub current_iteration: Option<i64>,
22751    /// Group membership ID, not a person or group ID.
22752    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
22753    pub domain_id: i64,
22754    /// Only present with include\[\]=domainObject; null when resolution fails.
22755    #[serde(rename = "domainObject", default, skip_serializing_if = "Option::is_none")]
22756    pub domain_object: Option<DomainObjectGroupMembership>,
22757    /// Allowed values: `group_membership`.
22758    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
22759    pub domain_type: String,
22760    /// Allowed values: `exception-thrown`, `invalid-step-id`, `loop-detected`.
22761    #[serde(rename = "errorCode", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22762    pub error_code: Option<String>,
22763    /// Can be either an error message or an translatable messageKey
22764    #[serde(rename = "errorMessage", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22765    pub error_message: Option<String>,
22766    /// Persisted run ID, or null for an unpersisted potential run.
22767    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22768    pub id: Option<i64>,
22769    #[serde(default, skip_serializing_if = "Option::is_none")]
22770    pub meta: Option<MetaDataEntityId>,
22771    #[serde(rename = "routineId", deserialize_with = "crate::lenient::number")]
22772    pub routine_id: i64,
22773    #[serde(rename = "routineStepId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22774    pub routine_step_id: Option<i64>,
22775    /// Allowed values: `failed`, `finished`, `not-started`, `paused`, `rerun-step`, `started`, `waiting`.
22776    #[serde(deserialize_with = "crate::lenient::string")]
22777    pub status: String,
22778    /// A simple date in ISO format, e.g. '2022-10-19'
22779    #[serde(rename = "waitingSince", default, skip_serializing_if = "Option::is_none")]
22780    pub waiting_since: Option<chrono::NaiveDate>,
22781    /// Fields not described by the spec, e.g. instance-specific DB fields.
22782    #[serde(flatten)]
22783    pub extra: serde_json::Map<String, serde_json::Value>,
22784}
22785
22786#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22787pub struct RoutineRunBulkUpdate {
22788    /// Run IDs processed sequentially. Duplicates are not rejected.
22789    #[serde(rename = "runIds")]
22790    pub run_ids: Vec<i64>,
22791    /// Fields not described by the spec, e.g. instance-specific DB fields.
22792    #[serde(flatten)]
22793    pub extra: serde_json::Map<String, serde_json::Value>,
22794}
22795
22796/// Only read for the update action. At most one state field can be supplied; an empty object is accepted.
22797#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22798pub struct RoutineRunUpdate {
22799    /// Update the current iteration for a special:repeat step
22800    #[serde(rename = "currentIteration", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22801    pub current_iteration: Option<i64>,
22802    /// Update the waiting since date for a special:wait step
22803    #[serde(rename = "waitingSince", default, skip_serializing_if = "Option::is_none")]
22804    pub waiting_since: Option<chrono::NaiveDate>,
22805    /// Fields not described by the spec, e.g. instance-specific DB fields.
22806    #[serde(flatten)]
22807    pub extra: serde_json::Map<String, serde_json::Value>,
22808}
22809
22810/// Persisted repeat step. Unlike the create payload, an empty children list is omitted in responses.
22811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22812pub struct RoutineStepRepeat {
22813    #[serde(deserialize_with = "crate::lenient::number")]
22814    pub id: i64,
22815    #[serde(rename = "routineId", deserialize_with = "crate::lenient::number")]
22816    pub routine_id: i64,
22817    #[serde(rename = "actionData")]
22818    pub action_data: RoutineStepRepeatActionData,
22819    /// Allowed values: `special:repeat`.
22820    #[serde(rename = "actionKey", deserialize_with = "crate::lenient::string")]
22821    pub action_key: String,
22822    /// Child steps when present. Omitted for an empty repeat step.
22823    #[serde(default, skip_serializing_if = "Option::is_none")]
22824    pub children: Option<Vec<RoutineStepWithoutRepeat>>,
22825    #[serde(rename = "isEnabled")]
22826    pub is_enabled: bool,
22827    /// Fields not described by the spec, e.g. instance-specific DB fields.
22828    #[serde(flatten)]
22829    pub extra: serde_json::Map<String, serde_json::Value>,
22830}
22831
22832#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22833pub struct RoutineStepRepeatActionData {
22834    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22835    pub count: Option<i64>,
22836    /// Fields not described by the spec, e.g. instance-specific DB fields.
22837    #[serde(flatten)]
22838    pub extra: serde_json::Map<String, serde_json::Value>,
22839}
22840
22841#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22842pub struct RoutineStepUpdateRepeat {
22843    #[serde(rename = "actionData")]
22844    pub action_data: RoutineStepRepeatActionData,
22845    /// Allowed values: `special:repeat`.
22846    #[serde(rename = "actionKey", deserialize_with = "crate::lenient::string")]
22847    pub action_key: String,
22848    pub children: Vec<RoutineStepUpdateWithoutRepeat>,
22849    /// Allowed values: `finished`, `not-started`, `started`.
22850    #[serde(default, skip_serializing_if = "Option::is_none")]
22851    pub finish: Option<Vec<serde_json::Value>>,
22852    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22853    pub id: Option<i64>,
22854    #[serde(rename = "isEnabled")]
22855    pub is_enabled: bool,
22856    /// Allowed values: `finished`, `not-started`, `started`.
22857    #[serde(default, skip_serializing_if = "Option::is_none")]
22858    pub reposition: Option<Vec<serde_json::Value>>,
22859    /// Allowed values: `finished`, `not-started`, `started`.
22860    #[serde(default, skip_serializing_if = "Option::is_none")]
22861    pub restart: Option<Vec<serde_json::Value>>,
22862    /// Fields not described by the spec, e.g. instance-specific DB fields.
22863    #[serde(flatten)]
22864    pub extra: serde_json::Map<String, serde_json::Value>,
22865}
22866
22867#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22868pub struct RoutineStepUpdateWithoutRepeat {
22869    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22870    pub id: Option<i64>,
22871    /// Allowed values: `finished`, `not-started`, `started`.
22872    #[serde(default, skip_serializing_if = "Option::is_none")]
22873    pub reposition: Option<Vec<serde_json::Value>>,
22874    /// Fields not described by the spec, e.g. instance-specific DB fields.
22875    #[serde(flatten)]
22876    pub extra: serde_json::Map<String, serde_json::Value>,
22877}
22878
22879#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22880pub struct RoutineStepWithoutRepeat {
22881    #[serde(deserialize_with = "crate::lenient::number")]
22882    pub id: i64,
22883    #[serde(rename = "routineId", deserialize_with = "crate::lenient::number")]
22884    pub routine_id: i64,
22885    /// Fields not described by the spec, e.g. instance-specific DB fields.
22886    #[serde(flatten)]
22887    pub extra: serde_json::Map<String, serde_json::Value>,
22888}
22889
22890#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22891pub struct RoutineUpdate {
22892    /// `None` leaves the field out, `Some(None)` sends `null`.
22893    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
22894    pub description: Option<Option<String>>,
22895    /// Source step IDs or run status buckets. not-started materializes potential runs; this is not a list of run IDs.
22896    /// Allowed values: `finished`, `not-started`, `started`.
22897    #[serde(default, skip_serializing_if = "Option::is_none")]
22898    pub finish: Option<Vec<serde_json::Value>>,
22899    #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")]
22900    pub is_enabled: Option<bool>,
22901    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22902    pub name: Option<String>,
22903    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22904    pub priority: Option<i64>,
22905    /// Source step IDs or run status buckets. not-started materializes potential runs; this is not a list of run IDs.
22906    /// Allowed values: `finished`, `not-started`, `started`.
22907    #[serde(default, skip_serializing_if = "Option::is_none")]
22908    pub restart: Option<Vec<serde_json::Value>>,
22909    /// Complete replacement tree; omitted existing steps are removed.
22910    #[serde(default, skip_serializing_if = "Option::is_none")]
22911    pub steps: Option<Vec<serde_json::Value>>,
22912    /// Fields not described by the spec, e.g. instance-specific DB fields.
22913    #[serde(flatten)]
22914    pub extra: serde_json::Map<String, serde_json::Value>,
22915}
22916
22917#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22918pub struct RssFeed {
22919    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22920    pub description: Option<String>,
22921    pub items: Vec<BlogItem>,
22922    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
22923    pub link: Option<String>,
22924    #[serde(deserialize_with = "crate::lenient::string")]
22925    pub title: String,
22926    #[serde(rename = "totalCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22927    pub total_count: Option<i64>,
22928    /// Fields not described by the spec, e.g. instance-specific DB fields.
22929    #[serde(flatten)]
22930    pub extra: serde_json::Map<String, serde_json::Value>,
22931}
22932
22933/// One usable IdP descriptor found in the uploaded document. This is parsed configuration data, not proof of metadata authenticity or a working login.
22934#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22935pub struct SamlIdpMetadataDescriptor {
22936    /// Deduplicated PEM certificate strings for this usage. A key descriptor with no use attribute can appear in both lists. Certificates must parse as X.509; this operation does not establish trust or verify metadata signatures.
22937    #[serde(rename = "encryptionCertificates")]
22938    pub encryption_certificates: Vec<String>,
22939    /// Nonempty entityID from the EntityDescriptor.
22940    #[serde(rename = "entityId", deserialize_with = "crate::lenient::string")]
22941    pub entity_id: String,
22942    /// Deduplicated PEM certificate strings for this usage. A key descriptor with no use attribute can appear in both lists. Certificates must parse as X.509; this operation does not establish trust or verify metadata signatures.
22943    #[serde(rename = "signingCertificates")]
22944    pub signing_certificates: Vec<String>,
22945    /// Optional supported SLO endpoints. May be empty.
22946    #[serde(rename = "singleLogoutServices")]
22947    pub single_logout_services: Vec<SamlMetadataEndpoint>,
22948    /// Supported SSO endpoints. Descriptors without any usable SSO endpoint are skipped.
22949    #[serde(rename = "singleSignOnServices")]
22950    pub single_sign_on_services: Vec<SamlMetadataEndpoint>,
22951    /// Fields not described by the spec, e.g. instance-specific DB fields.
22952    #[serde(flatten)]
22953    pub extra: serde_json::Map<String, serde_json::Value>,
22954}
22955
22956/// An endpoint using the supported HTTP-Redirect binding. Unsupported bindings and invalid endpoint URLs are excluded.
22957#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22958pub struct SamlMetadataEndpoint {
22959    /// Allowed values: `urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect`.
22960    #[serde(deserialize_with = "crate::lenient::string")]
22961    pub binding: String,
22962    #[serde(deserialize_with = "crate::lenient::string")]
22963    pub url: String,
22964    /// Fields not described by the spec, e.g. instance-specific DB fields.
22965    #[serde(flatten)]
22966    pub extra: serde_json::Map<String, serde_json::Value>,
22967}
22968
22969/// Read-only request to parse a SAML IdP metadata document. The server never fetches a metadata URL for this operation.
22970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22971pub struct SamlMetadataParseCreate {
22972    /// XML document with EntityDescriptor or EntitiesDescriptor root in the SAML metadata namespace. Trimmed UTF-8 input is limited to 1,048,576 bytes. DOCTYPE and ENTITY declarations are rejected.
22973    #[serde(deserialize_with = "crate::lenient::string")]
22974    pub xml: String,
22975    /// Fields not described by the spec, e.g. instance-specific DB fields.
22976    #[serde(flatten)]
22977    pub extra: serde_json::Map<String, serde_json::Value>,
22978}
22979
22980#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22981pub struct SecurityLevel {
22982    #[serde(deserialize_with = "crate::lenient::number")]
22983    pub id: i64,
22984    #[serde(deserialize_with = "crate::lenient::string")]
22985    pub name: String,
22986    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
22987    pub sort_key: i64,
22988    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
22989    #[deprecated = "deprecated in the ChurchTools API"]
22990    pub sortkey: Option<i64>,
22991    /// Fields not described by the spec, e.g. instance-specific DB fields.
22992    #[serde(flatten)]
22993    pub extra: serde_json::Map<String, serde_json::Value>,
22994}
22995
22996/// A reusable role in event planning, such as Lead vocals. It belongs to a service group. A person assigned to this role at a particular event is a separate service assignment.
22997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22998pub struct Service {
22999    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23000    pub deprecated: std::collections::BTreeMap<String, String>,
23001    /// Enable chat for this service.
23002    #[serde(rename = "allowChat")]
23003    pub allow_chat: bool,
23004    /// Allow a comment when confirming a service request.
23005    #[serde(rename = "allowCommentOnConfirmation")]
23006    pub allow_comment_on_confirmation: bool,
23007    /// Allow persons assigned to this service to control the live agenda.
23008    #[serde(rename = "allowControlLiveAgenda")]
23009    pub allow_control_live_agenda: bool,
23010    /// Allow assigned persons to decline service requests.
23011    #[serde(rename = "allowDecline")]
23012    pub allow_decline: bool,
23013    /// Allow assigned persons to request an exchange of their service assignment.
23014    #[serde(rename = "allowExchange")]
23015    pub allow_exchange: bool,
23016    /// Template for the calendar text of this service.
23017    #[serde(rename = "calTextTemplate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23018    pub cal_text_template: Option<String>,
23019    /// Use `description` instead.
23020    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23021    #[deprecated = "Use `description` instead."]
23022    pub comment: Option<String>,
23023    /// use `allowCommentOnConfirmation` instead
23024    #[serde(rename = "commentOnConfirmation", default, skip_serializing_if = "Option::is_none")]
23025    #[deprecated = "deprecated in the ChurchTools API"]
23026    pub comment_on_confirmation: Option<bool>,
23027    /// Description of the role.
23028    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23029    pub description: Option<String>,
23030    /// IDs of connected person groups used for service planning.
23031    #[serde(rename = "groupIds")]
23032    pub group_ids: Vec<i64>,
23033    /// Hide assigned persons from viewers without the service or service-group permissions needed to see them.
23034    #[serde(rename = "hidePersonName")]
23035    pub hide_person_name: bool,
23036    #[serde(deserialize_with = "crate::lenient::number")]
23037    pub id: i64,
23038    pub meta: MetaDataEntityId,
23039    /// Name of the planning role, for example Lead vocals. A service is reusable master data; the assignment of a person to this role belongs to an event.
23040    #[serde(deserialize_with = "crate::lenient::string")]
23041    pub name: String,
23042    /// Name translated for the current language; falls back to the stored name.
23043    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23044    pub name_translated: String,
23045    /// Restrict assignment candidates to the connected person groups.
23046    #[serde(rename = "onlyAssignFromGroups")]
23047    pub only_assign_from_groups: bool,
23048    /// Enable reminder emails for service assignments.
23049    #[serde(rename = "sendReminderMails")]
23050    pub send_reminder_mails: bool,
23051    /// Enable emails for service requests.
23052    #[serde(rename = "sendServiceRequestEmails")]
23053    pub send_service_request_emails: bool,
23054    /// ID of the existing service group that organizes this role, for example Music or Technical team. This is not a person group.
23055    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23056    pub service_group_id: i64,
23057    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23058    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23059    pub sort_key: i64,
23060    /// Whether this service is marked as a standard service for event planning.
23061    pub standard: bool,
23062    /// IDs of connected tags used for service planning.
23063    #[serde(rename = "tagIds")]
23064    pub tag_ids: Vec<i64>,
23065    /// Fields not described by the spec, e.g. instance-specific DB fields.
23066    #[serde(flatten)]
23067    pub extra: serde_json::Map<String, serde_json::Value>,
23068}
23069
23070#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23071pub struct ServiceCandidate {
23072    /// Person’s full name.
23073    #[serde(rename = "fullName", deserialize_with = "crate::lenient::string")]
23074    pub full_name: String,
23075    /// ID of the person.
23076    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
23077    pub person_id: i64,
23078    /// Fields not described by the spec, e.g. instance-specific DB fields.
23079    #[serde(flatten)]
23080    pub extra: serde_json::Map<String, serde_json::Value>,
23081}
23082
23083#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23084pub struct ServiceCandidateAssignment {
23085    /// Event as Domain Object
23086    pub event: DomainObjectEvent,
23087    /// Concrete assignment record. Serialized directly here, so comment is always `null` even when a comment is stored.
23088    #[serde(rename = "eventService")]
23089    pub event_service: ServiceCandidateAssignmentEventService,
23090    /// Fields not described by the spec, e.g. instance-specific DB fields.
23091    #[serde(flatten)]
23092    pub extra: serde_json::Map<String, serde_json::Value>,
23093}
23094
23095/// Concrete assignment record. Serialized directly here, so comment is always `null` even when a comment is stored.
23096#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23097pub struct ServiceCandidateAssignmentEventService {
23098    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23099    pub deprecated: std::collections::BTreeMap<String, String>,
23100    /// Use `isAccepted` instead
23101    #[serde(default, skip_serializing_if = "Option::is_none")]
23102    #[deprecated = "Use `isAccepted` instead"]
23103    pub agreed: Option<bool>,
23104    #[serde(rename = "allowChat")]
23105    pub allow_chat: bool,
23106    /// Confirmation or decline comment. Null when absent or hidden by permissions.
23107    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23108    pub comment: Option<String>,
23109    /// Use `index` instead
23110    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23111    #[deprecated = "Use `index` instead"]
23112    pub counter: Option<i64>,
23113    pub event: ServiceRequestEvent,
23114    /// ID of this particular assignment record. Updating or answering a request may create a new record; use the ID returned by the operation.
23115    #[serde(deserialize_with = "crate::lenient::number")]
23116    pub id: i64,
23117    /// Slot index when an event requires several persons for the same service; null if no index is assigned.
23118    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23119    pub index: Option<i64>,
23120    /// Whether this record was confirmed. Interpret together with isValid, as an older confirmed record can be invalid.
23121    #[serde(rename = "isAccepted")]
23122    pub is_accepted: bool,
23123    /// Whether this record is still the active assignment for its slot. Superseded and declined records are invalid.
23124    #[serde(rename = "isValid")]
23125    pub is_valid: bool,
23126    pub meta: MetaDataEntityId,
23127    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23128    pub name: Option<String>,
23129    /// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23130    #[serde(default, skip_serializing_if = "Option::is_none")]
23131    pub permissions: Option<ServiceRequestPermissions>,
23132    #[serde(default, skip_serializing_if = "Option::is_none")]
23133    pub person: Option<DomainObjectPerson>,
23134    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23135    #[deprecated = "deprecated in the ChurchTools API"]
23136    pub person_id: Option<i64>,
23137    /// Deprecated alias for `meta.modifiedDate`.
23138    #[serde(rename = "requestedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
23139    #[deprecated = "deprecated in the ChurchTools API"]
23140    pub requested_date: Option<chrono::DateTime<chrono::Utc>>,
23141    /// Person as Domain Object
23142    #[serde(rename = "requesterPerson")]
23143    pub requester_person: DomainObjectPerson,
23144    #[serde(rename = "requesterPersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23145    #[deprecated = "deprecated in the ChurchTools API"]
23146    pub requester_person_id: Option<i64>,
23147    /// ID of the reusable service role from /services, not the request ID.
23148    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
23149    pub service_id: i64,
23150    #[serde(rename = "serviceName", deserialize_with = "crate::lenient::string")]
23151    pub service_name: String,
23152    /// Fields not described by the spec, e.g. instance-specific DB fields.
23153    #[serde(flatten)]
23154    pub extra: serde_json::Map<String, serde_json::Value>,
23155}
23156
23157#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23158pub struct ServiceCandidateScoreHint {
23159    /// Human-readable explanation in the current language.
23160    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23161    pub name_translated: String,
23162    /// Stable reason key for a score contribution. Monthly utilization reasons include a YYYY-MM suffix. The spelling always-seperated is part of the wire format.
23163    /// Allowed values: `absence`, `last.service.near`, `next.service.near`, `preference.always-seperated`, `preference.daytime`, `preference.max-reached`, `preference.with-partner`, `service.previously-declined`, `service.same-day`.
23164    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
23165    pub reason: serde_json::Value,
23166    /// Contribution to the total score; positive values favor the candidate and negative values penalize it.
23167    #[serde(deserialize_with = "crate::lenient::number")]
23168    pub score: i64,
23169    /// Fields not described by the spec, e.g. instance-specific DB fields.
23170    #[serde(flatten)]
23171    pub extra: serde_json::Map<String, serde_json::Value>,
23172}
23173
23174/// Fields for creating a reusable service role. Free-text fields are not restricted to predefined values.
23175#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23176pub struct ServiceCreate {
23177    /// Enable chat for this service.
23178    #[serde(rename = "allowChat", default, skip_serializing_if = "Option::is_none")]
23179    pub allow_chat: Option<bool>,
23180    /// Allow a comment when confirming a service request.
23181    #[serde(rename = "allowCommentOnConfirmation", default, skip_serializing_if = "Option::is_none")]
23182    pub allow_comment_on_confirmation: Option<bool>,
23183    /// Allow persons assigned to this service to control the live agenda.
23184    #[serde(rename = "allowControlLiveAgenda", default, skip_serializing_if = "Option::is_none")]
23185    pub allow_control_live_agenda: Option<bool>,
23186    /// Allow assigned persons to decline service requests.
23187    #[serde(rename = "allowDecline", default, skip_serializing_if = "Option::is_none")]
23188    pub allow_decline: Option<bool>,
23189    /// Allow assigned persons to request an exchange of their service assignment.
23190    #[serde(rename = "allowExchange", default, skip_serializing_if = "Option::is_none")]
23191    pub allow_exchange: Option<bool>,
23192    /// Template for the calendar text of this service.
23193    ///
23194    /// `None` leaves the field out, `Some(None)` sends `null`.
23195    #[serde(rename = "calTextTemplate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23196    pub cal_text_template: Option<Option<String>>,
23197    /// Deprecated input alias for description. Use description for new integrations.
23198    ///
23199    /// `None` leaves the field out, `Some(None)` sends `null`.
23200    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23201    #[deprecated = "Use description for new integrations."]
23202    pub comment: Option<Option<String>>,
23203    /// Description of the role.
23204    ///
23205    /// `None` leaves the field out, `Some(None)` sends `null`.
23206    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23207    pub description: Option<Option<String>>,
23208    /// IDs of connected person groups used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23209    #[serde(rename = "groupIds", default, skip_serializing_if = "Option::is_none")]
23210    pub group_ids: Option<Vec<i64>>,
23211    /// Hide assigned persons from viewers without the service or service-group permissions needed to see them.
23212    #[serde(rename = "hidePersonName", default, skip_serializing_if = "Option::is_none")]
23213    pub hide_person_name: Option<bool>,
23214    /// Name of the planning role, for example Lead vocals. A service is reusable master data; the assignment of a person to this role belongs to an event.
23215    #[serde(deserialize_with = "crate::lenient::string")]
23216    pub name: String,
23217    /// Restrict assignment candidates to the connected person groups.
23218    #[serde(rename = "onlyAssignFromGroups", default, skip_serializing_if = "Option::is_none")]
23219    pub only_assign_from_groups: Option<bool>,
23220    /// Enable reminder emails for service assignments.
23221    #[serde(rename = "sendReminderMails", default, skip_serializing_if = "Option::is_none")]
23222    pub send_reminder_mails: Option<bool>,
23223    /// Enable emails for service requests.
23224    #[serde(rename = "sendServiceRequestEmails", default, skip_serializing_if = "Option::is_none")]
23225    pub send_service_request_emails: Option<bool>,
23226    /// ID of the existing service group that organizes this role, for example Music or Technical team. This is not a person group.
23227    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23228    pub service_group_id: i64,
23229    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23230    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23231    pub sort_key: Option<i64>,
23232    /// Whether this service is marked as a standard service for event planning.
23233    #[serde(default, skip_serializing_if = "Option::is_none")]
23234    pub standard: Option<bool>,
23235    /// IDs of connected tags used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23236    #[serde(rename = "tagIds", default, skip_serializing_if = "Option::is_none")]
23237    pub tag_ids: Option<Vec<i64>>,
23238    /// Fields not described by the spec, e.g. instance-specific DB fields.
23239    #[serde(flatten)]
23240    pub extra: serde_json::Map<String, serde_json::Value>,
23241}
23242
23243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23244pub struct ServiceExchangeCandidate {
23245    /// Start of the candidate event.
23246    #[serde(rename = "eventDate", serialize_with = "crate::datetime::serialize_utc")]
23247    pub event_date: chrono::DateTime<chrono::Utc>,
23248    /// ID of a concrete event-service assignment (service request), not the reusable service master-data ID from /services.
23249    #[serde(rename = "eventServiceId", deserialize_with = "crate::lenient::number")]
23250    pub event_service_id: i64,
23251    /// Title of the calendar appointment associated with the candidate event.
23252    #[serde(rename = "eventTitle", deserialize_with = "crate::lenient::string")]
23253    pub event_title: String,
23254    /// Legacy person object loaded for service exchanges, not the response schema of `/persons/{personId}` or a person domain object. Additional legacy model fields may be present.
23255    pub person: ServiceExchangePerson,
23256    /// Fields not described by the spec, e.g. instance-specific DB fields.
23257    #[serde(flatten)]
23258    pub extra: serde_json::Map<String, serde_json::Value>,
23259}
23260
23261#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23262pub struct ServiceExchangeEvent {
23263    /// ID of the event.
23264    #[serde(deserialize_with = "crate::lenient::number")]
23265    pub id: i64,
23266    /// Event name.
23267    #[serde(deserialize_with = "crate::lenient::string")]
23268    pub name: String,
23269    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
23270    pub start_date: chrono::DateTime<chrono::Utc>,
23271    /// Fields not described by the spec, e.g. instance-specific DB fields.
23272    #[serde(flatten)]
23273    pub extra: serde_json::Map<String, serde_json::Value>,
23274}
23275
23276/// Legacy person object loaded for service exchanges, not the response schema of `/persons/{personId}` or a person domain object. Additional legacy model fields may be present.
23277#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23278pub struct ServiceExchangePerson {
23279    #[serde(rename = "firstName", deserialize_with = "crate::lenient::string")]
23280    pub first_name: String,
23281    /// Person GUID, if available.
23282    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23283    pub guid: Option<String>,
23284    /// ID of the person.
23285    #[serde(deserialize_with = "crate::lenient::number")]
23286    pub id: i64,
23287    /// Avatar URL, if available.
23288    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23289    pub image_url: Option<String>,
23290    #[serde(rename = "isArchived")]
23291    pub is_archived: bool,
23292    #[serde(rename = "lastName", deserialize_with = "crate::lenient::string")]
23293    pub last_name: String,
23294    /// Fields not described by the spec, e.g. instance-specific DB fields.
23295    #[serde(flatten)]
23296    pub extra: serde_json::Map<String, serde_json::Value>,
23297}
23298
23299/// A request to exchange two concrete event-service assignments. Creating it does not swap the persons; accepting it does. List operations enrich the event and person fields where available. Write responses are not enriched, so those fields can be `null`.
23300#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23301pub struct ServiceExchangeRequest {
23302    /// ID of the exchange request.
23303    #[serde(deserialize_with = "crate::lenient::number")]
23304    pub id: i64,
23305    /// Whether this exchange is archived. Person-level lists exclude archived exchanges; the assignment-level list does not.
23306    #[serde(rename = "isArchived")]
23307    pub is_archived: bool,
23308    pub meta: ServiceExchangeRequestMeta,
23309    #[serde(rename = "requestedEvent", default, skip_serializing_if = "Option::is_none")]
23310    pub requested_event: Option<ServiceExchangeEvent>,
23311    #[serde(rename = "requestedPerson", default, skip_serializing_if = "Option::is_none")]
23312    pub requested_person: Option<ServiceExchangePerson>,
23313    /// Assignment requested in return. ID of a concrete event-service assignment (service request), not the reusable service master-data ID from /services.
23314    #[serde(rename = "requestedServiceId", deserialize_with = "crate::lenient::number")]
23315    pub requested_service_id: i64,
23316    #[serde(rename = "requestingEvent", default, skip_serializing_if = "Option::is_none")]
23317    pub requesting_event: Option<ServiceExchangeEvent>,
23318    #[serde(rename = "requestingPerson", default, skip_serializing_if = "Option::is_none")]
23319    pub requesting_person: Option<ServiceExchangePerson>,
23320    /// Assignment offered by the requester. ID of a concrete event-service assignment (service request), not the reusable service master-data ID from /services.
23321    #[serde(rename = "requestingServiceId", deserialize_with = "crate::lenient::number")]
23322    pub requesting_service_id: i64,
23323    /// `UNANSWERED`: awaiting a reply; `AGREED`: exchange accepted; `DECLINED`: recipient declined; `CANCELLED`: requester cancelled. Archiving is tracked separately by `isArchived`.
23324    /// Allowed values: `AGREED`, `CANCELLED`, `DECLINED`, `UNANSWERED`.
23325    #[serde(deserialize_with = "crate::lenient::string")]
23326    pub status: String,
23327    /// Fields not described by the spec, e.g. instance-specific DB fields.
23328    #[serde(flatten)]
23329    pub extra: serde_json::Map<String, serde_json::Value>,
23330}
23331
23332#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23333pub struct ServiceExchangeRequestCreate {
23334    /// Target assignment to exchange with. Use eventServiceId from the candidates endpoint. ID of a concrete event-service assignment (service request), not the reusable service master-data ID from /services.
23335    #[serde(rename = "requestedServiceId", deserialize_with = "crate::lenient::number")]
23336    pub requested_service_id: i64,
23337    /// Fields not described by the spec, e.g. instance-specific DB fields.
23338    #[serde(flatten)]
23339    pub extra: serde_json::Map<String, serde_json::Value>,
23340}
23341
23342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23343pub struct ServiceExchangeRequestMeta {
23344    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
23345    pub modified_date: chrono::DateTime<chrono::Utc>,
23346    /// Fields not described by the spec, e.g. instance-specific DB fields.
23347    #[serde(flatten)]
23348    pub extra: serde_json::Map<String, serde_json::Value>,
23349}
23350
23351/// A category of service roles, such as Music or Technical team, optionally associated with a campus. It is not a group of persons.
23352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23353pub struct ServiceGroup {
23354    /// ID of an existing campus, or `null` for no campus association.
23355    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23356    pub campus_id: Option<i64>,
23357    /// Description of the service group.
23358    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23359    pub description: Option<String>,
23360    #[serde(deserialize_with = "crate::lenient::number")]
23361    pub id: i64,
23362    pub meta: MetaDataEntityId,
23363    /// Name of a category of service roles, for example Technical team. This is separate from person groups.
23364    #[serde(deserialize_with = "crate::lenient::string")]
23365    pub name: String,
23366    /// Name translated for the current language; falls back to the stored name.
23367    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23368    pub name_translated: String,
23369    /// Show this service group only when filtering by its campus.
23370    #[serde(rename = "onlyVisibleInCampusFilter")]
23371    pub only_visible_in_campus_filter: bool,
23372    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23373    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23374    pub sort_key: i64,
23375    /// Make this service group visible through the general service-group viewing permissions.
23376    #[serde(rename = "viewAll")]
23377    pub view_all: bool,
23378    /// Fields not described by the spec, e.g. instance-specific DB fields.
23379    #[serde(flatten)]
23380    pub extra: serde_json::Map<String, serde_json::Value>,
23381}
23382
23383/// Create a category that organizes service roles.
23384#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23385pub struct ServiceGroupCreate {
23386    /// ID of an existing campus, or `null` for no campus association.
23387    ///
23388    /// `None` leaves the field out, `Some(None)` sends `null`.
23389    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23390    pub campus_id: Option<Option<i64>>,
23391    /// Description of the service group.
23392    ///
23393    /// `None` leaves the field out, `Some(None)` sends `null`.
23394    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23395    pub description: Option<Option<String>>,
23396    /// Name of a category of service roles, for example Technical team. This is separate from person groups.
23397    #[serde(deserialize_with = "crate::lenient::string")]
23398    pub name: String,
23399    /// Show this service group only when filtering by its campus.
23400    #[serde(rename = "onlyVisibleInCampusFilter", default, skip_serializing_if = "Option::is_none")]
23401    pub only_visible_in_campus_filter: Option<bool>,
23402    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23403    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23404    pub sort_key: Option<i64>,
23405    /// Make this service group visible through the general service-group viewing permissions.
23406    #[serde(rename = "viewAll", default, skip_serializing_if = "Option::is_none")]
23407    pub view_all: Option<bool>,
23408    /// Fields not described by the spec, e.g. instance-specific DB fields.
23409    #[serde(flatten)]
23410    pub extra: serde_json::Map<String, serde_json::Value>,
23411}
23412
23413#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23414pub struct ServiceGroupPersonPreference {
23415    /// Reaching or exceeding it adds a score penalty; it is not an assignment limit.
23416    #[serde(rename = "maxPerMonth", deserialize_with = "crate::lenient::number")]
23417    pub max_per_month: i64,
23418    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
23419    #[serde(rename = "modifiedDate", serialize_with = "crate::datetime::serialize_utc")]
23420    pub modified_date: chrono::DateTime<chrono::Utc>,
23421    #[serde(rename = "modifiedPerson")]
23422    pub modified_person: ServiceGroupPersonPreferenceModifiedPerson,
23423    /// 0: no preference; 1: prefer morning; 2: only morning; 3: prefer afternoon/evening; 4: only afternoon/evening. Candidate scoring treats event starts before 13:00 as morning. These preferences influence the score; they do not remove candidates.
23424    /// Allowed values: `0`, `1`, `2`, `3`, `4`.
23425    #[serde(rename = "morningWeight", deserialize_with = "crate::lenient::number")]
23426    pub morning_weight: i64,
23427    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
23428    pub person_id: i64,
23429    /// 0: no preference; 1: prefer serving with the partner; 2: prefer serving separately. Influences candidate scoring when a related partner has an assignment at the event.
23430    /// Allowed values: `0`, `1`, `2`.
23431    #[serde(rename = "relationWeight", deserialize_with = "crate::lenient::number")]
23432    pub relation_weight: i64,
23433    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23434    pub service_group_id: i64,
23435    /// Fields not described by the spec, e.g. instance-specific DB fields.
23436    #[serde(flatten)]
23437    pub extra: serde_json::Map<String, serde_json::Value>,
23438}
23439
23440#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23441pub struct ServiceGroupPersonPreferenceModifiedPerson {
23442    #[serde(deserialize_with = "crate::lenient::number")]
23443    pub id: i64,
23444    /// Fields not described by the spec, e.g. instance-specific DB fields.
23445    #[serde(flatten)]
23446    pub extra: serde_json::Map<String, serde_json::Value>,
23447}
23448
23449/// Fields for updating a service group.
23450#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23451pub struct ServiceGroupUpdate {
23452    /// ID of an existing campus, or `null` for no campus association.
23453    ///
23454    /// `None` leaves the field out, `Some(None)` sends `null`.
23455    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23456    pub campus_id: Option<Option<i64>>,
23457    /// Description of the service group.
23458    ///
23459    /// `None` leaves the field out, `Some(None)` sends `null`.
23460    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23461    pub description: Option<Option<String>>,
23462    /// Name of a category of service roles, for example Technical team. This is separate from person groups.
23463    #[serde(deserialize_with = "crate::lenient::string")]
23464    pub name: String,
23465    /// Show this service group only when filtering by its campus.
23466    #[serde(rename = "onlyVisibleInCampusFilter", default, skip_serializing_if = "Option::is_none")]
23467    pub only_visible_in_campus_filter: Option<bool>,
23468    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23469    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23470    pub sort_key: Option<i64>,
23471    /// Make this service group visible through the general service-group viewing permissions.
23472    #[serde(rename = "viewAll", default, skip_serializing_if = "Option::is_none")]
23473    pub view_all: Option<bool>,
23474    /// Fields not described by the spec, e.g. instance-specific DB fields.
23475    #[serde(flatten)]
23476    pub extra: serde_json::Map<String, serde_json::Value>,
23477}
23478
23479/// A concrete event-service assignment, also called a service request. This is separate from the reusable service role. A valid record may be unassigned, awaiting confirmation or confirmed. The comment is only exposed to authorized viewers; otherwise it is null. Historical records can still be fetched individually.
23480#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23481pub struct ServiceRequest {
23482    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23483    pub deprecated: std::collections::BTreeMap<String, String>,
23484    /// Use `isAccepted` instead
23485    #[serde(default, skip_serializing_if = "Option::is_none")]
23486    #[deprecated = "Use `isAccepted` instead"]
23487    pub agreed: Option<bool>,
23488    #[serde(rename = "allowChat")]
23489    pub allow_chat: bool,
23490    /// Confirmation or decline comment. Null when absent or hidden by permissions.
23491    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23492    pub comment: Option<String>,
23493    /// Use `index` instead
23494    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23495    #[deprecated = "Use `index` instead"]
23496    pub counter: Option<i64>,
23497    pub event: ServiceRequestEvent,
23498    /// ID of this particular assignment record. Updating or answering a request may create a new record; use the ID returned by the operation.
23499    #[serde(deserialize_with = "crate::lenient::number")]
23500    pub id: i64,
23501    /// Slot index when an event requires several persons for the same service; null if no index is assigned.
23502    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23503    pub index: Option<i64>,
23504    /// Whether this record was confirmed. Interpret together with isValid, as an older confirmed record can be invalid.
23505    #[serde(rename = "isAccepted")]
23506    pub is_accepted: bool,
23507    /// Whether this record is still the active assignment for its slot. Superseded and declined records are invalid.
23508    #[serde(rename = "isValid")]
23509    pub is_valid: bool,
23510    pub meta: MetaDataEntityId,
23511    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23512    pub name: Option<String>,
23513    /// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23514    #[serde(default, skip_serializing_if = "Option::is_none")]
23515    pub permissions: Option<ServiceRequestPermissions>,
23516    #[serde(default, skip_serializing_if = "Option::is_none")]
23517    pub person: Option<DomainObjectPerson>,
23518    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23519    #[deprecated = "deprecated in the ChurchTools API"]
23520    pub person_id: Option<i64>,
23521    /// Deprecated alias for `meta.modifiedDate`.
23522    #[serde(rename = "requestedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
23523    #[deprecated = "deprecated in the ChurchTools API"]
23524    pub requested_date: Option<chrono::DateTime<chrono::Utc>>,
23525    /// Person as Domain Object
23526    #[serde(rename = "requesterPerson")]
23527    pub requester_person: DomainObjectPerson,
23528    #[serde(rename = "requesterPersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23529    #[deprecated = "deprecated in the ChurchTools API"]
23530    pub requester_person_id: Option<i64>,
23531    /// ID of the reusable service role from /services, not the request ID.
23532    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
23533    pub service_id: i64,
23534    #[serde(rename = "serviceName", deserialize_with = "crate::lenient::string")]
23535    pub service_name: String,
23536    /// Fields not described by the spec, e.g. instance-specific DB fields.
23537    #[serde(flatten)]
23538    pub extra: serde_json::Map<String, serde_json::Value>,
23539}
23540
23541#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23542pub struct ServiceRequestAnswer {
23543    /// Optional response comment.
23544    ///
23545    /// `None` leaves the field out, `Some(None)` sends `null`.
23546    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23547    pub comment: Option<Option<String>>,
23548    /// Fields not described by the spec, e.g. instance-specific DB fields.
23549    #[serde(flatten)]
23550    pub extra: serde_json::Map<String, serde_json::Value>,
23551}
23552
23553#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23554pub struct ServiceRequestEvent {
23555    #[serde(deserialize_with = "crate::lenient::number")]
23556    pub id: i64,
23557    #[serde(deserialize_with = "crate::lenient::string")]
23558    pub name: String,
23559    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
23560    #[serde(rename = "startDate", serialize_with = "crate::datetime::serialize_utc")]
23561    pub start_date: chrono::DateTime<chrono::Utc>,
23562    /// Fields not described by the spec, e.g. instance-specific DB fields.
23563    #[serde(flatten)]
23564    pub extra: serde_json::Map<String, serde_json::Value>,
23565}
23566
23567/// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23568#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23569pub struct ServiceRequestPermissions {
23570    #[serde(rename = "enterSelfIfFree", default, skip_serializing_if = "Option::is_none")]
23571    pub enter_self_if_free: Option<bool>,
23572    /// Fields not described by the spec, e.g. instance-specific DB fields.
23573    #[serde(flatten)]
23574    pub extra: serde_json::Map<String, serde_json::Value>,
23575}
23576
23577#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23578pub struct ServiceRequestUndoCreate {
23579    /// ID of the person assigned to the record being undone. Must be the current user.
23580    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
23581    pub person_id: i64,
23582    /// Fields not described by the spec, e.g. instance-specific DB fields.
23583    #[serde(flatten)]
23584    pub extra: serde_json::Map<String, serde_json::Value>,
23585}
23586
23587/// Assignment returned after undoing an acceptance or decline.
23588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23589pub struct ServiceRequestUndoResult {
23590    #[serde(rename = "@deprecated", deserialize_with = "crate::lenient::map")]
23591    pub deprecated: std::collections::BTreeMap<String, String>,
23592    /// Use `isAccepted` instead
23593    #[serde(default, skip_serializing_if = "Option::is_none")]
23594    #[deprecated = "Use `isAccepted` instead"]
23595    pub agreed: Option<bool>,
23596    #[serde(rename = "allowChat")]
23597    pub allow_chat: bool,
23598    /// Confirmation or decline comment. Null when absent or hidden by permissions.
23599    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23600    pub comment: Option<String>,
23601    /// Use `index` instead
23602    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23603    #[deprecated = "Use `index` instead"]
23604    pub counter: Option<i64>,
23605    pub event: ServiceRequestEvent,
23606    /// ID of this particular assignment record. Updating or answering a request may create a new record; use the ID returned by the operation.
23607    #[serde(deserialize_with = "crate::lenient::number")]
23608    pub id: i64,
23609    /// Slot index when an event requires several persons for the same service; null if no index is assigned.
23610    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23611    pub index: Option<i64>,
23612    /// Whether this record was confirmed. Interpret together with isValid, as an older confirmed record can be invalid.
23613    #[serde(rename = "isAccepted")]
23614    pub is_accepted: bool,
23615    /// Whether this record is still the active assignment for its slot. Superseded and declined records are invalid.
23616    #[serde(rename = "isValid")]
23617    pub is_valid: bool,
23618    pub meta: MetaDataEntityId,
23619    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23620    pub name: Option<String>,
23621    /// Optional computed assignment permissions. These request endpoints do not populate them and normally return null.
23622    #[serde(default, skip_serializing_if = "Option::is_none")]
23623    pub permissions: Option<ServiceRequestPermissions>,
23624    #[serde(default, skip_serializing_if = "Option::is_none")]
23625    pub person: Option<DomainObjectPerson>,
23626    #[serde(rename = "personId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23627    #[deprecated = "deprecated in the ChurchTools API"]
23628    pub person_id: Option<i64>,
23629    /// Deprecated alias for `meta.modifiedDate`.
23630    #[serde(rename = "requestedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
23631    #[deprecated = "deprecated in the ChurchTools API"]
23632    pub requested_date: Option<chrono::DateTime<chrono::Utc>>,
23633    /// Person as Domain Object
23634    #[serde(rename = "requesterPerson")]
23635    pub requester_person: DomainObjectPerson,
23636    #[serde(rename = "requesterPersonId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23637    #[deprecated = "deprecated in the ChurchTools API"]
23638    pub requester_person_id: Option<i64>,
23639    /// ID of the reusable service role from /services, not the request ID.
23640    #[serde(rename = "serviceId", deserialize_with = "crate::lenient::number")]
23641    pub service_id: i64,
23642    #[serde(rename = "serviceName", deserialize_with = "crate::lenient::string")]
23643    pub service_name: String,
23644    /// Fields not described by the spec, e.g. instance-specific DB fields.
23645    #[serde(flatten)]
23646    pub extra: serde_json::Map<String, serde_json::Value>,
23647}
23648
23649/// Assign a person or external name to a service slot. The previous active record is invalidated and a new assignment record is returned.
23650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23651pub struct ServiceRequestUpdate {
23652    /// Legacy alias for isAccepted. Prefer isAccepted in new integrations.
23653    #[serde(default, skip_serializing_if = "Option::is_none")]
23654    #[deprecated = "deprecated in the ChurchTools API"]
23655    pub agreed: Option<bool>,
23656    /// Accepted for compatibility but ignored by this update operation; the replacement record starts without a comment. Use the accept or decline action for a response comment.
23657    ///
23658    /// `None` leaves the field out, `Some(None)` sends `null`.
23659    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23660    pub comment: Option<Option<String>>,
23661    /// Accepted for compatibility; this flag does not control notifications in the current implementation. Notifications follow the assignment workflow.
23662    #[serde(default, skip_serializing_if = "Option::is_none")]
23663    pub inform_person: Option<bool>,
23664    /// true creates a confirmed assignment; false creates an assignment awaiting confirmation. false does not decline it.
23665    #[serde(rename = "isAccepted", default, skip_serializing_if = "Option::is_none")]
23666    pub is_accepted: Option<bool>,
23667    /// Name of an external assignee without a person record.
23668    ///
23669    /// `None` leaves the field out, `Some(None)` sends `null`.
23670    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23671    pub name: Option<Option<String>>,
23672    /// Existing person to assign. Supply exactly one non-`null` value: `personId` or name.
23673    ///
23674    /// `None` leaves the field out, `Some(None)` sends `null`.
23675    #[serde(rename = "personId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23676    pub person_id: Option<Option<i64>>,
23677    /// Fields not described by the spec, e.g. instance-specific DB fields.
23678    #[serde(flatten)]
23679    pub extra: serde_json::Map<String, serde_json::Value>,
23680}
23681
23682/// Update a service role.
23683#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23684pub struct ServiceUpdate {
23685    /// Enable chat for this service.
23686    #[serde(rename = "allowChat", default, skip_serializing_if = "Option::is_none")]
23687    pub allow_chat: Option<bool>,
23688    /// Allow a comment when confirming a service request.
23689    #[serde(rename = "allowCommentOnConfirmation", default, skip_serializing_if = "Option::is_none")]
23690    pub allow_comment_on_confirmation: Option<bool>,
23691    /// Allow persons assigned to this service to control the live agenda.
23692    #[serde(rename = "allowControlLiveAgenda", default, skip_serializing_if = "Option::is_none")]
23693    pub allow_control_live_agenda: Option<bool>,
23694    /// Allow assigned persons to decline service requests.
23695    #[serde(rename = "allowDecline", default, skip_serializing_if = "Option::is_none")]
23696    pub allow_decline: Option<bool>,
23697    /// Allow assigned persons to request an exchange of their service assignment.
23698    #[serde(rename = "allowExchange", default, skip_serializing_if = "Option::is_none")]
23699    pub allow_exchange: Option<bool>,
23700    /// Template for the calendar text of this service.
23701    ///
23702    /// `None` leaves the field out, `Some(None)` sends `null`.
23703    #[serde(rename = "calTextTemplate", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23704    pub cal_text_template: Option<Option<String>>,
23705    /// Deprecated input alias for description. Use description for new integrations.
23706    ///
23707    /// `None` leaves the field out, `Some(None)` sends `null`.
23708    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23709    #[deprecated = "Use description for new integrations."]
23710    pub comment: Option<Option<String>>,
23711    /// Description of the role.
23712    ///
23713    /// `None` leaves the field out, `Some(None)` sends `null`.
23714    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23715    pub description: Option<Option<String>>,
23716    /// IDs of connected person groups used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23717    #[serde(rename = "groupIds", default, skip_serializing_if = "Option::is_none")]
23718    pub group_ids: Option<Vec<i64>>,
23719    /// Hide assigned persons from viewers without the service or service-group permissions needed to see them.
23720    #[serde(rename = "hidePersonName", default, skip_serializing_if = "Option::is_none")]
23721    pub hide_person_name: Option<bool>,
23722    /// Name of the planning role, for example Lead vocals. A service is reusable master data; the assignment of a person to this role belongs to an event.
23723    #[serde(deserialize_with = "crate::lenient::string")]
23724    pub name: String,
23725    /// Restrict assignment candidates to the connected person groups.
23726    #[serde(rename = "onlyAssignFromGroups", default, skip_serializing_if = "Option::is_none")]
23727    pub only_assign_from_groups: Option<bool>,
23728    /// Enable reminder emails for service assignments.
23729    #[serde(rename = "sendReminderMails", default, skip_serializing_if = "Option::is_none")]
23730    pub send_reminder_mails: Option<bool>,
23731    /// Enable emails for service requests.
23732    #[serde(rename = "sendServiceRequestEmails", default, skip_serializing_if = "Option::is_none")]
23733    pub send_service_request_emails: Option<bool>,
23734    /// ID of the existing service group that organizes this role, for example Music or Technical team. This is not a person group.
23735    #[serde(rename = "serviceGroupId", deserialize_with = "crate::lenient::number")]
23736    pub service_group_id: i64,
23737    /// Display order. Lists are sorted by `sortKey` and then name, both ascending.
23738    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23739    pub sort_key: Option<i64>,
23740    /// Whether this service is marked as a standard service for event planning.
23741    #[serde(default, skip_serializing_if = "Option::is_none")]
23742    pub standard: Option<bool>,
23743    /// IDs of connected tags used for service planning. Nonexistent IDs are silently removed. Duplicates are retained. An empty list clears the connections.
23744    #[serde(rename = "tagIds", default, skip_serializing_if = "Option::is_none")]
23745    pub tag_ids: Option<Vec<i64>>,
23746    /// Fields not described by the spec, e.g. instance-specific DB fields.
23747    #[serde(flatten)]
23748    pub extra: serde_json::Map<String, serde_json::Value>,
23749}
23750
23751/// Configurable sex master-data entry, including localized salutations and audit metadata.
23752#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23753pub struct Sex {
23754    /// Stored name or translation key. Use nameTranslated for display in the current language.
23755    #[serde(deserialize_with = "crate::lenient::string")]
23756    pub name: String,
23757    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23758    #[serde(rename = "salutationFormal", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23759    pub salutation_formal: Option<String>,
23760    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23761    #[serde(rename = "salutationInformal", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23762    pub salutation_informal: Option<String>,
23763    /// Stored sort order.
23764    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23765    pub sort_key: i64,
23766    /// Catalog ID referenced by person records. IDs 1 and 2 are protected against deletion.
23767    #[serde(deserialize_with = "crate::lenient::number")]
23768    pub id: i64,
23769    pub meta: MetaDataEntityId,
23770    /// Display name translated for the current language.
23771    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23772    pub name_translated: String,
23773    /// Localized salutation; empty string when the stored salutation is null.
23774    #[serde(rename = "salutationFormalTranslated", deserialize_with = "crate::lenient::string")]
23775    pub salutation_formal_translated: String,
23776    /// Localized salutation; empty string when the stored salutation is null.
23777    #[serde(rename = "salutationInformalTranslated", deserialize_with = "crate::lenient::string")]
23778    pub salutation_informal_translated: String,
23779    /// Fields not described by the spec, e.g. instance-specific DB fields.
23780    #[serde(flatten)]
23781    pub extra: serde_json::Map<String, serde_json::Value>,
23782}
23783
23784/// Writable catalog values for a person’s sex and associated salutations. Text is trimmed; translation keys and literal display text are accepted.
23785#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23786pub struct SexCreate {
23787    /// Stored name or translation key. Use nameTranslated for display in the current language.
23788    #[serde(deserialize_with = "crate::lenient::string")]
23789    pub name: String,
23790    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23791    ///
23792    /// `None` leaves the field out, `Some(None)` sends `null`.
23793    #[serde(rename = "salutationFormal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23794    pub salutation_formal: Option<Option<String>>,
23795    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23796    ///
23797    /// `None` leaves the field out, `Some(None)` sends `null`.
23798    #[serde(rename = "salutationInformal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23799    pub salutation_informal: Option<Option<String>>,
23800    /// Sort order. Omission or null becomes 0.
23801    ///
23802    /// `None` leaves the field out, `Some(None)` sends `null`.
23803    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23804    pub sort_key: Option<Option<i64>>,
23805    /// Fields not described by the spec, e.g. instance-specific DB fields.
23806    #[serde(flatten)]
23807    pub extra: serde_json::Map<String, serde_json::Value>,
23808}
23809
23810/// Replaces the catalog entry’s writable values. name is required; omitted sortKey becomes 0 and omitted salutations become null. The ID comes from the URL.
23811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23812pub struct SexUpdate {
23813    /// Stored name or translation key. Use nameTranslated for display in the current language.
23814    #[serde(deserialize_with = "crate::lenient::string")]
23815    pub name: String,
23816    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23817    ///
23818    /// `None` leaves the field out, `Some(None)` sends `null`.
23819    #[serde(rename = "salutationFormal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23820    pub salutation_formal: Option<Option<String>>,
23821    /// Stored salutation text or translation key. Omission, null, empty string and whitespace-only input all become null.
23822    ///
23823    /// `None` leaves the field out, `Some(None)` sends `null`.
23824    #[serde(rename = "salutationInformal", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23825    pub salutation_informal: Option<Option<String>>,
23826    /// Sort order. Omission or null becomes 0.
23827    ///
23828    /// `None` leaves the field out, `Some(None)` sends `null`.
23829    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23830    pub sort_key: Option<Option<i64>>,
23831    /// Fields not described by the spec, e.g. instance-specific DB fields.
23832    #[serde(flatten)]
23833    pub extra: serde_json::Map<String, serde_json::Value>,
23834}
23835
23836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23837pub struct SimpleAppointment {
23838    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
23839    pub calendar_id: i64,
23840    #[serde(deserialize_with = "crate::lenient::number")]
23841    pub id: i64,
23842    #[serde(deserialize_with = "crate::lenient::string")]
23843    pub title: String,
23844    /// Fields not described by the spec, e.g. instance-specific DB fields.
23845    #[serde(flatten)]
23846    pub extra: serde_json::Map<String, serde_json::Value>,
23847}
23848
23849/// Wiki page metadata for one version. Text and previews are optional enrichments depending on the endpoint. A page is addressed by category ID and stable GUID; version identifies its revision.
23850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23851pub struct SimpleWikiPage {
23852    /// Compatibility marker used by existing clients.
23853    #[serde(rename = "@deprecated")]
23854    pub deprecated: SimpleWikiPageDeprecated,
23855    /// Stable page GUID across versions in its category.
23856    #[serde(deserialize_with = "crate::lenient::string")]
23857    pub guid: String,
23858    /// Deprecated alias for `guid`. Use `guid` instead.
23859    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23860    #[deprecated = "Use `guid` instead."]
23861    pub identifier: Option<String>,
23862    /// Whether page text is Markdown rather than legacy HTML.
23863    #[serde(rename = "isMarkdown")]
23864    pub is_markdown: bool,
23865    pub meta: MetaDataEntityPerson,
23866    /// Whether the page is configured to appear on the wiki start page.
23867    #[serde(rename = "onStartpage")]
23868    pub on_startpage: bool,
23869    /// Page editing/deletion capabilities for the current user; system pages have additional restrictions.
23870    pub permissions: SimpleWikiPagePermissions,
23871    /// Stored redirect title. API reads return the page and this value; they do not follow the redirect.
23872    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23873    pub redirect_to: Option<String>,
23874    /// Query-focused preview snippet. Present when the page list endpoint is called with a search query.
23875    #[serde(rename = "searchPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23876    pub search_preview: Option<String>,
23877    /// Markdown source or sanitized legacy HTML. Absent from category lists and from /wiki/pages unless include\[\]=text is requested. Null stored content is returned as an empty string.
23878    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23879    pub text: Option<String>,
23880    /// Unrendered prefix of stored page text, truncated by Unicode characters. May contain raw HTML or incomplete markup. Present only with include\[\]=preview; not sanitized like text.
23881    #[serde(rename = "textPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23882    pub text_preview: Option<String>,
23883    #[serde(deserialize_with = "crate::lenient::string")]
23884    pub title: String,
23885    /// Revision number of this page.
23886    #[serde(deserialize_with = "crate::lenient::number")]
23887    pub version: i64,
23888    /// A category organizes wiki pages and is the unit of wiki access permissions.
23889    #[serde(rename = "wikiCategory")]
23890    pub wiki_category: WikiCategory,
23891    /// Fields not described by the spec, e.g. instance-specific DB fields.
23892    #[serde(flatten)]
23893    pub extra: serde_json::Map<String, serde_json::Value>,
23894}
23895
23896/// Compatibility marker used by existing clients.
23897#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23898pub struct SimpleWikiPageDeprecated {
23899    #[serde(deserialize_with = "crate::lenient::string")]
23900    pub identifier: String,
23901    /// Fields not described by the spec, e.g. instance-specific DB fields.
23902    #[serde(flatten)]
23903    pub extra: serde_json::Map<String, serde_json::Value>,
23904}
23905
23906/// Page editing/deletion capabilities for the current user; system pages have additional restrictions.
23907#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23908pub struct SimpleWikiPagePermissions {
23909    #[serde(rename = "canDelete")]
23910    pub can_delete: bool,
23911    #[serde(rename = "canEdit")]
23912    pub can_edit: bool,
23913    /// Fields not described by the spec, e.g. instance-specific DB fields.
23914    #[serde(flatten)]
23915    pub extra: serde_json::Map<String, serde_json::Value>,
23916}
23917
23918/// Song with its category and all arrangements. Agenda-specific selection, order and timing belong to agenda items, not to this song record.
23919#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23920pub struct Song {
23921    /// Compatibility markers included in serialized song records.
23922    #[serde(rename = "@deprecated")]
23923    pub deprecated: SongDeprecated,
23924    /// All musical versions, always returned by the current API, even without include=arrangements. Each version has its own key, tempo and attachments.
23925    #[serde(default, skip_serializing_if = "Option::is_none")]
23926    #[deprecated = "deprecated in the ChurchTools API"]
23927    pub arrangements: Option<Vec<Arrangement>>,
23928    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23929    pub author: Option<String>,
23930    /// Configurable category for organizing songs.
23931    pub category: SongCategory,
23932    /// CCLI song number, stored as text.
23933    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23934    pub ccli: Option<String>,
23935    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23936    pub copyright: Option<String>,
23937    #[serde(deserialize_with = "crate::lenient::number")]
23938    pub id: i64,
23939    pub meta: MetaDataEntityId,
23940    #[serde(deserialize_with = "crate::lenient::string")]
23941    pub name: String,
23942    /// Deprecated compatibility field, returned as an empty string.
23943    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
23944    #[deprecated = "deprecated in the ChurchTools API"]
23945    pub note: Option<String>,
23946    /// Whether the song is marked for rehearsal.
23947    #[serde(rename = "shouldPractice")]
23948    pub should_practice: bool,
23949    /// Song tags, included only when GET requests use include=tags. An empty array means no tags are assigned. The count on each tag defaults to 1; it is not a total across all songs.
23950    #[serde(default, skip_serializing_if = "Option::is_none")]
23951    pub tags: Option<Vec<TagWithCount>>,
23952    /// Fields not described by the spec, e.g. instance-specific DB fields.
23953    #[serde(flatten)]
23954    pub extra: serde_json::Map<String, serde_json::Value>,
23955}
23956
23957/// Configurable category for organizing songs.
23958#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23959pub struct SongCategory {
23960    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23961    pub campus_id: Option<i64>,
23962    #[serde(deserialize_with = "crate::lenient::number")]
23963    pub id: i64,
23964    pub meta: MetaDataEntityId,
23965    /// Stored, configurable name.
23966    #[serde(deserialize_with = "crate::lenient::string")]
23967    pub name: String,
23968    /// Display name after translation, or the original name when no translation is available.
23969    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
23970    pub name_translated: String,
23971    /// Display order; lower values come first.
23972    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
23973    pub sort_key: i64,
23974    /// Fields not described by the spec, e.g. instance-specific DB fields.
23975    #[serde(flatten)]
23976    pub extra: serde_json::Map<String, serde_json::Value>,
23977}
23978
23979/// Input for a configurable song category.
23980#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
23981pub struct SongCategoryCreate {
23982    /// Existing campus ID associated with the category.
23983    ///
23984    /// `None` leaves the field out, `Some(None)` sends `null`.
23985    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
23986    pub campus_id: Option<Option<i64>>,
23987    /// Configurable category name.
23988    #[serde(deserialize_with = "crate::lenient::string")]
23989    pub name: String,
23990    /// Display order; lower values come first.
23991    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
23992    pub sort_key: Option<i64>,
23993    /// Fields not described by the spec, e.g. instance-specific DB fields.
23994    #[serde(flatten)]
23995    pub extra: serde_json::Map<String, serde_json::Value>,
23996}
23997
23998/// Input for replacing a song category.
23999#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24000pub struct SongCategoryUpdate {
24001    /// Existing campus ID associated with the category.
24002    ///
24003    /// `None` leaves the field out, `Some(None)` sends `null`.
24004    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24005    pub campus_id: Option<Option<i64>>,
24006    /// Configurable category name.
24007    #[serde(deserialize_with = "crate::lenient::string")]
24008    pub name: String,
24009    /// Display order; lower values come first.
24010    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24011    pub sort_key: Option<i64>,
24012    /// Fields not described by the spec, e.g. instance-specific DB fields.
24013    #[serde(flatten)]
24014    pub extra: serde_json::Map<String, serde_json::Value>,
24015}
24016
24017/// A song, optionally with initial arrangements and tags. A song is the composition; arrangements describe its musical versions and are selected by event agenda items.
24018#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24019pub struct SongCreate {
24020    /// Author or composer credits.
24021    ///
24022    /// `None` leaves the field out, `Some(None)` sends `null`.
24023    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24024    pub author: Option<Option<String>>,
24025    /// ID of an existing song category from GET /song/categories. Categories organize songs and determine access permissions. Changing it requires edit permission for both the old and the new category.
24026    #[serde(rename = "categoryId", deserialize_with = "crate::lenient::number")]
24027    pub category_id: i64,
24028    /// CCLI song number, stored as text.
24029    ///
24030    /// `None` leaves the field out, `Some(None)` sends `null`.
24031    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24032    pub ccli: Option<Option<String>>,
24033    /// Copyright or licensing notice.
24034    ///
24035    /// `None` leaves the field out, `Some(None)` sends `null`.
24036    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24037    pub copyright: Option<Option<String>>,
24038    /// Song title.
24039    #[serde(deserialize_with = "crate::lenient::string")]
24040    pub name: String,
24041    /// Marks the song for rehearsal.
24042    #[serde(rename = "shouldPractice", default, skip_serializing_if = "Option::is_none")]
24043    pub should_practice: Option<bool>,
24044    /// Tag names to assign. Existing tags are reused by name; missing tags are created. During update, this replaces the song's tag set.
24045    #[serde(default, skip_serializing_if = "Option::is_none")]
24046    pub tags: Option<Vec<String>>,
24047    /// Initial musical versions. The first arrangement becomes the default unless a later item has `isDefault: true`.
24048    #[serde(default, skip_serializing_if = "Option::is_none")]
24049    pub arrangements: Option<Vec<ArrangementCreate>>,
24050    /// Fields not described by the spec, e.g. instance-specific DB fields.
24051    #[serde(flatten)]
24052    pub extra: serde_json::Map<String, serde_json::Value>,
24053}
24054
24055/// Compatibility markers included in serialized song records.
24056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24057pub struct SongDeprecated {
24058    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24059    pub arrangements: serde_json::Value,
24060    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24061    pub note: serde_json::Value,
24062    /// Fields not described by the spec, e.g. instance-specific DB fields.
24063    #[serde(flatten)]
24064    pub extra: serde_json::Map<String, serde_json::Value>,
24065}
24066
24067/// Source associated with song arrangements, such as a hymnal or songbook.
24068#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24069pub struct SongSource {
24070    #[serde(deserialize_with = "crate::lenient::number")]
24071    pub id: i64,
24072    pub meta: MetaDataEntityId,
24073    /// Stored, configurable name.
24074    #[serde(deserialize_with = "crate::lenient::string")]
24075    pub name: String,
24076    /// Display name after translation, or the original name when no translation is available.
24077    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
24078    pub name_translated: String,
24079    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24080    pub shorty: Option<String>,
24081    /// Display order; lower values come first.
24082    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
24083    pub sort_key: i64,
24084    /// Fields not described by the spec, e.g. instance-specific DB fields.
24085    #[serde(flatten)]
24086    pub extra: serde_json::Map<String, serde_json::Value>,
24087}
24088
24089/// Input for a song source, such as a hymnal or songbook.
24090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24091pub struct SongSourceCreate {
24092    /// Configurable source name.
24093    #[serde(deserialize_with = "crate::lenient::string")]
24094    pub name: String,
24095    /// Display abbreviation.
24096    ///
24097    /// `None` leaves the field out, `Some(None)` sends `null`.
24098    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24099    pub shorty: Option<Option<String>>,
24100    /// Display order; lower values come first.
24101    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24102    pub sort_key: Option<i64>,
24103    /// Fields not described by the spec, e.g. instance-specific DB fields.
24104    #[serde(flatten)]
24105    pub extra: serde_json::Map<String, serde_json::Value>,
24106}
24107
24108/// Input for replacing a song source.
24109#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24110pub struct SongSourceUpdate {
24111    /// Configurable source name.
24112    #[serde(deserialize_with = "crate::lenient::string")]
24113    pub name: String,
24114    /// Display abbreviation.
24115    ///
24116    /// `None` leaves the field out, `Some(None)` sends `null`.
24117    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24118    pub shorty: Option<Option<String>>,
24119    /// Display order; lower values come first.
24120    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24121    pub sort_key: Option<i64>,
24122    /// Fields not described by the spec, e.g. instance-specific DB fields.
24123    #[serde(flatten)]
24124    pub extra: serde_json::Map<String, serde_json::Value>,
24125}
24126
24127/// Song details shared by creation and update. Inline arrangements are supported only during creation.
24128#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24129pub struct SongUpdate {
24130    /// Author or composer credits.
24131    ///
24132    /// `None` leaves the field out, `Some(None)` sends `null`.
24133    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24134    pub author: Option<Option<String>>,
24135    /// ID of an existing song category from GET /song/categories. Categories organize songs and determine access permissions. Changing it requires edit permission for both the old and the new category.
24136    #[serde(rename = "categoryId", deserialize_with = "crate::lenient::number")]
24137    pub category_id: i64,
24138    /// CCLI song number, stored as text.
24139    ///
24140    /// `None` leaves the field out, `Some(None)` sends `null`.
24141    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24142    pub ccli: Option<Option<String>>,
24143    /// Copyright or licensing notice.
24144    ///
24145    /// `None` leaves the field out, `Some(None)` sends `null`.
24146    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24147    pub copyright: Option<Option<String>>,
24148    /// Song title.
24149    #[serde(deserialize_with = "crate::lenient::string")]
24150    pub name: String,
24151    /// Marks the song for rehearsal.
24152    #[serde(rename = "shouldPractice", default, skip_serializing_if = "Option::is_none")]
24153    pub should_practice: Option<bool>,
24154    /// Tag names to assign. Existing tags are reused by name; missing tags are created. During update, this replaces the song's tag set.
24155    #[serde(default, skip_serializing_if = "Option::is_none")]
24156    pub tags: Option<Vec<String>>,
24157    /// Fields not described by the spec, e.g. instance-specific DB fields.
24158    #[serde(flatten)]
24159    pub extra: serde_json::Map<String, serde_json::Value>,
24160}
24161
24162/// A parent grouping ordinary accounting bookings into one gross amount. All submitted non-tax children share either their debit account or their credit account, and an account cannot occur on both sides. The parent is not itself an ordinary transaction row. Generated tax bookings also appear in splitChildren; their amounts plus the corresponding net children make up the gross total.
24163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24164pub struct SplitTransaction {
24165    /// Total amount in the currency's smallest denomination (e.g. cents). Must equal the sum of all `splitChildren` amounts.
24166    #[serde(deserialize_with = "crate::lenient::number")]
24167    pub amount: i64,
24168    /// Parent receipts, included when include\[\]=bills is requested.
24169    #[serde(default, skip_serializing_if = "Option::is_none")]
24170    pub bills: Option<Vec<Bill>>,
24171    /// A simple date in ISO format, e.g. '2022-10-19'
24172    #[serde(rename = "documentDate")]
24173    pub document_date: chrono::NaiveDate,
24174    /// Document number of the split transaction. Auto-generated when the accounting period increments document numbers, otherwise required.
24175    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
24176    pub document_number: String,
24177    /// ID of the split parent, distinct from each ordinary child transaction ID.
24178    #[serde(deserialize_with = "crate::lenient::number")]
24179    pub id: i64,
24180    pub meta: MetaDataEntityId,
24181    /// Free-text note describing the split booking.
24182    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24183    pub note: Option<String>,
24184    /// Ordinary child bookings, including generated tax rows. A fresh read orders them by transaction ID. Child IDs can be read through /finance/transactions/{id}; edit the group through the split endpoint.
24185    #[serde(rename = "splitChildren")]
24186    pub split_children: Vec<Transaction>,
24187    /// Fields not described by the spec, e.g. instance-specific DB fields.
24188    #[serde(flatten)]
24189    pub extra: serde_json::Map<String, serde_json::Value>,
24190}
24191
24192/// One non-tax part of a split booking. Parent documentDate/documentNumber are applied automatically. Supply its gross amount when taxRateId is present. Do not copy generated tax rows from a read response into a new request; they are created from their main rows. Use real JSON numbers and booleans because child normalization is currently discarded.
24193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24194pub struct SplitTransactionChildCreate {
24195    /// ID of the debit account the amount is posted to.
24196    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
24197    pub account_id: i64,
24198    /// Gross booking amount in integer minor currency units. With taxRateId, tax is calculated from this amount and split into a separate booking; the returned main booking contains the remaining net amount.
24199    #[serde(deserialize_with = "crate::lenient::number")]
24200    pub amount: i64,
24201    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
24202    ///
24203    /// `None` leaves the field out, `Some(None)` sends `null`.
24204    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24205    pub cash_discount_amount: Option<Option<i64>>,
24206    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
24207    ///
24208    /// `None` leaves the field out, `Some(None)` sends `null`.
24209    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24210    pub cash_discount_id: Option<Option<i64>>,
24211    /// ID of the credit (contra) account the amount is posted from. Must differ from `accountId`.
24212    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
24213    pub contra_account_id: i64,
24214    /// Cost center from the same accounting period. Omission or null clears the assignment on update.
24215    ///
24216    /// `None` leaves the field out, `Some(None)` sends `null`.
24217    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24218    pub cost_center_id: Option<Option<i64>>,
24219    /// Donor person ID. Normally required when only the credit account is a donation account. Donor assignments are retained only when exactly one side is a donation account.
24220    ///
24221    /// `None` leaves the field out, `Some(None)` sends `null`.
24222    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24223    pub donator_id: Option<Option<i64>>,
24224    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
24225    ///
24226    /// `None` leaves the field out, `Some(None)` sends `null`.
24227    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24228    pub donator_spouse_id: Option<Option<i64>>,
24229    /// Existing ordinary booking to update/adopt. Omit or use null for a new booking. Existing children from another split cannot be moved through the regular multi-child update.
24230    ///
24231    /// `None` leaves the field out, `Some(None)` sends `null`.
24232    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24233    pub id: Option<Option<i64>>,
24234    /// Sync marker used for newly created children; existing children retain their marker.
24235    #[serde(rename = "isSynced", default, skip_serializing_if = "Option::is_none")]
24236    pub is_synced: Option<bool>,
24237    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
24238    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
24239    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
24240    /// Child booking note. Validation checks the trimmed length, but the current implementation writes the original child value.
24241    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24242    pub note: Option<String>,
24243    /// Tax rate from the same period. On update an explicit null removes the existing tax booking; omission currently retains it because child defaults are discarded.
24244    ///
24245    /// `None` leaves the field out, `Some(None)` sends `null`.
24246    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24247    pub tax_rate_id: Option<Option<i64>>,
24248    /// Fields not described by the spec, e.g. instance-specific DB fields.
24249    #[serde(flatten)]
24250    pub extra: serde_json::Map<String, serde_json::Value>,
24251}
24252
24253/// Input for a grouped booking. At least one child is needed; child amounts must sum exactly to amount. All children must share one debit or one credit account, with no account used on both sides. Parent and child notes may be null. A single child is saved as an ordinary transaction and yields HTTP 204.
24254#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24255pub struct SplitTransactionCreate {
24256    /// Total gross amount in minor currency units, equal to the sum of submitted child amounts.
24257    #[serde(deserialize_with = "crate::lenient::number")]
24258    pub amount: i64,
24259    /// Document date applied to all children.
24260    #[serde(rename = "documentDate")]
24261    pub document_date: chrono::NaiveDate,
24262    /// Parent number. Required unless the period generates numbers; omission or null then generates a number, including on update. Multi-child bookings receive suffixes -1, -2, and so on.
24263    ///
24264    /// `None` leaves the field out, `Some(None)` sends `null`.
24265    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24266    pub document_number: Option<Option<String>>,
24267    /// Parent note; trimmed, with an empty result stored as null. For single-child conversion this replaces the child note.
24268    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24269    pub note: Option<String>,
24270    /// Complete replacement list. Existing IDs keep/update rows; omitted previous rows are deleted. Omit id to create a new child.
24271    #[serde(rename = "splitChildren")]
24272    pub split_children: Vec<SplitTransactionChildCreate>,
24273    /// Fields not described by the spec, e.g. instance-specific DB fields.
24274    #[serde(flatten)]
24275    pub extra: serde_json::Map<String, serde_json::Value>,
24276}
24277
24278#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24279pub struct SplitTransactionStornoCreate {
24280    /// Cancellation reason; trimmed before being added to parent and child notes.
24281    #[serde(deserialize_with = "crate::lenient::string")]
24282    pub note: String,
24283    /// Fields not described by the spec, e.g. instance-specific DB fields.
24284    #[serde(flatten)]
24285    pub extra: serde_json::Map<String, serde_json::Value>,
24286}
24287
24288/// Complete replacement of a split parent identified by the URL. Preserve IDs of existing children, omit IDs for new children and omit old rows to delete them. One remaining child converts the group to an ordinary booking and returns no body.
24289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24290pub struct SplitTransactionUpdate {
24291    /// Total gross amount in minor currency units, equal to the sum of submitted child amounts.
24292    #[serde(deserialize_with = "crate::lenient::number")]
24293    pub amount: i64,
24294    /// Document date applied to all children.
24295    #[serde(rename = "documentDate")]
24296    pub document_date: chrono::NaiveDate,
24297    /// Parent number. Required unless the period generates numbers; omission or null then generates a number, including on update. Multi-child bookings receive suffixes -1, -2, and so on.
24298    ///
24299    /// `None` leaves the field out, `Some(None)` sends `null`.
24300    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24301    pub document_number: Option<Option<String>>,
24302    /// Parent note; trimmed, with an empty result stored as null. For single-child conversion this replaces the child note.
24303    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24304    pub note: Option<String>,
24305    /// Complete replacement list. Existing IDs keep/update rows; omitted previous rows are deleted. Omit id to create a new child.
24306    #[serde(rename = "splitChildren")]
24307    pub split_children: Vec<SplitTransactionChildCreate>,
24308    /// Fields not described by the spec, e.g. instance-specific DB fields.
24309    #[serde(flatten)]
24310    pub extra: serde_json::Map<String, serde_json::Value>,
24311}
24312
24313/// Public login-screen entry for a visible OAuth, OpenID Connect or SAML provider.
24314#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24315pub struct SsoLogin {
24316    /// Whether account registration is configured for this provider.
24317    #[serde(rename = "hasRegistration")]
24318    pub has_registration: bool,
24319    /// External login provider ID.
24320    #[serde(deserialize_with = "crate::lenient::number")]
24321    pub id: i64,
24322    /// URL that starts authentication; navigate the browser to it.
24323    #[serde(rename = "loginLink", deserialize_with = "crate::lenient::string")]
24324    pub login_link: String,
24325    /// Optional provider logo URL.
24326    #[serde(rename = "logoUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24327    pub logo_url: Option<String>,
24328    /// Label shown for the provider.
24329    #[serde(deserialize_with = "crate::lenient::string")]
24330    pub name: String,
24331    /// Whether the provider is marked as the primary login option.
24332    #[serde(rename = "primaryLogin")]
24333    pub primary_login: bool,
24334    /// Optional explanatory text for the login screen.
24335    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24336    pub subtitle: Option<String>,
24337    /// Authentication protocol implemented by the provider.
24338    /// Allowed values: `oauth`, `oidc`, `saml`.
24339    #[serde(deserialize_with = "crate::lenient::string")]
24340    pub r#type: String,
24341    /// Fields not described by the spec, e.g. instance-specific DB fields.
24342    #[serde(flatten)]
24343    pub extra: serde_json::Map<String, serde_json::Value>,
24344}
24345
24346#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24347pub struct StartStopChat {
24348    pub enabled: bool,
24349    #[serde(rename = "triggerChatInviteMail", default, skip_serializing_if = "Option::is_none")]
24350    pub trigger_chat_invite_mail: Option<bool>,
24351    /// Fields not described by the spec, e.g. instance-specific DB fields.
24352    #[serde(flatten)]
24353    pub extra: serde_json::Map<String, serde_json::Value>,
24354}
24355
24356/// One imported bank-statement movement and its proposed booking fields. Suggestions are always included; include\[\]=bills additionally expands supporting documents on the suggestions.
24357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24358pub struct StatementMovement {
24359    /// Movement amount in minor currency units. isDebit distinguishes outgoing from incoming funds.
24360    #[serde(deserialize_with = "crate::lenient::number")]
24361    pub amount: i64,
24362    #[serde(deserialize_with = "crate::lenient::string")]
24363    pub description: String,
24364    /// A simple date in ISO format, e.g. '2022-10-19'
24365    #[serde(rename = "documentDate")]
24366    pub document_date: chrono::NaiveDate,
24367    #[serde(deserialize_with = "crate::lenient::number")]
24368    pub id: i64,
24369    #[serde(deserialize_with = "crate::lenient::string")]
24370    pub identifier: String,
24371    /// True for outgoing funds, false for incoming funds.
24372    #[serde(rename = "isDebit")]
24373    pub is_debit: bool,
24374    /// Donation indicator recorded by the import.
24375    #[serde(rename = "isDonation")]
24376    pub is_donation: bool,
24377    /// Original sequence number used as the secondary sort key.
24378    #[serde(rename = "numberInStatement", deserialize_with = "crate::lenient::number")]
24379    pub number_in_statement: i64,
24380    #[serde(rename = "personName", deserialize_with = "crate::lenient::string")]
24381    pub person_name: String,
24382    #[serde(deserialize_with = "crate::lenient::string")]
24383    pub purpose: String,
24384    /// Normally open, booked or ignored. The current mutation endpoint also stores other strings without validating an enum.
24385    #[serde(deserialize_with = "crate::lenient::string")]
24386    pub state: String,
24387    pub suggestions: Vec<MovementSuggestion>,
24388    #[serde(rename = "transactionCode", deserialize_with = "crate::lenient::string")]
24389    pub transaction_code: String,
24390    /// Associated transaction, or null before booking. For a split booking this identifies the first non-tax child, not the split parent.
24391    #[serde(rename = "transactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24392    pub transaction_id: Option<i64>,
24393    /// A simple date in ISO format, e.g. '2022-10-19'
24394    pub valuta: chrono::NaiveDate,
24395    /// Fields not described by the spec, e.g. instance-specific DB fields.
24396    #[serde(flatten)]
24397    pub extra: serde_json::Map<String, serde_json::Value>,
24398}
24399
24400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24401pub struct StatementMovementUpdate {
24402    /// Target movement state. Returning from booked to another state does not undo or delete the existing transaction.
24403    /// Allowed values: `booked`, `ignored`, `open`.
24404    #[serde(deserialize_with = "crate::lenient::string")]
24405    pub state: String,
24406    /// Fields not described by the spec, e.g. instance-specific DB fields.
24407    #[serde(flatten)]
24408    pub extra: serde_json::Map<String, serde_json::Value>,
24409}
24410
24411#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24412pub struct StatementStatistics {
24413    /// Sum of open, booked and ignored movements.
24414    #[serde(deserialize_with = "crate::lenient::number")]
24415    pub all: i64,
24416    /// Number of booked movements.
24417    #[serde(deserialize_with = "crate::lenient::number")]
24418    pub booked: i64,
24419    /// Number of ignored movements.
24420    #[serde(deserialize_with = "crate::lenient::number")]
24421    pub ignored: i64,
24422    /// Number of open movements.
24423    #[serde(deserialize_with = "crate::lenient::number")]
24424    pub open: i64,
24425    /// Fields not described by the spec, e.g. instance-specific DB fields.
24426    #[serde(flatten)]
24427    pub extra: serde_json::Map<String, serde_json::Value>,
24428}
24429
24430/// Configurable person status, independent of a person’s memberships in groups. Status IDs are installation-specific and are not an enum.
24431#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24432pub struct Status {
24433    /// ID of status
24434    #[serde(deserialize_with = "crate::lenient::number")]
24435    pub id: i64,
24436    /// Flag if status is member of the church
24437    #[serde(rename = "isMember")]
24438    pub is_member: bool,
24439    /// Flag if that status is searchable
24440    #[serde(rename = "isSearchable")]
24441    pub is_searchable: bool,
24442    /// Status name
24443    #[serde(deserialize_with = "crate::lenient::string")]
24444    pub name: String,
24445    /// Translated status name
24446    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
24447    pub name_translated: String,
24448    /// Existing security-level definition associated with this status. Retrieve available IDs from GET /securitylevels.
24449    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
24450    pub security_level_id: i64,
24451    /// Abbreviation of name.
24452    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24453    pub shorty: Option<String>,
24454    /// Localized abbreviation. Present even when shorty is null.
24455    #[serde(rename = "shortyTranslated", deserialize_with = "crate::lenient::string")]
24456    pub shorty_translated: String,
24457    /// Used to sort all statuses
24458    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
24459    pub sort_key: i64,
24460    /// Fields not described by the spec, e.g. instance-specific DB fields.
24461    #[serde(flatten)]
24462    pub extra: serde_json::Map<String, serde_json::Value>,
24463}
24464
24465/// Person status definition, such as member or guest.
24466#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24467pub struct StatusCreate {
24468    /// Whether this status marks a person as a church member.
24469    ///
24470    /// `None` leaves the field out, `Some(None)` sends `null`.
24471    #[serde(rename = "isMember", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24472    pub is_member: Option<Option<bool>>,
24473    /// Whether persons with this status are eligible for the corresponding free-text person selection. This flag does not replace person visibility permissions.
24474    ///
24475    /// `None` leaves the field out, `Some(None)` sends `null`.
24476    #[serde(rename = "isSearchable", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24477    pub is_searchable: Option<Option<bool>>,
24478    /// Status name.
24479    #[serde(deserialize_with = "crate::lenient::string")]
24480    pub name: String,
24481    /// Existing security-level definition associated with this status. Retrieve available IDs from `GET /securitylevels`.
24482    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::number")]
24483    pub security_level_id: i64,
24484    /// Abbreviation of the status name.
24485    ///
24486    /// `None` leaves the field out, `Some(None)` sends `null`.
24487    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24488    pub shorty: Option<Option<String>>,
24489    /// Display-order value.
24490    ///
24491    /// `None` leaves the field out, `Some(None)` sends `null`.
24492    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24493    pub sort_key: Option<Option<i64>>,
24494    /// Fields not described by the spec, e.g. instance-specific DB fields.
24495    #[serde(flatten)]
24496    pub extra: serde_json::Map<String, serde_json::Value>,
24497}
24498
24499/// Fields to update; omitted fields remain unchanged.
24500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24501pub struct StatusUpdate {
24502    #[serde(rename = "isMember", default, skip_serializing_if = "Option::is_none")]
24503    pub is_member: Option<bool>,
24504    #[serde(rename = "isSearchable", default, skip_serializing_if = "Option::is_none")]
24505    pub is_searchable: Option<bool>,
24506    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24507    pub name: Option<String>,
24508    /// Existing security-level definition associated with this status.
24509    #[serde(rename = "securityLevelId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24510    pub security_level_id: Option<i64>,
24511    /// `None` leaves the field out, `Some(None)` sends `null`.
24512    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
24513    pub shorty: Option<Option<String>>,
24514    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24515    pub sort_key: Option<i64>,
24516    /// Fields not described by the spec, e.g. instance-specific DB fields.
24517    #[serde(flatten)]
24518    pub extra: serde_json::Map<String, serde_json::Value>,
24519}
24520
24521/// Stored address with its numeric ID, owning domain object and legacy compatibility fields. Coordinates are serialized as strings or null. The current serializer also returns a stored coordinate of zero as null.
24522#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24523pub struct StoredAddress {
24524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24525    pub addition: Option<String>,
24526    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24527    pub city: Option<String>,
24528    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`, `default`, `parent`.
24529    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24530    pub color: serde_json::Value,
24531    /// A country's ISO-code
24532    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24533    pub country: Option<String>,
24534    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24535    pub district: Option<String>,
24536    /// The identifier of the domain object. This field is set automatically from the path parameter and should not be included in the request body.
24537    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
24538    pub domain_identifier: String,
24539    /// The domain type of the address. This field is set automatically from the path parameter and should not be included in the request body.
24540    /// Allowed values: `appointment`, `campus`, `church`, `group`.
24541    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
24542    pub domain_type: String,
24543    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24544    pub icon: Option<String>,
24545    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24546    pub latitude: Option<String>,
24547    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24548    pub longitude: Option<String>,
24549    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24550    pub name: Option<String>,
24551    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24552    pub street: Option<String>,
24553    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24554    pub zip: Option<String>,
24555    #[serde(deserialize_with = "crate::lenient::number")]
24556    pub id: i64,
24557    #[serde(rename = "@deprecated")]
24558    pub deprecated: StoredAddressDeprecated,
24559    /// Use `latitude` instead
24560    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24561    #[deprecated = "Use `latitude` instead"]
24562    pub geo_lat: Option<String>,
24563    /// Use `longitude` instead
24564    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24565    #[deprecated = "Use `longitude` instead"]
24566    pub geo_lng: Option<String>,
24567    /// Use `latitude` instead
24568    #[serde(rename = "latitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24569    #[deprecated = "Use `latitude` instead"]
24570    pub latitude_loose: Option<String>,
24571    /// Use `longitude` instead
24572    #[serde(rename = "longitudeLoose", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24573    #[deprecated = "Use `longitude` instead"]
24574    pub longitude_loose: Option<String>,
24575    /// Allowed values: `default`, `parent`, `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
24576    #[serde(rename = "markerColor", default, skip_serializing_if = "serde_json::Value::is_null")]
24577    #[deprecated = "deprecated in the ChurchTools API"]
24578    pub marker_color: serde_json::Value,
24579    /// Use `icon` instead
24580    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24581    #[deprecated = "Use `icon` instead"]
24582    pub marker_icon: Option<String>,
24583    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24584    #[deprecated = "deprecated in the ChurchTools API"]
24585    pub marker_url: Option<String>,
24586    /// Use `name` instead
24587    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24588    #[deprecated = "Use `name` instead"]
24589    pub meeting_at: Option<String>,
24590    /// Use `zip` instead
24591    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24592    #[deprecated = "Use `zip` instead"]
24593    pub postalcode: Option<String>,
24594    /// Fields not described by the spec, e.g. instance-specific DB fields.
24595    #[serde(flatten)]
24596    pub extra: serde_json::Map<String, serde_json::Value>,
24597}
24598
24599#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24600pub struct StoredAddressDeprecated {
24601    /// Allowed values: `latitude`.
24602    #[serde(rename = "geoLat", deserialize_with = "crate::lenient::string")]
24603    pub geo_lat: String,
24604    /// Allowed values: `longitude`.
24605    #[serde(rename = "geoLng", deserialize_with = "crate::lenient::string")]
24606    pub geo_lng: String,
24607    /// Allowed values: `color`.
24608    #[serde(rename = "markerColor", deserialize_with = "crate::lenient::string")]
24609    pub marker_color: String,
24610    /// Allowed values: `icon`.
24611    #[serde(rename = "markerIcon", deserialize_with = "crate::lenient::string")]
24612    pub marker_icon: String,
24613    /// Allowed values: `@deleted use icon and color instead`.
24614    #[serde(rename = "markerUrl", deserialize_with = "crate::lenient::string")]
24615    pub marker_url: String,
24616    /// Allowed values: `name`.
24617    #[serde(rename = "meetingAt", deserialize_with = "crate::lenient::string")]
24618    pub meeting_at: String,
24619    /// Allowed values: `zip`.
24620    #[serde(deserialize_with = "crate::lenient::string")]
24621    pub postalcode: String,
24622    /// Fields not described by the spec, e.g. instance-specific DB fields.
24623    #[serde(flatten)]
24624    pub extra: serde_json::Map<String, serde_json::Value>,
24625}
24626
24627/// Effective notification subscription. origin=default means an explicit stored override; other origins are computed defaults. Deleting an explicit override may reveal an active default again.
24628#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24629pub struct SubscriptionGroup {
24630    /// Translation key for a brief description addressed to the end user.
24631    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24632    pub hint: Option<String>,
24633    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24634    #[serde(rename = "isActive")]
24635    pub is_active: bool,
24636    /// True for a stored override, false for an implicit default or legacy list alias.
24637    #[serde(rename = "isExplicit")]
24638    pub is_explicit: bool,
24639    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24640    #[serde(default, skip_serializing_if = "Option::is_none")]
24641    pub meta: Option<SubscriptionGroupMeta>,
24642    /// Reason this subscription exists; default means an explicit override.
24643    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24644    #[serde(deserialize_with = "crate::lenient::string")]
24645    pub origin: String,
24646    /// Deprecated alias for `hint`.
24647    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24648    #[deprecated = "deprecated in the ChurchTools API"]
24649    pub origin_hint: Option<String>,
24650    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24651    pub person_id: i64,
24652    /// Subject-specific identifier represented as a string, including numeric IDs.
24653    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24654    pub subject_identifier: String,
24655    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24656    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24657    pub options: serde_json::Value,
24658    /// Allowed values: `group`.
24659    #[serde(deserialize_with = "crate::lenient::string")]
24660    pub subject: String,
24661    /// Fields not described by the spec, e.g. instance-specific DB fields.
24662    #[serde(flatten)]
24663    pub extra: serde_json::Map<String, serde_json::Value>,
24664}
24665
24666/// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24667#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24668pub struct SubscriptionGroupMeta {
24669    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
24670    #[serde(rename = "createdDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
24671    pub created_date: Option<chrono::DateTime<chrono::Utc>>,
24672    #[serde(rename = "createdPerson", default, skip_serializing_if = "Option::is_none")]
24673    pub created_person: Option<SubscriptionGroupMetaCreatedPerson>,
24674    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
24675    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
24676    pub modified_date: Option<chrono::DateTime<chrono::Utc>>,
24677    #[serde(rename = "modifiedPerson", default, skip_serializing_if = "Option::is_none")]
24678    pub modified_person: Option<SubscriptionGroupMetaCreatedPerson>,
24679    /// Fields not described by the spec, e.g. instance-specific DB fields.
24680    #[serde(flatten)]
24681    pub extra: serde_json::Map<String, serde_json::Value>,
24682}
24683
24684#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24685pub struct SubscriptionGroupMetaCreatedPerson {
24686    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
24687    pub id: Option<i64>,
24688    /// Fields not described by the spec, e.g. instance-specific DB fields.
24689    #[serde(flatten)]
24690    pub extra: serde_json::Map<String, serde_json::Value>,
24691}
24692
24693/// Legacy list alias for the corresponding canonical root subscription. Prefer the singular canonical subject for new clients.
24694#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24695pub struct SubscriptionLegacyMeetingRequests {
24696    /// Translation key for a brief description addressed to the end user.
24697    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24698    pub hint: Option<String>,
24699    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24700    #[serde(rename = "isActive")]
24701    pub is_active: bool,
24702    /// True for a stored override, false for an implicit default or legacy list alias.
24703    #[serde(rename = "isExplicit")]
24704    pub is_explicit: bool,
24705    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24706    #[serde(default, skip_serializing_if = "Option::is_none")]
24707    pub meta: Option<SubscriptionGroupMeta>,
24708    /// Reason this subscription exists; default means an explicit override.
24709    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24710    #[serde(deserialize_with = "crate::lenient::string")]
24711    pub origin: String,
24712    /// Deprecated alias for `hint`.
24713    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24714    #[deprecated = "deprecated in the ChurchTools API"]
24715    pub origin_hint: Option<String>,
24716    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24717    pub person_id: i64,
24718    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24719    pub subject_identifier: String,
24720    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24721    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24722    pub options: serde_json::Value,
24723    #[serde(deserialize_with = "crate::lenient::string")]
24724    pub subject: String,
24725    /// Fields not described by the spec, e.g. instance-specific DB fields.
24726    #[serde(flatten)]
24727    pub extra: serde_json::Map<String, serde_json::Value>,
24728}
24729
24730/// Legacy list alias for the corresponding canonical root subscription. Prefer the singular canonical subject for new clients.
24731#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24732pub struct SubscriptionLegacyServiceRequests {
24733    /// Translation key for a brief description addressed to the end user.
24734    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24735    pub hint: Option<String>,
24736    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24737    #[serde(rename = "isActive")]
24738    pub is_active: bool,
24739    /// True for a stored override, false for an implicit default or legacy list alias.
24740    #[serde(rename = "isExplicit")]
24741    pub is_explicit: bool,
24742    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24743    #[serde(default, skip_serializing_if = "Option::is_none")]
24744    pub meta: Option<SubscriptionGroupMeta>,
24745    /// Reason this subscription exists; default means an explicit override.
24746    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24747    #[serde(deserialize_with = "crate::lenient::string")]
24748    pub origin: String,
24749    /// Deprecated alias for `hint`.
24750    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24751    #[deprecated = "deprecated in the ChurchTools API"]
24752    pub origin_hint: Option<String>,
24753    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24754    pub person_id: i64,
24755    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24756    pub subject_identifier: String,
24757    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24758    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24759    pub options: serde_json::Value,
24760    #[serde(deserialize_with = "crate::lenient::string")]
24761    pub subject: String,
24762    /// Fields not described by the spec, e.g. instance-specific DB fields.
24763    #[serde(flatten)]
24764    pub extra: serde_json::Map<String, serde_json::Value>,
24765}
24766
24767/// Effective notification subscription. origin=default means an explicit stored override; other origins are computed defaults. Deleting an explicit override may reveal an active default again.
24768#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24769pub struct SubscriptionMeetingRequests {
24770    /// Translation key for a brief description addressed to the end user.
24771    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24772    pub hint: Option<String>,
24773    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24774    #[serde(rename = "isActive")]
24775    pub is_active: bool,
24776    /// True for a stored override, false for an implicit default or legacy list alias.
24777    #[serde(rename = "isExplicit")]
24778    pub is_explicit: bool,
24779    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24780    #[serde(default, skip_serializing_if = "Option::is_none")]
24781    pub meta: Option<SubscriptionGroupMeta>,
24782    /// Reason this subscription exists; default means an explicit override.
24783    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24784    #[serde(deserialize_with = "crate::lenient::string")]
24785    pub origin: String,
24786    /// Deprecated alias for `hint`.
24787    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24788    #[deprecated = "deprecated in the ChurchTools API"]
24789    pub origin_hint: Option<String>,
24790    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24791    pub person_id: i64,
24792    /// Subject-specific identifier represented as a string, including numeric IDs.
24793    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24794    pub subject_identifier: String,
24795    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24796    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24797    pub options: serde_json::Value,
24798    /// Allowed values: `meetingrequest`.
24799    #[serde(deserialize_with = "crate::lenient::string")]
24800    pub subject: String,
24801    /// Fields not described by the spec, e.g. instance-specific DB fields.
24802    #[serde(flatten)]
24803    pub extra: serde_json::Map<String, serde_json::Value>,
24804}
24805
24806/// Effective notification subscription. origin=default means an explicit stored override; other origins are computed defaults. Deleting an explicit override may reveal an active default again.
24807#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24808pub struct SubscriptionPost {
24809    /// Translation key for a brief description addressed to the end user.
24810    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24811    pub hint: Option<String>,
24812    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24813    #[serde(rename = "isActive")]
24814    pub is_active: bool,
24815    /// True for a stored override, false for an implicit default or legacy list alias.
24816    #[serde(rename = "isExplicit")]
24817    pub is_explicit: bool,
24818    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24819    #[serde(default, skip_serializing_if = "Option::is_none")]
24820    pub meta: Option<SubscriptionGroupMeta>,
24821    /// Reason this subscription exists; default means an explicit override.
24822    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24823    #[serde(deserialize_with = "crate::lenient::string")]
24824    pub origin: String,
24825    /// Deprecated alias for `hint`.
24826    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24827    #[deprecated = "deprecated in the ChurchTools API"]
24828    pub origin_hint: Option<String>,
24829    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24830    pub person_id: i64,
24831    /// Subject-specific identifier represented as a string, including numeric IDs.
24832    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24833    pub subject_identifier: String,
24834    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24835    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24836    pub options: serde_json::Value,
24837    /// Allowed values: `post`.
24838    #[serde(deserialize_with = "crate::lenient::string")]
24839    pub subject: String,
24840    /// Fields not described by the spec, e.g. instance-specific DB fields.
24841    #[serde(flatten)]
24842    pub extra: serde_json::Map<String, serde_json::Value>,
24843}
24844
24845/// Effective notification subscription. origin=default means an explicit stored override; other origins are computed defaults. Deleting an explicit override may reveal an active default again.
24846#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24847pub struct SubscriptionPostSummary {
24848    /// Translation key for a brief description addressed to the end user.
24849    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24850    pub hint: Option<String>,
24851    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24852    #[serde(rename = "isActive")]
24853    pub is_active: bool,
24854    /// True for a stored override, false for an implicit default or legacy list alias.
24855    #[serde(rename = "isExplicit")]
24856    pub is_explicit: bool,
24857    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24858    #[serde(default, skip_serializing_if = "Option::is_none")]
24859    pub meta: Option<SubscriptionGroupMeta>,
24860    /// Reason this subscription exists; default means an explicit override.
24861    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24862    #[serde(deserialize_with = "crate::lenient::string")]
24863    pub origin: String,
24864    /// Deprecated alias for `hint`.
24865    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24866    #[deprecated = "deprecated in the ChurchTools API"]
24867    pub origin_hint: Option<String>,
24868    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24869    pub person_id: i64,
24870    /// Subject-specific identifier represented as a string, including numeric IDs.
24871    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24872    pub subject_identifier: String,
24873    pub options: SubscriptionPostSummaryOptions,
24874    /// Allowed values: `post_summary`.
24875    #[serde(deserialize_with = "crate::lenient::string")]
24876    pub subject: String,
24877    /// Fields not described by the spec, e.g. instance-specific DB fields.
24878    #[serde(flatten)]
24879    pub extra: serde_json::Map<String, serde_json::Value>,
24880}
24881
24882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24883pub struct SubscriptionPostSummaryOptions {
24884    /// Allowed values: `all`, `featured_groups`, `my_campus`, `my_groups`.
24885    #[serde(deserialize_with = "crate::lenient::string")]
24886    pub filter: String,
24887    pub weekdays: Vec<serde_json::Value>,
24888    /// Fields not described by the spec, e.g. instance-specific DB fields.
24889    #[serde(flatten)]
24890    pub extra: serde_json::Map<String, serde_json::Value>,
24891}
24892
24893/// Effective notification subscription. origin=default means an explicit stored override; other origins are computed defaults. Deleting an explicit override may reveal an active default again.
24894#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24895pub struct SubscriptionPublicChannel {
24896    /// Translation key for a brief description addressed to the end user.
24897    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24898    pub hint: Option<String>,
24899    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24900    #[serde(rename = "isActive")]
24901    pub is_active: bool,
24902    /// True for a stored override, false for an implicit default or legacy list alias.
24903    #[serde(rename = "isExplicit")]
24904    pub is_explicit: bool,
24905    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24906    #[serde(default, skip_serializing_if = "Option::is_none")]
24907    pub meta: Option<SubscriptionGroupMeta>,
24908    /// Reason this subscription exists; default means an explicit override.
24909    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24910    #[serde(deserialize_with = "crate::lenient::string")]
24911    pub origin: String,
24912    /// Deprecated alias for `hint`.
24913    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24914    #[deprecated = "deprecated in the ChurchTools API"]
24915    pub origin_hint: Option<String>,
24916    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24917    pub person_id: i64,
24918    /// Subject-specific identifier represented as a string, including numeric IDs.
24919    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24920    pub subject_identifier: String,
24921    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24922    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24923    pub options: serde_json::Value,
24924    /// Allowed values: `public_channel`.
24925    #[serde(deserialize_with = "crate::lenient::string")]
24926    pub subject: String,
24927    /// Fields not described by the spec, e.g. instance-specific DB fields.
24928    #[serde(flatten)]
24929    pub extra: serde_json::Map<String, serde_json::Value>,
24930}
24931
24932/// Effective notification subscription. origin=default means an explicit stored override; other origins are computed defaults. Deleting an explicit override may reveal an active default again.
24933#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24934pub struct SubscriptionResource {
24935    /// Translation key for a brief description addressed to the end user.
24936    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24937    pub hint: Option<String>,
24938    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24939    #[serde(rename = "isActive")]
24940    pub is_active: bool,
24941    /// True for a stored override, false for an implicit default or legacy list alias.
24942    #[serde(rename = "isExplicit")]
24943    pub is_explicit: bool,
24944    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24945    #[serde(default, skip_serializing_if = "Option::is_none")]
24946    pub meta: Option<SubscriptionGroupMeta>,
24947    /// Reason this subscription exists; default means an explicit override.
24948    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24949    #[serde(deserialize_with = "crate::lenient::string")]
24950    pub origin: String,
24951    /// Deprecated alias for `hint`.
24952    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24953    #[deprecated = "deprecated in the ChurchTools API"]
24954    pub origin_hint: Option<String>,
24955    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24956    pub person_id: i64,
24957    /// root for the resource notification umbrella, or a resource ID as a string. Read results are filtered to administrable resources.
24958    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24959    pub subject_identifier: String,
24960    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
24961    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
24962    pub options: serde_json::Value,
24963    /// Allowed values: `resource`.
24964    #[serde(deserialize_with = "crate::lenient::string")]
24965    pub subject: String,
24966    /// Fields not described by the spec, e.g. instance-specific DB fields.
24967    #[serde(flatten)]
24968    pub extra: serde_json::Map<String, serde_json::Value>,
24969}
24970
24971/// Effective notification subscription. origin=default means an explicit stored override; other origins are computed defaults. Deleting an explicit override may reveal an active default again.
24972#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
24973pub struct SubscriptionServiceRequests {
24974    /// Translation key for a brief description addressed to the end user.
24975    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24976    pub hint: Option<String>,
24977    /// Whether this subscription enables notifications; inactive overrides can suppress an active implicit default.
24978    #[serde(rename = "isActive")]
24979    pub is_active: bool,
24980    /// True for a stored override, false for an implicit default or legacy list alias.
24981    #[serde(rename = "isExplicit")]
24982    pub is_explicit: bool,
24983    /// Audit metadata for explicit overrides; null for implicit defaults and legacy aliases.
24984    #[serde(default, skip_serializing_if = "Option::is_none")]
24985    pub meta: Option<SubscriptionGroupMeta>,
24986    /// Reason this subscription exists; default means an explicit override.
24987    /// Allowed values: `default`, `group-settings`, `meetingrequests-default`, `post-summary-default`, `resource-admin`, `resource-permission`, `resource-root-default`, `servicerequests-default`.
24988    #[serde(deserialize_with = "crate::lenient::string")]
24989    pub origin: String,
24990    /// Deprecated alias for `hint`.
24991    #[serde(rename = "originHint", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
24992    #[deprecated = "deprecated in the ChurchTools API"]
24993    pub origin_hint: Option<String>,
24994    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
24995    pub person_id: i64,
24996    /// Subject-specific identifier represented as a string, including numeric IDs.
24997    #[serde(rename = "subjectIdentifier", deserialize_with = "crate::lenient::string")]
24998    pub subject_identifier: String,
24999    /// Subject-specific options; null when none are stored. Most subjects do not interpret these options.
25000    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25001    pub options: serde_json::Value,
25002    /// Allowed values: `servicerequest`.
25003    #[serde(deserialize_with = "crate::lenient::string")]
25004    pub subject: String,
25005    /// Fields not described by the spec, e.g. instance-specific DB fields.
25006    #[serde(flatten)]
25007    pub extra: serde_json::Map<String, serde_json::Value>,
25008}
25009
25010/// Explicit override. Subject and identifier come from the path. post_summary requires PostSummarySubscriptionOptions; other subjects accept optional opaque options.
25011#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25012pub struct SubscriptionUpdate {
25013    /// Omission enables the override, including when replacing an existing inactive setting.
25014    #[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")]
25015    pub is_active: Option<bool>,
25016    /// Required structured email-summary options for post_summary. For other subjects, omission clears stored options.
25017    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25018    pub options: serde_json::Value,
25019    /// Fields not described by the spec, e.g. instance-specific DB fields.
25020    #[serde(flatten)]
25021    pub extra: serde_json::Map<String, serde_json::Value>,
25022}
25023
25024#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25025pub struct SumBalanceReportCreate {
25026    /// Accepted by the shared validator but ignored by the sum-balance report.
25027    ///
25028    /// `None` leaves the field out, `Some(None)` sends `null`.
25029    #[serde(rename = "accountTypes", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25030    pub account_types: Option<Option<Vec<i64>>>,
25031    /// Accounting period owning the accounts. Requires finance edit masterdata or explicit view/edit permission for this period.
25032    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
25033    pub accounting_period_id: i64,
25034    /// PDF creates a file and returns its URL with HTTP 201. CSV/XLSX return the file directly with HTTP 200. Accept: text/html overrides this selection.
25035    /// Allowed values: `csv`, `pdf`, `xlsx`.
25036    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25037    pub format: Option<String>,
25038    /// Calendar month in the year of the accounting period’s start date. The report includes month totals and cumulative totals from January.
25039    #[serde(deserialize_with = "crate::lenient::number")]
25040    pub month: i64,
25041    /// Include account-group grouping/columns in the report.
25042    #[serde(rename = "showAccountGroups", default, skip_serializing_if = "Option::is_none")]
25043    pub show_account_groups: Option<bool>,
25044    /// Include zero-value accounts according to the selected report’s balance/activity calculation.
25045    #[serde(rename = "showEmptyAccounts", default, skip_serializing_if = "Option::is_none")]
25046    pub show_empty_accounts: Option<bool>,
25047    /// Fields not described by the spec, e.g. instance-specific DB fields.
25048    #[serde(flatten)]
25049    pub extra: serde_json::Map<String, serde_json::Value>,
25050}
25051
25052/// Registered adapter service with a masked `token`.
25053#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25054pub struct SyncAdapter {
25055    /// Unique adapter lookup name used by external systems and the proxy.
25056    #[serde(deserialize_with = "crate::lenient::string")]
25057    pub name: String,
25058    /// Fixed mask; the stored token is not returned.
25059    #[serde(deserialize_with = "crate::lenient::string")]
25060    pub token: String,
25061    /// Base URL of the adapter service.
25062    #[serde(deserialize_with = "crate::lenient::string")]
25063    pub url: String,
25064    /// Adapter ID
25065    #[serde(deserialize_with = "crate::lenient::number")]
25066    pub id: i64,
25067    /// Fields not described by the spec, e.g. instance-specific DB fields.
25068    #[serde(flatten)]
25069    pub extra: serde_json::Map<String, serde_json::Value>,
25070}
25071
25072/// Registration of a sync adapter service. Names are configured by the installation, not a fixed list of vendors.
25073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25074pub struct SyncAdapterCreate {
25075    /// Unique adapter lookup name used by external systems and the proxy.
25076    #[serde(deserialize_with = "crate::lenient::string")]
25077    pub name: String,
25078    /// Authentication token sent to the adapter.
25079    #[serde(deserialize_with = "crate::lenient::string")]
25080    pub token: String,
25081    /// Base URL of the adapter service.
25082    #[serde(deserialize_with = "crate::lenient::string")]
25083    pub url: String,
25084    /// Fields not described by the spec, e.g. instance-specific DB fields.
25085    #[serde(flatten)]
25086    pub extra: serde_json::Map<String, serde_json::Value>,
25087}
25088
25089/// Replaces the adapter name, URL and authentication token.
25090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25091pub struct SyncAdapterUpdate {
25092    /// Unique adapter lookup name used by external systems and the proxy.
25093    #[serde(deserialize_with = "crate::lenient::string")]
25094    pub name: String,
25095    /// Authentication token sent to the adapter.
25096    #[serde(deserialize_with = "crate::lenient::string")]
25097    pub token: String,
25098    /// Base URL of the adapter service.
25099    #[serde(deserialize_with = "crate::lenient::string")]
25100    pub url: String,
25101    /// Fields not described by the spec, e.g. instance-specific DB fields.
25102    #[serde(flatten)]
25103    pub extra: serde_json::Map<String, serde_json::Value>,
25104}
25105
25106#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25107pub struct SyncConflictCreate {
25108    pub data: Vec<SyncConflictDataCreate>,
25109    /// Relationship affected by the conflict.
25110    #[serde(rename = "entityMappingId", deserialize_with = "crate::lenient::number")]
25111    pub entity_mapping_id: i64,
25112    /// Identifier of the sync job run that produced the conflict; not the numeric job configuration ID.
25113    #[serde(rename = "jobId", deserialize_with = "crate::lenient::string")]
25114    pub job_id: String,
25115    /// Conflict category. Values use underscores and are case-sensitive; CT denotes ChurchTools.
25116    /// Allowed values: `create`, `delete_or_create`, `duplicate_in_CT`, `duplicate_in_source`, `link_and_update`, `update`.
25117    #[serde(deserialize_with = "crate::lenient::string")]
25118    pub r#type: String,
25119    /// Fields not described by the spec, e.g. instance-specific DB fields.
25120    #[serde(flatten)]
25121    pub extra: serde_json::Map<String, serde_json::Value>,
25122}
25123
25124#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25125pub struct SyncConflictData {
25126    /// Conflict-specific data key.
25127    #[serde(deserialize_with = "crate::lenient::string")]
25128    pub key: String,
25129    /// Conflict-specific value.
25130    #[serde(deserialize_with = "crate::lenient::string")]
25131    pub value: String,
25132    /// Fields not described by the spec, e.g. instance-specific DB fields.
25133    #[serde(flatten)]
25134    pub extra: serde_json::Map<String, serde_json::Value>,
25135}
25136
25137#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25138pub struct SyncConflictDataCreate {
25139    #[serde(deserialize_with = "crate::lenient::string")]
25140    pub key: String,
25141    #[serde(deserialize_with = "crate::lenient::string")]
25142    pub value: String,
25143    /// Fields not described by the spec, e.g. instance-specific DB fields.
25144    #[serde(flatten)]
25145    pub extra: serde_json::Map<String, serde_json::Value>,
25146}
25147
25148/// Replace conflict classification, job, entity mapping and the complete data list.
25149#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25150pub struct SyncConflictUpdate {
25151    pub data: Vec<SyncConflictDataCreate>,
25152    /// Relationship affected by the conflict.
25153    #[serde(rename = "entityMappingId", deserialize_with = "crate::lenient::number")]
25154    pub entity_mapping_id: i64,
25155    /// Identifier of the sync job run that produced the conflict; not the numeric job configuration ID.
25156    #[serde(rename = "jobId", deserialize_with = "crate::lenient::string")]
25157    pub job_id: String,
25158    /// Conflict category. Values use underscores and are case-sensitive; CT denotes ChurchTools.
25159    /// Allowed values: `create`, `delete_or_create`, `duplicate_in_CT`, `duplicate_in_source`, `link_and_update`, `update`.
25160    #[serde(deserialize_with = "crate::lenient::string")]
25161    pub r#type: String,
25162    /// Fields not described by the spec, e.g. instance-specific DB fields.
25163    #[serde(flatten)]
25164    pub extra: serde_json::Map<String, serde_json::Value>,
25165}
25166
25167/// Stored conflict record. Updating or deleting this record does not itself synchronize or resolve the underlying entities.
25168#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25169pub struct SyncConflicts {
25170    pub data: Vec<SyncConflictData>,
25171    /// Relationship affected by the conflict.
25172    #[serde(rename = "entityMappingId", deserialize_with = "crate::lenient::number")]
25173    pub entity_mapping_id: i64,
25174    /// Conflict ID
25175    #[serde(deserialize_with = "crate::lenient::number")]
25176    pub id: i64,
25177    /// Identifier of the sync job run that produced the conflict; not the numeric job configuration ID.
25178    #[serde(rename = "jobId", deserialize_with = "crate::lenient::string")]
25179    pub job_id: String,
25180    pub meta: MetaDataEntityId,
25181    /// Conflict category. Values use underscores and are case-sensitive; CT denotes ChurchTools.
25182    /// Allowed values: `create`, `delete_or_create`, `duplicate_in_CT`, `duplicate_in_source`, `link_and_update`, `update`.
25183    #[serde(deserialize_with = "crate::lenient::string")]
25184    pub r#type: String,
25185    /// Fields not described by the spec, e.g. instance-specific DB fields.
25186    #[serde(flatten)]
25187    pub extra: serde_json::Map<String, serde_json::Value>,
25188}
25189
25190/// Stored link between a ChurchTools entity and an external record; deleting it does not delete either record.
25191#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25192pub struct SyncEntityMapping {
25193    /// ChurchTools entity ID as text.
25194    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25195    pub domain_id: Option<String>,
25196    /// ChurchTools domain types accepted by entity and field mapping validation. Adapter support can be a smaller subset.
25197    /// 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`, ….
25198    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25199    pub domain_type: String,
25200    /// Mapping ID
25201    #[serde(deserialize_with = "crate::lenient::number")]
25202    pub id: i64,
25203    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25204    #[serde(rename = "lastSyncedDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25205    pub last_synced_date: Option<chrono::DateTime<chrono::Utc>>,
25206    pub meta: MetaDataEntityId,
25207    /// Adapter-specific context key.
25208    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25209    pub scope: Option<String>,
25210    /// ID in the external system.
25211    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25212    pub source_entity_id: Option<String>,
25213    /// External connection ID (the source system).
25214    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::number")]
25215    pub source_id: i64,
25216    /// State of the relationship: synchronized, unresolved conflict, or deleted in ChurchTools.
25217    /// Allowed values: `conflict`, `deleted in CT`, `synced`.
25218    #[serde(deserialize_with = "crate::lenient::string")]
25219    pub status: String,
25220    /// Fields not described by the spec, e.g. instance-specific DB fields.
25221    #[serde(flatten)]
25222    pub extra: serde_json::Map<String, serde_json::Value>,
25223}
25224
25225/// Persists a record relationship. Provided ChurchTools or external IDs must not be linked for the same domain and source.
25226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25227pub struct SyncEntityMappingCreate {
25228    /// ChurchTools entity ID as text.
25229    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25230    pub domain_id: Option<String>,
25231    /// ChurchTools domain types accepted by entity and field mapping validation. Adapter support can be a smaller subset.
25232    /// 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`, ….
25233    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25234    pub domain_type: String,
25235    /// Last synchronization timestamp. Prefer an explicit timezone.
25236    ///
25237    /// `None` leaves the field out, `Some(None)` sends `null`.
25238    #[serde(rename = "lastSyncedDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
25239    pub last_synced_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
25240    /// Adapter-specific context key.
25241    ///
25242    /// `None` leaves the field out, `Some(None)` sends `null`.
25243    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25244    pub scope: Option<Option<String>>,
25245    /// ID in the external system.
25246    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25247    pub source_entity_id: Option<String>,
25248    /// External connection ID (the source system).
25249    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::number")]
25250    pub source_id: i64,
25251    /// State of the relationship: synchronized, unresolved conflict, or deleted in ChurchTools.
25252    /// Allowed values: `conflict`, `deleted in CT`, `synced`.
25253    #[serde(deserialize_with = "crate::lenient::string")]
25254    pub status: String,
25255    /// Fields not described by the spec, e.g. instance-specific DB fields.
25256    #[serde(flatten)]
25257    pub extra: serde_json::Map<String, serde_json::Value>,
25258}
25259
25260/// Replaces a record relationship.
25261#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25262pub struct SyncEntityMappingUpdate {
25263    /// ChurchTools entity ID as text.
25264    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25265    pub domain_id: Option<String>,
25266    /// ChurchTools domain types accepted by entity and field mapping validation. Adapter support can be a smaller subset.
25267    /// 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`, ….
25268    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25269    pub domain_type: String,
25270    /// Last synchronization timestamp. Prefer an explicit timezone.
25271    ///
25272    /// `None` leaves the field out, `Some(None)` sends `null`.
25273    #[serde(rename = "lastSyncedDate", deserialize_with = "crate::lenient::double_option", serialize_with = "crate::datetime::serialize_double_opt_utc", default, skip_serializing_if = "Option::is_none")]
25274    pub last_synced_date: Option<Option<chrono::DateTime<chrono::Utc>>>,
25275    /// Adapter-specific context key.
25276    ///
25277    /// `None` leaves the field out, `Some(None)` sends `null`.
25278    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25279    pub scope: Option<Option<String>>,
25280    /// ID in the external system.
25281    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25282    pub source_entity_id: Option<String>,
25283    /// External connection ID (the source system).
25284    #[serde(rename = "sourceId", deserialize_with = "crate::lenient::number")]
25285    pub source_id: i64,
25286    /// State of the relationship: synchronized, unresolved conflict, or deleted in ChurchTools.
25287    /// Allowed values: `conflict`, `deleted in CT`, `synced`.
25288    #[serde(deserialize_with = "crate::lenient::string")]
25289    pub status: String,
25290    /// Fields not described by the spec, e.g. instance-specific DB fields.
25291    #[serde(flatten)]
25292    pub extra: serde_json::Map<String, serde_json::Value>,
25293}
25294
25295#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25296pub struct SyncExecutionBehavior {
25297    pub create: SyncExecutionBehaviorCreate,
25298    pub delete: SyncExecutionBehaviorDelete,
25299    pub link: SyncExecutionBehaviorLink,
25300    pub update: SyncExecutionBehaviorUpdate,
25301    /// Fields not described by the spec, e.g. instance-specific DB fields.
25302    #[serde(flatten)]
25303    pub extra: serde_json::Map<String, serde_json::Value>,
25304}
25305
25306#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25307pub struct SyncExecutionBehaviorCreate {
25308    /// Whether records may be created or updated.
25309    /// Allowed values: `always`, `never`.
25310    #[serde(rename = "behaviorES", deserialize_with = "crate::lenient::string")]
25311    pub behavior_es: String,
25312    /// Whether records may be created or updated.
25313    /// Allowed values: `always`, `never`.
25314    #[serde(rename = "behaviorMaster", deserialize_with = "crate::lenient::string")]
25315    pub behavior_master: String,
25316    /// Adapter-specific JSON object or list.
25317    #[serde(rename = "defaultsES", default, skip_serializing_if = "serde_json::Value::is_null")]
25318    pub defaults_es: serde_json::Value,
25319    /// Adapter-specific JSON object or list.
25320    #[serde(rename = "defaultsMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25321    pub defaults_master: serde_json::Value,
25322    /// Fields not described by the spec, e.g. instance-specific DB fields.
25323    #[serde(flatten)]
25324    pub extra: serde_json::Map<String, serde_json::Value>,
25325}
25326
25327#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25328pub struct SyncExecutionBehaviorDelete {
25329    /// How deletions are handled on the specified side: retain, archive or delete.
25330    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25331    #[serde(rename = "behaviorES", deserialize_with = "crate::lenient::string")]
25332    pub behavior_es: String,
25333    /// How deletions are handled on the specified side: retain, archive or delete.
25334    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25335    #[serde(rename = "behaviorMaster", deserialize_with = "crate::lenient::string")]
25336    pub behavior_master: String,
25337    /// Fields not described by the spec, e.g. instance-specific DB fields.
25338    #[serde(flatten)]
25339    pub extra: serde_json::Map<String, serde_json::Value>,
25340}
25341
25342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25343pub struct SyncExecutionBehaviorLink {
25344    /// Whether matching records are linked: never, use an existing record, or merge when linking.
25345    /// Allowed values: `alwaysMerge`, `alwaysUse`, `never`.
25346    #[serde(deserialize_with = "crate::lenient::string")]
25347    pub behavior: String,
25348    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25349    /// Allowed values: `es`, `lastUpdated`, `master`.
25350    #[serde(deserialize_with = "crate::lenient::string")]
25351    pub data: String,
25352    /// Fields not described by the spec, e.g. instance-specific DB fields.
25353    #[serde(flatten)]
25354    pub extra: serde_json::Map<String, serde_json::Value>,
25355}
25356
25357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25358pub struct SyncExecutionBehaviorUpdate {
25359    /// Whether records may be created or updated.
25360    /// Allowed values: `always`, `never`.
25361    #[serde(deserialize_with = "crate::lenient::string")]
25362    pub behavior: String,
25363    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25364    /// Allowed values: `es`, `lastUpdated`, `master`.
25365    #[serde(deserialize_with = "crate::lenient::string")]
25366    pub data: String,
25367    /// Fields not described by the spec, e.g. instance-specific DB fields.
25368    #[serde(flatten)]
25369    pub extra: serde_json::Map<String, serde_json::Value>,
25370}
25371
25372#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25373pub struct SyncExecutionCounts {
25374    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25375    pub create: Option<i64>,
25376    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25377    pub delete: Option<i64>,
25378    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25379    pub link: Option<i64>,
25380    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25381    pub update: Option<i64>,
25382    /// Fields not described by the spec, e.g. instance-specific DB fields.
25383    #[serde(flatten)]
25384    pub extra: serde_json::Map<String, serde_json::Value>,
25385}
25386
25387#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25388pub struct SyncExecutionCreate {
25389    /// Schedule a dry run; the worker is instructed not to change synchronized records.
25390    #[serde(rename = "isDryRun", default, skip_serializing_if = "Option::is_none")]
25391    pub is_dry_run: Option<bool>,
25392    /// Schedule configuration validation only.
25393    #[serde(rename = "isValidationOnly", default, skip_serializing_if = "Option::is_none")]
25394    pub is_validation_only: Option<bool>,
25395    /// Fields not described by the spec, e.g. instance-specific DB fields.
25396    #[serde(flatten)]
25397    pub extra: serde_json::Map<String, serde_json::Value>,
25398}
25399
25400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25401pub struct SyncExecutionDetails {
25402    /// Domain saved with this execution.
25403    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25404    pub domain_type: String,
25405    /// Filter snapshot indexed by domain, then by ES and Master.
25406    #[serde(deserialize_with = "crate::lenient::map")]
25407    pub filter: std::collections::BTreeMap<String, SyncExecutionDetailsFilterValue>,
25408    /// Numeric job configuration ID.
25409    #[serde(rename = "jobId", deserialize_with = "crate::lenient::number")]
25410    pub job_id: i64,
25411    /// Mapping snapshot indexed by the configured domain name.
25412    #[serde(deserialize_with = "crate::lenient::map")]
25413    pub mapping: std::collections::BTreeMap<String, SyncExecutionMapping>,
25414    #[serde(rename = "syncBehavior")]
25415    pub sync_behavior: SyncExecutionBehavior,
25416    #[serde(rename = "systemES")]
25417    pub system_es: SyncExecutionDetailsSystemES,
25418    /// Adapter credentials are removed from this snapshot.
25419    #[serde(rename = "systemMaster")]
25420    pub system_master: Vec<serde_json::Value>,
25421    #[serde(rename = "validationOnly")]
25422    pub validation_only: bool,
25423    /// Fields not described by the spec, e.g. instance-specific DB fields.
25424    #[serde(flatten)]
25425    pub extra: serde_json::Map<String, serde_json::Value>,
25426}
25427
25428#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25429pub struct SyncExecutionDetailsFilterValue {
25430    #[serde(rename = "ES")]
25431    pub es: Vec<SyncJobFilter>,
25432    #[serde(rename = "Master")]
25433    pub master: Vec<SyncJobFilter>,
25434    /// Fields not described by the spec, e.g. instance-specific DB fields.
25435    #[serde(flatten)]
25436    pub extra: serde_json::Map<String, serde_json::Value>,
25437}
25438
25439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25440pub struct SyncExecutionDetailsSystemES {
25441    /// External connection ID.
25442    #[serde(rename = "systemId", deserialize_with = "crate::lenient::number")]
25443    pub system_id: i64,
25444    /// External connection name.
25445    #[serde(rename = "systemName", deserialize_with = "crate::lenient::string")]
25446    pub system_name: String,
25447    /// Fields not described by the spec, e.g. instance-specific DB fields.
25448    #[serde(flatten)]
25449    pub extra: serde_json::Map<String, serde_json::Value>,
25450}
25451
25452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25453pub struct SyncExecutionMapping {
25454    #[serde(rename = "propertyMappingsESToMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25455    pub property_mappings_es_to_master: serde_json::Value,
25456    #[serde(rename = "propertyMappingsMasterToES", default, skip_serializing_if = "serde_json::Value::is_null")]
25457    pub property_mappings_master_to_es: serde_json::Value,
25458    /// Fields not described by the spec, e.g. instance-specific DB fields.
25459    #[serde(flatten)]
25460    pub extra: serde_json::Map<String, serde_json::Value>,
25461}
25462
25463/// Stored directional field mapping. No separate entry ID is returned.
25464#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25465pub struct SyncExecutionProperty {
25466    /// Source field name supported by the adapter.
25467    #[serde(deserialize_with = "crate::lenient::string")]
25468    pub from: String,
25469    /// Adapter-specific source-field qualifier.
25470    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25471    pub from_filter: String,
25472    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25473    pub others: serde_json::Value,
25474    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25475    /// Allowed values: `es`, `master`.
25476    #[serde(deserialize_with = "crate::lenient::string")]
25477    pub system: String,
25478    /// Target field name supported by the adapter.
25479    #[serde(deserialize_with = "crate::lenient::string")]
25480    pub to: String,
25481    /// Adapter-specific target-field qualifier.
25482    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25483    pub to_filter: String,
25484    #[serde(rename = "valueMapping", default, skip_serializing_if = "serde_json::Value::is_null")]
25485    pub value_mapping: serde_json::Value,
25486    /// Fields not described by the spec, e.g. instance-specific DB fields.
25487    #[serde(flatten)]
25488    pub extra: serde_json::Map<String, serde_json::Value>,
25489}
25490
25491#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25492pub struct SyncExecutionSummary {
25493    pub both: SyncExecutionCounts,
25494    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25495    #[serde(rename = "createdDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25496    pub created_date: Option<chrono::DateTime<chrono::Utc>>,
25497    /// Latest log timestamp; this is not necessarily a completion timestamp.
25498    #[serde(rename = "endDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25499    pub end_date: Option<chrono::DateTime<chrono::Utc>>,
25500    #[serde(rename = "errorCount", deserialize_with = "crate::lenient::number")]
25501    pub error_count: i64,
25502    pub es: SyncExecutionCounts,
25503    /// Background execution ID.
25504    #[serde(rename = "executionId", deserialize_with = "crate::lenient::string")]
25505    pub execution_id: String,
25506    #[serde(rename = "isDryRun")]
25507    pub is_dry_run: bool,
25508    /// Numeric sync job configuration ID.
25509    #[serde(rename = "jobId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25510    pub job_id: Option<i64>,
25511    pub master: SyncExecutionCounts,
25512    /// Earliest log timestamp.
25513    #[serde(rename = "startDate", deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
25514    pub start_date: Option<chrono::DateTime<chrono::Utc>>,
25515    /// Background execution status, distinct from entity mapping status.
25516    /// Allowed values: `CANCELED`, `DONE`, `ERROR`, `IN_PROGRESS`, `QUEUED`.
25517    #[serde(deserialize_with = "crate::lenient::string")]
25518    pub status: String,
25519    /// Fields not described by the spec, e.g. instance-specific DB fields.
25520    #[serde(flatten)]
25521    pub extra: serde_json::Map<String, serde_json::Value>,
25522}
25523
25524/// Proposed connection settings to test. `id` loads an existing connection and merges the supplied headers before testing; connection configuration is not saved.
25525#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25526pub struct SyncExternalSystemTestCreate {
25527    /// Adapter-specific HTTP header values used to access the external system.
25528    #[serde(rename = "accessHeaderValues", default, skip_serializing_if = "serde_json::Value::is_null")]
25529    pub access_header_values: serde_json::Value,
25530    /// Name of a registered adapter from `/sync/adapters`. Custom adapter names are supported.
25531    #[serde(deserialize_with = "crate::lenient::string")]
25532    pub adapter: String,
25533    /// Display name of the external connection.
25534    #[serde(deserialize_with = "crate::lenient::string")]
25535    pub name: String,
25536    /// Existing connection to base the test on.
25537    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
25538    pub id: Option<i64>,
25539    /// Fields not described by the spec, e.g. instance-specific DB fields.
25540    #[serde(flatten)]
25541    pub extra: serde_json::Map<String, serde_json::Value>,
25542}
25543
25544#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25545pub struct SyncFieldMappingEntries {
25546    #[serde(rename = "propertyMappingsESToMaster")]
25547    pub property_mappings_es_to_master: Vec<FieldMappingEntry>,
25548    #[serde(rename = "propertyMappingsMasterToES")]
25549    pub property_mappings_master_to_es: Vec<FieldMappingEntry>,
25550    /// Fields not described by the spec, e.g. instance-specific DB fields.
25551    #[serde(flatten)]
25552    pub extra: serde_json::Map<String, serde_json::Value>,
25553}
25554
25555#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25556pub struct SyncFieldMappingEntryCreate {
25557    /// Source field name supported by the adapter.
25558    #[serde(deserialize_with = "crate::lenient::string")]
25559    pub from: String,
25560    /// Adapter-specific source-field qualifier.
25561    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25562    pub from_filter: String,
25563    /// Adapter-specific JSON object or list.
25564    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25565    pub others: serde_json::Value,
25566    /// Target field name supported by the adapter.
25567    #[serde(deserialize_with = "crate::lenient::string")]
25568    pub to: String,
25569    /// Adapter-specific target-field qualifier.
25570    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25571    pub to_filter: String,
25572    /// Adapter-specific JSON object or list.
25573    #[serde(rename = "valueMapping", default, skip_serializing_if = "serde_json::Value::is_null")]
25574    pub value_mapping: serde_json::Value,
25575    /// Fields not described by the spec, e.g. instance-specific DB fields.
25576    #[serde(flatten)]
25577    pub extra: serde_json::Map<String, serde_json::Value>,
25578}
25579
25580/// Replaces both direction lists. The enclosing list sets `system`.
25581#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25582pub struct SyncFieldMappingUpdate {
25583    #[serde(rename = "propertyMappingsESToMaster")]
25584    pub property_mappings_es_to_master: Vec<SyncFieldMappingEntryCreate>,
25585    #[serde(rename = "propertyMappingsMasterToES")]
25586    pub property_mappings_master_to_es: Vec<SyncFieldMappingEntryCreate>,
25587    /// Fields not described by the spec, e.g. instance-specific DB fields.
25588    #[serde(flatten)]
25589    pub extra: serde_json::Map<String, serde_json::Value>,
25590}
25591
25592#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25593pub struct SyncJobConfigurationCreate {
25594    /// Whether the periodic scheduler can start this job.
25595    #[serde(rename = "autoScheduleEnabled")]
25596    pub auto_schedule_enabled: bool,
25597    /// Whether records may be created or updated.
25598    /// Allowed values: `always`, `never`.
25599    #[serde(rename = "createBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25600    pub create_behavior_es: Option<String>,
25601    /// Whether records may be created or updated.
25602    /// Allowed values: `always`, `never`.
25603    #[serde(rename = "createBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25604    pub create_behavior_master: Option<String>,
25605    #[serde(rename = "createDefaultsES", default, skip_serializing_if = "serde_json::Value::is_null")]
25606    pub create_defaults_es: serde_json::Value,
25607    #[serde(rename = "createDefaultsMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25608    pub create_defaults_master: serde_json::Value,
25609    /// How deletions are handled on the specified side: retain, archive or delete.
25610    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25611    #[serde(rename = "deleteBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25612    pub delete_behavior_es: Option<String>,
25613    /// How deletions are handled on the specified side: retain, archive or delete.
25614    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25615    #[serde(rename = "deleteBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25616    pub delete_behavior_master: Option<String>,
25617    /// Domain supported by the adapter, such as person. Job configuration accepts adapter-specific domain names.
25618    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25619    pub domain_type: String,
25620    /// Whether matching records are linked: never, use an existing record, or merge when linking.
25621    /// Allowed values: `alwaysMerge`, `alwaysUse`, `never`.
25622    #[serde(rename = "linkBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25623    pub link_behavior: Option<String>,
25624    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25625    /// Allowed values: `es`, `lastUpdated`, `master`.
25626    #[serde(rename = "linkData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25627    pub link_data: Option<String>,
25628    /// Job display name.
25629    #[serde(deserialize_with = "crate::lenient::string")]
25630    pub name: String,
25631    /// Whether records may be created or updated.
25632    /// Allowed values: `always`, `never`.
25633    #[serde(rename = "updateBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25634    pub update_behavior: Option<String>,
25635    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25636    /// Allowed values: `es`, `lastUpdated`, `master`.
25637    #[serde(rename = "updateData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25638    pub update_data: Option<String>,
25639    /// Fields not described by the spec, e.g. instance-specific DB fields.
25640    #[serde(flatten)]
25641    pub extra: serde_json::Map<String, serde_json::Value>,
25642}
25643
25644/// Updates the job configuration.
25645#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25646pub struct SyncJobConfigurationUpdate {
25647    /// Whether the periodic scheduler can start this job.
25648    #[serde(rename = "autoScheduleEnabled")]
25649    pub auto_schedule_enabled: bool,
25650    /// Whether records may be created or updated.
25651    /// Allowed values: `always`, `never`.
25652    #[serde(rename = "createBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25653    pub create_behavior_es: Option<String>,
25654    /// Whether records may be created or updated.
25655    /// Allowed values: `always`, `never`.
25656    #[serde(rename = "createBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25657    pub create_behavior_master: Option<String>,
25658    /// Adapter-specific defaults for newly created records on this side.
25659    #[serde(rename = "createDefaultsES", default, skip_serializing_if = "serde_json::Value::is_null")]
25660    pub create_defaults_es: serde_json::Value,
25661    /// Adapter-specific defaults for newly created records on this side.
25662    #[serde(rename = "createDefaultsMaster", default, skip_serializing_if = "serde_json::Value::is_null")]
25663    pub create_defaults_master: serde_json::Value,
25664    /// How deletions are handled on the specified side: retain, archive or delete.
25665    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25666    #[serde(rename = "deleteBehaviorES", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25667    pub delete_behavior_es: Option<String>,
25668    /// How deletions are handled on the specified side: retain, archive or delete.
25669    /// Allowed values: `alwaysArchive`, `alwaysDelete`, `never`.
25670    #[serde(rename = "deleteBehaviorMaster", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25671    pub delete_behavior_master: Option<String>,
25672    /// Domain supported by the adapter, such as person. Job configuration accepts adapter-specific domain names.
25673    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25674    pub domain_type: String,
25675    /// Whether matching records are linked: never, use an existing record, or merge when linking.
25676    /// Allowed values: `alwaysMerge`, `alwaysUse`, `never`.
25677    #[serde(rename = "linkBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25678    pub link_behavior: Option<String>,
25679    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25680    /// Allowed values: `es`, `lastUpdated`, `master`.
25681    #[serde(rename = "linkData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25682    pub link_data: Option<String>,
25683    /// Job display name.
25684    #[serde(deserialize_with = "crate::lenient::string")]
25685    pub name: String,
25686    /// Whether records may be created or updated.
25687    /// Allowed values: `always`, `never`.
25688    #[serde(rename = "updateBehavior", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25689    pub update_behavior: Option<String>,
25690    /// Which side supplies data: the most recently updated record, ChurchTools, or the external system.
25691    /// Allowed values: `es`, `lastUpdated`, `master`.
25692    #[serde(rename = "updateData", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25693    pub update_data: Option<String>,
25694    /// Existing job configuration ID.
25695    #[serde(deserialize_with = "crate::lenient::number")]
25696    pub id: i64,
25697    /// Fields not described by the spec, e.g. instance-specific DB fields.
25698    #[serde(flatten)]
25699    pub extra: serde_json::Map<String, serde_json::Value>,
25700}
25701
25702#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25703pub struct SyncJobFilter {
25704    /// Adapter field to filter.
25705    #[serde(deserialize_with = "crate::lenient::string")]
25706    pub field: String,
25707    /// Adapter-specific comparison operator. ChurchTools does not enforce a fixed operator list.
25708    #[serde(deserialize_with = "crate::lenient::string")]
25709    pub operator: String,
25710    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25711    /// Allowed values: `es`, `master`.
25712    #[serde(deserialize_with = "crate::lenient::string")]
25713    pub system: String,
25714    /// Adapter-specific filter values.
25715    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25716    pub values: serde_json::Value,
25717    /// Fields not described by the spec, e.g. instance-specific DB fields.
25718    #[serde(flatten)]
25719    pub extra: serde_json::Map<String, serde_json::Value>,
25720}
25721
25722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25723pub struct SyncJobFilterCreate {
25724    /// Adapter field to filter.
25725    #[serde(deserialize_with = "crate::lenient::string")]
25726    pub field: String,
25727    /// Adapter-specific comparison operator. ChurchTools does not enforce a fixed operator list.
25728    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25729    pub operator: Option<String>,
25730    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25731    /// Allowed values: `es`, `master`.
25732    #[serde(deserialize_with = "crate::lenient::string")]
25733    pub system: String,
25734    /// Filter values passed to the adapter. Value types depend on the field and adapter.
25735    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25736    pub values: serde_json::Value,
25737    /// Fields not described by the spec, e.g. instance-specific DB fields.
25738    #[serde(flatten)]
25739    pub extra: serde_json::Map<String, serde_json::Value>,
25740}
25741
25742#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25743pub struct SyncJobFilters {
25744    pub es: Vec<SyncJobFilter>,
25745    pub master: Vec<SyncJobFilter>,
25746    /// Fields not described by the spec, e.g. instance-specific DB fields.
25747    #[serde(flatten)]
25748    pub extra: serde_json::Map<String, serde_json::Value>,
25749}
25750
25751/// Replaces all job filters, grouped by each entry's `system`.
25752#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25753pub struct SyncJobFiltersUpdate {
25754    pub es: Vec<SyncJobFilterCreate>,
25755    pub master: Vec<SyncJobFilterCreate>,
25756    /// Fields not described by the spec, e.g. instance-specific DB fields.
25757    #[serde(flatten)]
25758    pub extra: serde_json::Map<String, serde_json::Value>,
25759}
25760
25761#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25762pub struct SyncJobProperties {
25763    /// Domain configured for the job.
25764    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
25765    pub domain_type: String,
25766    /// Configured external connection with masked access credentials.
25767    #[serde(rename = "externalSystem")]
25768    pub external_system: ExternalSystem,
25769    pub properties: SyncJobPropertyLists,
25770    /// Fields not described by the spec, e.g. instance-specific DB fields.
25771    #[serde(flatten)]
25772    pub extra: serde_json::Map<String, serde_json::Value>,
25773}
25774
25775/// Replaces the selected fields in both directions. Each entry's `system` determines its stored direction.
25776#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25777pub struct SyncJobPropertiesUpdate {
25778    #[serde(rename = "propertyMappingsESToMaster")]
25779    pub property_mappings_es_to_master: Vec<SyncJobPropertyCreate>,
25780    #[serde(rename = "propertyMappingsMasterToES")]
25781    pub property_mappings_master_to_es: Vec<SyncJobPropertyCreate>,
25782    /// Fields not described by the spec, e.g. instance-specific DB fields.
25783    #[serde(flatten)]
25784    pub extra: serde_json::Map<String, serde_json::Value>,
25785}
25786
25787/// Selected job field. `valueMapping` and `others` are resolved from the referenced field mapping.
25788#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25789pub struct SyncJobProperty {
25790    /// Field mapping whose domain must match the job.
25791    #[serde(rename = "fieldMappingId", deserialize_with = "crate::lenient::number")]
25792    pub field_mapping_id: i64,
25793    /// Source field name supported by the adapter.
25794    #[serde(deserialize_with = "crate::lenient::string")]
25795    pub from: String,
25796    /// Adapter-specific source-field qualifier.
25797    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25798    pub from_filter: String,
25799    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25800    /// Allowed values: `es`, `master`.
25801    #[serde(deserialize_with = "crate::lenient::string")]
25802    pub system: String,
25803    /// Target field name supported by the adapter.
25804    #[serde(deserialize_with = "crate::lenient::string")]
25805    pub to: String,
25806    /// Adapter-specific target-field qualifier.
25807    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25808    pub to_filter: String,
25809    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25810    pub others: serde_json::Value,
25811    #[serde(rename = "valueMapping", default, skip_serializing_if = "serde_json::Value::is_null")]
25812    pub value_mapping: serde_json::Value,
25813    /// Fields not described by the spec, e.g. instance-specific DB fields.
25814    #[serde(flatten)]
25815    pub extra: serde_json::Map<String, serde_json::Value>,
25816}
25817
25818#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25819pub struct SyncJobPropertyCreate {
25820    /// Field mapping whose domain must match the job.
25821    #[serde(rename = "fieldMappingId", deserialize_with = "crate::lenient::number")]
25822    pub field_mapping_id: i64,
25823    /// Source field name supported by the adapter.
25824    #[serde(deserialize_with = "crate::lenient::string")]
25825    pub from: String,
25826    /// Adapter-specific source-field qualifier.
25827    #[serde(rename = "fromFilter", deserialize_with = "crate::lenient::string")]
25828    pub from_filter: String,
25829    /// Side of synchronization: `master` is ChurchTools and `es` is the configured external system.
25830    /// Allowed values: `es`, `master`.
25831    #[serde(deserialize_with = "crate::lenient::string")]
25832    pub system: String,
25833    /// Target field name supported by the adapter.
25834    #[serde(deserialize_with = "crate::lenient::string")]
25835    pub to: String,
25836    /// Adapter-specific target-field qualifier.
25837    #[serde(rename = "toFilter", deserialize_with = "crate::lenient::string")]
25838    pub to_filter: String,
25839    /// Fields not described by the spec, e.g. instance-specific DB fields.
25840    #[serde(flatten)]
25841    pub extra: serde_json::Map<String, serde_json::Value>,
25842}
25843
25844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25845pub struct SyncJobPropertyLists {
25846    #[serde(rename = "propertyMappingsESToMaster")]
25847    pub property_mappings_es_to_master: Vec<SyncJobProperty>,
25848    #[serde(rename = "propertyMappingsMasterToES")]
25849    pub property_mappings_master_to_es: Vec<SyncJobProperty>,
25850    /// Fields not described by the spec, e.g. instance-specific DB fields.
25851    #[serde(flatten)]
25852    pub extra: serde_json::Map<String, serde_json::Value>,
25853}
25854
25855/// Log entry during a sync execution.
25856#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25857pub struct SyncLog {
25858    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25859    #[serde(serialize_with = "crate::datetime::serialize_utc")]
25860    pub date: chrono::DateTime<chrono::Utc>,
25861    /// `domainId` of the affected record.
25862    #[serde(rename = "domainId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25863    pub domain_id: Option<String>,
25864    /// `domainType` of the affected record.
25865    #[serde(rename = "domainType", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25866    pub domain_type: Option<String>,
25867    /// Background execution identifier.
25868    #[serde(rename = "executionId", deserialize_with = "crate::lenient::string")]
25869    pub execution_id: String,
25870    #[serde(deserialize_with = "crate::lenient::number")]
25871    pub id: i64,
25872    #[serde(rename = "isDryRun")]
25873    pub is_dry_run: bool,
25874    pub job: SyncLogJob,
25875    /// PSR log severity.
25876    /// Allowed values: `alert`, `critical`, `debug`, `emergency`, `error`, `info`, `notice`, `warning`.
25877    #[serde(deserialize_with = "crate::lenient::string")]
25878    pub level: String,
25879    /// Rendered, translated log message including formatted changes. Original messageKey and args are not returned.
25880    #[serde(deserialize_with = "crate::lenient::string")]
25881    pub message: String,
25882    /// `sourceEntityId` of the affected record.
25883    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25884    pub source_entity_id: Option<String>,
25885    /// Allowed values: `both`, `es`, `master`.
25886    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
25887    pub system: Option<String>,
25888    /// Operation described by a sync log entry.
25889    /// Allowed values: `create`, `delete`, `execution`, `link`, `update`.
25890    #[serde(deserialize_with = "crate::lenient::string")]
25891    pub r#type: String,
25892    /// Fields not described by the spec, e.g. instance-specific DB fields.
25893    #[serde(flatten)]
25894    pub extra: serde_json::Map<String, serde_json::Value>,
25895}
25896
25897#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25898pub struct SyncLogCreate {
25899    /// Translation arguments; keys and values are passed to the translation system.
25900    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
25901    pub args: serde_json::Value,
25902    #[serde(default, skip_serializing_if = "Option::is_none")]
25903    pub changes: Option<Vec<SyncLogCreateChangesItem>>,
25904    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
25905    #[serde(serialize_with = "crate::datetime::serialize_utc")]
25906    pub date: chrono::DateTime<chrono::Utc>,
25907    /// `None` leaves the field out, `Some(None)` sends `null`.
25908    #[serde(rename = "domainId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25909    pub domain_id: Option<Option<String>>,
25910    /// `None` leaves the field out, `Some(None)` sends `null`.
25911    #[serde(rename = "domainType", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25912    pub domain_type: Option<Option<String>>,
25913    /// Background execution identifier, not the job configuration ID.
25914    #[serde(rename = "executionId", deserialize_with = "crate::lenient::string")]
25915    pub execution_id: String,
25916    #[serde(rename = "isDryRun", default, skip_serializing_if = "Option::is_none")]
25917    pub is_dry_run: Option<bool>,
25918    #[serde(rename = "jobId", deserialize_with = "crate::lenient::number")]
25919    pub job_id: i64,
25920    /// PSR log severity.
25921    /// Allowed values: `alert`, `critical`, `debug`, `emergency`, `error`, `info`, `notice`, `warning`.
25922    #[serde(deserialize_with = "crate::lenient::string")]
25923    pub level: String,
25924    /// Translation Key
25925    #[serde(rename = "messageKey", deserialize_with = "crate::lenient::string")]
25926    pub message_key: String,
25927    /// `None` leaves the field out, `Some(None)` sends `null`.
25928    #[serde(rename = "sourceEntityId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25929    pub source_entity_id: Option<Option<String>>,
25930    /// Affected side.
25931    /// Allowed values: `both`, `es`, `master`.
25932    ///
25933    /// `None` leaves the field out, `Some(None)` sends `null`.
25934    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25935    pub system: Option<Option<String>>,
25936    /// Operation described by a sync log entry.
25937    /// Allowed values: `create`, `delete`, `execution`, `link`, `update`.
25938    #[serde(deserialize_with = "crate::lenient::string")]
25939    pub r#type: String,
25940    /// Fields not described by the spec, e.g. instance-specific DB fields.
25941    #[serde(flatten)]
25942    pub extra: serde_json::Map<String, serde_json::Value>,
25943}
25944
25945#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25946pub struct SyncLogCreateChangesItem {
25947    /// Secondary value for FieldName. Used for Group Roles.
25948    ///
25949    /// `None` leaves the field out, `Some(None)` sends `null`.
25950    #[serde(rename = "fieldAttribute", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25951    pub field_attribute: Option<Option<String>>,
25952    /// Name of field. Translation Key allowed
25953    #[serde(rename = "fieldName", deserialize_with = "crate::lenient::string")]
25954    pub field_name: String,
25955    /// `None` leaves the field out, `Some(None)` sends `null`.
25956    #[serde(rename = "newValue", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25957    pub new_value: Option<Option<String>>,
25958    /// `None` leaves the field out, `Some(None)` sends `null`.
25959    #[serde(rename = "oldValue", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
25960    pub old_value: Option<Option<String>>,
25961    /// Fields not described by the spec, e.g. instance-specific DB fields.
25962    #[serde(flatten)]
25963    pub extra: serde_json::Map<String, serde_json::Value>,
25964}
25965
25966#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25967pub struct SyncLogJob {
25968    #[serde(rename = "externalSystem")]
25969    pub external_system: SyncLogJobExternalSystem,
25970    #[serde(deserialize_with = "crate::lenient::number")]
25971    pub id: i64,
25972    #[serde(deserialize_with = "crate::lenient::string")]
25973    pub name: String,
25974    /// Fields not described by the spec, e.g. instance-specific DB fields.
25975    #[serde(flatten)]
25976    pub extra: serde_json::Map<String, serde_json::Value>,
25977}
25978
25979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25980pub struct SyncLogJobExternalSystem {
25981    #[serde(deserialize_with = "crate::lenient::number")]
25982    pub id: i64,
25983    #[serde(deserialize_with = "crate::lenient::string")]
25984    pub name: String,
25985    /// Fields not described by the spec, e.g. instance-specific DB fields.
25986    #[serde(flatten)]
25987    pub extra: serde_json::Map<String, serde_json::Value>,
25988}
25989
25990#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25991pub struct SyncLogsCreate {
25992    pub logs: Vec<SyncLogCreate>,
25993    /// Fields not described by the spec, e.g. instance-specific DB fields.
25994    #[serde(flatten)]
25995    pub extra: serde_json::Map<String, serde_json::Value>,
25996}
25997
25998#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25999pub struct SyncLogsPersisted {
26000    /// Number of stored entries.
26001    #[serde(deserialize_with = "crate::lenient::number")]
26002    pub persisted: i64,
26003    /// Fields not described by the spec, e.g. instance-specific DB fields.
26004    #[serde(flatten)]
26005    pub extra: serde_json::Map<String, serde_json::Value>,
26006}
26007
26008/// Tag label and display properties. The REST tag controller does not return the tag domain or audit metadata.
26009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26010pub struct Tag {
26011    /// Stored semantic color, or `basic` when no color is stored.
26012    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
26013    #[serde(deserialize_with = "crate::lenient::string")]
26014    pub color: String,
26015    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26016    pub description: Option<String>,
26017    #[serde(deserialize_with = "crate::lenient::number")]
26018    pub id: i64,
26019    #[serde(deserialize_with = "crate::lenient::string")]
26020    pub name: String,
26021    #[serde(rename = "modifiedAt", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26022    #[deprecated = "deprecated in the ChurchTools API"]
26023    pub modified_at: Option<String>,
26024    #[serde(rename = "modifiedBy", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26025    #[deprecated = "deprecated in the ChurchTools API"]
26026    pub modified_by: Option<i64>,
26027    #[serde(rename = "modifiedDate", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26028    #[deprecated = "deprecated in the ChurchTools API"]
26029    pub modified_date: Option<String>,
26030    #[serde(rename = "modifiedPid", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26031    #[deprecated = "deprecated in the ChurchTools API"]
26032    pub modified_pid: Option<String>,
26033    /// Fields not described by the spec, e.g. instance-specific DB fields.
26034    #[serde(flatten)]
26035    pub extra: serde_json::Map<String, serde_json::Value>,
26036}
26037
26038#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26039pub struct TagAssignmentCreate {
26040    /// Name of an existing or newly created tag in this domain.
26041    #[serde(deserialize_with = "crate::lenient::string")]
26042    pub name: String,
26043    /// Fields not described by the spec, e.g. instance-specific DB fields.
26044    #[serde(flatten)]
26045    pub extra: serde_json::Map<String, serde_json::Value>,
26046}
26047
26048#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26049pub struct TagCreate {
26050    /// Semantic tag color; responses use `basic` when unset.
26051    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
26052    ///
26053    /// `None` leaves the field out, `Some(None)` sends `null`.
26054    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26055    pub color: Option<Option<String>>,
26056    /// `None` leaves the field out, `Some(None)` sends `null`.
26057    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26058    pub description: Option<Option<String>>,
26059    /// Tag name, unique within the domain.
26060    #[serde(deserialize_with = "crate::lenient::string")]
26061    pub name: String,
26062    /// Fields not described by the spec, e.g. instance-specific DB fields.
26063    #[serde(flatten)]
26064    pub extra: serde_json::Map<String, serde_json::Value>,
26065}
26066
26067/// Replacement tag properties. The tag’s domain cannot be changed.
26068#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26069pub struct TagUpdate {
26070    /// Semantic tag color; responses use `basic` when unset.
26071    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
26072    ///
26073    /// `None` leaves the field out, `Some(None)` sends `null`.
26074    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26075    pub color: Option<Option<String>>,
26076    /// `None` leaves the field out, `Some(None)` sends `null`.
26077    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26078    pub description: Option<Option<String>>,
26079    /// Tag name, unique within the domain.
26080    #[serde(deserialize_with = "crate::lenient::string")]
26081    pub name: String,
26082    /// Fields not described by the spec, e.g. instance-specific DB fields.
26083    #[serde(flatten)]
26084    pub extra: serde_json::Map<String, serde_json::Value>,
26085}
26086
26087/// Tag with contextual count. The domain-wide list computes its total links; creation returns `0`. Other operations normally return the serializer’s fallback `1`, not a freshly calculated total.
26088#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26089pub struct TagWithCount {
26090    /// Stored semantic color, or `basic` when no color is stored.
26091    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
26092    #[serde(deserialize_with = "crate::lenient::string")]
26093    pub color: String,
26094    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26095    pub description: Option<String>,
26096    #[serde(deserialize_with = "crate::lenient::number")]
26097    pub id: i64,
26098    #[serde(deserialize_with = "crate::lenient::string")]
26099    pub name: String,
26100    /// Link count only for the domain-wide catalog; other endpoint contexts use `0` on creation or normally `1`.
26101    #[serde(deserialize_with = "crate::lenient::number")]
26102    pub count: i64,
26103    /// Fields not described by the spec, e.g. instance-specific DB fields.
26104    #[serde(flatten)]
26105    pub extra: serde_json::Map<String, serde_json::Value>,
26106}
26107
26108/// An intended audience for a group, such as families or students. A group can reference one audience through information.targetGroupId. This is descriptive master data, not a collection of person records or a group membership.
26109#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26110pub struct TargetGroup {
26111    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
26112    #[serde(deserialize_with = "crate::lenient::string")]
26113    pub name: String,
26114    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
26115    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26116    pub sort_key: i64,
26117    /// ID of this master-data record in this ChurchTools installation. Use it when assigning this classification to a group.
26118    #[serde(deserialize_with = "crate::lenient::number")]
26119    pub id: i64,
26120    /// Localized display name, translated from the stored name when a translation exists.
26121    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
26122    pub name_translated: String,
26123    /// Fields not described by the spec, e.g. instance-specific DB fields.
26124    #[serde(flatten)]
26125    pub extra: serde_json::Map<String, serde_json::Value>,
26126}
26127
26128#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26129pub struct TargetGroupCreate {
26130    /// Stored label configured in this installation. Use nameTranslated from the response for a localized display name.
26131    #[serde(deserialize_with = "crate::lenient::string")]
26132    pub name: String,
26133    /// Display order. Lower values come first; list endpoints sort equal values by the stored name.
26134    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26135    pub sort_key: i64,
26136    /// Fields not described by the spec, e.g. instance-specific DB fields.
26137    #[serde(flatten)]
26138    pub extra: serde_json::Map<String, serde_json::Value>,
26139}
26140
26141/// A tax rate combines a tax type, a percentage and the ledger account receiving the tax amount. Its accounting period is determined by that account.
26142#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26143pub struct TaxRate {
26144    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
26145    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26146    pub account_id: i64,
26147    #[serde(deserialize_with = "crate::lenient::number")]
26148    pub id: i64,
26149    pub meta: MetaDataEntityId,
26150    /// Description, trimmed before storage. Omitted, null or blank clears it.
26151    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26152    pub note: Option<String>,
26153    /// Percentage points: 7 means 7%. Legacy or internally created records can contain null.
26154    #[serde(deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26155    pub rate: Option<f64>,
26156    /// Existing tax type from /finance/taxtypes.
26157    #[serde(rename = "taxTypeId", deserialize_with = "crate::lenient::number")]
26158    pub tax_type_id: i64,
26159    /// Fields not described by the spec, e.g. instance-specific DB fields.
26160    #[serde(flatten)]
26161    pub extra: serde_json::Map<String, serde_json::Value>,
26162}
26163
26164/// A tax rate combines a tax type, a percentage and the ledger account receiving the tax amount. Its accounting period is determined by that account.
26165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26166pub struct TaxRateCreate {
26167    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
26168    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26169    pub account_id: i64,
26170    /// Description, trimmed before storage. Omitted, null or blank clears it.
26171    ///
26172    /// `None` leaves the field out, `Some(None)` sends `null`.
26173    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26174    pub note: Option<Option<String>>,
26175    /// Percentage points: 7 means 7%, not 0.07. The API validates a number but does not enforce a percentage range.
26176    #[serde(deserialize_with = "crate::lenient::number")]
26177    pub rate: f64,
26178    /// Existing tax type from /finance/taxtypes.
26179    #[serde(rename = "taxTypeId", deserialize_with = "crate::lenient::number")]
26180    pub tax_type_id: i64,
26181    /// Fields not described by the spec, e.g. instance-specific DB fields.
26182    #[serde(flatten)]
26183    pub extra: serde_json::Map<String, serde_json::Value>,
26184}
26185
26186/// Replacement values for this tax rate. If transactions already reference it, only note may change; send the existing rate, taxTypeId and accountId unchanged.
26187#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26188pub struct TaxRateUpdate {
26189    /// ID of the existing ledger account receiving this amount. It also determines the accounting period.
26190    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26191    pub account_id: i64,
26192    /// Description, trimmed before storage. Omitted, null or blank clears it.
26193    ///
26194    /// `None` leaves the field out, `Some(None)` sends `null`.
26195    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26196    pub note: Option<Option<String>>,
26197    /// Percentage points: 7 means 7%, not 0.07. The API validates a number but does not enforce a percentage range.
26198    #[serde(deserialize_with = "crate::lenient::number")]
26199    pub rate: f64,
26200    /// Existing tax type from /finance/taxtypes.
26201    #[serde(rename = "taxTypeId", deserialize_with = "crate::lenient::number")]
26202    pub tax_type_id: i64,
26203    /// Fields not described by the spec, e.g. instance-specific DB fields.
26204    #[serde(flatten)]
26205    pub extra: serde_json::Map<String, serde_json::Value>,
26206}
26207
26208/// Tax types group tax rates by their accounting purpose, for example input tax or output tax. The percentage and receiving ledger account are configured on each tax rate.
26209#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26210pub struct TaxType {
26211    /// Unique name, trimmed before storage. Omitted, null or blank becomes null, including on update.
26212    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26213    pub name: Option<String>,
26214    /// Ascending display order. Required for creation and update; there is no API default.
26215    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26216    pub sort_key: i64,
26217    #[serde(deserialize_with = "crate::lenient::number")]
26218    pub id: i64,
26219    pub meta: MetaDataEntityId,
26220    /// Fields not described by the spec, e.g. instance-specific DB fields.
26221    #[serde(flatten)]
26222    pub extra: serde_json::Map<String, serde_json::Value>,
26223}
26224
26225/// Tax types group tax rates by their accounting purpose, for example input tax or output tax. The percentage and receiving ledger account are configured on each tax rate.
26226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26227pub struct TaxTypeCreate {
26228    /// Unique name, trimmed before storage. Omitted, null or blank becomes null, including on update.
26229    ///
26230    /// `None` leaves the field out, `Some(None)` sends `null`.
26231    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26232    pub name: Option<Option<String>>,
26233    /// Ascending display order. Required for creation and update; there is no API default.
26234    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26235    pub sort_key: i64,
26236    /// Fields not described by the spec, e.g. instance-specific DB fields.
26237    #[serde(flatten)]
26238    pub extra: serde_json::Map<String, serde_json::Value>,
26239}
26240
26241/// Replacement values for this tax type.
26242#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26243pub struct TaxTypeUpdate {
26244    /// Unique name, trimmed before storage. Omitted, null or blank becomes null, including on update.
26245    ///
26246    /// `None` leaves the field out, `Some(None)` sends `null`.
26247    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26248    pub name: Option<Option<String>>,
26249    /// Ascending display order. Required for creation and update; there is no API default.
26250    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26251    pub sort_key: i64,
26252    /// Fields not described by the spec, e.g. instance-specific DB fields.
26253    #[serde(flatten)]
26254    pub extra: serde_json::Map<String, serde_json::Value>,
26255}
26256
26257/// A single accounting transaction (a booking). Every transaction posts a given `amount` between a debit account (`accountId`) and a credit account (`contraAccountId`) within one accounting period. Equal account IDs represent a transfer from `costCenterId` to `contraCostCenterId`. Monetary values are always integers in the currency's smallest denomination (e.g. cents). A transaction that belongs to a split transaction references its parent via `splitTransactionId` and cannot be edited or deleted on its own.
26258#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26259pub struct Transaction {
26260    /// Compatibility marker mapping the deprecated donor ID fields to their replacements.
26261    #[serde(rename = "@deprecated")]
26262    pub deprecated: TransactionDeprecated,
26263    /// ID of the debit account the amount is posted to.
26264    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26265    pub account_id: i64,
26266    /// Stored booking amount in minor currency units. When this is the main booking of a tax split, it excludes the separate taxTransactionId amount; add both amounts to obtain the gross input amount.
26267    #[serde(deserialize_with = "crate::lenient::number")]
26268    pub amount: i64,
26269    /// Receipts attached to this booking, included when include\[\]=bills is requested.
26270    #[serde(default, skip_serializing_if = "Option::is_none")]
26271    pub bills: Option<Vec<Bill>>,
26272    /// Granted cash discount in the currency's smallest denomination (e.g. cents). `null` if no cash discount applies.
26273    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26274    pub cash_discount_amount: Option<i64>,
26275    /// ID of the applied cash discount, or `null` if none.
26276    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26277    pub cash_discount_id: Option<i64>,
26278    /// ID of the credit (contra) account the amount is posted from.
26279    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26280    pub contra_account_id: i64,
26281    /// ID of the target cost center for a cost center transfer. Required when `accountId` and `contraAccountId` are equal, otherwise it must be `null`.
26282    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26283    pub contra_cost_center_id: Option<i64>,
26284    /// ID of the assigned cost center, or `null` if none. For a cost center transfer this is the source cost center.
26285    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26286    pub cost_center_id: Option<i64>,
26287    /// Document date of the booking. Used for accounting-period validation, date filters and accounting reports.
26288    #[serde(rename = "documentDate")]
26289    pub document_date: chrono::NaiveDate,
26290    /// Document number of the transaction. Auto-generated when the accounting period increments document numbers, otherwise required on creation.
26291    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
26292    pub document_number: String,
26293    /// Resolved donor person, or null when no person has been resolved. Without donor visibility the response contains a censored person placeholder.
26294    #[serde(default, skip_serializing_if = "Option::is_none")]
26295    pub donator: Option<DomainObjectPerson>,
26296    /// Deprecated: use `donator` instead.
26297    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26298    #[deprecated = "deprecated in the ChurchTools API"]
26299    pub donator_id: Option<i64>,
26300    /// Resolved spouse for joint donation receipts, or null. Without donor visibility the response contains a censored person placeholder.
26301    #[serde(rename = "donatorSpouse", default, skip_serializing_if = "Option::is_none")]
26302    pub donator_spouse: Option<DomainObjectPerson>,
26303    /// Deprecated: use `donatorSpouse` instead.
26304    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26305    #[deprecated = "deprecated in the ChurchTools API"]
26306    pub donator_spouse_id: Option<i64>,
26307    /// Unique ID of the transaction.
26308    #[serde(deserialize_with = "crate::lenient::number")]
26309    pub id: i64,
26310    /// If a transaction is immutable, none of its fields can be changed and it cannot be deleted (it has been finalized/locked).
26311    #[serde(rename = "isImmutable")]
26312    pub is_immutable: bool,
26313    /// True, if the transaction has been created through a sync.
26314    #[serde(rename = "isSynced")]
26315    pub is_synced: bool,
26316    /// True, if this transaction is a waiver of reimbursement of expenses ("Aufwandsspende").
26317    #[serde(rename = "isWaiverOfReimbursementOfExpenses")]
26318    pub is_waiver_of_reimbursement_of_expenses: bool,
26319    pub meta: MetaDataEntityId,
26320    /// Free-text booking note. Null when unset or hidden because the current user may view the transaction but not its donor information.
26321    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26322    pub note: Option<String>,
26323    /// Permissions calculated for the current caller, or null when this booking was serialized without a permission collection, for example a newly generated tax child.
26324    #[serde(default, skip_serializing_if = "Option::is_none")]
26325    pub permissions: Option<TransactionPermissions>,
26326    /// ID of the parent split transaction, or `null` if this is a normal standalone transaction.
26327    #[serde(rename = "splitTransactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26328    pub split_transaction_id: Option<i64>,
26329    /// Reference to the transaction which gets stornoed by this transaction.
26330    #[serde(rename = "stornoBaseId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26331    pub storno_base_id: Option<i64>,
26332    /// Reference to the transaction which stornoed this transaction.
26333    #[serde(rename = "stornoTransactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26334    pub storno_transaction_id: Option<i64>,
26335    /// Reference to the transaction which is the base for a tax split booking.
26336    #[serde(rename = "taxBaseId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26337    pub tax_base_id: Option<i64>,
26338    /// If a tax rate is set for the transaction, the corresponding tax transaction is returned in the field taxTransactionId.
26339    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26340    pub tax_rate_id: Option<i64>,
26341    /// Reference to the transaction which is a split booking for taxes.
26342    #[serde(rename = "taxTransactionId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26343    pub tax_transaction_id: Option<i64>,
26344    /// Date on which the transaction was created, derived from meta.createdDate. Date filters and accounting reports use documentDate.
26345    #[serde(rename = "transactionDate")]
26346    pub transaction_date: chrono::NaiveDate,
26347    /// Fields not described by the spec, e.g. instance-specific DB fields.
26348    #[serde(flatten)]
26349    pub extra: serde_json::Map<String, serde_json::Value>,
26350}
26351
26352/// One accounting-period scope. Conditions within it are combined with AND; filter objects are combined with OR. Empty includeIds/excludeIds arrays impose no ID restriction. Exclusions apply only inside their own filter.
26353#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26354pub struct TransactionBatchFilter {
26355    /// Filter by account/contra account. All transactions match, where either account or contra account is in the list.
26356    #[serde(rename = "accountIds", default, skip_serializing_if = "Option::is_none")]
26357    pub account_ids: Option<Vec<i64>>,
26358    /// ID of accounting period to get master data for
26359    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
26360    pub accounting_period_id: i64,
26361    /// Filter by cost centers.
26362    #[serde(rename = "costCenterIds", default, skip_serializing_if = "Option::is_none")]
26363    pub cost_center_ids: Option<Vec<i64>>,
26364    /// Filter by person ID. Get all transactions the person has created. But only show those the user can see.
26365    #[serde(rename = "createdPid", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26366    pub created_pid: Option<i64>,
26367    /// Person IDs matching either donor or spouse, including donors of the original booking when matching cancellations.
26368    #[serde(rename = "donatorIds", default, skip_serializing_if = "Option::is_none")]
26369    pub donator_ids: Option<Vec<i64>>,
26370    /// Inclusive upper bound for documentDate.
26371    #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")]
26372    pub end_date: Option<chrono::NaiveDate>,
26373    /// Legacy alias for excludeIds. When both are present, this alias takes precedence.
26374    #[serde(default, skip_serializing_if = "Option::is_none")]
26375    #[deprecated = "deprecated in the ChurchTools API"]
26376    pub exclude: Option<Vec<i64>>,
26377    /// Filter by ids to exclude.
26378    #[serde(rename = "excludeIds", default, skip_serializing_if = "Option::is_none")]
26379    pub exclude_ids: Option<Vec<i64>>,
26380    /// Legacy alias for includeIds. When both are present, this alias takes precedence.
26381    #[serde(default, skip_serializing_if = "Option::is_none")]
26382    #[deprecated = "deprecated in the ChurchTools API"]
26383    pub include: Option<Vec<i64>>,
26384    /// Filter by ids to include.
26385    #[serde(rename = "includeIds", default, skip_serializing_if = "Option::is_none")]
26386    pub include_ids: Option<Vec<i64>>,
26387    /// Currently, either true or false selects bookings with a positive donor ID. Omit this parameter to include both donations and other bookings.
26388    #[serde(rename = "isDonation", default, skip_serializing_if = "Option::is_none")]
26389    pub is_donation: Option<bool>,
26390    /// Filter transactions, whether transaction is immutable.
26391    #[serde(rename = "isImmutable", default, skip_serializing_if = "Option::is_none")]
26392    pub is_immutable: Option<bool>,
26393    /// 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.
26394    #[serde(rename = "isIncome", default, skip_serializing_if = "Option::is_none")]
26395    pub is_income: Option<bool>,
26396    /// 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.
26397    /// Allowed values: `account`, `amount`, `bills`, `contra_account`, `cost_center`, `date`, `donator`, `modified`, `note`, `number`.
26398    #[serde(rename = "orderBy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26399    pub order_by: Option<String>,
26400    /// Search note, document number or amount. For amount matching, leading zeros and decimal separators are removed.
26401    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26402    pub query: Option<String>,
26403    /// Inclusive lower bound for documentDate.
26404    #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")]
26405    pub start_date: Option<chrono::NaiveDate>,
26406    /// Fields not described by the spec, e.g. instance-specific DB fields.
26407    #[serde(flatten)]
26408    pub extra: serde_json::Map<String, serde_json::Value>,
26409}
26410
26411/// Result counters. They do not enumerate the affected booking IDs.
26412#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26413pub struct TransactionBatchResult {
26414    /// Finalization: selected and automatically added related bookings. Deletion: initial selected rows, excluding additional rows removed through dependencies.
26415    #[serde(rename = "affectedRows", deserialize_with = "crate::lenient::number")]
26416    pub affected_rows: i64,
26417    /// Finalization: previously mutable rows actually updated. Deletion currently always reports zero, even when rows were deleted.
26418    #[serde(rename = "changedRows", deserialize_with = "crate::lenient::number")]
26419    pub changed_rows: i64,
26420    /// Fields not described by the spec, e.g. instance-specific DB fields.
26421    #[serde(flatten)]
26422    pub extra: serde_json::Map<String, serde_json::Value>,
26423}
26424
26425/// A batch action and its non-empty list of accounting-period scopes. Always provide at least one filter: the current backend does not safely scope an empty filters array.
26426#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26427pub struct TransactionBatchUpdate {
26428    /// Use isImmutable=true to finalize or delete=true to delete. If both are true, finalization takes precedence. No recognized true trigger results in a no-op.
26429    pub changeset: TransactionBatchUpdateChangeset,
26430    /// Scopes to combine with OR. Each scope requires an accountingPeriodId.
26431    pub filters: Vec<TransactionBatchFilter>,
26432    /// Fields not described by the spec, e.g. instance-specific DB fields.
26433    #[serde(flatten)]
26434    pub extra: serde_json::Map<String, serde_json::Value>,
26435}
26436
26437/// Use isImmutable=true to finalize or delete=true to delete. If both are true, finalization takes precedence. No recognized true trigger results in a no-op.
26438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26439pub struct TransactionBatchUpdateChangeset {
26440    /// Delete matched bookings, including immutable ones. This is the period-cleanup operation, not ordinary per-booking deletion.
26441    #[serde(default, skip_serializing_if = "Option::is_none")]
26442    pub delete: Option<bool>,
26443    /// Finalize the matched bookings and related tax/base bookings.
26444    #[serde(rename = "isImmutable", default, skip_serializing_if = "Option::is_none")]
26445    pub is_immutable: Option<bool>,
26446    /// Fields not described by the spec, e.g. instance-specific DB fields.
26447    #[serde(flatten)]
26448    pub extra: serde_json::Map<String, serde_json::Value>,
26449}
26450
26451/// One booking in a bulk request. Unlike single creation, documentNumber is required even when the period normally generates numbers. Send actual JSON booleans and numbers: the bulk implementation uses the original body after validation.
26452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26453pub struct TransactionBulkCreateItem {
26454    /// ID of the debit account the amount is posted to.
26455    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26456    pub account_id: i64,
26457    /// Gross booking amount in integer minor currency units. With taxRateId, tax is calculated from this amount and split into a separate booking; the returned main booking contains the remaining net amount.
26458    #[serde(deserialize_with = "crate::lenient::number")]
26459    pub amount: i64,
26460    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
26461    ///
26462    /// `None` leaves the field out, `Some(None)` sends `null`.
26463    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26464    pub cash_discount_amount: Option<Option<i64>>,
26465    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
26466    ///
26467    /// `None` leaves the field out, `Some(None)` sends `null`.
26468    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26469    pub cash_discount_id: Option<Option<i64>>,
26470    /// ID of the credit (contra) account the amount is posted from. Equal to `accountId` only for a cost center transfer.
26471    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26472    pub contra_account_id: i64,
26473    /// ID of the target cost center for a cost center transfer. Required when `accountId` and `contraAccountId` are equal, otherwise it must be omitted or `null`.
26474    ///
26475    /// `None` leaves the field out, `Some(None)` sends `null`.
26476    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26477    pub contra_cost_center_id: Option<Option<i64>>,
26478    /// Cost center from the same accounting period. Omission or null clears the assignment on update. Required as the source cost center for a cost center transfer.
26479    ///
26480    /// `None` leaves the field out, `Some(None)` sends `null`.
26481    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26482    pub cost_center_id: Option<Option<i64>>,
26483    /// Date printed on the underlying document/receipt.
26484    #[serde(rename = "documentDate")]
26485    pub document_date: chrono::NaiveDate,
26486    /// Donor person ID. Normally required when only the credit account is a donation account. Donor assignments are retained only when exactly one side is a donation account.
26487    ///
26488    /// `None` leaves the field out, `Some(None)` sends `null`.
26489    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26490    pub donator_id: Option<Option<i64>>,
26491    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
26492    ///
26493    /// `None` leaves the field out, `Some(None)` sends `null`.
26494    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26495    pub donator_spouse_id: Option<Option<i64>>,
26496    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
26497    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
26498    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
26499    /// Free-text note describing the booking.
26500    #[serde(deserialize_with = "crate::lenient::string")]
26501    pub note: String,
26502    /// Tax rate from the same accounting period. Generates or updates a separate tax booking. On update, omission or null removes the existing tax booking.
26503    ///
26504    /// `None` leaves the field out, `Some(None)` sends `null`.
26505    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26506    pub tax_rate_id: Option<Option<i64>>,
26507    /// Explicit document number for this item.
26508    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
26509    pub document_number: String,
26510    /// Mark this booking as created through a sync.
26511    #[serde(rename = "isSynced", default, skip_serializing_if = "Option::is_none")]
26512    pub is_synced: Option<bool>,
26513    /// Fields not described by the spec, e.g. instance-specific DB fields.
26514    #[serde(flatten)]
26515    pub extra: serde_json::Map<String, serde_json::Value>,
26516}
26517
26518/// Creates one booking. The document date must lie within the open accounting period. Supply documentNumber unless the period generates numbers; omission or null then requests an automatically suggested number. Donation-validation bypass for this endpoint is a query parameter.
26519#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26520pub struct TransactionCreate {
26521    /// ID of the debit account the amount is posted to.
26522    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26523    pub account_id: i64,
26524    /// Gross booking amount in integer minor currency units. With taxRateId, tax is calculated from this amount and split into a separate booking; the returned main booking contains the remaining net amount.
26525    #[serde(deserialize_with = "crate::lenient::number")]
26526    pub amount: i64,
26527    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
26528    ///
26529    /// `None` leaves the field out, `Some(None)` sends `null`.
26530    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26531    pub cash_discount_amount: Option<Option<i64>>,
26532    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
26533    ///
26534    /// `None` leaves the field out, `Some(None)` sends `null`.
26535    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26536    pub cash_discount_id: Option<Option<i64>>,
26537    /// ID of the credit (contra) account the amount is posted from. Equal to `accountId` only for a cost center transfer.
26538    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26539    pub contra_account_id: i64,
26540    /// ID of the target cost center for a cost center transfer. Required when `accountId` and `contraAccountId` are equal, otherwise it must be omitted or `null`.
26541    ///
26542    /// `None` leaves the field out, `Some(None)` sends `null`.
26543    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26544    pub contra_cost_center_id: Option<Option<i64>>,
26545    /// Cost center from the same accounting period. Omission or null clears the assignment on update. Required as the source cost center for a cost center transfer.
26546    ///
26547    /// `None` leaves the field out, `Some(None)` sends `null`.
26548    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26549    pub cost_center_id: Option<Option<i64>>,
26550    /// Date printed on the underlying document/receipt.
26551    #[serde(rename = "documentDate")]
26552    pub document_date: chrono::NaiveDate,
26553    /// Donor person ID. Normally required when only the credit account is a donation account. Donor assignments are retained only when exactly one side is a donation account.
26554    ///
26555    /// `None` leaves the field out, `Some(None)` sends `null`.
26556    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26557    pub donator_id: Option<Option<i64>>,
26558    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
26559    ///
26560    /// `None` leaves the field out, `Some(None)` sends `null`.
26561    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26562    pub donator_spouse_id: Option<Option<i64>>,
26563    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
26564    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
26565    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
26566    /// Free-text note describing the booking.
26567    #[serde(deserialize_with = "crate::lenient::string")]
26568    pub note: String,
26569    /// Tax rate from the same accounting period. Generates or updates a separate tax booking. On update, omission or null removes the existing tax booking.
26570    ///
26571    /// `None` leaves the field out, `Some(None)` sends `null`.
26572    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26573    pub tax_rate_id: Option<Option<i64>>,
26574    /// Document number, required unless automatic numbering is enabled. An explicitly supplied value is used as-is.
26575    ///
26576    /// `None` leaves the field out, `Some(None)` sends `null`.
26577    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26578    pub document_number: Option<Option<String>>,
26579    /// Mark this booking as created through a sync.
26580    #[serde(rename = "isSynced", default, skip_serializing_if = "Option::is_none")]
26581    pub is_synced: Option<bool>,
26582    /// Fields not described by the spec, e.g. instance-specific DB fields.
26583    #[serde(flatten)]
26584    pub extra: serde_json::Map<String, serde_json::Value>,
26585}
26586
26587/// Compatibility marker mapping the deprecated donor ID fields to their replacements.
26588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26589pub struct TransactionDeprecated {
26590    /// Allowed values: `donator`.
26591    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::string")]
26592    pub donator_id: String,
26593    /// Allowed values: `donatorSpouse`.
26594    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::string")]
26595    pub donator_spouse_id: String,
26596    /// Fields not described by the spec, e.g. instance-specific DB fields.
26597    #[serde(flatten)]
26598    pub extra: serde_json::Map<String, serde_json::Value>,
26599}
26600
26601/// Permissions calculated for the current caller, or null when this booking was serialized without a permission collection, for example a newly generated tax child.
26602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26603pub struct TransactionPermissions {
26604    /// Flag if user can edit this transaction
26605    #[serde(rename = "canEdit", default, skip_serializing_if = "Option::is_none")]
26606    pub can_edit: Option<bool>,
26607    /// Fields not described by the spec, e.g. instance-specific DB fields.
26608    #[serde(flatten)]
26609    pub extra: serde_json::Map<String, serde_json::Value>,
26610}
26611
26612/// A transaction purpose is a reusable preset for simplified bookkeeping. It fixes one ledger account, offers a list of accounts for the other side, and can assign a cost center. isIncome selects an income or expense preset; it is not the free-text note of a bank statement.
26613#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26614pub struct TransactionPurpose {
26615    /// Resolved, distinct ledger account IDs. Can be empty when input IDs could not be resolved. No order is guaranteed.
26616    #[serde(rename = "accountIds")]
26617    pub account_ids: Vec<i64>,
26618    /// Optional cost center. Omitted or null removes it, including on update. If supplied, its period must match the fixed account and all resolved accountIds.
26619    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
26620    pub cost_center_id: Option<i64>,
26621    #[serde(deserialize_with = "crate::lenient::number")]
26622    pub id: i64,
26623    /// True for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
26624    #[serde(rename = "isIncome")]
26625    pub is_income: bool,
26626    pub meta: MetaDataEntityId,
26627    /// Trimmed display name. Names are not required to be unique.
26628    #[serde(deserialize_with = "crate::lenient::string")]
26629    pub name: String,
26630    /// Fixed ledger account: the contra account for income, or the account for expenses. Its period must be open.
26631    #[serde(rename = "purposeAccountId", deserialize_with = "crate::lenient::number")]
26632    pub purpose_account_id: i64,
26633    /// Ascending display order. Required in creation and update.
26634    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26635    pub sort_key: i64,
26636    /// Fields not described by the spec, e.g. instance-specific DB fields.
26637    #[serde(flatten)]
26638    pub extra: serde_json::Map<String, serde_json::Value>,
26639}
26640
26641/// A transaction purpose is a reusable preset for simplified bookkeeping. It fixes one ledger account, offers a list of accounts for the other side, and can assign a cost center. isIncome selects an income or expense preset; it is not the free-text note of a bank statement.
26642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26643pub struct TransactionPurposeCreate {
26644    /// Accounts offered for the other side of the posting. Duplicate IDs are collapsed; unknown IDs are currently omitted by the lookup. Supply existing accounts.
26645    #[serde(rename = "accountIds")]
26646    pub account_ids: Vec<i64>,
26647    /// Optional cost center. Omitted or null removes it, including on update. If supplied, its period must match the fixed account and all resolved accountIds.
26648    ///
26649    /// `None` leaves the field out, `Some(None)` sends `null`.
26650    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26651    pub cost_center_id: Option<Option<i64>>,
26652    /// True for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
26653    #[serde(rename = "isIncome")]
26654    pub is_income: bool,
26655    /// Trimmed display name. Names are not required to be unique.
26656    #[serde(deserialize_with = "crate::lenient::string")]
26657    pub name: String,
26658    /// Fixed ledger account: the contra account for income, or the account for expenses. Its period must be open.
26659    #[serde(rename = "purposeAccountId", deserialize_with = "crate::lenient::number")]
26660    pub purpose_account_id: i64,
26661    /// Ascending display order. Required in creation and update.
26662    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26663    pub sort_key: i64,
26664    /// Fields not described by the spec, e.g. instance-specific DB fields.
26665    #[serde(flatten)]
26666    pub extra: serde_json::Map<String, serde_json::Value>,
26667}
26668
26669/// Replacement preset, including the complete accountIds selection. Omitted costCenterId clears the linked cost center.
26670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26671pub struct TransactionPurposeUpdate {
26672    /// Accounts offered for the other side of the posting. Duplicate IDs are collapsed; unknown IDs are currently omitted by the lookup. Supply existing accounts.
26673    #[serde(rename = "accountIds")]
26674    pub account_ids: Vec<i64>,
26675    /// Optional cost center. Omitted or null removes it, including on update. If supplied, its period must match the fixed account and all resolved accountIds.
26676    ///
26677    /// `None` leaves the field out, `Some(None)` sends `null`.
26678    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26679    pub cost_center_id: Option<Option<i64>>,
26680    /// True for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
26681    #[serde(rename = "isIncome")]
26682    pub is_income: bool,
26683    /// Trimmed display name. Names are not required to be unique.
26684    #[serde(deserialize_with = "crate::lenient::string")]
26685    pub name: String,
26686    /// Fixed ledger account: the contra account for income, or the account for expenses. Its period must be open.
26687    #[serde(rename = "purposeAccountId", deserialize_with = "crate::lenient::number")]
26688    pub purpose_account_id: i64,
26689    /// Ascending display order. Required in creation and update.
26690    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
26691    pub sort_key: i64,
26692    /// Fields not described by the spec, e.g. instance-specific DB fields.
26693    #[serde(flatten)]
26694    pub extra: serde_json::Map<String, serde_json::Value>,
26695}
26696
26697/// Reason to record when cancelling a booking.
26698#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26699pub struct TransactionStornoCreate {
26700    /// Reason added to the original booking note in a localized cancellation prefix. A repeated cancellation keeps the existing cancellation note.
26701    #[serde(deserialize_with = "crate::lenient::string")]
26702    pub note: String,
26703    /// Fields not described by the spec, e.g. instance-specific DB fields.
26704    #[serde(flatten)]
26705    pub extra: serde_json::Map<String, serde_json::Value>,
26706}
26707
26708/// Income, expense and net amount for the selected cost centers. Previous-year values are null when no previous period exists.
26709#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26710pub struct TransactionSummaryCostCenter {
26711    pub periods: TransactionSummaryCostCenterPeriods,
26712    pub summary: TransactionSummaryCostCenterSummary,
26713    /// Allowed values: `costcenter-sum`.
26714    #[serde(deserialize_with = "crate::lenient::string")]
26715    pub r#type: String,
26716    /// Fields not described by the spec, e.g. instance-specific DB fields.
26717    #[serde(flatten)]
26718    pub extra: serde_json::Map<String, serde_json::Value>,
26719}
26720
26721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26722pub struct TransactionSummaryCostCenterPeriods {
26723    #[serde(rename = "endDate")]
26724    pub end_date: TransactionSummaryCostCenterPeriodsEndDate,
26725    #[serde(rename = "startDate")]
26726    pub start_date: TransactionSummaryCostCenterPeriodsEndDate,
26727    /// Fields not described by the spec, e.g. instance-specific DB fields.
26728    #[serde(flatten)]
26729    pub extra: serde_json::Map<String, serde_json::Value>,
26730}
26731
26732#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26733pub struct TransactionSummaryCostCenterPeriodsEndDate {
26734    /// A simple date in ISO format, e.g. '2022-10-19'
26735    #[serde(rename = "lastYear")]
26736    pub last_year: chrono::NaiveDate,
26737    /// A simple date in ISO format, e.g. '2022-10-19'
26738    #[serde(rename = "thisYear")]
26739    pub this_year: chrono::NaiveDate,
26740    /// Fields not described by the spec, e.g. instance-specific DB fields.
26741    #[serde(flatten)]
26742    pub extra: serde_json::Map<String, serde_json::Value>,
26743}
26744
26745#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26746pub struct TransactionSummaryCostCenterSummary {
26747    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26748    pub income: FinanceYearValueComparison,
26749    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26750    pub outcome: FinanceYearValueComparison,
26751    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26752    pub sum: FinanceYearValueComparison,
26753    /// Fields not described by the spec, e.g. instance-specific DB fields.
26754    #[serde(flatten)]
26755    pub extra: serde_json::Map<String, serde_json::Value>,
26756}
26757
26758/// Debit, credit and balance totals for selected accounts. Accounts must share the same balance-account classification. Total previous-year values are null unless all selected accounts have a previous-year counterpart.
26759#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26760pub struct TransactionSummaryCreditDebit {
26761    pub periods: TransactionSummaryCostCenterPeriods,
26762    pub summary: TransactionSummaryCreditDebitSummary,
26763    /// Allowed values: `credit-debit`.
26764    #[serde(deserialize_with = "crate::lenient::string")]
26765    pub r#type: String,
26766    /// Fields not described by the spec, e.g. instance-specific DB fields.
26767    #[serde(flatten)]
26768    pub extra: serde_json::Map<String, serde_json::Value>,
26769}
26770
26771#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26772pub struct TransactionSummaryCreditDebitSummary {
26773    /// Selected accounts, with separate debit, credit and balance comparisons. Balance is debit minus credit for balance-sheet accounts and credit minus debit for other accounts.
26774    pub accounts: Vec<TransactionSummaryCreditDebitSummaryAccountsItem>,
26775    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26776    pub credit: FinanceYearValueComparison,
26777    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26778    pub debit: FinanceYearValueComparison,
26779    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26780    pub sum: FinanceYearValueComparison,
26781    /// Fields not described by the spec, e.g. instance-specific DB fields.
26782    #[serde(flatten)]
26783    pub extra: serde_json::Map<String, serde_json::Value>,
26784}
26785
26786#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26787pub struct TransactionSummaryCreditDebitSummaryAccountsItem {
26788    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26789    pub balance: FinanceYearValueComparison,
26790    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26791    pub credit: FinanceYearValueComparison,
26792    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26793    pub debit: FinanceYearValueComparison,
26794    #[serde(deserialize_with = "crate::lenient::number")]
26795    pub id: i64,
26796    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26797    pub name: Option<String>,
26798    #[serde(deserialize_with = "crate::lenient::string")]
26799    pub number: String,
26800    /// Fields not described by the spec, e.g. instance-specific DB fields.
26801    #[serde(flatten)]
26802    pub extra: serde_json::Map<String, serde_json::Value>,
26803}
26804
26805/// Net donations with repayments subtracted and cancellation pairs excluded. Missing previous-year donations are represented by zero.
26806#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26807pub struct TransactionSummaryDonation {
26808    pub periods: TransactionSummaryCostCenterPeriods,
26809    pub summary: TransactionSummaryDonationSummary,
26810    /// Allowed values: `donation-sum`.
26811    #[serde(deserialize_with = "crate::lenient::string")]
26812    pub r#type: String,
26813    /// Fields not described by the spec, e.g. instance-specific DB fields.
26814    #[serde(flatten)]
26815    pub extra: serde_json::Map<String, serde_json::Value>,
26816}
26817
26818#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26819pub struct TransactionSummaryDonationSummary {
26820    /// Net donations grouped by primary donor. A spouse filter can select bookings attributed to the primary donor. Persons that cannot be resolved or viewed are omitted.
26821    pub donators: Vec<TransactionSummaryDonationSummaryDonatorsItem>,
26822    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26823    pub sum: FinanceYearValueComparison,
26824    /// Fields not described by the spec, e.g. instance-specific DB fields.
26825    #[serde(flatten)]
26826    pub extra: serde_json::Map<String, serde_json::Value>,
26827}
26828
26829#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26830pub struct TransactionSummaryDonationSummaryDonatorsItem {
26831    /// Person as Domain Object
26832    pub person: DomainObjectPerson,
26833    /// Amounts in integer minor currency units for the selected date interval and its previous-year counterpart. A missing comparison value can be null; zero represents a calculated zero.
26834    pub sum: FinanceYearValueComparison,
26835    /// Fields not described by the spec, e.g. instance-specific DB fields.
26836    #[serde(flatten)]
26837    pub extra: serde_json::Map<String, serde_json::Value>,
26838}
26839
26840/// Replaces required booking fields. Omitted cost center, donor/spouse and tax rate are cleared; waiver defaults to false. Cash-discount fields are retained when cashDiscountId is omitted or null. Existing immutable bookings, generated tax bookings, cancellations and split children cannot be updated through the ordinary endpoint.
26841#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26842pub struct TransactionUpdate {
26843    /// ID of the debit account the amount is posted to.
26844    #[serde(rename = "accountId", deserialize_with = "crate::lenient::number")]
26845    pub account_id: i64,
26846    /// Gross booking amount in integer minor currency units. With taxRateId, tax is calculated from this amount and split into a separate booking; the returned main booking contains the remaining net amount.
26847    #[serde(deserialize_with = "crate::lenient::number")]
26848    pub amount: i64,
26849    /// Cash discount in the smallest currency unit. Used only together with cashDiscountId.
26850    ///
26851    /// `None` leaves the field out, `Some(None)` sends `null`.
26852    #[serde(rename = "cashDiscountAmount", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26853    pub cash_discount_amount: Option<Option<i64>>,
26854    /// Cash-discount definition from the same accounting period. When supplied, cashDiscountAmount must also be non-null.
26855    ///
26856    /// `None` leaves the field out, `Some(None)` sends `null`.
26857    #[serde(rename = "cashDiscountId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26858    pub cash_discount_id: Option<Option<i64>>,
26859    /// ID of the credit (contra) account the amount is posted from. Equal to `accountId` only for a cost center transfer.
26860    #[serde(rename = "contraAccountId", deserialize_with = "crate::lenient::number")]
26861    pub contra_account_id: i64,
26862    /// ID of the target cost center for a cost center transfer. Required when `accountId` and `contraAccountId` are equal, otherwise it must be omitted or `null`.
26863    ///
26864    /// `None` leaves the field out, `Some(None)` sends `null`.
26865    #[serde(rename = "contraCostCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26866    pub contra_cost_center_id: Option<Option<i64>>,
26867    /// Cost center from the same accounting period. Omission or null clears the assignment on update. Required as the source cost center for a cost center transfer.
26868    ///
26869    /// `None` leaves the field out, `Some(None)` sends `null`.
26870    #[serde(rename = "costCenterId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26871    pub cost_center_id: Option<Option<i64>>,
26872    /// Date printed on the underlying document/receipt.
26873    #[serde(rename = "documentDate")]
26874    pub document_date: chrono::NaiveDate,
26875    /// Donor person ID. Normally required when only the credit account is a donation account. Donor assignments are retained only when exactly one side is a donation account.
26876    ///
26877    /// `None` leaves the field out, `Some(None)` sends `null`.
26878    #[serde(rename = "donatorId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26879    pub donator_id: Option<Option<i64>>,
26880    /// Spouse for joint donation receipts. Requires a different donor person and an existing spouse relationship; inconsistent assignments return 422.
26881    ///
26882    /// `None` leaves the field out, `Some(None)` sends `null`.
26883    #[serde(rename = "donatorSpouseId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26884    pub donator_spouse_id: Option<Option<i64>>,
26885    /// Whether this is a donation through waived reimbursement of expenses. Defaults to false, including on update.
26886    #[serde(rename = "isWaiverOfReimbursementOfExpenses", default, skip_serializing_if = "Option::is_none")]
26887    pub is_waiver_of_reimbursement_of_expenses: Option<bool>,
26888    /// Free-text note describing the booking.
26889    #[serde(deserialize_with = "crate::lenient::string")]
26890    pub note: String,
26891    /// Tax rate from the same accounting period. Generates or updates a separate tax booking. On update, omission or null removes the existing tax booking.
26892    ///
26893    /// `None` leaves the field out, `Some(None)` sends `null`.
26894    #[serde(rename = "taxRateId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26895    pub tax_rate_id: Option<Option<i64>>,
26896    /// Replacement document number; never generated automatically on update.
26897    #[serde(rename = "documentNumber", deserialize_with = "crate::lenient::string")]
26898    pub document_number: String,
26899    /// Skip the normal donation-account/donor constraint. Spouse-consistency checks still apply when assignments change.
26900    #[serde(rename = "ignoreDonationConstraint", default, skip_serializing_if = "Option::is_none")]
26901    pub ignore_donation_constraint: Option<bool>,
26902    /// Finalize this booking and its tax booking. This cannot unlock an already immutable booking.
26903    #[serde(rename = "isImmutable", default, skip_serializing_if = "Option::is_none")]
26904    pub is_immutable: Option<bool>,
26905    /// Fields not described by the spec, e.g. instance-specific DB fields.
26906    #[serde(flatten)]
26907    pub extra: serde_json::Map<String, serde_json::Value>,
26908}
26909
26910/// Text and maintenance flags for one language of a translation key. The enclosing map identifies the language code.
26911#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26912pub struct Translation {
26913    /// Whether this language entry is marked deleted.
26914    pub deleted: bool,
26915    /// Whether this translation needs review.
26916    #[serde(rename = "needsCheck")]
26917    pub needs_check: bool,
26918    /// The translation value for the key
26919    #[serde(deserialize_with = "crate::lenient::string")]
26920    pub translation: String,
26921    /// Last updated
26922    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
26923    pub updated: Option<chrono::DateTime<chrono::Utc>>,
26924    /// Determines if the translation was updated or created by the church
26925    #[serde(rename = "updatedByChurch")]
26926    pub updated_by_church: bool,
26927    /// Fields not described by the spec, e.g. instance-specific DB fields.
26928    #[serde(flatten)]
26929    pub extra: serde_json::Map<String, serde_json::Value>,
26930}
26931
26932/// Translation identifier and its texts by language code. Local keys are marked createdByChurch; supplied product keys cannot be renamed or deleted through these endpoints.
26933#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26934pub struct TranslationKey {
26935    /// Whether the key was created locally by this installation.
26936    #[serde(rename = "createdByChurch")]
26937    pub created_by_church: bool,
26938    /// Whether the key is marked deleted.
26939    pub deleted: bool,
26940    #[serde(deserialize_with = "crate::lenient::number")]
26941    pub id: i64,
26942    #[serde(deserialize_with = "crate::lenient::string")]
26943    pub key: String,
26944    #[serde(deserialize_with = "crate::lenient::string")]
26945    pub module: String,
26946    /// Translations keyed by language code, for example de or en. An empty collection serializes as \[\].
26947    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
26948    pub translations: serde_json::Value,
26949    /// Last updated
26950    #[serde(deserialize_with = "crate::lenient::opt_datetime", serialize_with = "crate::datetime::serialize_opt_utc", default, skip_serializing_if = "Option::is_none")]
26951    pub updated: Option<chrono::DateTime<chrono::Utc>>,
26952    /// Fields not described by the spec, e.g. instance-specific DB fields.
26953    #[serde(flatten)]
26954    pub extra: serde_json::Map<String, serde_json::Value>,
26955}
26956
26957/// Rename or move a locally created translation key to a module. Both fields are required; translation texts are unchanged.
26958#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26959pub struct TranslationKeyUpdate {
26960    /// Translation key, trimmed before validation.
26961    #[serde(deserialize_with = "crate::lenient::string")]
26962    pub key: String,
26963    /// Module grouping, trimmed before validation. This value is stored as text rather than checked against a fixed module enum.
26964    #[serde(deserialize_with = "crate::lenient::string")]
26965    pub module: String,
26966    /// Fields not described by the spec, e.g. instance-specific DB fields.
26967    #[serde(flatten)]
26968    pub extra: serde_json::Map<String, serde_json::Value>,
26969}
26970
26971#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
26972pub struct TurnoverReportCreate {
26973    /// Account-type IDs. Omission, null or \[\] selects all types. Existing IDs must be JSON integers; numeric strings do not match. Unknown IDs are ignored. If no supplied ID matches, the turnover calculator falls back to all types.
26974    ///
26975    /// `None` leaves the field out, `Some(None)` sends `null`.
26976    #[serde(rename = "accountTypes", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
26977    pub account_types: Option<Option<Vec<i64>>>,
26978    /// Accounting period owning the accounts. Requires finance edit masterdata or explicit view/edit permission for this period.
26979    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
26980    pub accounting_period_id: i64,
26981    /// PDF creates a file and returns its URL with HTTP 201. CSV/XLSX return the file directly with HTTP 200. Accept: text/html overrides this selection.
26982    /// Allowed values: `csv`, `pdf`, `xlsx`.
26983    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
26984    pub format: Option<String>,
26985    /// Use twelve calendar-month columns or four calendar-quarter columns for the year of the accounting period’s start date.
26986    /// Allowed values: `monthly`, `quarterly`.
26987    #[serde(deserialize_with = "crate::lenient::string")]
26988    pub period: String,
26989    /// Accepted by the shared validator but ignored by the turnover report.
26990    #[serde(rename = "showAccountGroups", default, skip_serializing_if = "Option::is_none")]
26991    pub show_account_groups: Option<bool>,
26992    /// Include zero-value accounts according to the selected report’s balance/activity calculation.
26993    #[serde(rename = "showEmptyAccounts", default, skip_serializing_if = "Option::is_none")]
26994    pub show_empty_accounts: Option<bool>,
26995    /// Fields not described by the spec, e.g. instance-specific DB fields.
26996    #[serde(flatten)]
26997    pub extra: serde_json::Map<String, serde_json::Value>,
26998}
26999
27000/// Two-factor completion result. The legacy disabled-two-factor branch returns only status and does not complete login.
27001#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27002pub struct TwoFactorLoginResult {
27003    /// Suggested post-login navigation target from the pending session or external-link completion. Can be relative, absolute or empty. Absent in the legacy disabled-two-factor branch.
27004    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27005    pub redirect_to: Option<String>,
27006    #[serde(deserialize_with = "crate::lenient::string")]
27007    pub status: String,
27008    /// Fields not described by the spec, e.g. instance-specific DB fields.
27009    #[serde(flatten)]
27010    pub extra: serde_json::Map<String, serde_json::Value>,
27011}
27012
27013#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27014pub struct TwoFactorSetupActivate {
27015    /// Six-digit current authenticator code. Send it as a string to preserve leading zeroes. A code already accepted recently for this person cannot be reused.
27016    #[serde(deserialize_with = "crate::lenient::string")]
27017    pub code: String,
27018    /// Fields not described by the spec, e.g. instance-specific DB fields.
27019    #[serde(flatten)]
27020    pub extra: serde_json::Map<String, serde_json::Value>,
27021}
27022
27023/// New authenticator enrollment material. Both fields contain the same sensitive TOTP secret; initialize once and keep the result for activation.
27024#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27025pub struct TwoFactorSetupSecret {
27026    /// QR-code image as a data URI, suitable for an image element. It is not an HTTP URL.
27027    #[serde(deserialize_with = "crate::lenient::string")]
27028    pub qrcode: String,
27029    /// New Base32 authenticator secret.
27030    #[serde(deserialize_with = "crate::lenient::string")]
27031    pub secret: String,
27032    /// Fields not described by the spec, e.g. instance-specific DB fields.
27033    #[serde(flatten)]
27034    pub extra: serde_json::Map<String, serde_json::Value>,
27035}
27036
27037/// Stored statement suggestion rule. Historical values are returned as stored, including unsupported values accepted by the write validator.
27038#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27039pub struct UserRule {
27040    /// Accounts whose statement movements are eligible when allAccounts is false. An empty list then matches no accounts.
27041    #[serde(rename = "accountIds")]
27042    pub account_ids: Vec<i64>,
27043    /// Accounting period owning these rules.
27044    #[serde(rename = "accountingPeriodId", deserialize_with = "crate::lenient::number")]
27045    pub accounting_period_id: i64,
27046    /// Apply to all statement accounts in this accounting period instead of accountIds.
27047    #[serde(rename = "allAccounts")]
27048    pub all_accounts: bool,
27049    /// Generated ID, replaced when the rule set is saved.
27050    #[serde(deserialize_with = "crate::lenient::number")]
27051    pub id: i64,
27052    /// True matches incoming movements, false matches outgoing movements.
27053    #[serde(rename = "isIncome")]
27054    pub is_income: bool,
27055    /// contains and = compare case-insensitively. regex uses PHP preg_match with the supplied pattern and flags. The storage API also accepts other strings; unsupported search types/operators produce no match.
27056    #[serde(deserialize_with = "crate::lenient::string")]
27057    pub operator: String,
27058    /// Text to match against the movement purpose, or a complete PHP regular expression including delimiters for regex (for example /donation/i).
27059    #[serde(rename = "searchString", deserialize_with = "crate::lenient::string")]
27060    pub search_string: String,
27061    /// Movement field to search. Only purpose is implemented. The storage API also accepts other strings; unsupported search types/operators produce no match.
27062    #[serde(rename = "searchType", deserialize_with = "crate::lenient::string")]
27063    pub search_type: String,
27064    /// Ascending rule order. IDs are regenerated when the complete rule set is replaced.
27065    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
27066    pub sort_key: i64,
27067    /// Booking field for which a value is suggested. The storage API also accepts other strings; unsupported search types/operators produce no match.
27068    #[serde(rename = "suggestionType", deserialize_with = "crate::lenient::string")]
27069    pub suggestion_type: String,
27070    /// Suggested account or cost-center ID encoded as a string. Referenced IDs are not validated when saving the rules.
27071    #[serde(rename = "suggestionValue", deserialize_with = "crate::lenient::string")]
27072    pub suggestion_value: String,
27073    /// Fields not described by the spec, e.g. instance-specific DB fields.
27074    #[serde(flatten)]
27075    pub extra: serde_json::Map<String, serde_json::Value>,
27076}
27077
27078/// Rule for generating booking suggestions from imported statement movements. Rules belong to an accounting period, not to the currently logged-in person.
27079#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27080pub struct UserRuleCreate {
27081    /// Accounts whose statement movements are eligible when allAccounts is false. An empty list then matches no accounts.
27082    #[serde(rename = "accountIds")]
27083    pub account_ids: Vec<i64>,
27084    /// Apply to all statement accounts in this accounting period instead of accountIds.
27085    #[serde(rename = "allAccounts")]
27086    pub all_accounts: bool,
27087    /// True matches incoming movements, false matches outgoing movements.
27088    #[serde(rename = "isIncome")]
27089    pub is_income: bool,
27090    /// contains and = compare case-insensitively. regex uses PHP preg_match with the supplied pattern and flags.
27091    /// Allowed values: `=`, `contains`, `regex`.
27092    #[serde(deserialize_with = "crate::lenient::string")]
27093    pub operator: String,
27094    /// Text to match against the movement purpose, or a complete PHP regular expression including delimiters for regex (for example /donation/i).
27095    #[serde(rename = "searchString", deserialize_with = "crate::lenient::string")]
27096    pub search_string: String,
27097    /// Movement field to search. Only purpose is implemented.
27098    /// Allowed values: `purpose`.
27099    #[serde(rename = "searchType", deserialize_with = "crate::lenient::string")]
27100    pub search_type: String,
27101    /// Ascending rule order. IDs are regenerated when the complete rule set is replaced.
27102    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
27103    pub sort_key: i64,
27104    /// Booking field for which a value is suggested.
27105    /// Allowed values: `accountId`, `contraAccountId`, `costCenterId`.
27106    #[serde(rename = "suggestionType", deserialize_with = "crate::lenient::string")]
27107    pub suggestion_type: String,
27108    /// Suggested account or cost-center ID encoded as a string. Referenced IDs are not validated when saving the rules.
27109    #[serde(rename = "suggestionValue", deserialize_with = "crate::lenient::string")]
27110    pub suggestion_value: String,
27111    /// Fields not described by the spec, e.g. instance-specific DB fields.
27112    #[serde(flatten)]
27113    pub extra: serde_json::Map<String, serde_json::Value>,
27114}
27115
27116/// Complete replacement of an accounting period’s rules. Existing rule IDs are discarded.
27117#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27118pub struct UserRulesUpdate {
27119    /// All rules to retain. An empty array removes every rule for this period.
27120    pub rules: Vec<UserRuleCreate>,
27121    /// Fields not described by the spec, e.g. instance-specific DB fields.
27122    #[serde(flatten)]
27123    pub extra: serde_json::Map<String, serde_json::Value>,
27124}
27125
27126#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27127pub struct WebsiteDataCalendar {
27128    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27129    pub domain_id: i64,
27130    #[serde(deserialize_with = "crate::lenient::number")]
27131    pub id: i64,
27132    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27133    pub additional_id: i64,
27134    /// Calendar containing appointments and their series. Calendar settings, appointment editing and calendar administration are separate concerns. The type selects the applicable administration category; effective visibility depends on permissions. This object is also embedded in appointment responses.
27135    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27136    pub domain_data: Option<Calendar>,
27137    /// Allowed values: `calendar`.
27138    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27139    pub domain_type: String,
27140    /// Fields not described by the spec, e.g. instance-specific DB fields.
27141    #[serde(flatten)]
27142    pub extra: serde_json::Map<String, serde_json::Value>,
27143}
27144
27145#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27146pub struct WebsiteDataCreate {
27147    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
27148    pub additional_id: Option<i64>,
27149    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27150    pub domain_id: i64,
27151    /// Allowed values: `calendar`, `person`, `posts-in-group`, `staff`.
27152    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27153    pub domain_type: String,
27154    /// Fields not described by the spec, e.g. instance-specific DB fields.
27155    #[serde(flatten)]
27156    pub extra: serde_json::Map<String, serde_json::Value>,
27157}
27158
27159#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27160pub struct WebsiteDataPerson {
27161    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27162    pub domain_id: i64,
27163    #[serde(deserialize_with = "crate::lenient::number")]
27164    pub id: i64,
27165    /// The role id
27166    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27167    pub additional_id: i64,
27168    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27169    pub domain_data: Option<WebsiteDataPersonDomainData>,
27170    /// Allowed values: `person`.
27171    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27172    pub domain_type: String,
27173    /// Fields not described by the spec, e.g. instance-specific DB fields.
27174    #[serde(flatten)]
27175    pub extra: serde_json::Map<String, serde_json::Value>,
27176}
27177
27178#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27179pub struct WebsiteDataPersonDomainData {
27180    pub group: DomainObjectGroup,
27181    pub members: Vec<DomainObjectPerson>,
27182    /// A membership role defined for a group type, such as leader or participant. Groups of that type use this definition and add their own settings through GroupRole. A role describes a person's function; MemberStatus separately describes whether their membership is active, requested, waiting or pending removal.
27183    pub role: Role,
27184    /// Fields not described by the spec, e.g. instance-specific DB fields.
27185    #[serde(flatten)]
27186    pub extra: serde_json::Map<String, serde_json::Value>,
27187}
27188
27189#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27190pub struct WebsiteDataPostsInGroup {
27191    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27192    pub domain_id: i64,
27193    #[serde(deserialize_with = "crate::lenient::number")]
27194    pub id: i64,
27195    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27196    pub additional_id: i64,
27197    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27198    pub domain_data: Option<WebsiteDataPostsInGroupDomainData>,
27199    /// Allowed values: `posts-in-group`.
27200    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27201    pub domain_type: String,
27202    /// Fields not described by the spec, e.g. instance-specific DB fields.
27203    #[serde(flatten)]
27204    pub extra: serde_json::Map<String, serde_json::Value>,
27205}
27206
27207#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27208pub struct WebsiteDataPostsInGroupDomainData {
27209    pub group: DomainObjectGroup,
27210    #[serde(rename = "groupVisiblePostCount", deserialize_with = "crate::lenient::number")]
27211    pub group_visible_post_count: i64,
27212    /// Fields not described by the spec, e.g. instance-specific DB fields.
27213    #[serde(flatten)]
27214    pub extra: serde_json::Map<String, serde_json::Value>,
27215}
27216
27217#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27218pub struct WebsiteDataStaff {
27219    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27220    pub domain_id: i64,
27221    #[serde(deserialize_with = "crate::lenient::number")]
27222    pub id: i64,
27223    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::number")]
27224    pub additional_id: i64,
27225    /// Person as Domain Object
27226    #[serde(rename = "domainData", default, skip_serializing_if = "Option::is_none")]
27227    pub domain_data: Option<DomainObjectPerson>,
27228    /// Allowed values: `staff`.
27229    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27230    pub domain_type: String,
27231    /// Fields not described by the spec, e.g. instance-specific DB fields.
27232    #[serde(flatten)]
27233    pub extra: serde_json::Map<String, serde_json::Value>,
27234}
27235
27236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27237pub struct WebsiteDataWithoutInclude {
27238    #[serde(rename = "domainId", deserialize_with = "crate::lenient::number")]
27239    pub domain_id: i64,
27240    #[serde(deserialize_with = "crate::lenient::number")]
27241    pub id: i64,
27242    #[serde(rename = "additionalId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
27243    pub additional_id: Option<i64>,
27244    /// Allowed values: `calendar`, `person`, `posts-in-group`, `staff`.
27245    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
27246    pub domain_type: String,
27247    /// Fields not described by the spec, e.g. instance-specific DB fields.
27248    #[serde(flatten)]
27249    pub extra: serde_json::Map<String, serde_json::Value>,
27250}
27251
27252#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27253pub struct Weekday {
27254    #[serde(deserialize_with = "crate::lenient::number")]
27255    pub id: i64,
27256    #[serde(deserialize_with = "crate::lenient::string")]
27257    pub name: String,
27258    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
27259    pub name_translated: String,
27260    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
27261    pub sort_key: i64,
27262    /// Fields not described by the spec, e.g. instance-specific DB fields.
27263    #[serde(flatten)]
27264    pub extra: serde_json::Map<String, serde_json::Value>,
27265}
27266
27267#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27268pub struct WidgetActionAllBirthdaysAll {
27269    /// Flavor of widget action
27270    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27271    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27272    pub flavor: Option<String>,
27273    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27274    pub icon: Option<String>,
27275    /// Allowed values: `action.allBirthdays.all`.
27276    #[serde(deserialize_with = "crate::lenient::string")]
27277    pub key: String,
27278    #[serde(deserialize_with = "crate::lenient::string")]
27279    pub label: String,
27280    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27281    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27282    /// Type of widget action
27283    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27284    #[serde(deserialize_with = "crate::lenient::string")]
27285    pub r#type: String,
27286    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27287    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27288    /// Fields not described by the spec, e.g. instance-specific DB fields.
27289    #[serde(flatten)]
27290    pub extra: serde_json::Map<String, serde_json::Value>,
27291}
27292
27293#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27294pub struct WidgetActionAppointmentsAll {
27295    /// Flavor of widget action
27296    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27297    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27298    pub flavor: Option<String>,
27299    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27300    pub icon: Option<String>,
27301    /// Allowed values: `action.appointments.all`.
27302    #[serde(deserialize_with = "crate::lenient::string")]
27303    pub key: String,
27304    #[serde(deserialize_with = "crate::lenient::string")]
27305    pub label: String,
27306    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27307    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27308    /// Type of widget action
27309    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27310    #[serde(deserialize_with = "crate::lenient::string")]
27311    pub r#type: String,
27312    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27313    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27314    /// Fields not described by the spec, e.g. instance-specific DB fields.
27315    #[serde(flatten)]
27316    pub extra: serde_json::Map<String, serde_json::Value>,
27317}
27318
27319#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27320pub struct WidgetActionDataAppointment {
27321    #[serde(rename = "appointmentId", deserialize_with = "crate::lenient::number")]
27322    pub appointment_id: i64,
27323    #[serde(rename = "calendarId", deserialize_with = "crate::lenient::number")]
27324    pub calendar_id: i64,
27325    /// A simple date in ISO format, e.g. '2022-10-19'
27326    #[serde(rename = "startDate")]
27327    pub start_date: chrono::NaiveDate,
27328    /// Fields not described by the spec, e.g. instance-specific DB fields.
27329    #[serde(flatten)]
27330    pub extra: serde_json::Map<String, serde_json::Value>,
27331}
27332
27333#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27334pub struct WidgetActionDataBooking {
27335    #[serde(rename = "bookingId", deserialize_with = "crate::lenient::number")]
27336    pub booking_id: i64,
27337    /// A simple date in ISO format, e.g. '2022-10-19'
27338    #[serde(rename = "startDate")]
27339    pub start_date: chrono::NaiveDate,
27340    /// Fields not described by the spec, e.g. instance-specific DB fields.
27341    #[serde(flatten)]
27342    pub extra: serde_json::Map<String, serde_json::Value>,
27343}
27344
27345#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27346pub struct WidgetActionDataEvent {
27347    #[serde(rename = "eventId", deserialize_with = "crate::lenient::number")]
27348    pub event_id: i64,
27349    /// Fields not described by the spec, e.g. instance-specific DB fields.
27350    #[serde(flatten)]
27351    pub extra: serde_json::Map<String, serde_json::Value>,
27352}
27353
27354#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27355pub struct WidgetActionDataGroup {
27356    #[serde(rename = "groupId", deserialize_with = "crate::lenient::number")]
27357    pub group_id: i64,
27358    /// Fields not described by the spec, e.g. instance-specific DB fields.
27359    #[serde(flatten)]
27360    pub extra: serde_json::Map<String, serde_json::Value>,
27361}
27362
27363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27364pub struct WidgetActionDataPerson {
27365    #[serde(rename = "personId", deserialize_with = "crate::lenient::number")]
27366    pub person_id: i64,
27367    /// Fields not described by the spec, e.g. instance-specific DB fields.
27368    #[serde(flatten)]
27369    pub extra: serde_json::Map<String, serde_json::Value>,
27370}
27371
27372#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27373pub struct WidgetActionDataPostExternal {
27374    #[serde(rename = "groupGuid", deserialize_with = "crate::lenient::string")]
27375    pub group_guid: String,
27376    #[serde(deserialize_with = "crate::lenient::string")]
27377    pub guid: String,
27378    #[serde(rename = "instanceGuid", deserialize_with = "crate::lenient::string")]
27379    pub instance_guid: String,
27380    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
27381    pub post_id: i64,
27382    /// Fields not described by the spec, e.g. instance-specific DB fields.
27383    #[serde(flatten)]
27384    pub extra: serde_json::Map<String, serde_json::Value>,
27385}
27386
27387#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27388pub struct WidgetActionDataPostInternal {
27389    #[serde(deserialize_with = "crate::lenient::string")]
27390    pub guid: String,
27391    #[serde(rename = "postId", deserialize_with = "crate::lenient::number")]
27392    pub post_id: i64,
27393    /// Fields not described by the spec, e.g. instance-specific DB fields.
27394    #[serde(flatten)]
27395    pub extra: serde_json::Map<String, serde_json::Value>,
27396}
27397
27398#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27399pub struct WidgetActionDataResource {
27400    #[serde(rename = "resourceId", deserialize_with = "crate::lenient::number")]
27401    pub resource_id: i64,
27402    /// Fields not described by the spec, e.g. instance-specific DB fields.
27403    #[serde(flatten)]
27404    pub extra: serde_json::Map<String, serde_json::Value>,
27405}
27406
27407#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27408pub struct WidgetActionDataUrl {
27409    #[serde(deserialize_with = "crate::lenient::string")]
27410    pub url: String,
27411    /// Fields not described by the spec, e.g. instance-specific DB fields.
27412    #[serde(flatten)]
27413    pub extra: serde_json::Map<String, serde_json::Value>,
27414}
27415
27416#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27417pub struct WidgetActionExchangeRequestsAll {
27418    /// Flavor of widget action
27419    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27420    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27421    pub flavor: Option<String>,
27422    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27423    pub icon: Option<String>,
27424    /// Allowed values: `action.exchange-requests.all`.
27425    #[serde(deserialize_with = "crate::lenient::string")]
27426    pub key: String,
27427    #[serde(deserialize_with = "crate::lenient::string")]
27428    pub label: String,
27429    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27430    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27431    /// Type of widget action
27432    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27433    #[serde(deserialize_with = "crate::lenient::string")]
27434    pub r#type: String,
27435    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27436    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27437    /// Fields not described by the spec, e.g. instance-specific DB fields.
27438    #[serde(flatten)]
27439    pub extra: serde_json::Map<String, serde_json::Value>,
27440}
27441
27442#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27443pub struct WidgetActionFavoriteGroupsAll {
27444    /// Flavor of widget action
27445    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27446    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27447    pub flavor: Option<String>,
27448    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27449    pub icon: Option<String>,
27450    /// Allowed values: `action.favorite-groups.all`.
27451    #[serde(deserialize_with = "crate::lenient::string")]
27452    pub key: String,
27453    #[serde(deserialize_with = "crate::lenient::string")]
27454    pub label: String,
27455    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27456    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27457    /// Type of widget action
27458    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27459    #[serde(deserialize_with = "crate::lenient::string")]
27460    pub r#type: String,
27461    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27462    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27463    /// Fields not described by the spec, e.g. instance-specific DB fields.
27464    #[serde(flatten)]
27465    pub extra: serde_json::Map<String, serde_json::Value>,
27466}
27467
27468#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27469pub struct WidgetActionGeneralUrl {
27470    /// Flavor of widget action
27471    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27472    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27473    pub flavor: Option<String>,
27474    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27475    pub icon: Option<String>,
27476    /// Allowed values: `action.general.url`.
27477    #[serde(deserialize_with = "crate::lenient::string")]
27478    pub key: String,
27479    #[serde(deserialize_with = "crate::lenient::string")]
27480    pub label: String,
27481    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27482    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27483    /// Type of widget action
27484    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27485    #[serde(deserialize_with = "crate::lenient::string")]
27486    pub r#type: String,
27487    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
27488    pub action_data: Option<WidgetActionDataUrl>,
27489    /// Fields not described by the spec, e.g. instance-specific DB fields.
27490    #[serde(flatten)]
27491    pub extra: serde_json::Map<String, serde_json::Value>,
27492}
27493
27494#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27495pub struct WidgetActionGroupMeetingAll {
27496    /// Flavor of widget action
27497    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27498    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27499    pub flavor: Option<String>,
27500    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27501    pub icon: Option<String>,
27502    /// Allowed values: `action.groupmeeting.all`.
27503    #[serde(deserialize_with = "crate::lenient::string")]
27504    pub key: String,
27505    #[serde(deserialize_with = "crate::lenient::string")]
27506    pub label: String,
27507    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27508    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27509    /// Type of widget action
27510    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27511    #[serde(deserialize_with = "crate::lenient::string")]
27512    pub r#type: String,
27513    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27514    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27515    /// Fields not described by the spec, e.g. instance-specific DB fields.
27516    #[serde(flatten)]
27517    pub extra: serde_json::Map<String, serde_json::Value>,
27518}
27519
27520#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27521pub struct WidgetActionMyBookingsAll {
27522    /// Flavor of widget action
27523    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27524    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27525    pub flavor: Option<String>,
27526    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27527    pub icon: Option<String>,
27528    /// Allowed values: `action.my-bookings.all`.
27529    #[serde(deserialize_with = "crate::lenient::string")]
27530    pub key: String,
27531    #[serde(deserialize_with = "crate::lenient::string")]
27532    pub label: String,
27533    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27534    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27535    /// Type of widget action
27536    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27537    #[serde(deserialize_with = "crate::lenient::string")]
27538    pub r#type: String,
27539    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27540    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27541    /// Fields not described by the spec, e.g. instance-specific DB fields.
27542    #[serde(flatten)]
27543    pub extra: serde_json::Map<String, serde_json::Value>,
27544}
27545
27546#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27547pub struct WidgetActionMyGroupsAll {
27548    /// Flavor of widget action
27549    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27550    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27551    pub flavor: Option<String>,
27552    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27553    pub icon: Option<String>,
27554    /// Allowed values: `action.my-groups.all`.
27555    #[serde(deserialize_with = "crate::lenient::string")]
27556    pub key: String,
27557    #[serde(deserialize_with = "crate::lenient::string")]
27558    pub label: String,
27559    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27560    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27561    /// Type of widget action
27562    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27563    #[serde(deserialize_with = "crate::lenient::string")]
27564    pub r#type: String,
27565    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27566    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27567    /// Fields not described by the spec, e.g. instance-specific DB fields.
27568    #[serde(flatten)]
27569    pub extra: serde_json::Map<String, serde_json::Value>,
27570}
27571
27572#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27573pub struct WidgetActionMyResourcesAll {
27574    /// Flavor of widget action
27575    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27576    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27577    pub flavor: Option<String>,
27578    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27579    pub icon: Option<String>,
27580    /// Allowed values: `action.my-resources.all`.
27581    #[serde(deserialize_with = "crate::lenient::string")]
27582    pub key: String,
27583    #[serde(deserialize_with = "crate::lenient::string")]
27584    pub label: String,
27585    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27586    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27587    /// Type of widget action
27588    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27589    #[serde(deserialize_with = "crate::lenient::string")]
27590    pub r#type: String,
27591    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27592    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27593    /// Fields not described by the spec, e.g. instance-specific DB fields.
27594    #[serde(flatten)]
27595    pub extra: serde_json::Map<String, serde_json::Value>,
27596}
27597
27598#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27599pub struct WidgetActionPostsAll {
27600    /// Flavor of widget action
27601    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27602    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27603    pub flavor: Option<String>,
27604    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27605    pub icon: Option<String>,
27606    /// Allowed values: `action.posts.all`.
27607    #[serde(deserialize_with = "crate::lenient::string")]
27608    pub key: String,
27609    #[serde(deserialize_with = "crate::lenient::string")]
27610    pub label: String,
27611    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27612    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27613    /// Type of widget action
27614    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27615    #[serde(deserialize_with = "crate::lenient::string")]
27616    pub r#type: String,
27617    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27618    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27619    /// Fields not described by the spec, e.g. instance-specific DB fields.
27620    #[serde(flatten)]
27621    pub extra: serde_json::Map<String, serde_json::Value>,
27622}
27623
27624#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27625pub struct WidgetActionServiceRequestsAll {
27626    /// Flavor of widget action
27627    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27628    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27629    pub flavor: Option<String>,
27630    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27631    pub icon: Option<String>,
27632    /// Allowed values: `action.service-requests.all`.
27633    #[serde(deserialize_with = "crate::lenient::string")]
27634    pub key: String,
27635    #[serde(deserialize_with = "crate::lenient::string")]
27636    pub label: String,
27637    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27638    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27639    /// Type of widget action
27640    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27641    #[serde(deserialize_with = "crate::lenient::string")]
27642    pub r#type: String,
27643    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27644    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27645    /// Fields not described by the spec, e.g. instance-specific DB fields.
27646    #[serde(flatten)]
27647    pub extra: serde_json::Map<String, serde_json::Value>,
27648}
27649
27650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27651pub struct WidgetActionSongsToLearnAll {
27652    /// Flavor of widget action
27653    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27654    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27655    pub flavor: Option<String>,
27656    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27657    pub icon: Option<String>,
27658    /// Allowed values: `action.songsToLearn.all`.
27659    #[serde(deserialize_with = "crate::lenient::string")]
27660    pub key: String,
27661    #[serde(deserialize_with = "crate::lenient::string")]
27662    pub label: String,
27663    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27664    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27665    /// Type of widget action
27666    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27667    #[serde(deserialize_with = "crate::lenient::string")]
27668    pub r#type: String,
27669    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27670    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27671    /// Fields not described by the spec, e.g. instance-specific DB fields.
27672    #[serde(flatten)]
27673    pub extra: serde_json::Map<String, serde_json::Value>,
27674}
27675
27676#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27677pub struct WidgetActionUpcomingServicesAll {
27678    /// Flavor of widget action
27679    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
27680    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27681    pub flavor: Option<String>,
27682    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27683    pub icon: Option<String>,
27684    /// Allowed values: `action.upcoming-services.all`.
27685    #[serde(deserialize_with = "crate::lenient::string")]
27686    pub key: String,
27687    #[serde(deserialize_with = "crate::lenient::string")]
27688    pub label: String,
27689    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27690    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27691    /// Type of widget action
27692    /// Allowed values: `details`, `other`, `primary`, `secondary`.
27693    #[serde(deserialize_with = "crate::lenient::string")]
27694    pub r#type: String,
27695    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
27696    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
27697    /// Fields not described by the spec, e.g. instance-specific DB fields.
27698    #[serde(flatten)]
27699    pub extra: serde_json::Map<String, serde_json::Value>,
27700}
27701
27702/// Avatar for widget items
27703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27704pub struct WidgetAvatar {
27705    #[serde(rename = "primaryDomainObject", default, skip_serializing_if = "serde_json::Value::is_null")]
27706    pub primary_domain_object: serde_json::Value,
27707    #[serde(rename = "secondaryDomainObject", default, skip_serializing_if = "serde_json::Value::is_null")]
27708    pub secondary_domain_object: serde_json::Value,
27709    /// Fields not described by the spec, e.g. instance-specific DB fields.
27710    #[serde(flatten)]
27711    pub extra: serde_json::Map<String, serde_json::Value>,
27712}
27713
27714#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27715pub struct WidgetCommon {
27716    #[serde(default, skip_serializing_if = "Option::is_none")]
27717    pub actions: Option<Vec<serde_json::Value>>,
27718    /// Strategy for handling empty widget content
27719    /// Allowed values: `HIDE`, `SHOW`.
27720    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27721    pub empty_strategy: Option<String>,
27722    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27723    pub empty_text: Option<String>,
27724    #[serde(default, skip_serializing_if = "Option::is_none")]
27725    pub filter: Option<WidgetDateFilterVariant1>,
27726    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27727    pub help_link: Option<String>,
27728    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
27729    pub is_mandatory: Option<bool>,
27730    #[serde(deserialize_with = "crate::lenient::string")]
27731    pub key: String,
27732    /// Allowed values: `horizontal`, `vertical`.
27733    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27734    pub orientation: Option<String>,
27735    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27736    pub replacement: Option<String>,
27737    #[serde(deserialize_with = "crate::lenient::string")]
27738    pub title: String,
27739    /// Settings specific to common widgets
27740    #[serde(rename = "widgetSettings")]
27741    pub widget_settings: WidgetSettingsCommon,
27742    /// Grouping configuration for widgets
27743    #[serde(deserialize_with = "crate::lenient::map")]
27744    pub groupings: std::collections::BTreeMap<String, WidgetGroupingOption>,
27745    pub items: Vec<WidgetCommonItem>,
27746    /// Allowed values: `common`.
27747    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
27748    pub widget_type: String,
27749    /// Fields not described by the spec, e.g. instance-specific DB fields.
27750    #[serde(flatten)]
27751    pub extra: serde_json::Map<String, serde_json::Value>,
27752}
27753
27754/// Common widget item structure
27755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27756pub struct WidgetCommonItem {
27757    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
27758    pub action_data: serde_json::Value,
27759    pub actions: Vec<serde_json::Value>,
27760    /// Details for common widget items
27761    pub details: WidgetCommonItemDetails,
27762    #[serde(rename = "filterKeys")]
27763    pub filter_keys: Vec<String>,
27764    #[serde(rename = "groupingKeys", default, skip_serializing_if = "Option::is_none")]
27765    pub grouping_keys: Option<Vec<String>>,
27766    pub infos: Vec<WidgetDomainObjectItemInfosItem>,
27767    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::string")]
27768    pub summary_text: String,
27769    #[serde(deserialize_with = "crate::lenient::string")]
27770    pub title: String,
27771    /// Fields not described by the spec, e.g. instance-specific DB fields.
27772    #[serde(flatten)]
27773    pub extra: serde_json::Map<String, serde_json::Value>,
27774}
27775
27776/// Details for common widget items
27777#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27778pub struct WidgetCommonItemDetails {
27779    #[serde(default, skip_serializing_if = "Option::is_none")]
27780    pub avatar: Option<WidgetAvatar>,
27781    #[serde(default, skip_serializing_if = "Option::is_none")]
27782    pub count: Option<WidgetCount>,
27783    #[serde(rename = "infoLists")]
27784    pub info_lists: Vec<WidgetInfoList>,
27785    #[serde(rename = "initialInfoList", default, skip_serializing_if = "Option::is_none")]
27786    pub initial_info_list: Option<WidgetInfoList>,
27787    #[serde(rename = "primaryInfoList", default, skip_serializing_if = "Option::is_none")]
27788    pub primary_info_list: Option<WidgetInfoList>,
27789    #[serde(rename = "topLine", default, skip_serializing_if = "Option::is_none")]
27790    pub top_line: Option<WidgetTopLine>,
27791    /// Fields not described by the spec, e.g. instance-specific DB fields.
27792    #[serde(flatten)]
27793    pub extra: serde_json::Map<String, serde_json::Value>,
27794}
27795
27796/// Count display for widgets
27797#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27798pub struct WidgetCount {
27799    /// A color in ChurchTools
27800    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
27801    #[serde(deserialize_with = "crate::lenient::string")]
27802    pub color: String,
27803    #[serde(deserialize_with = "crate::lenient::string")]
27804    pub text: String,
27805    /// Allowed values: `bubble`, `regular`.
27806    #[serde(deserialize_with = "crate::lenient::string")]
27807    pub r#type: String,
27808    /// Fields not described by the spec, e.g. instance-specific DB fields.
27809    #[serde(flatten)]
27810    pub extra: serde_json::Map<String, serde_json::Value>,
27811}
27812
27813#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27814pub struct WidgetDate {
27815    #[serde(default, skip_serializing_if = "Option::is_none")]
27816    pub actions: Option<Vec<serde_json::Value>>,
27817    /// Strategy for handling empty widget content
27818    /// Allowed values: `HIDE`, `SHOW`.
27819    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27820    pub empty_strategy: Option<String>,
27821    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27822    pub empty_text: Option<String>,
27823    #[serde(default, skip_serializing_if = "Option::is_none")]
27824    pub filter: Option<WidgetDateFilterVariant1>,
27825    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27826    pub help_link: Option<String>,
27827    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
27828    pub is_mandatory: Option<bool>,
27829    #[serde(deserialize_with = "crate::lenient::string")]
27830    pub key: String,
27831    /// Allowed values: `horizontal`, `vertical`.
27832    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27833    pub orientation: Option<String>,
27834    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27835    pub replacement: Option<String>,
27836    #[serde(deserialize_with = "crate::lenient::string")]
27837    pub title: String,
27838    #[serde(rename = "widgetSettings")]
27839    pub widget_settings: WidgetDateWidgetSettings,
27840    pub items: Vec<WidgetDateItem>,
27841    /// Allowed values: `date`.
27842    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
27843    pub widget_type: String,
27844    /// Fields not described by the spec, e.g. instance-specific DB fields.
27845    #[serde(flatten)]
27846    pub extra: serde_json::Map<String, serde_json::Value>,
27847}
27848
27849#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27850pub struct WidgetDateFilterVariant1 {
27851    #[serde(default, skip_serializing_if = "Option::is_none")]
27852    pub options: Option<Vec<WidgetDateFilterVariant1OptionsItem>>,
27853    /// Fields not described by the spec, e.g. instance-specific DB fields.
27854    #[serde(flatten)]
27855    pub extra: serde_json::Map<String, serde_json::Value>,
27856}
27857
27858#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27859pub struct WidgetDateFilterVariant1OptionsItem {
27860    #[serde(deserialize_with = "crate::lenient::string")]
27861    pub id: String,
27862    #[serde(deserialize_with = "crate::lenient::string")]
27863    pub name: String,
27864    /// Total number of groups available for this filter option.
27865    #[serde(rename = "totalCount", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
27866    pub total_count: Option<i64>,
27867    /// Fields not described by the spec, e.g. instance-specific DB fields.
27868    #[serde(flatten)]
27869    pub extra: serde_json::Map<String, serde_json::Value>,
27870}
27871
27872/// Item for widget date lists
27873#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27874pub struct WidgetDateItem {
27875    #[serde(rename = "actionData")]
27876    pub action_data: WidgetActionDataAppointment,
27877    pub actions: Vec<serde_json::Value>,
27878    pub details: WidgetDateItemDetails,
27879    #[serde(rename = "filterKeys", default, skip_serializing_if = "serde_json::Value::is_null")]
27880    pub filter_keys: serde_json::Value,
27881    pub infos: Vec<WidgetDateItemInfosItem>,
27882    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27883    pub summary_text: Option<String>,
27884    #[serde(deserialize_with = "crate::lenient::string")]
27885    pub title: String,
27886    /// Fields not described by the spec, e.g. instance-specific DB fields.
27887    #[serde(flatten)]
27888    pub extra: serde_json::Map<String, serde_json::Value>,
27889}
27890
27891#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27892pub struct WidgetDateItemDetails {
27893    #[serde(rename = "allDay")]
27894    pub all_day: bool,
27895    /// A timestamp in Zulu time format, e.g. '2022-10-19T12:00:00Z'
27896    #[serde(rename = "dateTime", serialize_with = "crate::datetime::serialize_utc")]
27897    pub date_time: chrono::DateTime<chrono::Utc>,
27898    #[serde(deserialize_with = "crate::lenient::string")]
27899    pub title: String,
27900    /// Fields not described by the spec, e.g. instance-specific DB fields.
27901    #[serde(flatten)]
27902    pub extra: serde_json::Map<String, serde_json::Value>,
27903}
27904
27905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27906pub struct WidgetDateItemInfosItem {
27907    #[serde(deserialize_with = "crate::lenient::string")]
27908    pub text: String,
27909    /// Fields not described by the spec, e.g. instance-specific DB fields.
27910    #[serde(flatten)]
27911    pub extra: serde_json::Map<String, serde_json::Value>,
27912}
27913
27914#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27915pub struct WidgetDateWidgetSettings {
27916    /// Value for Tailwind color
27917    #[serde(rename = "backgroundColor", default, skip_serializing_if = "Option::is_none")]
27918    pub background_color: Option<Color>,
27919    /// Fields not described by the spec, e.g. instance-specific DB fields.
27920    #[serde(flatten)]
27921    pub extra: serde_json::Map<String, serde_json::Value>,
27922}
27923
27924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27925pub struct WidgetDetail {
27926    #[serde(default, skip_serializing_if = "Option::is_none")]
27927    pub actions: Option<Vec<serde_json::Value>>,
27928    /// Strategy for handling empty widget content
27929    /// Allowed values: `HIDE`, `SHOW`.
27930    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27931    pub empty_strategy: Option<String>,
27932    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27933    pub empty_text: Option<String>,
27934    #[serde(default, skip_serializing_if = "Option::is_none")]
27935    pub filter: Option<WidgetDateFilterVariant1>,
27936    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27937    pub help_link: Option<String>,
27938    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
27939    pub is_mandatory: Option<bool>,
27940    #[serde(deserialize_with = "crate::lenient::string")]
27941    pub key: String,
27942    /// Allowed values: `horizontal`, `vertical`.
27943    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27944    pub orientation: Option<String>,
27945    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27946    pub replacement: Option<String>,
27947    #[serde(deserialize_with = "crate::lenient::string")]
27948    pub title: String,
27949    #[serde(rename = "widgetSettings")]
27950    pub widget_settings: WidgetDateWidgetSettings,
27951    pub items: Vec<WidgetDetailItem>,
27952    /// Allowed values: `detail`.
27953    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
27954    pub widget_type: String,
27955    /// Fields not described by the spec, e.g. instance-specific DB fields.
27956    #[serde(flatten)]
27957    pub extra: serde_json::Map<String, serde_json::Value>,
27958}
27959
27960/// Item for widget detail lists
27961#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27962pub struct WidgetDetailItem {
27963    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
27964    pub action_data: serde_json::Value,
27965    pub actions: Vec<serde_json::Value>,
27966    pub rows: Vec<serde_json::Value>,
27967    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27968    pub summary_text: Option<String>,
27969    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
27970    pub title: Option<String>,
27971    /// Fields not described by the spec, e.g. instance-specific DB fields.
27972    #[serde(flatten)]
27973    pub extra: serde_json::Map<String, serde_json::Value>,
27974}
27975
27976/// Entry row type for widget detail items
27977#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27978pub struct WidgetDetailItemRowEntry {
27979    /// Value for Tailwind color
27980    pub color: Color,
27981    #[serde(deserialize_with = "crate::lenient::string")]
27982    pub icon: String,
27983    #[serde(deserialize_with = "crate::lenient::string")]
27984    pub text: String,
27985    /// Allowed values: `entry`.
27986    #[serde(deserialize_with = "crate::lenient::string")]
27987    pub r#type: String,
27988    /// Fields not described by the spec, e.g. instance-specific DB fields.
27989    #[serde(flatten)]
27990    pub extra: serde_json::Map<String, serde_json::Value>,
27991}
27992
27993/// Domain objects row type for widget detail items
27994#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
27995pub struct WidgetDetailRowDomainObjects {
27996    #[serde(rename = "domainObjects")]
27997    pub domain_objects: Vec<serde_json::Value>,
27998    #[serde(deserialize_with = "crate::lenient::string")]
27999    pub text: String,
28000    /// Allowed values: `domainObjects`.
28001    #[serde(deserialize_with = "crate::lenient::string")]
28002    pub r#type: String,
28003    /// Fields not described by the spec, e.g. instance-specific DB fields.
28004    #[serde(flatten)]
28005    pub extra: serde_json::Map<String, serde_json::Value>,
28006}
28007
28008/// Info line row type for widget detail items
28009#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28010pub struct WidgetDetailRowInfoLine {
28011    pub infos: Vec<String>,
28012    /// Allowed values: `info-line`.
28013    #[serde(deserialize_with = "crate::lenient::string")]
28014    pub r#type: String,
28015    /// Fields not described by the spec, e.g. instance-specific DB fields.
28016    #[serde(flatten)]
28017    pub extra: serde_json::Map<String, serde_json::Value>,
28018}
28019
28020/// Primary row type for widget detail items
28021#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28022pub struct WidgetDetailRowPrimary {
28023    #[serde(deserialize_with = "crate::lenient::string")]
28024    pub text: String,
28025    /// Allowed values: `primary`.
28026    #[serde(deserialize_with = "crate::lenient::string")]
28027    pub r#type: String,
28028    /// Fields not described by the spec, e.g. instance-specific DB fields.
28029    #[serde(flatten)]
28030    pub extra: serde_json::Map<String, serde_json::Value>,
28031}
28032
28033/// Properties row type for widget detail items
28034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28035pub struct WidgetDetailRowProperties {
28036    pub properties: Vec<WidgetDetailRowPropertiesPropertiesItem>,
28037    /// Allowed values: `properties`.
28038    #[serde(deserialize_with = "crate::lenient::string")]
28039    pub r#type: String,
28040    /// Fields not described by the spec, e.g. instance-specific DB fields.
28041    #[serde(flatten)]
28042    pub extra: serde_json::Map<String, serde_json::Value>,
28043}
28044
28045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28046pub struct WidgetDetailRowPropertiesPropertiesItem {
28047    #[serde(deserialize_with = "crate::lenient::string")]
28048    pub label: String,
28049    pub property: Vec<String>,
28050    /// Fields not described by the spec, e.g. instance-specific DB fields.
28051    #[serde(flatten)]
28052    pub extra: serde_json::Map<String, serde_json::Value>,
28053}
28054
28055/// Status row type for widget detail items
28056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28057pub struct WidgetDetailRowStatus {
28058    pub status: Vec<WidgetDetailRowStatusStatusItem>,
28059    /// Allowed values: `status`.
28060    #[serde(deserialize_with = "crate::lenient::string")]
28061    pub r#type: String,
28062    /// Fields not described by the spec, e.g. instance-specific DB fields.
28063    #[serde(flatten)]
28064    pub extra: serde_json::Map<String, serde_json::Value>,
28065}
28066
28067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28068pub struct WidgetDetailRowStatusStatusItem {
28069    /// Value for Tailwind color
28070    pub color: Color,
28071    #[serde(deserialize_with = "crate::lenient::string")]
28072    pub icon: String,
28073    pub infos: Vec<String>,
28074    #[serde(deserialize_with = "crate::lenient::string")]
28075    pub status: String,
28076    /// Fields not described by the spec, e.g. instance-specific DB fields.
28077    #[serde(flatten)]
28078    pub extra: serde_json::Map<String, serde_json::Value>,
28079}
28080
28081/// Top line row type for widget detail items
28082#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28083pub struct WidgetDetailRowTopLine {
28084    /// Value for Tailwind color
28085    pub color: Color,
28086    pub infos: Vec<String>,
28087    /// Allowed values: `top-line`.
28088    #[serde(deserialize_with = "crate::lenient::string")]
28089    pub r#type: String,
28090    /// Fields not described by the spec, e.g. instance-specific DB fields.
28091    #[serde(flatten)]
28092    pub extra: serde_json::Map<String, serde_json::Value>,
28093}
28094
28095#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28096pub struct WidgetDomainObject {
28097    #[serde(default, skip_serializing_if = "Option::is_none")]
28098    pub actions: Option<Vec<serde_json::Value>>,
28099    /// Strategy for handling empty widget content
28100    /// Allowed values: `HIDE`, `SHOW`.
28101    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28102    pub empty_strategy: Option<String>,
28103    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28104    pub empty_text: Option<String>,
28105    #[serde(default, skip_serializing_if = "Option::is_none")]
28106    pub filter: Option<WidgetDateFilterVariant1>,
28107    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28108    pub help_link: Option<String>,
28109    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
28110    pub is_mandatory: Option<bool>,
28111    #[serde(deserialize_with = "crate::lenient::string")]
28112    pub key: String,
28113    /// Allowed values: `horizontal`, `vertical`.
28114    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28115    pub orientation: Option<String>,
28116    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28117    pub replacement: Option<String>,
28118    #[serde(deserialize_with = "crate::lenient::string")]
28119    pub title: String,
28120    #[serde(rename = "widgetSettings")]
28121    pub widget_settings: WidgetDateWidgetSettings,
28122    pub items: Vec<WidgetDomainObjectItem>,
28123    /// Allowed values: `domainObject`.
28124    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
28125    pub widget_type: String,
28126    /// Fields not described by the spec, e.g. instance-specific DB fields.
28127    #[serde(flatten)]
28128    pub extra: serde_json::Map<String, serde_json::Value>,
28129}
28130
28131/// Item for widget domain object lists
28132#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28133pub struct WidgetDomainObjectItem {
28134    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
28135    pub action_data: serde_json::Value,
28136    pub actions: Vec<serde_json::Value>,
28137    pub details: WidgetDomainObjectItemDetails,
28138    #[serde(rename = "filterKeys", default, skip_serializing_if = "serde_json::Value::is_null")]
28139    pub filter_keys: serde_json::Value,
28140    pub infos: Vec<WidgetDomainObjectItemInfosItem>,
28141    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28142    pub summary_text: Option<String>,
28143    #[serde(deserialize_with = "crate::lenient::string")]
28144    pub title: String,
28145    /// Fields not described by the spec, e.g. instance-specific DB fields.
28146    #[serde(flatten)]
28147    pub extra: serde_json::Map<String, serde_json::Value>,
28148}
28149
28150#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28151pub struct WidgetDomainObjectItemDetails {
28152    #[serde(rename = "domainObject", default, skip_serializing_if = "serde_json::Value::is_null")]
28153    pub domain_object: serde_json::Value,
28154    /// Fields not described by the spec, e.g. instance-specific DB fields.
28155    #[serde(flatten)]
28156    pub extra: serde_json::Map<String, serde_json::Value>,
28157}
28158
28159#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28160pub struct WidgetDomainObjectItemInfosItem {
28161    #[serde(deserialize_with = "crate::lenient::string")]
28162    pub text: String,
28163    /// Fields not described by the spec, e.g. instance-specific DB fields.
28164    #[serde(flatten)]
28165    pub extra: serde_json::Map<String, serde_json::Value>,
28166}
28167
28168/// Individual grouping option configuration
28169#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28170pub struct WidgetGroupingOption {
28171    #[serde(default, skip_serializing_if = "Option::is_none")]
28172    pub count: Option<WidgetCount>,
28173    #[serde(rename = "filterKeys")]
28174    pub filter_keys: Vec<String>,
28175    #[serde(rename = "infoList", default, skip_serializing_if = "Option::is_none")]
28176    pub info_list: Option<WidgetInfoList>,
28177    /// The title
28178    #[serde(deserialize_with = "crate::lenient::string")]
28179    pub title: String,
28180    /// Fields not described by the spec, e.g. instance-specific DB fields.
28181    #[serde(flatten)]
28182    pub extra: serde_json::Map<String, serde_json::Value>,
28183}
28184
28185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28186pub struct WidgetHidden {
28187    #[serde(default, skip_serializing_if = "Option::is_none")]
28188    pub actions: Option<Vec<serde_json::Value>>,
28189    /// Strategy for handling empty widget content
28190    /// Allowed values: `HIDE`, `SHOW`.
28191    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28192    pub empty_strategy: Option<String>,
28193    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28194    pub empty_text: Option<String>,
28195    #[serde(default, skip_serializing_if = "Option::is_none")]
28196    pub filter: Option<WidgetDateFilterVariant1>,
28197    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28198    pub help_link: Option<String>,
28199    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
28200    pub is_mandatory: Option<bool>,
28201    #[serde(deserialize_with = "crate::lenient::string")]
28202    pub key: String,
28203    /// Allowed values: `horizontal`, `vertical`.
28204    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28205    pub orientation: Option<String>,
28206    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28207    pub replacement: Option<String>,
28208    #[serde(deserialize_with = "crate::lenient::string")]
28209    pub title: String,
28210    #[serde(rename = "widgetSettings")]
28211    pub widget_settings: WidgetDateWidgetSettings,
28212    /// Allowed values: `hidden`.
28213    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
28214    pub widget_type: String,
28215    /// Fields not described by the spec, e.g. instance-specific DB fields.
28216    #[serde(flatten)]
28217    pub extra: serde_json::Map<String, serde_json::Value>,
28218}
28219
28220/// Information item for widget lists
28221#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28222pub struct WidgetInfoItem {
28223    /// A color in ChurchTools
28224    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
28225    #[serde(deserialize_with = "crate::lenient::string")]
28226    pub color: String,
28227    #[serde(rename = "iconBefore", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28228    pub icon_before: Option<String>,
28229    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28230    pub label: Option<String>,
28231    #[serde(rename = "subItems")]
28232    pub sub_items: Vec<WidgetInfoSubItem>,
28233    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28234    pub text: Option<String>,
28235    /// Fields not described by the spec, e.g. instance-specific DB fields.
28236    #[serde(flatten)]
28237    pub extra: serde_json::Map<String, serde_json::Value>,
28238}
28239
28240/// List of information items for widgets
28241#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28242pub struct WidgetInfoList {
28243    /// Direction for widget info lists
28244    /// Allowed values: `horizontal`, `vertical`, `wrapped`.
28245    #[serde(deserialize_with = "crate::lenient::string")]
28246    pub direction: String,
28247    #[serde(rename = "infoItems")]
28248    pub info_items: Vec<WidgetInfoItem>,
28249    /// Size options for widget info lists
28250    /// Allowed values: `medium`, `small`.
28251    #[serde(deserialize_with = "crate::lenient::string")]
28252    pub size: String,
28253    #[serde(rename = "withLabel")]
28254    pub with_label: bool,
28255    /// Fields not described by the spec, e.g. instance-specific DB fields.
28256    #[serde(flatten)]
28257    pub extra: serde_json::Map<String, serde_json::Value>,
28258}
28259
28260/// Sub-item for widget information items
28261#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28262pub struct WidgetInfoSubItem {
28263    /// A color in ChurchTools
28264    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
28265    #[serde(deserialize_with = "crate::lenient::string")]
28266    pub color: String,
28267    #[serde(rename = "iconBefore", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28268    pub icon_before: Option<String>,
28269    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28270    pub text: Option<String>,
28271    /// Fields not described by the spec, e.g. instance-specific DB fields.
28272    #[serde(flatten)]
28273    pub extra: serde_json::Map<String, serde_json::Value>,
28274}
28275
28276#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28277pub struct WidgetItemActionAppointmentDetails {
28278    /// Flavor of widget action
28279    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28280    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28281    pub flavor: Option<String>,
28282    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28283    pub icon: Option<String>,
28284    /// Allowed values: `action.appointment.details`.
28285    #[serde(deserialize_with = "crate::lenient::string")]
28286    pub key: String,
28287    #[serde(deserialize_with = "crate::lenient::string")]
28288    pub label: String,
28289    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28290    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28291    /// Type of widget action
28292    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28293    #[serde(deserialize_with = "crate::lenient::string")]
28294    pub r#type: String,
28295    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28296    pub action_data: Option<WidgetActionDataAppointment>,
28297    /// Fields not described by the spec, e.g. instance-specific DB fields.
28298    #[serde(flatten)]
28299    pub extra: serde_json::Map<String, serde_json::Value>,
28300}
28301
28302#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28303pub struct WidgetItemActionBirthdayDetails {
28304    /// Flavor of widget action
28305    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28306    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28307    pub flavor: Option<String>,
28308    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28309    pub icon: Option<String>,
28310    /// Allowed values: `action.birthday.details`.
28311    #[serde(deserialize_with = "crate::lenient::string")]
28312    pub key: String,
28313    #[serde(deserialize_with = "crate::lenient::string")]
28314    pub label: String,
28315    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28316    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28317    /// Type of widget action
28318    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28319    #[serde(deserialize_with = "crate::lenient::string")]
28320    pub r#type: String,
28321    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28322    pub action_data: Option<WidgetActionDataPerson>,
28323    /// Fields not described by the spec, e.g. instance-specific DB fields.
28324    #[serde(flatten)]
28325    pub extra: serde_json::Map<String, serde_json::Value>,
28326}
28327
28328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28329pub struct WidgetItemActionBookingDetails {
28330    /// Flavor of widget action
28331    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28332    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28333    pub flavor: Option<String>,
28334    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28335    pub icon: Option<String>,
28336    /// Allowed values: `action.my-bookings.details`.
28337    #[serde(deserialize_with = "crate::lenient::string")]
28338    pub key: String,
28339    #[serde(deserialize_with = "crate::lenient::string")]
28340    pub label: String,
28341    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28342    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28343    /// Type of widget action
28344    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28345    #[serde(deserialize_with = "crate::lenient::string")]
28346    pub r#type: String,
28347    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28348    pub action_data: Option<WidgetActionDataBooking>,
28349    /// Fields not described by the spec, e.g. instance-specific DB fields.
28350    #[serde(flatten)]
28351    pub extra: serde_json::Map<String, serde_json::Value>,
28352}
28353
28354#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28355pub struct WidgetItemActionEventAgenda {
28356    /// Flavor of widget action
28357    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28358    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28359    pub flavor: Option<String>,
28360    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28361    pub icon: Option<String>,
28362    /// Allowed values: `action.event.agenda`.
28363    #[serde(deserialize_with = "crate::lenient::string")]
28364    pub key: String,
28365    #[serde(deserialize_with = "crate::lenient::string")]
28366    pub label: String,
28367    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28368    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28369    /// Type of widget action
28370    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28371    #[serde(deserialize_with = "crate::lenient::string")]
28372    pub r#type: String,
28373    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28374    pub action_data: Option<WidgetActionDataEvent>,
28375    /// Fields not described by the spec, e.g. instance-specific DB fields.
28376    #[serde(flatten)]
28377    pub extra: serde_json::Map<String, serde_json::Value>,
28378}
28379
28380#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28381pub struct WidgetItemActionEventDetails {
28382    /// Flavor of widget action
28383    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28384    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28385    pub flavor: Option<String>,
28386    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28387    pub icon: Option<String>,
28388    /// Allowed values: `action.event.details`.
28389    #[serde(deserialize_with = "crate::lenient::string")]
28390    pub key: String,
28391    #[serde(deserialize_with = "crate::lenient::string")]
28392    pub label: String,
28393    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28394    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28395    /// Type of widget action
28396    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28397    #[serde(deserialize_with = "crate::lenient::string")]
28398    pub r#type: String,
28399    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28400    pub action_data: Option<WidgetActionDataEvent>,
28401    /// Fields not described by the spec, e.g. instance-specific DB fields.
28402    #[serde(flatten)]
28403    pub extra: serde_json::Map<String, serde_json::Value>,
28404}
28405
28406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28407pub struct WidgetItemActionEventfactDetails {
28408    /// Flavor of widget action
28409    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28410    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28411    pub flavor: Option<String>,
28412    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28413    pub icon: Option<String>,
28414    /// Allowed values: `action.eventfact.details`.
28415    #[serde(deserialize_with = "crate::lenient::string")]
28416    pub key: String,
28417    #[serde(deserialize_with = "crate::lenient::string")]
28418    pub label: String,
28419    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28420    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28421    /// Type of widget action
28422    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28423    #[serde(deserialize_with = "crate::lenient::string")]
28424    pub r#type: String,
28425    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28426    pub action_data: Option<WidgetActionDataEvent>,
28427    /// Fields not described by the spec, e.g. instance-specific DB fields.
28428    #[serde(flatten)]
28429    pub extra: serde_json::Map<String, serde_json::Value>,
28430}
28431
28432#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28433pub struct WidgetItemActionExchangeRequests {
28434    /// Flavor of widget action
28435    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28436    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28437    pub flavor: Option<String>,
28438    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28439    pub icon: Option<String>,
28440    /// Allowed values: `action.exchangeRequests.accept`, `action.exchangeRequests.cancel`, `action.exchangeRequests.decline`, `action.exchangeRequests.request`.
28441    #[serde(deserialize_with = "crate::lenient::string")]
28442    pub key: String,
28443    #[serde(deserialize_with = "crate::lenient::string")]
28444    pub label: String,
28445    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28446    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28447    /// Type of widget action
28448    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28449    #[serde(deserialize_with = "crate::lenient::string")]
28450    pub r#type: String,
28451    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28452    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28453    /// Fields not described by the spec, e.g. instance-specific DB fields.
28454    #[serde(flatten)]
28455    pub extra: serde_json::Map<String, serde_json::Value>,
28456}
28457
28458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28459pub struct WidgetItemActionGroupDetails {
28460    /// Flavor of widget action
28461    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28462    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28463    pub flavor: Option<String>,
28464    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28465    pub icon: Option<String>,
28466    /// Allowed values: `action.group.details`.
28467    #[serde(deserialize_with = "crate::lenient::string")]
28468    pub key: String,
28469    #[serde(deserialize_with = "crate::lenient::string")]
28470    pub label: String,
28471    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28472    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28473    /// Type of widget action
28474    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28475    #[serde(deserialize_with = "crate::lenient::string")]
28476    pub r#type: String,
28477    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28478    pub action_data: Option<WidgetActionDataGroup>,
28479    /// Fields not described by the spec, e.g. instance-specific DB fields.
28480    #[serde(flatten)]
28481    pub extra: serde_json::Map<String, serde_json::Value>,
28482}
28483
28484#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28485pub struct WidgetItemActionMyResourcesDetails {
28486    /// Flavor of widget action
28487    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28488    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28489    pub flavor: Option<String>,
28490    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28491    pub icon: Option<String>,
28492    /// Allowed values: `action.my-resources.details`.
28493    #[serde(deserialize_with = "crate::lenient::string")]
28494    pub key: String,
28495    #[serde(deserialize_with = "crate::lenient::string")]
28496    pub label: String,
28497    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28498    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28499    /// Type of widget action
28500    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28501    #[serde(deserialize_with = "crate::lenient::string")]
28502    pub r#type: String,
28503    #[serde(rename = "actionData", default, skip_serializing_if = "Option::is_none")]
28504    pub action_data: Option<WidgetActionDataResource>,
28505    /// Fields not described by the spec, e.g. instance-specific DB fields.
28506    #[serde(flatten)]
28507    pub extra: serde_json::Map<String, serde_json::Value>,
28508}
28509
28510#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28511pub struct WidgetItemActionPostDetails {
28512    /// Flavor of widget action
28513    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28514    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28515    pub flavor: Option<String>,
28516    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28517    pub icon: Option<String>,
28518    /// Allowed values: `action.post.details`.
28519    #[serde(deserialize_with = "crate::lenient::string")]
28520    pub key: String,
28521    #[serde(deserialize_with = "crate::lenient::string")]
28522    pub label: String,
28523    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28524    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28525    /// Type of widget action
28526    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28527    #[serde(deserialize_with = "crate::lenient::string")]
28528    pub r#type: String,
28529    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
28530    pub action_data: serde_json::Value,
28531    /// Fields not described by the spec, e.g. instance-specific DB fields.
28532    #[serde(flatten)]
28533    pub extra: serde_json::Map<String, serde_json::Value>,
28534}
28535
28536#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28537pub struct WidgetItemActionServiceRequests {
28538    /// Flavor of widget action
28539    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28540    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28541    pub flavor: Option<String>,
28542    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28543    pub icon: Option<String>,
28544    /// Allowed values: `action.serviceRequests.absence`, `action.serviceRequests.accept`, `action.serviceRequests.comment`, `action.serviceRequests.decline`, `action.serviceRequests.exchange`, `action.serviceRequests.undo`.
28545    #[serde(deserialize_with = "crate::lenient::string")]
28546    pub key: String,
28547    #[serde(deserialize_with = "crate::lenient::string")]
28548    pub label: String,
28549    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28550    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28551    /// Type of widget action
28552    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28553    #[serde(deserialize_with = "crate::lenient::string")]
28554    pub r#type: String,
28555    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28556    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28557    /// Fields not described by the spec, e.g. instance-specific DB fields.
28558    #[serde(flatten)]
28559    pub extra: serde_json::Map<String, serde_json::Value>,
28560}
28561
28562#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28563pub struct WidgetItemActionSongsToLearnDetails {
28564    /// Flavor of widget action
28565    /// Allowed values: `accent`, `basic`, `constructive`, `destructive`, `magic`.
28566    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28567    pub flavor: Option<String>,
28568    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28569    pub icon: Option<String>,
28570    /// Allowed values: `action.songsToLearn.details`.
28571    #[serde(deserialize_with = "crate::lenient::string")]
28572    pub key: String,
28573    #[serde(deserialize_with = "crate::lenient::string")]
28574    pub label: String,
28575    #[serde(deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28576    pub props: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28577    /// Type of widget action
28578    /// Allowed values: `details`, `other`, `primary`, `secondary`.
28579    #[serde(deserialize_with = "crate::lenient::string")]
28580    pub r#type: String,
28581    #[serde(rename = "actionData", deserialize_with = "crate::lenient::opt_map", default, skip_serializing_if = "Option::is_none")]
28582    pub action_data: Option<std::collections::BTreeMap<String, serde_json::Value>>,
28583    /// Fields not described by the spec, e.g. instance-specific DB fields.
28584    #[serde(flatten)]
28585    pub extra: serde_json::Map<String, serde_json::Value>,
28586}
28587
28588#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28589pub struct WidgetPost {
28590    #[serde(default, skip_serializing_if = "Option::is_none")]
28591    pub actions: Option<Vec<serde_json::Value>>,
28592    /// Strategy for handling empty widget content
28593    /// Allowed values: `HIDE`, `SHOW`.
28594    #[serde(rename = "emptyStrategy", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28595    pub empty_strategy: Option<String>,
28596    #[serde(rename = "emptyText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28597    pub empty_text: Option<String>,
28598    #[serde(default, skip_serializing_if = "Option::is_none")]
28599    pub filter: Option<WidgetDateFilterVariant1>,
28600    #[serde(rename = "helpLink", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28601    pub help_link: Option<String>,
28602    #[serde(rename = "isMandatory", default, skip_serializing_if = "Option::is_none")]
28603    pub is_mandatory: Option<bool>,
28604    #[serde(deserialize_with = "crate::lenient::string")]
28605    pub key: String,
28606    /// Allowed values: `horizontal`, `vertical`.
28607    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28608    pub orientation: Option<String>,
28609    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28610    pub replacement: Option<String>,
28611    #[serde(deserialize_with = "crate::lenient::string")]
28612    pub title: String,
28613    #[serde(rename = "widgetSettings")]
28614    pub widget_settings: WidgetDateWidgetSettings,
28615    pub items: Vec<WidgetPostItem>,
28616    /// Allowed values: `post`.
28617    #[serde(rename = "widgetType", deserialize_with = "crate::lenient::string")]
28618    pub widget_type: String,
28619    /// Fields not described by the spec, e.g. instance-specific DB fields.
28620    #[serde(flatten)]
28621    pub extra: serde_json::Map<String, serde_json::Value>,
28622}
28623
28624/// Item for widget post lists
28625#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28626pub struct WidgetPostItem {
28627    #[serde(rename = "actionData", default, skip_serializing_if = "serde_json::Value::is_null")]
28628    pub action_data: serde_json::Value,
28629    pub actions: Vec<serde_json::Value>,
28630    pub details: WidgetPostItemDetails,
28631    #[serde(rename = "filterKeys", default, skip_serializing_if = "serde_json::Value::is_null")]
28632    pub filter_keys: serde_json::Value,
28633    pub infos: Vec<WidgetDomainObjectItemInfosItem>,
28634    #[serde(rename = "summaryText", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28635    pub summary_text: Option<String>,
28636    #[serde(deserialize_with = "crate::lenient::string")]
28637    pub title: String,
28638    /// Fields not described by the spec, e.g. instance-specific DB fields.
28639    #[serde(flatten)]
28640    pub extra: serde_json::Map<String, serde_json::Value>,
28641}
28642
28643#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28644pub struct WidgetPostItemDetails {
28645    pub post: Post,
28646    /// Fields not described by the spec, e.g. instance-specific DB fields.
28647    #[serde(flatten)]
28648    pub extra: serde_json::Map<String, serde_json::Value>,
28649}
28650
28651/// Settings specific to common widgets
28652#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28653pub struct WidgetSettingsCommon {
28654    /// Density options for common widgets
28655    /// Allowed values: `compact`, `default`, `divided`.
28656    #[serde(deserialize_with = "crate::lenient::string")]
28657    pub density: String,
28658    /// Fields not described by the spec, e.g. instance-specific DB fields.
28659    #[serde(flatten)]
28660    pub extra: serde_json::Map<String, serde_json::Value>,
28661}
28662
28663/// Top line text for widget items
28664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28665pub struct WidgetTopLine {
28666    #[serde(deserialize_with = "crate::lenient::string")]
28667    pub text: String,
28668    /// Fields not described by the spec, e.g. instance-specific DB fields.
28669    #[serde(flatten)]
28670    pub extra: serde_json::Map<String, serde_json::Value>,
28671}
28672
28673/// A category organizes wiki pages and is the unit of wiki access permissions.
28674#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28675pub struct WikiCategory {
28676    /// Campus association, or null when no campus is assigned.
28677    #[serde(rename = "campusId", deserialize_with = "crate::lenient::opt_number", default, skip_serializing_if = "Option::is_none")]
28678    pub campus_id: Option<i64>,
28679    /// Whether files in this wiki category can be read without category-view permission. This flag does not make the wiki pages themselves public.
28680    #[serde(rename = "fileAccessWithoutPermission")]
28681    pub file_access_without_permission: bool,
28682    /// Whether the category should appear in navigation menus; it is still returned by the category catalog when false.
28683    #[serde(rename = "inMenu")]
28684    pub in_menu: bool,
28685    /// Category name; unlike page titles it is not trimmed.
28686    #[serde(deserialize_with = "crate::lenient::string")]
28687    pub name: String,
28688    /// Sort order; negative values are accepted.
28689    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
28690    pub sort_key: i64,
28691    /// Wiki category ID used in category/page endpoint URLs.
28692    #[serde(deserialize_with = "crate::lenient::number")]
28693    pub id: i64,
28694    /// Display name translated for the current request language.
28695    #[serde(rename = "nameTranslated", deserialize_with = "crate::lenient::string")]
28696    pub name_translated: String,
28697    /// Page-operation hints based on category edit rights. Populated by the category list; normally empty in create/update and embedded page categories.
28698    pub permissions: GroupWikiCategoryPagesItemCategoryPermissions,
28699    /// Fields not described by the spec, e.g. instance-specific DB fields.
28700    #[serde(flatten)]
28701    pub extra: serde_json::Map<String, serde_json::Value>,
28702}
28703
28704#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28705pub struct WikiCategoryCreate {
28706    /// Optional campus association. Omission/null clears it; an unknown ID currently also resolves to no campus.
28707    ///
28708    /// `None` leaves the field out, `Some(None)` sends `null`.
28709    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28710    pub campus_id: Option<Option<i64>>,
28711    /// Whether files in this wiki category can be read without category-view permission. This flag does not make the wiki pages themselves public.
28712    #[serde(rename = "fileAccessWithoutPermission")]
28713    pub file_access_without_permission: bool,
28714    /// Whether the category should appear in navigation menus; it is still returned by the category catalog when false.
28715    #[serde(rename = "inMenu")]
28716    pub in_menu: bool,
28717    /// Category name; unlike page titles it is not trimmed.
28718    #[serde(deserialize_with = "crate::lenient::string")]
28719    pub name: String,
28720    /// Sort order; negative values are accepted.
28721    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
28722    pub sort_key: i64,
28723    /// Fields not described by the spec, e.g. instance-specific DB fields.
28724    #[serde(flatten)]
28725    pub extra: serde_json::Map<String, serde_json::Value>,
28726}
28727
28728/// Replacement category settings. The optional campus association is cleared on omission.
28729#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28730pub struct WikiCategoryUpdate {
28731    /// Optional campus association. Omission/null clears it; an unknown ID currently also resolves to no campus.
28732    ///
28733    /// `None` leaves the field out, `Some(None)` sends `null`.
28734    #[serde(rename = "campusId", deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28735    pub campus_id: Option<Option<i64>>,
28736    /// Whether files in this wiki category can be read without category-view permission. This flag does not make the wiki pages themselves public.
28737    #[serde(rename = "fileAccessWithoutPermission")]
28738    pub file_access_without_permission: bool,
28739    /// Whether the category should appear in navigation menus; it is still returned by the category catalog when false.
28740    #[serde(rename = "inMenu")]
28741    pub in_menu: bool,
28742    /// Category name; unlike page titles it is not trimmed.
28743    #[serde(deserialize_with = "crate::lenient::string")]
28744    pub name: String,
28745    /// Sort order; negative values are accepted.
28746    #[serde(rename = "sortKey", deserialize_with = "crate::lenient::number")]
28747    pub sort_key: i64,
28748    /// Fields not described by the spec, e.g. instance-specific DB fields.
28749    #[serde(flatten)]
28750    pub extra: serde_json::Map<String, serde_json::Value>,
28751}
28752
28753/// Wiki page metadata for one version. Text and previews are optional enrichments depending on the endpoint. A page is addressed by category ID and stable GUID; version identifies its revision.
28754#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28755pub struct WikiPage {
28756    /// Compatibility marker used by existing clients.
28757    #[serde(rename = "@deprecated")]
28758    pub deprecated: SimpleWikiPageDeprecated,
28759    /// Stable page GUID across versions in its category.
28760    #[serde(deserialize_with = "crate::lenient::string")]
28761    pub guid: String,
28762    /// Deprecated alias for `guid`. Use `guid` instead.
28763    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28764    #[deprecated = "Use `guid` instead."]
28765    pub identifier: Option<String>,
28766    /// Whether page text is Markdown rather than legacy HTML.
28767    #[serde(rename = "isMarkdown")]
28768    pub is_markdown: bool,
28769    pub meta: MetaDataEntityPerson,
28770    /// Whether the page is configured to appear on the wiki start page.
28771    #[serde(rename = "onStartpage")]
28772    pub on_startpage: bool,
28773    /// Page editing/deletion capabilities for the current user; system pages have additional restrictions.
28774    pub permissions: SimpleWikiPagePermissions,
28775    /// Stored redirect title. API reads return the page and this value; they do not follow the redirect.
28776    #[serde(rename = "redirectTo", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28777    pub redirect_to: Option<String>,
28778    /// Query-focused preview snippet. Present when the page list endpoint is called with a search query.
28779    #[serde(rename = "searchPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28780    pub search_preview: Option<String>,
28781    #[serde(deserialize_with = "crate::lenient::string")]
28782    pub text: String,
28783    /// Unrendered prefix of stored page text, truncated by Unicode characters. May contain raw HTML or incomplete markup. Present only with include\[\]=preview; not sanitized like text.
28784    #[serde(rename = "textPreview", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28785    pub text_preview: Option<String>,
28786    #[serde(deserialize_with = "crate::lenient::string")]
28787    pub title: String,
28788    /// Revision number of this page.
28789    #[serde(deserialize_with = "crate::lenient::number")]
28790    pub version: i64,
28791    /// A category organizes wiki pages and is the unit of wiki access permissions.
28792    #[serde(rename = "wikiCategory")]
28793    pub wiki_category: WikiCategory,
28794    /// Fields not described by the spec, e.g. instance-specific DB fields.
28795    #[serde(flatten)]
28796    pub extra: serde_json::Map<String, serde_json::Value>,
28797}
28798
28799#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28800pub struct WikiPageCreate {
28801    /// Whether text is Markdown. False selects legacy HTML, sanitized on normal text reads.
28802    #[serde(rename = "isMarkdown", default, skip_serializing_if = "Option::is_none")]
28803    pub is_markdown: Option<bool>,
28804    /// Whether this page is marked for display on the wiki start page.
28805    #[serde(rename = "onStartpage", default, skip_serializing_if = "Option::is_none")]
28806    pub on_startpage: Option<bool>,
28807    /// Trimmed Markdown or legacy HTML according to isMarkdown. Omitted, null or blank content is stored as null and read back as an empty string.
28808    ///
28809    /// `None` leaves the field out, `Some(None)` sends `null`.
28810    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28811    pub text: Option<Option<String>>,
28812    /// Trimmed unique page title; Unicode ellipsis is normalized to three periods.
28813    #[serde(deserialize_with = "crate::lenient::string")]
28814    pub title: String,
28815    /// Fields not described by the spec, e.g. instance-specific DB fields.
28816    #[serde(flatten)]
28817    pub extra: serde_json::Map<String, serde_json::Value>,
28818}
28819
28820/// Partial page update; an empty object is accepted. The page title, GUID and category are not editable here.
28821#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28822pub struct WikiPageUpdate {
28823    #[serde(rename = "isMarkdown", default, skip_serializing_if = "Option::is_none")]
28824    pub is_markdown: Option<bool>,
28825    #[serde(rename = "onStartpage", default, skip_serializing_if = "Option::is_none")]
28826    pub on_startpage: Option<bool>,
28827    /// Trimmed replacement content. A different stored value creates a new version; null or blank clears the text. Omission leaves it unchanged.
28828    ///
28829    /// `None` leaves the field out, `Some(None)` sends `null`.
28830    #[serde(deserialize_with = "crate::lenient::double_option", default, skip_serializing_if = "Option::is_none")]
28831    pub text: Option<Option<String>>,
28832    /// Fields not described by the spec, e.g. instance-specific DB fields.
28833    #[serde(flatten)]
28834    pub extra: serde_json::Map<String, serde_json::Value>,
28835}
28836
28837/// Compact, domain-independent representation for displaying a link to a ChurchTools object. It is not the full resource returned by the object’s own API.
28838#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28839pub struct WikiSearchResult {
28840    /// URL for the full API resource, if available. Some legacy domain implementations produce inconsistent URLs.
28841    #[serde(rename = "apiUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28842    pub api_url: Option<String>,
28843    /// Optional display color.
28844    /// Allowed values: `accent`, `amber`, `basic`, `blue`, `constructive`, `critical`, `cyan`, `destructive`, `emerald`, `error`, `fuchsia`, `gray`, `green`, `indigo`, `info`, `lime`, `magic`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `success`, `teal`, `violet`, `warning`, `yellow`.
28845    #[serde(default, skip_serializing_if = "serde_json::Value::is_null")]
28846    pub color: serde_json::Value,
28847    /// Opaque identifier within the domain; do not assume that every domain uses a numeric ID.
28848    #[serde(rename = "domainIdentifier", deserialize_with = "crate::lenient::string")]
28849    pub domain_identifier: String,
28850    /// Optional image URL.
28851    #[serde(rename = "imageUrl", deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28852    pub image_url: Option<String>,
28853    /// Additional localized display lines; not structured resource fields.
28854    #[serde(default, skip_serializing_if = "Option::is_none")]
28855    pub infos: Option<Vec<String>>,
28856    /// Optional initials for an avatar fallback.
28857    #[serde(deserialize_with = "crate::lenient::opt_string", default, skip_serializing_if = "Option::is_none")]
28858    pub initials: Option<String>,
28859    /// Display title of the referenced object.
28860    #[serde(deserialize_with = "crate::lenient::string")]
28861    pub title: String,
28862    #[serde(rename = "domainAttributes")]
28863    pub domain_attributes: DomainObjectWikiPageDomainAttributes,
28864    /// Allowed values: `wiki_page`.
28865    #[serde(rename = "domainType", deserialize_with = "crate::lenient::string")]
28866    pub domain_type: String,
28867    #[serde(rename = "frontendUrl", deserialize_with = "crate::lenient::string")]
28868    pub frontend_url: String,
28869    /// Allowed values: `file`.
28870    #[serde(deserialize_with = "crate::lenient::string")]
28871    pub icon: String,
28872    /// Search excerpt, possibly empty, with Markdown emphasis for matching text.
28873    #[serde(deserialize_with = "crate::lenient::string")]
28874    pub preview: String,
28875    #[serde(deserialize_with = "crate::lenient::string")]
28876    pub r#type: String,
28877    /// Fields not described by the spec, e.g. instance-specific DB fields.
28878    #[serde(flatten)]
28879    pub extra: serde_json::Map<String, serde_json::Value>,
28880}